This commit is contained in:
zhangxinah@yonyou.com 2025-06-05 15:09:40 +08:00
commit 20ce9f86d9
4 changed files with 1167 additions and 82 deletions

File diff suppressed because it is too large Load Diff

View File

@ -138,80 +138,6 @@ public class AfterSignRuleSyncInToMesProcess implements IRule<GeneralInVO> {
} }
} }
private void syncTransferIn(GeneralInVO generalInVO) throws BusinessException {
GeneralInHeadVO head = generalInVO.getHead();
// 表体body信息拼接
JSONArray details = new JSONArray();
// 填充details
for (GeneralInBodyVO body : generalInVO.getBodys()) {
JSONObject temp = new JSONObject();
temp.put("orderNo", head.getVbillcode()); // 通知单ID
temp.put("sequenceNum", body.getCrowno()); // 通知单序号
temp.put("type", "DBRK"); // 事务类型
MaterialVersionVO materialVersionVO = (MaterialVersionVO) IUIFSERVICE.queryByPrimaryKey(MaterialVersionVO.class, body.getCmaterialvid());
if (Objects.isNull(materialVersionVO)) {
throw new BusinessException("物料信息不存在, 主键:" + body.getCmaterialvid());
}
temp.put("materialId", materialVersionVO.getCode()); // 物料ID
temp.put("outQty", body.getNnum() != null ? body.getNnum().doubleValue() : null); // 应发数量
temp.put("actInQty", body.getNshouldnum() != null ? body.getNshouldnum().doubleValue() : null); // 实收数量
temp.put("assistActInQry", body.getNassistnum() != null ? body.getNassistnum().doubleValue() : 0); // 辅助实收数量
temp.put("productNum", null); // 产品编号
temp.put("inStorageId", body.getClocationid()); // 库位
temp.put("inBatchNum", body.getVbatchcode()); // 物料批号
temp.put("customId", null); // 客户ID
temp.put("supplierId", null); // 供应商ID
temp.put("manufactureDate", null); // 生产日期
temp.put("color", null); // 颜色
temp.put("packLen", null); // 包装长度
temp.put("packSize", null); // 包装尺寸
temp.put("remark", body.getVnotebody()); // 备注 ()
details.add(temp);
}
JSONObject info = new JSONObject();
info.put("details", details); // 明细
// 从head中取数
info.put("orderNo", head.getVbillcode()); // 通知单ID
info.put("type", "DBRK"); // 事务类型
info.put("outDate", head.getDbilldate() != null ? head.getDbilldate().toString() : null); // 出库日期
StordocVO outWarehouse = (StordocVO) IUIFSERVICE.queryByPrimaryKey(StordocVO.class, head.getCwarehouseid());
if (Objects.isNull(outWarehouse)) {
throw new BusinessException("拨出仓库信息不存在, 主键:" + head.getCwarehouseid());
}
if (outWarehouse.getCode() != null && outWarehouse.getCode().length() > 4) {
throw new BusinessException("MES系统拨出仓库编码[" + outWarehouse.getCode() + "]不能超过4位请选择合适的仓库!");
}
info.put("outStoreId", outWarehouse.getCode()); // 仓库ID
StordocVO inWarehouse = (StordocVO) IUIFSERVICE.queryByPrimaryKey(StordocVO.class, head.getCotherwhid());
if (Objects.isNull(inWarehouse)) {
throw new BusinessException("拨入仓库信息不存在, 主键:" + head.getCotherwhid());
}
if (inWarehouse.getCode() != null && inWarehouse.getCode().length() > 4) {
throw new BusinessException("MES系统拨入仓库编码[" + inWarehouse.getCode() + "]不能超过4位请选择合适的仓库!");
}
info.put("inStoreId", inWarehouse.getCode()); // 仓库ID
info.put("workerNo", null);
info.put("worker", null);
info.put("storeKeeper", head.getCwhsmanagerid());
info.put("returned", "N"); // 是否退库
info.put("mark", "N"); // 生成标志
info.put("remark", head.getVnote()); // 备注 ()
// 拼接数据,先创建一个jsonObject
JSONObject requestData = new JSONObject();
requestData.put("operation_type", "I"); // 操作
requestData.put("info", info);
obmlog.debug("调拨入库requestData:" + requestData.toJSONString());
HTTP_POST_OTHER_SYS.sendToExternalSystem("/GTHINKING/AjaxService/N_KCSJJS/101527013.ashx/gt_rec_api_dbrkdj", requestData);
obmlog.debug("调拨入库单 " + head.getVbillcode() + " 同步成功");
}
private String transferCodeByPk(String tableName, String selectField, String pkField, String pk) throws BusinessException { private String transferCodeByPk(String tableName, String selectField, String pkField, String pk) throws BusinessException {
if (StringUtils.isEmpty(pk)) { if (StringUtils.isEmpty(pk)) {
return null; return null;

View File

@ -116,10 +116,10 @@ public class AfterSignRuleSyncOutToMesProcess implements IRule<GeneralOutVO> {
if ("4I-01".equals(trantypecode)) { if ("4I-01".equals(trantypecode)) {
syncOtherOut(generalOutVO); syncOtherOut(generalOutVO);
} }
// // 딧꺅놔욋/瘻욋데 // 딧꺅놔욋/瘻욋데
// else if ("4I-02".equals(trantypecode)) { else if ("4I-02".equals(trantypecode)) {
// syncTransferOut(generalOutVO); syncTransferOut(generalOutVO);
// } }
} }
@ -131,7 +131,7 @@ public class AfterSignRuleSyncOutToMesProcess implements IRule<GeneralOutVO> {
// 填充details // 填充details
for (GeneralOutBodyVO body : generalOutVO.getBodys()) {// body中取数 for (GeneralOutBodyVO body : generalOutVO.getBodys()) {// body中取数
JSONObject temp = new JSONObject(); JSONObject temp = new JSONObject();
temp.put("orderNo", head.getVbillcode()); // 繫列데ID // temp.put("orderNo", head.getVbillcode()); // 繫列데ID
temp.put("sequenceNum", body.getCrowno()); // 通知单序号 temp.put("sequenceNum", body.getCrowno()); // 通知单序号
temp.put("type", "DBCK"); // 事务类型 temp.put("type", "DBCK"); // 事务类型
temp.put("genType", null); temp.put("genType", null);
@ -159,7 +159,7 @@ public class AfterSignRuleSyncOutToMesProcess implements IRule<GeneralOutVO> {
JSONObject info = new JSONObject(); JSONObject info = new JSONObject();
info.put("details", details); info.put("details", details);
// 从head中取数 // 从head中取数
info.put("orderNo", head.getVbillcode()); // 繫列데ID // info.put("orderNo", head.getVbillcode()); // 繫列데ID
info.put("type", "DBCK"); // 事务类型 info.put("type", "DBCK"); // 事务类型
info.put("genType", null); info.put("genType", null);
info.put("outDate", head.getDbilldate().toString()); info.put("outDate", head.getDbilldate().toString());

View File

@ -133,6 +133,7 @@ public class IAPISaleInvMaitainImpl {
// 数电票(增值税专用发票)=31,数电票(普通发票)=32,数电纸质发票(机动车销售统一发票)=36,数电纸质发票(增值税专用发票)=33,数电纸质发票(普通发票)=34, // 数电票(增值税专用发票)=31,数电票(普通发票)=32,数电纸质发票(机动车销售统一发票)=36,数电纸质发票(增值税专用发票)=33,数电纸质发票(普通发票)=34,
// 增值税电子普通发票=1,增值税电子专用发票=2,增值税普通发票=3,增值税专用发票=4,增值税电子普通发票成品油=8,成品油普通发票(卷式)=9, // 增值税电子普通发票=1,增值税电子专用发票=2,增值税普通发票=3,增值税专用发票=4,增值税电子普通发票成品油=8,成品油普通发票(卷式)=9,
// 成品油普通发票=10,成品油专用发票=11,增值税普通发票(卷式)=12,增值税专用发票(机动车)=99 // 成品油普通发票=10,成品油专用发票=11,增值税普通发票(卷式)=12,增值税专用发票(机动车)=99
Logger.error("vbillcode:" + saleInvoiceHVO.getVbillcode() + ",fplxStr:" + fplxStr);
invoiceService.issueTaxInvoice(saleInvoiceVO, fplxStr); invoiceService.issueTaxInvoice(saleInvoiceVO, fplxStr);
JSONObject desc = r.getDesc(); JSONObject desc = r.getDesc();
@ -408,8 +409,8 @@ public class IAPISaleInvMaitainImpl {
private String getTaxcode(String taxrateStr) throws BusinessException { private String getTaxcode(String taxrateStr) throws BusinessException {
IUAPQueryBS queryBS = NCLocator.getInstance().lookup(IUAPQueryBS.class); IUAPQueryBS queryBS = NCLocator.getInstance().lookup(IUAPQueryBS.class);
String sql = " select code FROM bd_taxrate tt inner join bd_taxcode tc on tt.pk_taxcode=tc.pk_taxcode where taxrate='" String sql = " select code FROM bd_taxrate tt inner join bd_taxcode tc on tt.pk_taxcode=tc.pk_taxcode where tc.dr = 0 " +
+ taxrateStr + "' AND ROWNUM = 1 "; " AND taxrate='" + taxrateStr + "' AND ROWNUM = 1 AND tc.enablestate = 2 ";
String taxcodeStr = (String) queryBS.executeQuery(sql, new ColumnProcessor()); String taxcodeStr = (String) queryBS.executeQuery(sql, new ColumnProcessor());
return taxcodeStr; return taxcodeStr;
} }