互感器总补丁

This commit is contained in:
李正@用友 2025-06-24 14:48:50 +08:00 committed by mzr
parent c28339a91c
commit 3731882c3d
32 changed files with 96 additions and 53 deletions

View File

@ -51,9 +51,9 @@ public class SignBP implements ISignBP<SaleOutVO>, ISignRuleProvider<SaleOutVO>
processor.addAfterRule(new SaleOutProceedsRuleCG()); processor.addAfterRule(new SaleOutProceedsRuleCG());
processor.addAfterRule(new MobAfterSignMessageRule()); processor.addAfterRule(new MobAfterSignMessageRule());
// 销售出库 多一个步骤 先提交销售交货单 与同步销售出库单的orderNo一致 // 销售出库 多一个步骤 先提交销售交货单 与同步销售出库单的orderNo一致
processor.addAfterRule(new SalesDeliveryOrderRuleMES()); // processor.addAfterRule(new SalesDeliveryOrderRuleMES());
// 销售出库 签字后 同步到MES金思维系统 // 销售出库 签字后 同步到MES金思维系统
processor.addAfterRule(new AfterSigningSynchronizeRuleMES()); // processor.addAfterRule(new AfterSigningSynchronizeRuleMES());
// 盘点审批后传MES // 盘点审批后传MES
} }

View File

@ -32,7 +32,7 @@ import java.util.List;
* @Description TODO * @Description TODO
* @Version 1.0.0 * @Version 1.0.0
* @Date 2025/5/16 9:01 * @Date 2025/5/16 9:01
* @Created by ame * @Created by sdlizheng
*/ */
public class AfterSigningSynchronizeRuleRZ implements IRule<SaleOutVO> { public class AfterSigningSynchronizeRuleRZ implements IRule<SaleOutVO> {
private static Log log = Log.getInstance("rzmomlog"); private static Log log = Log.getInstance("rzmomlog");

View File

@ -35,7 +35,7 @@ public class APISubcontInMaintainImpl implements IAPISubcontInMaintain {
checker.check(vos); checker.check(vos);
// 2编码翻译成pk // 2编码翻译成pk
aggVOList = TransferCodeToPKTool.transferAggVO(aggVOList); aggVOList = TransferCodeToPKTool.transferAggVO(aggVOList);
// キュメ<EFBFBD><EFBFBD> // 3翻译货位
ICAPILocationVOUtils.translate(vos); ICAPILocationVOUtils.translate(vos);
new SubcontInSaveFillValue().setDefaultValue(vos); new SubcontInSaveFillValue().setDefaultValue(vos);

View File

@ -25,10 +25,7 @@ public class CheckSubcontInSaveValidator extends VONullValidate {
public String[] getHeadNotNullFields() { public String[] getHeadNotNullFields() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//组织仓库出入库类型编码 //组织仓库出入库类型编码
String[] headnames = String[] headnames ={ICPubMetaNameConst.PK_ORG, ICPubMetaNameConst.CWAREHOUSEID, ICPubMetaNameConst.VTRANTYPECODE};
{
ICPubMetaNameConst.PK_ORG, ICPubMetaNameConst.CWAREHOUSEID, ICPubMetaNameConst.VTRANTYPECODE
};
return headnames; return headnames;
} }

View File

@ -61,7 +61,7 @@ public class SubcontInSaveFillValue {
// 数量金额汇率税率处理 // 数量金额汇率税率处理
rule = new ICBodyNshouldassistnumCal<SubcontInVO>(); rule = new ICBodyNshouldassistnumCal<SubcontInVO>();
processer.addFillvalueRule(rule); processer.addFillvalueRule(rule);
//执行
processer.fillvalue(vos); processer.fillvalue(vos);
} }

View File

@ -14,5 +14,11 @@ import java.util.Map;
*/ */
public interface IAPISubcontInMaintain { public interface IAPISubcontInMaintain {
/**
*
* @param subcontInVOList
* @return
* @throws Exception
*/
SubcontInVO[] save(List<Map<String, Object>> subcontInVOList) throws Exception; SubcontInVO[] save(List<Map<String, Object>> subcontInVOList) throws Exception;
} }

View File

@ -16,7 +16,23 @@ import nc.vo.pub.BusinessException;
*/ */
public interface IAPIOnhandQuery { public interface IAPIOnhandQuery {
/**
* 根据维度查询现存量信息
* 此方法接收一个参数映射用于指定查询条件如仓库物料等
*
* @param paramMap 参数映射包含查询条件
* @return OnhandVO[] 查询到的现存量信息数组
* @throws BusinessException 当查询操作失败时抛出的业务异常
*/
OnhandVO[] queryOnhandVOByDims(Map<String, Object> paramMap) throws BusinessException; OnhandVO[] queryOnhandVOByDims(Map<String, Object> paramMap) throws BusinessException;
/**
* 根据多个维度查询现存量信息
* 此方法接收一个参数映射列表每个映射包含一组查询条件用于批量查询
*
* @param paramMap 参数映射列表每个映射包含一组查询条件
* @return OnhandVO[] 查询到的现存量信息数组
* @throws Exception 当查询操作失败时抛出的异常
*/
OnhandVO[] queryOnhandVOByDims(List<Map<String, Object>> paramMap) throws Exception; OnhandVO[] queryOnhandVOByDims(List<Map<String, Object>> paramMap) throws Exception;
} }

View File

@ -2,13 +2,10 @@ package nccloud.openapi.ic.m47;
import nc.bs.framework.common.NCLocator; import nc.bs.framework.common.NCLocator;
import nc.vo.ic.m47.entity.SubcontInVO; import nc.vo.ic.m47.entity.SubcontInVO;
import nc.vo.scmpub.res.billtype.ICBillType;
import nc.ws.opm.pub.utils.result.APIErrCodeEnum; import nc.ws.opm.pub.utils.result.APIErrCodeEnum;
import nccloud.api.ic.m47.IAPISubcontInMaintain; import nccloud.api.ic.m47.IAPISubcontInMaintain;
import nccloud.api.rest.utils.ResultMessageUtil; import nccloud.api.rest.utils.ResultMessageUtil;
import nccloud.openapi.ic.util.ICAPILocationVOUtils;
import nccloud.openapi.scmpub.pub.NCCPubRestResource; import nccloud.openapi.scmpub.pub.NCCPubRestResource;
import nccloud.openapi.scmpub.pub.TransferMapToVOTool;
import org.json.JSONString; import org.json.JSONString;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
@ -32,32 +29,57 @@ public class SubcontInResource extends NCCPubRestResource {
private static String HEADTABLE = "ic_subcontin_h"; private static String HEADTABLE = "ic_subcontin_h";
private static String BODYTABLE = "ic_subcontin_b"; private static String BODYTABLE = "ic_subcontin_b";
/**
* 保存操作信息
*
* 该方法通过POST请求接收JSON格式的参数处理后返回JSON格式的结果
* 主要用于保存单个操作的信息将接收到的参数封装成列表的形式
* 调用另一个save方法进行实际的保存操作
*
* @param param 包含操作信息的键值对参数
* @return 返回保存操作的结果格式为JSON字符串
*/
@POST @POST
@Path("operation/save") @Path("operation/save")
@Consumes({"application/json"}) @Consumes({"application/json"})
@Produces({"application/json"}) @Produces({"application/json"})
public JSONString save(Map<String, Object> param) { public JSONString save(Map<String, Object> param) {
// 将接收到的参数封装成列表以便调用实际的保存方法
List<Map<String, Object>> paramList = new ArrayList(); List<Map<String, Object>> paramList = new ArrayList();
paramList.add(param); paramList.add(param);
// 调用实际的保存方法并返回保存结果
JSONString result = this.save(paramList); JSONString result = this.save(paramList);
return result; return result;
} }
/**
* 保存数据接口
* 该方法接收一个包含表头和表体信息的JSON数组尝试将其保存到数据库中
* 如果传入的数据格式不正确不包含表头或表体信息则返回错误信息
* 如果保存过程中发生异常则返回异常信息
*
* @param paramList 一个包含多个数据项的列表每个数据项是一个Map对象必须包含表头和表体信息
* @return 返回一个JSON字符串包含保存结果或错误信息
*/
@POST @POST
@Path("save") @Path("save")
@Consumes({"application/json"}) @Consumes({"application/json"})
@Produces({"application/json"}) @Produces({"application/json"})
public JSONString save(List<Map<String, Object>> paramList){ public JSONString save(List<Map<String, Object>> paramList){
try { try {
// 遍历传入的参数列表检查每个Map对象是否包含表头和表体信息
for (Map<String, Object> map : paramList) { for (Map<String, Object> map : paramList) {
if (!map.containsKey(HEADTABLE) || !map.containsKey(BODYTABLE)) { if (!map.containsKey(HEADTABLE) || !map.containsKey(BODYTABLE)) {
// 如果任一数据项不包含表头或表体信息返回错误信息
return ResultMessageUtil.exceptionToJSON("传入数据异常,参数要包含表头信息和表体信息", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); return ResultMessageUtil.exceptionToJSON("传入数据异常,参数要包含表头信息和表体信息", APIErrCodeEnum.BUSINESSEXCCODE.getCode());
} }
} }
// 调用服务接口保存数据并返回保存结果
SubcontInVO[] save = NCLocator.getInstance().lookup(IAPISubcontInMaintain.class).save(paramList); SubcontInVO[] save = NCLocator.getInstance().lookup(IAPISubcontInMaintain.class).save(paramList);
return ResultMessageUtil.toJSON(save, "保存成功"); return ResultMessageUtil.toJSON(save, "保存成功");
} catch (Exception e) { } catch (Exception e) {
// 如果保存过程中发生异常返回异常信息
return ResultMessageUtil.exceptionToJSON(e); return ResultMessageUtil.exceptionToJSON(e);
} }
} }
} }

View File

@ -21,6 +21,7 @@ import nc.vo.mmpac.pickm.enumeration.FbillstatusEnum;
public class PickmApproveBP { public class PickmApproveBP {
private void addAfterRule(CompareAroundProcesser<AggPickmVO> processer) { private void addAfterRule(CompareAroundProcesser<AggPickmVO> processer) {
//备料计划审批推送锐制
IRule<AggPickmVO> pickmstatusFilterRule = new AfterApproveRuleSyncRZWMS(); IRule<AggPickmVO> pickmstatusFilterRule = new AfterApproveRuleSyncRZWMS();
processer.addAfterRule(pickmstatusFilterRule); processer.addAfterRule(pickmstatusFilterRule);
} }

View File

@ -9,6 +9,7 @@ import nc.bs.uapbd.util.ThirdPartyPostRequestUtil;
import nc.impl.pubapp.pattern.rule.IRule; import nc.impl.pubapp.pattern.rule.IRule;
import nc.jdbc.framework.processor.ColumnProcessor; import nc.jdbc.framework.processor.ColumnProcessor;
import nc.pubitf.para.SysInitQuery; import nc.pubitf.para.SysInitQuery;
import nc.vo.bd.defdoc.DefdocVO;
import nc.vo.bd.material.MaterialVO; import nc.vo.bd.material.MaterialVO;
import nc.vo.bd.rt.rt0004.entity.RcVO; import nc.vo.bd.rt.rt0004.entity.RcVO;
import nc.vo.bd.stordoc.StordocVO; import nc.vo.bd.stordoc.StordocVO;
@ -19,6 +20,7 @@ import nc.vo.mmpac.pickm.entity.PickmItemVO;
import nc.vo.org.OrgVO; import nc.vo.org.OrgVO;
import nc.vo.pub.BusinessException; import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFBoolean; import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDouble;
import nc.vo.pubapp.pattern.exception.ExceptionUtils; import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nc.vo.pubapp.pattern.pub.SqlBuilder; import nc.vo.pubapp.pattern.pub.SqlBuilder;
import nc.vo.scmpub.util.ArrayUtil; import nc.vo.scmpub.util.ArrayUtil;
@ -154,31 +156,29 @@ public class AfterApproveRuleSyncRZWMS implements IRule<AggPickmVO> {
singleObj.put("djxh", body.getVrowno()); singleObj.put("djxh", body.getVrowno());
//djrq datetime 单据日期 必填 //djrq datetime 单据日期 必填
singleObj.put("djrq", head.getDmakedate()); singleObj.put("djrq", head.getDmakedate().toString());
//wlbm_wbid varchar(100) 第三方系统物料名称id 必填 物料编码的后台ID //wlbm_wbid varchar(100) 第三方系统物料名称id 必填 物料编码的后台ID
singleObj.put("wlbm_wbid", wlbm_wbid); singleObj.put("wlbm_wbid", wlbm_wbid);
//scjh_wbid varchar(100) 第三方系统生产计划ID 必填 生产计划号外部ID一般ERP系统的生产订单号
singleObj.put("scjh_wbid", head.getCsourcebillid());
//jhxh numeric(5) 计划序号 -生产订单行号
singleObj.put("jhxh", head.getVsourcebillrowno());
//djsl numeric(18,3) 单据数量 必填 //djsl numeric(18,3) 单据数量 必填
singleObj.put("djsl", body.getNpscnum().getDouble()); UFDouble djsl = body.getNplanoutastnum() == null ? UFDouble.ZERO_DBL : body.getNplanoutastnum();
singleObj.put("djsl", djsl.getDouble());
//sddd varchar(510)送达地点 必填 传仓库名称要求上位ERP仓库名称不重复 //sddd varchar(510)送达地点 必填 传仓库名称要求上位ERP仓库名称不重复
singleObj.put("sddd", transferCodeByPk(StordocVO.getDefaultTableName(), StordocVO.NAME, StordocVO.PK_STORDOC, body.getCoutstockid())); // singleObj.put("sddd", transferCodeByPk(StordocVO.getDefaultTableName(), StordocVO.NAME, StordocVO.PK_STORDOC, body.getCoutstockid()));
//ckbh_wbid varchar(100) 第三方系统仓库id 必填 储区根据仓库默认同仓库多储区时两者必填 //ckbh_wbid varchar(100) 第三方系统仓库id 必填 储区根据仓库默认同仓库多储区时两者必填
singleObj.put("ckbh_wbid",transferCodeByPk(StordocVO.getDefaultTableName(), StordocVO.CODE, StordocVO.PK_STORDOC, body.getCoutstockid())); // singleObj.put("ckbh_wbid",body.getCoutstockid());
//qfbj int 签发标记 必填 默认1上位系统审核传至MOM 1 //qfbj int 签发标记 必填 默认1上位系统审核传至MOM 1
singleObj.put("qfbj", 1); singleObj.put("qfbj", 1);
//cght_wbid varchar(100) 第三方系统合同id 必填 委外订单 //cght_wbid varchar(100) 第三方系统合同id 必填 委外订单主键ID
singleObj.put("cght_wbid", head.getVfirstbillcode()); singleObj.put("cght_wbid",head.getCfirstbillid());
//cght_wbid varchar(100) 第三方系统合同id 必填
// singleObj.put("cght_wbid", transferCodeByPk("bd_defdoc", DefdocVO.CODE, DefdocVO.PK_DEFDOC, body.getVbdef5()));
details.add(singleObj); details.add(singleObj);
} }

View File

@ -51,10 +51,10 @@ public class PMOApproveBP {
processer.addAfterRule(new PMOCreatePSCPlanRule()); processer.addAfterRule(new PMOCreatePSCPlanRule());
ICompareRule<PMOAggVO> auditSupplyRule = new PMOApproveAuditSupplyRule(); ICompareRule<PMOAggVO> auditSupplyRule = new PMOApproveAuditSupplyRule();
processer.addAfterRule(auditSupplyRule); processer.addAfterRule(auditSupplyRule);
// 审批后推送到RZ系统 // 审批后推送到锐制系统
processer.addAfterRule(new AfterApprovingSynchronizeRuleRZ(true)); processer.addAfterRule(new AfterApprovingSynchronizeRuleRZ(true));
// 审批后推送流程生产订单到MES // 审批后推送流程生产订单到MES
processer.addAfterRule(new AfterApproveRuleSyncMes()); // processer.addAfterRule(new AfterApproveRuleSyncMes());
} }

View File

@ -52,7 +52,7 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<PMOAggVO> {
return; return;
} }
// 推送到RZ系统 // 推送到锐制系统
pushToRZMOM(filteredOrders.toArray(new PMOAggVO[0])); pushToRZMOM(filteredOrders.toArray(new PMOAggVO[0]));
} catch (Exception e) { } catch (Exception e) {
log.error("同步生产订单到RZ系统失败: " + e.getMessage()); log.error("同步生产订单到RZ系统失败: " + e.getMessage());

View File

@ -52,7 +52,7 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<OrderVO> {
if (newOrderVOS.isEmpty()) { if (newOrderVOS.isEmpty()) {
return; return;
} }
// 推送到睿智系统 //推送到锐制系统
pushToRZMOM(newOrderVOS.toArray(new OrderVO[0])); pushToRZMOM(newOrderVOS.toArray(new OrderVO[0]));
} catch (Exception e) { } catch (Exception e) {
log.error("同步采购订单到锐制系统失败: " + e.getMessage()); log.error("同步采购订单到锐制系统失败: " + e.getMessage());

View File

@ -111,7 +111,7 @@ public class OrderApproveAction {
processer.addAfterRule(new OrderRewritePMStartDateRule(true)); processer.addAfterRule(new OrderRewritePMStartDateRule(true));
processer.addAfterRule(new OrderApprovePMSupplyRule()); processer.addAfterRule(new OrderApprovePMSupplyRule());
// 采购订单审批后同步到锐制MES系统 // 采购订单审批后同步到锐制系统
processer.addAfterRule(new AfterApprovingSynchronizeRuleRZ()); processer.addAfterRule(new AfterApprovingSynchronizeRuleRZ());
} }

View File

@ -3,4 +3,5 @@
<rest> <rest>
<resource classname="nccloud.api.uapbd.QuerySync" exinfo=""/> <resource classname="nccloud.api.uapbd.QuerySync" exinfo=""/>
</rest> </rest>
</module> </module>

View File

@ -39,7 +39,7 @@ public class QuerySync extends AbstractNCCRestResource {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(date); calendar.setTime(date);
calendar.add(Calendar.HOUR_OF_DAY, -3); // 减去 3 小时 calendar.add(Calendar.HOUR_OF_DAY, -3); // 减去 3 小时
//提前三小时防止ts与现实时间差别 //提前三小时防止ts与现实时间差别
UFDate adjustedUfDate = new UFDate(calendar.getTimeInMillis()); UFDate adjustedUfDate = new UFDate(calendar.getTimeInMillis());
if (!ts.contains(",")) { // 单个时间戳 if (!ts.contains(",")) { // 单个时间戳
tsCondition = "ts >= '" + adjustedUfDate + "' AND ts <= '" + new UFDate(new Date()) + "'"; tsCondition = "ts >= '" + adjustedUfDate + "' AND ts <= '" + new UFDate(new Date()) + "'";