增加pu模块,编码转为GBK
This commit is contained in:
parent
8d2d27c7cd
commit
a783655c15
11
.classpath
11
.classpath
|
@ -55,7 +55,16 @@
|
|||
<classpathentry kind="src" output="bin" path="uapbd/src/private"/>
|
||||
<classpathentry kind="src" output="bin" path="uapbd/src/test"/>
|
||||
<classpathentry kind="src" output="bin" path="uapbd/resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/public"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/client"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/private"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/test"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="com.yonyou.studio.udt.core.container/Ant_Library"/>
|
||||
<classpathentry kind="con" path="com.yonyou.studio.udt.core.container/Product_Common_Library"/>
|
||||
<classpathentry kind="con" path="com.yonyou.studio.udt.core.container/Middleware_Library"/>
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
encoding//mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/PMORowFinishBP.java=gbk
|
||||
encoding//uapbd/src/private/nc/bs/uapbd/bip/workplugin/ErpSaleOrderToBIPBackgroupWorkPlugin.java=UTF-8
|
||||
encoding/<project>=gbk
|
||||
|
|
|
@ -41,34 +41,34 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction
|
|||
}
|
||||
|
||||
/**
|
||||
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
|
||||
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
|
||||
*/
|
||||
int i = 0;
|
||||
|
||||
for(AggregatedValueObject bill : bills) {
|
||||
AggregatedValueObject oriBill = orginBills[i++];
|
||||
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
|
||||
BaseBillVO billOriVO = (BaseBillVO) oriBill.getParentVO(); //之前的收款单
|
||||
UFDouble money = billVO.getMoney(); //修改后的金额
|
||||
UFDouble oriMoney = billOriVO.getMoney(); //修改前的金额
|
||||
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
|
||||
BaseBillVO billOriVO = (BaseBillVO) oriBill.getParentVO(); //之前的收款单
|
||||
UFDouble money = billVO.getMoney(); //修改后的金额
|
||||
UFDouble oriMoney = billOriVO.getMoney(); //修改前的金额
|
||||
String pk_tradetype = billVO.getPk_tradetype();
|
||||
if(!"F2-Cxx-02".equals(pk_tradetype)){
|
||||
continue;
|
||||
}
|
||||
String def3 = billVO.getDef3(); //收款单对应的销售订单id
|
||||
String def3 = billVO.getDef3(); //收款单对应的销售订单id
|
||||
if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){
|
||||
//无绑定的销售订单则下一次循环
|
||||
//无绑定的销售订单则下一次循环
|
||||
continue;
|
||||
}
|
||||
//计算收款单金额差值
|
||||
//计算收款单金额差值
|
||||
UFDouble changeMoney = money.sub(oriMoney);
|
||||
//根据销售订单id去查询销售订单
|
||||
//根据销售订单id去查询销售订单
|
||||
BaseDAO dao = new BaseDAO();
|
||||
String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'";
|
||||
Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor());
|
||||
//销售订单价税合计
|
||||
//销售订单价税合计
|
||||
UFDouble ntotalorigmny = UFDouble.ZERO_DBL;
|
||||
//销售订单实际收款金额
|
||||
//销售订单实际收款金额
|
||||
UFDouble nreceivedmny = UFDouble.ZERO_DBL;
|
||||
if(saleMap != null) {
|
||||
nreceivedmny = new UFDouble(saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString());
|
||||
|
@ -76,7 +76,7 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction
|
|||
}
|
||||
UFDouble moreMoney = nreceivedmny.add(changeMoney).sub(ntotalorigmny);
|
||||
if(nreceivedmny.add(changeMoney).compareTo(ntotalorigmny) > 0){
|
||||
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
|
||||
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,29 +59,29 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction {
|
|||
ArapBillVOUtils.setDefaultSettleFlag(bills);
|
||||
|
||||
/**
|
||||
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
|
||||
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
|
||||
*/
|
||||
|
||||
for(AggregatedValueObject bill : bills) {
|
||||
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
|
||||
UFDouble money = billVO.getMoney(); //金额
|
||||
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
|
||||
UFDouble money = billVO.getMoney(); //金额
|
||||
String pk_tradetype = billVO.getPk_tradetype();
|
||||
if(!"F2-Cxx-02".equals(pk_tradetype)){
|
||||
continue;
|
||||
}
|
||||
String def3 = billVO.getDef3(); //收款单对应的销售订单id
|
||||
String def3 = billVO.getDef3(); //收款单对应的销售订单id
|
||||
if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){
|
||||
//无绑定的销售订单则下一次循环
|
||||
//无绑定的销售订单则下一次循环
|
||||
continue;
|
||||
}
|
||||
|
||||
//根据销售订单id去查询销售订单
|
||||
//根据销售订单id去查询销售订单
|
||||
BaseDAO dao = new BaseDAO();
|
||||
String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'";
|
||||
Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor());
|
||||
//销售订单价税合计
|
||||
//销售订单价税合计
|
||||
UFDouble ntotalorigmny = UFDouble.ZERO_DBL;
|
||||
//销售订单实际收款金额
|
||||
//销售订单实际收款金额
|
||||
UFDouble nreceivedmny = UFDouble.ZERO_DBL;
|
||||
if(saleMap != null) {
|
||||
nreceivedmny = new UFDouble(saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString());
|
||||
|
@ -89,7 +89,7 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction {
|
|||
}
|
||||
UFDouble moreMoney = nreceivedmny.add(money).sub(ntotalorigmny);
|
||||
if(nreceivedmny.add(money).compareTo(ntotalorigmny) > 0){
|
||||
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
|
||||
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ public class GatherManageServiceImpl implements IGatherManageService {
|
|||
ICustsupPubService cusService = (ICustsupPubService) NCLocator.getInstance().lookup(ICustsupPubService.class);
|
||||
String paybillunit = registervo.getPaybillunit();
|
||||
String entrustedpaybillunit = registervo.getEntrustedpaybillunit();
|
||||
// zhangxinah 去掉收票单位校验
|
||||
// zhangxinah 去掉收票单位校验
|
||||
if (StringUtil.isNull(paybillunit) && StringUtil.isNull(entrustedpaybillunit)) {
|
||||
throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("3618ncc1_0", "03618ncc1-0000")
|
||||
+ NCLangRes4VoTransl.getNCLangRes().getStrByID("3618ncc1_0", "03618ncc1-0000")
|
||||
|
@ -1374,7 +1374,7 @@ public class GatherManageServiceImpl implements IGatherManageService {
|
|||
throw new BusinessException(obj.getExceptionMsg());
|
||||
}
|
||||
|
||||
Logger.debug("快速导入已完成");
|
||||
Logger.debug("快速导入已完成");
|
||||
}
|
||||
|
||||
private void checkOrgIsExist(String pk_org) throws BusinessException {
|
||||
|
@ -1904,7 +1904,7 @@ public class GatherManageServiceImpl implements IGatherManageService {
|
|||
AggRegisterVO[] aggVOs = gatherService.getAggVOsByPKs(pk_registers);
|
||||
|
||||
if (ArrayUtils.isEmpty(aggVOs)) {
|
||||
throw new BusinessException("传入AggRegisterVO数组为空,请检查");
|
||||
throw new BusinessException("传入AggRegisterVO数组为空,请检查");
|
||||
}
|
||||
GatherCheckUtil.checkSameOrgCurr(aggVOs);
|
||||
GatherCheckUtil.checkSamePaybillunit(aggVOs);
|
||||
|
|
|
@ -113,7 +113,7 @@ public class GatherExcelImport4NCCImpl extends AbstractImportProceeWithContext {
|
|||
throw new BusinessException(
|
||||
var10002 + NCLangRes4VoTransl.getNCLangRes().getStrByID("3618ncc_0", "03618ncc-0078"));
|
||||
}
|
||||
//zhangxinah 去掉银行账户是否电票签约账户的校验
|
||||
//zhangxinah 去掉银行账户是否电票签约账户的校验
|
||||
// if (!accbasVO.getIsenableelecbill().booleanValue()) {
|
||||
// var10002 = pvo.getFbmbillno();
|
||||
// throw new BusinessException(
|
||||
|
@ -201,7 +201,7 @@ public class GatherExcelImport4NCCImpl extends AbstractImportProceeWithContext {
|
|||
pvo.setBillrange(var10001 + "-" + pvo.getBillrangeend());
|
||||
} else if (ifBelongNewbillSys) {
|
||||
if (!"0".equals(pvo.getBillrangestart()) || !"0".equals(pvo.getBillrangeend())) {
|
||||
throw new BusinessException("票据[" + pvo.getFbmbillno() + "]为新一代票且不可分包流转,子票区间开始和结束应为0!");
|
||||
throw new BusinessException("票据[" + pvo.getFbmbillno() + "]为新一代票且不可分包流转,子票区间开始和结束应为0!");
|
||||
}
|
||||
|
||||
pvo.setBillrange(String.valueOf("0"));
|
||||
|
|
|
@ -133,7 +133,7 @@ public class FbmCommonTools {
|
|||
fbmbillno + NCLangRes4VoTransl.getNCLangRes().getStrByID("3618nccd_0", "03618nccd--186"));
|
||||
} else {
|
||||
|
||||
// zhangxinah 去掉收票登记导入时票据长度校验
|
||||
// zhangxinah 去掉收票登记导入时票据长度校验
|
||||
// checkFbmbillnoLength(fbmbillno);
|
||||
if (fbmbillno.length() > 16) {
|
||||
eBillNoCheck(fbmbillno);
|
||||
|
@ -196,7 +196,7 @@ public class FbmCommonTools {
|
|||
private static void eBillNoCheck(String fbmno) throws BusinessException {
|
||||
Pattern pattern = Pattern.compile("\\d{30}");
|
||||
Boolean ismatch = pattern.matcher(fbmno).matches();
|
||||
// 电票不校验票据号长度
|
||||
// 电票不校验票据号长度
|
||||
ismatch = true;
|
||||
if (!ismatch) {
|
||||
throw new BusinessException(
|
||||
|
@ -353,7 +353,7 @@ public class FbmCommonTools {
|
|||
&& BillRangeTools
|
||||
.handleBillRange(register.getBillrangestart()) <= billrangeend)) {
|
||||
throw new BusinessException(
|
||||
"票据号码" + fbmBillNo + "子票区间" + billrangestart + "-" + billrangeend + "已存在");
|
||||
"票据号码" + fbmBillNo + "子票区间" + billrangestart + "-" + billrangeend + "已存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -371,8 +371,8 @@ public class FbmCommonTools {
|
|||
Integer total = billrangeend - billrangestart + 1;
|
||||
UFDouble count = (new UFDouble("0.01")).multiply((double) total);
|
||||
if (count.compareTo(money) != 0) {
|
||||
throw new BusinessException("票据号码" + registerVO.getFbmbillno() + "子票区间" + billrangestart + "-"
|
||||
+ billrangeend + "的金额" + count.toString() + "与票据金额不相等,请修改");
|
||||
throw new BusinessException("票据号码" + registerVO.getFbmbillno() + "子票区间" + billrangestart + "-"
|
||||
+ billrangeend + "的金额" + count.toString() + "与票据金额不相等,请修改");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -420,17 +420,17 @@ public class FbmCommonTools {
|
|||
String billRangeEnd = registerVO.getBillrangeend();
|
||||
String firstNum = registerVO.getFbmbillno().substring(0, 1);
|
||||
if (isEbill && !"5".equals(firstNum) && !"6".equals(firstNum)) {
|
||||
throw new BusinessException("票据" + registerVO.getFbmbillno() + "非新一代票据,不可进行分包流转!");
|
||||
throw new BusinessException("票据" + registerVO.getFbmbillno() + "非新一代票据,不可进行分包流转!");
|
||||
}
|
||||
|
||||
if (StringUtil.isNull(billRangeStart) || StringUtil.isNull(billRangeEnd)) {
|
||||
throw new BusinessException("票据可分包流转状态下,票据子票区间开始和截止值不能为空!");
|
||||
throw new BusinessException("票据可分包流转状态下,票据子票区间开始和截止值不能为空!");
|
||||
}
|
||||
|
||||
if (Long.valueOf(billRangeStart) > 0L && Long.valueOf(billRangeEnd) > 0L) {
|
||||
if (billRangeStart.length() >= 12 && billRangeEnd.length() >= 12) {
|
||||
if (Long.parseLong(billRangeEnd) < Long.parseLong(billRangeStart)) {
|
||||
throw new BusinessException("子票区间截止值不能小于开始值!");
|
||||
throw new BusinessException("子票区间截止值不能小于开始值!");
|
||||
}
|
||||
|
||||
checkMoneyFormatCorrect(registerVO.getMoney());
|
||||
|
@ -439,25 +439,25 @@ public class FbmCommonTools {
|
|||
UFDouble diffMoney = (new UFDouble(rangeDiff)).add(1.0).multiply(0.01);
|
||||
RegisterVO newRegisterVO = calcMoneyPrecision(registerVO, diffMoney);
|
||||
if (newRegisterVO.getMoney().doubleValue() != registerVO.getMoney().doubleValue()) {
|
||||
throw new BusinessException("票据号码" + registerVO.getFbmbillno() + ",子票区间" + billRangeStart
|
||||
+ "-" + billRangeEnd + "的金额" + newRegisterVO.getMoney().toString()
|
||||
+ "(根据公式自动计算出的金额)与票据金额不相等,请修改!");
|
||||
throw new BusinessException("票据号码" + registerVO.getFbmbillno() + ",子票区间" + billRangeStart
|
||||
+ "-" + billRangeEnd + "的金额" + newRegisterVO.getMoney().toString()
|
||||
+ "(根据公式自动计算出的金额)与票据金额不相等,请修改!");
|
||||
}
|
||||
|
||||
if (!isEbill) {
|
||||
throw new BusinessException("纸票不能进行分包流转!");
|
||||
throw new BusinessException("纸票不能进行分包流转!");
|
||||
}
|
||||
|
||||
if (Long.parseLong(billRangeEnd) < Long.parseLong(billRangeStart)) {
|
||||
throw new BusinessException("子票区间截止值不能小于开始值!");
|
||||
throw new BusinessException("子票区间截止值不能小于开始值!");
|
||||
}
|
||||
break label101;
|
||||
}
|
||||
|
||||
throw new BusinessException("子票区间开始值和截止值长度都必须为12位!");
|
||||
throw new BusinessException("子票区间开始值和截止值长度都必须为12位!");
|
||||
}
|
||||
|
||||
throw new BusinessException("子票区间开始值和截止值都必须大于0!");
|
||||
throw new BusinessException("子票区间开始值和截止值都必须大于0!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -474,10 +474,10 @@ public class FbmCommonTools {
|
|||
}
|
||||
|
||||
} else {
|
||||
throw new BusinessException("非新一代票据不可进行分包流转,不可输入子票区间!");
|
||||
throw new BusinessException("非新一代票据不可进行分包流转,不可输入子票区间!");
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("票据[" + registerVO.getFbmbillno() + "]为新一代票且不可分包流转,子票区间开始和结束应为0!");
|
||||
throw new BusinessException("票据[" + registerVO.getFbmbillno() + "]为新一代票且不可分包流转,子票区间开始和结束应为0!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,20 +495,20 @@ public class FbmCommonTools {
|
|||
if (ifIncludesInterval(register, newRegisterVO)) {
|
||||
var10002 = register.getparentVO().getFbmbillno();
|
||||
throw new BusinessException(
|
||||
"票据号码" + var10002 + ",子票区间" + register.getparentVO().getBillrangestart() + "-"
|
||||
"票据号码" + var10002 + ",子票区间" + register.getparentVO().getBillrangestart() + "-"
|
||||
+ register.getparentVO().getBillrangeend()
|
||||
+ "已存在,请勿重复录入,请在票据台账节点查询该票据号对应单据是否处理完成!");
|
||||
+ "已存在,请勿重复录入,请在票据台账节点查询该票据号对应单据是否处理完成!");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
throw new BusinessException("票据号[" + newRegisterVO.getFbmbillno() + "]已存在,且为等分票据,不可再登记非等分票据信息!");
|
||||
throw new BusinessException("票据号[" + newRegisterVO.getFbmbillno() + "]已存在,且为等分票据,不可再登记非等分票据信息!");
|
||||
}
|
||||
|
||||
if (!StringUtil.isNull(newRegisterVO.getBillrangestart())
|
||||
&& !StringUtil.isNull(newRegisterVO.getBillrangeend())) {
|
||||
return "票据号[" + newRegisterVO.getFbmbillno() + "]已存在,且为非等分票据,不可再登记等分票据信息!";
|
||||
return "票据号[" + newRegisterVO.getFbmbillno() + "]已存在,且为非等分票据,不可再登记等分票据信息!";
|
||||
}
|
||||
|
||||
throw new BusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("3618fbm_0", "03618fbm-0598",
|
||||
|
@ -516,7 +516,7 @@ public class FbmCommonTools {
|
|||
} else if (registers != null && registers.length > 1) {
|
||||
if (StringUtil.isNull(newRegisterVO.getBillrangestart())
|
||||
|| StringUtil.isNull(newRegisterVO.getBillrangeend())) {
|
||||
throw new BusinessException("票据号[" + newRegisterVO.getFbmbillno() + "]已存在,且为等分票据,不可再登记非等分票据信息!");
|
||||
throw new BusinessException("票据号[" + newRegisterVO.getFbmbillno() + "]已存在,且为等分票据,不可再登记非等分票据信息!");
|
||||
}
|
||||
|
||||
AggRegisterVO[] var7 = registers;
|
||||
|
@ -526,20 +526,20 @@ public class FbmCommonTools {
|
|||
AggRegisterVO vo = var7[var4];
|
||||
if (ifIncludesInterval(vo, newRegisterVO)) {
|
||||
var10002 = vo.getparentVO().getFbmbillno();
|
||||
throw new BusinessException("票据号码" + var10002 + ",子票区间" + vo.getparentVO().getBillrangestart()
|
||||
+ "-" + vo.getparentVO().getBillrangeend() + "已存在,请勿重复录入,请在票据台账节点查询该票据号对应单据是否处理完成!");
|
||||
throw new BusinessException("票据号码" + var10002 + ",子票区间" + vo.getparentVO().getBillrangestart()
|
||||
+ "-" + vo.getparentVO().getBillrangeend() + "已存在,请勿重复录入,请在票据台账节点查询该票据号对应单据是否处理完成!");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (registers == null || registers.length == 0) {
|
||||
throw new BusinessException("修改失败,票据" + newRegisterVO.getFbmbillno() + "数据不存在!");
|
||||
throw new BusinessException("修改失败,票据" + newRegisterVO.getFbmbillno() + "数据不存在!");
|
||||
}
|
||||
|
||||
if (registers != null && registers.length > 1) {
|
||||
if (newRegisterVO.getSubcontractcirculation() != null
|
||||
&& !newRegisterVO.getSubcontractcirculation().booleanValue()) {
|
||||
throw new BusinessException("票据号码 " + newRegisterVO.getFbmbillno() + "作为等分票据已拆包,无法再变更为非等分票据!");
|
||||
throw new BusinessException("票据号码 " + newRegisterVO.getFbmbillno() + "作为等分票据已拆包,无法再变更为非等分票据!");
|
||||
}
|
||||
|
||||
boolean intervalRepeat = false;
|
||||
|
@ -551,7 +551,7 @@ public class FbmCommonTools {
|
|||
if (StringUtil.isNull(vo.getparentVO().getBillrangestart())
|
||||
|| StringUtil.isNull(vo.getparentVO().getBillrangeend())) {
|
||||
throw new BusinessException(
|
||||
"修改失败,票据 " + newRegisterVO.getFbmbillno() + "既存在等分票据数据,又存在非等分票据数据!");
|
||||
"修改失败,票据 " + newRegisterVO.getFbmbillno() + "既存在等分票据数据,又存在非等分票据数据!");
|
||||
}
|
||||
|
||||
if (vo.getparentVO().getPk_register().equals(newRegisterVO.getPk_register())) {
|
||||
|
@ -566,8 +566,8 @@ public class FbmCommonTools {
|
|||
|
||||
if (intervalRepeat) {
|
||||
var10002 = newRegisterVO.getFbmbillno();
|
||||
throw new BusinessException("票据号码" + var10002 + ",子票区间" + newRegisterVO.getBillrangestart() + "-"
|
||||
+ newRegisterVO.getBillrangeend() + "已存在,请勿重复录入,请在票据台账节点查询该票据号对应单据是否处理完成!");
|
||||
throw new BusinessException("票据号码" + var10002 + ",子票区间" + newRegisterVO.getBillrangestart() + "-"
|
||||
+ newRegisterVO.getBillrangeend() + "已存在,请勿重复录入,请在票据台账节点查询该票据号对应单据是否处理完成!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ public class FbmCommonTools {
|
|||
&& !(standardAmountMultiplier.sub(new UFDouble(roundmum)).doubleValue() < 0.0)) {
|
||||
return roundmum;
|
||||
} else {
|
||||
throw new BusinessException("等分票据的票据金额要等于标准金额的整数倍,请修改!");
|
||||
throw new BusinessException("等分票据的票据金额要等于标准金额的整数倍,请修改!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@ import java.time.LocalDateTime;
|
|||
|
||||
|
||||
/**
|
||||
* 发货时保存时验证销售订单累计发货数量,并校验销售发票标识,并验证发货款比例
|
||||
* 发货时保存时验证销售订单累计发货数量,并校验销售发票标识,并验证发货款比例
|
||||
* zhangxinah
|
||||
* 2005适配2312
|
||||
* 2005适配2312
|
||||
*/
|
||||
public class saveBeforeCheck implements IBusinessListener {
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
if (event != null) {
|
||||
Map<String, SaleOutVO[]> map = this.getBills(event);
|
||||
SaleOutVO[] obills = map.get("obj");
|
||||
// 判断是否是需要控制的业务单元
|
||||
// 判断是否是需要控制的业务单元
|
||||
SaleOutHeadVO parentVO = obills[0].getHead();
|
||||
String pkstockorgStr = getPk_stockorg(parentVO.getPk_org());
|
||||
if (pkstockorgStr == null || pkstockorgStr.equals("")) {
|
||||
|
@ -51,7 +51,7 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
if (valMap == null || valMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// 历史数据不考虑
|
||||
// 历史数据不考虑
|
||||
String storedDateStr = (String) valMap.get("creationtime");
|
||||
String targetDateStr = "2024-12-31 00:00:00";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -60,51 +60,51 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
if (storedDate.isBefore(targetDate)) {
|
||||
return;
|
||||
}
|
||||
// 销售发票表头pk_billtypecode=30-Cxx-12
|
||||
// 销售发票表头pk_billtypecode=30-Cxx-12
|
||||
if (valMap.get("pk_billtypecode").equals("30-Cxx-12")
|
||||
|| valMap.get("pk_billtypecode").equals("30-Cxx-02")
|
||||
|| valMap.get("pk_billtypecode").equals("30-Cxx-08")
|
||||
|| valMap.get("pk_billtypecode").equals("30-Cxx-13")) {
|
||||
return;
|
||||
}
|
||||
// 销售发票表头vdef21=是
|
||||
// 销售发票表头vdef21=是
|
||||
if (valMap.get("vdef20") == null || !valMap.get("vdef20").equals("Y")) {
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",销售发票验证不通过,无法保存!");
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",销售发票验证不通过,无法保存!");
|
||||
}
|
||||
if (valMap.get("sqty") == null) {
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",累计发货申请数量为0,无法保存!");
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",累计发货申请数量为0,无法保存!");
|
||||
} else {
|
||||
try {
|
||||
double sQty = Double.parseDouble((String) valMap.get("sqty"));// 累计发货申请数量
|
||||
UFDouble bdnumUF = vo.getNshouldassistnum();// 本单应发数量
|
||||
double sQty = Double.parseDouble((String) valMap.get("sqty"));// 累计发货申请数量
|
||||
UFDouble bdnumUF = vo.getNshouldassistnum();// 本单应发数量
|
||||
double bdnum = 0;
|
||||
if (bdnumUF != null) {
|
||||
bdnum = bdnumUF.getDouble();
|
||||
}
|
||||
// 应发数量判断
|
||||
// 应发数量判断
|
||||
Object ntotaloutnumsObj = valMap.get("ntotaloutnums");
|
||||
String ntotaloutnums = (ntotaloutnumsObj != null) ? ntotaloutnumsObj.toString() : "";
|
||||
double ntotaloutnum = (ntotaloutnums.isEmpty()) ? 0 : Double.parseDouble(ntotaloutnums);// 累计出库主数量
|
||||
double ntotaloutnum = (ntotaloutnums.isEmpty()) ? 0 : Double.parseDouble(ntotaloutnums);// 累计出库主数量
|
||||
|
||||
if (sQty < (ntotaloutnum + bdnum)) {
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库应发数量'" + (ntotaloutnum + bdnum)
|
||||
+ "'大于销售订单累计发货申请数量'" + sQty + "',无法保存!");
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库应发数量'" + (ntotaloutnum + bdnum)
|
||||
+ "'大于销售订单累计发货申请数量'" + sQty + "',无法保存!");
|
||||
}
|
||||
// 实发数量判断
|
||||
UFDouble bdsfnumUF = vo.getNassistnum();// 本单实发数量
|
||||
// 实发数量判断
|
||||
UFDouble bdsfnumUF = vo.getNassistnum();// 本单实发数量
|
||||
double bdsfnum = 0;
|
||||
if (bdsfnumUF != null) {
|
||||
bdsfnum = bdsfnumUF.getDouble();
|
||||
}
|
||||
Object nassistnumObj = valMap.get("nassistnum");
|
||||
String nassistnums = (nassistnumObj != null) ? nassistnumObj.toString() : "";
|
||||
double nassistnum = (nassistnums.isEmpty()) ? 0 : Double.parseDouble(nassistnums);// 累计出库主数量
|
||||
double nassistnum = (nassistnums.isEmpty()) ? 0 : Double.parseDouble(nassistnums);// 累计出库主数量
|
||||
if (sQty < (nassistnum + bdsfnum)) {
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库实发数量'" + (nassistnum + bdsfnum)
|
||||
+ "'大于销售订单累计发货申请数量'" + sQty + "',无法保存!");
|
||||
throw new BusinessException("销售出库单明细" + (i + 1) + ",累计出库实发数量'" + (nassistnum + bdsfnum)
|
||||
+ "'大于销售订单累计发货申请数量'" + sQty + "',无法保存!");
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
throw new BusinessException("累计发货申请数量、累计出库数量转化数值失败" + e);
|
||||
throw new BusinessException("累计发货申请数量、累计出库数量转化数值失败" + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
Object object = null;
|
||||
Object old = null;
|
||||
Map<String, SaleOutVO[]> retMap = new HashMap<>();
|
||||
// 类型判断和赋值
|
||||
// 类型判断和赋值
|
||||
if (event instanceof BusinessEvent) {
|
||||
BusinessEvent bills = (BusinessEvent) event;
|
||||
object = bills.getObject();
|
||||
|
@ -155,17 +155,17 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
object = e.getNewObjs();
|
||||
old = e.getOldObjs();
|
||||
} else {
|
||||
throw new BusinessException("未找到单据类型");
|
||||
throw new BusinessException("未找到单据类型");
|
||||
}
|
||||
// 将 object 和 old 转换为 SaleOutVO[] 并添加到 retMap
|
||||
// 将 object 和 old 转换为 SaleOutVO[] 并添加到 retMap
|
||||
retMap.put("new", toSaleOutVOArray(object));
|
||||
retMap.put("old", toSaleOutVOArray(old));
|
||||
// 根据 new 或 old 来设置 "obj"
|
||||
// 根据 new 或 old 来设置 "obj"
|
||||
retMap.put("obj", retMap.get("new") != null ? retMap.get("new") : retMap.get("old"));
|
||||
return retMap;
|
||||
}
|
||||
|
||||
// 辅助方法:将对象转换为 SaleOutVO 数组
|
||||
// 辅助方法:将对象转换为 SaleOutVO 数组
|
||||
private SaleOutVO[] toSaleOutVOArray(Object object) {
|
||||
if (object == null) {
|
||||
return null;
|
||||
|
|
|
@ -23,14 +23,14 @@ public class PickmFillInfoFormMORule implements IRule<AggPickmVO> {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
//流程生产订单表体主键
|
||||
//流程生产订单表体主键
|
||||
Set<String> bmopksSet = new HashSet<>();
|
||||
Arrays.stream(vos).forEach(aggPickmVO -> bmopksSet.add(aggPickmVO.getParentVO().getVsourcemorowid()));
|
||||
IPMOQueryService ipmoQueryService = NCLocator.getInstance().lookup(IPMOQueryService.class);
|
||||
Map<String, PMOItemVO> pMOItemVOMap = ipmoQueryService.queryItemBybid(bmopksSet.toArray(new String[0]));
|
||||
|
||||
Arrays.stream(vos).forEach(aggPickmVO -> {
|
||||
//生产订单行主键
|
||||
//生产订单行主键
|
||||
String vsourcemorowid = aggPickmVO.getParentVO().getVsourcemorowid();
|
||||
PickmItemVO[] children = (PickmItemVO[])aggPickmVO.getChildren(PickmItemVO.class);
|
||||
if(!MMValueCheck.isNotEmpty(children)){
|
||||
|
@ -38,9 +38,9 @@ public class PickmFillInfoFormMORule implements IRule<AggPickmVO> {
|
|||
}
|
||||
for (PickmItemVO pickmItemVO : children) {
|
||||
PMOItemVO pmoItemVO = pMOItemVOMap.get(vsourcemorowid);
|
||||
pickmItemVO.setVbdef5(pmoItemVO.getVdef1());//合同编号
|
||||
pickmItemVO.setVbdef6(pmoItemVO.getVdef2());//合同销售订单号
|
||||
pickmItemVO.setVbdef7(pmoItemVO.getVdef7());//标前项目号
|
||||
pickmItemVO.setVbdef5(pmoItemVO.getVdef1());//合同编号
|
||||
pickmItemVO.setVbdef6(pmoItemVO.getVdef2());//合同销售订单号
|
||||
pickmItemVO.setVbdef7(pmoItemVO.getVdef7());//标前项目号
|
||||
}
|
||||
});
|
||||
} catch (BusinessException e) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class PMOFinishBP {
|
|||
private void addFinishAfterRule(CompareAroundProcesser<PMOAggVO> processer) {
|
||||
IRule<PMOAggVO> finishPutPlanRule = new PMOFinishAutoFinishPutPlanRule();
|
||||
processer.addAfterRule(finishPutPlanRule);
|
||||
/** 同步修改备料计划完成(生产订单强制完工时) */
|
||||
/** 同步修改备料计划完成(生产订单强制完工时) */
|
||||
IRule<PMOAggVO> pMOToFinishPickMRule = new PMOToFinishPickMRule();
|
||||
processer.addAfterRule(pMOToFinishPickMRule);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class PMORowFinishBP {
|
|||
returnvos[0].setChildrenVO((CircularlyAccessibleValueObject[])newitemMap.values().toArray(new PMOItemVO[0]));
|
||||
processer.after(returnvos, returnvos);
|
||||
|
||||
/** 同步修改备料计划完成(生产订单强制完工时) */
|
||||
/** 同步修改备料计划完成(生产订单强制完工时) */
|
||||
IRule<PMOAggVO> pMOToFinishPickMRule = new PMOToFinishPickMRule();
|
||||
pMOToFinishPickMRule.process(newaggvos);
|
||||
/** ******************** */
|
||||
|
|
|
@ -20,7 +20,7 @@ import nc.vo.so.m30.entity.SaleOrderBVO;
|
|||
//import nc.bs.rbac.bizlistener.BaseDocDataPermChangeEventListener;
|
||||
//import nc.impl.mmpac.pmo.pac0002.PMOTransTypeQueryServiceImpl;
|
||||
//import nc.impl.mmpac.bcrule.predata.BarCodeDataInitListener;
|
||||
//import nc.ui.mmpub.setanalysis.action.SaAnalysisAction.actionPerformed;//流程生产订单齐套分析-分析
|
||||
//import nc.ui.mmpub.setanalysis.action.SaAnalysisAction.actionPerformed;//流程生产订单齐套分析-分析
|
||||
|
||||
//import nc.impl.mmpub.setanalysis.SetAnalysisServiceImpl;
|
||||
import nc.bs.mmpac.pmo.pac0002.bp.PMORowPutBP;
|
||||
|
@ -38,7 +38,7 @@ public class putBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
// TODO Auto-generated method stub
|
||||
List<SaleOrderBVO> list = new ArrayList<SaleOrderBVO>();
|
||||
for (PMOAggVO vo : vos) {
|
||||
//判断是否是需要控制的业务单元
|
||||
//判断是否是需要控制的业务单元
|
||||
PMOHeadVO pmoHeadVO = vo.getParentVO();
|
||||
String pkstockorgStr = getPk_stockorg(pmoHeadVO.getPk_org());
|
||||
if (pkstockorgStr == null || pkstockorgStr.equals("")) {
|
||||
|
@ -47,16 +47,16 @@ public class putBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
PMOItemVO[] iSuperVOs = vo.getChildrenVO();
|
||||
for (int i = 0; i < iSuperVOs.length; i++) {
|
||||
PMOItemVO itemvo = iSuperVOs[i];
|
||||
//判断是否类型是否为30
|
||||
//判断是否类型是否为30
|
||||
if (itemvo.getVsrctype() == null || !itemvo.getVsrctype().equals("30")) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> valMap = getVbdef6(itemvo.getVsrcbid());
|
||||
//销售发票表头pk_billtypecode=30-Cxx-12
|
||||
//销售发票表头pk_billtypecode=30-Cxx-12
|
||||
if (valMap.get("pk_billtypecode").equals("30-Cxx-12")||valMap.get("pk_billtypecode").equals("30-Cxx-02")||valMap.get("pk_billtypecode").equals("30-Cxx-08")||valMap.get("pk_billtypecode").equals("30-Cxx-13")) {
|
||||
return;
|
||||
}
|
||||
//历史数据不考虑
|
||||
//历史数据不考虑
|
||||
String storedDateStr = (String) valMap.get("creationtime");
|
||||
String targetDateStr = "2024-12-31 00:00:00";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -65,15 +65,15 @@ public class putBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
if (storedDate.isBefore(targetDate)) {
|
||||
return;
|
||||
}
|
||||
String vdef4Str = itemvo.getVdef4();//齐套率
|
||||
String vdef4Str = itemvo.getVdef4();//齐套率
|
||||
String vdef4 = (vdef4Str != null) ? vdef4Str.toString() : "";
|
||||
double vdef4qty = (vdef4.isEmpty()) ? 0 : Double.parseDouble(vdef4);//齐套率
|
||||
String vdef10Str = itemvo.getVdef10();//齐套率标准
|
||||
double vdef4qty = (vdef4.isEmpty()) ? 0 : Double.parseDouble(vdef4);//齐套率
|
||||
String vdef10Str = itemvo.getVdef10();//齐套率标准
|
||||
String vdef10 = (vdef10Str != null) ? vdef10Str.toString() : "";
|
||||
double vdef10qty = (vdef10.isEmpty()) ? 0 : Double.parseDouble(vdef10);//齐套率标准
|
||||
double vdef10qty = (vdef10.isEmpty()) ? 0 : Double.parseDouble(vdef10);//齐套率标准
|
||||
if (vdef4qty < vdef10qty) {
|
||||
throw new BusinessException(
|
||||
"齐套率" + vdef4qty + "小于齐套率标准'" + vdef10qty + "',无法保存!");
|
||||
"齐套率" + vdef4qty + "小于齐套率标准'" + vdef10qty + "',无法保存!");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ import nc.vo.pub.BusinessException;
|
|||
import nc.vo.so.m30.entity.SaleOrderBVO;
|
||||
|
||||
/**
|
||||
* 流程生成订单保存时验证销售订单累计排产状态,并验收首付款比例
|
||||
* zhangxinah 适配2312
|
||||
* 流程生成订单保存时验证销售订单累计排产状态,并验收首付款比例
|
||||
* zhangxinah 适配2312
|
||||
*/
|
||||
public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
try {
|
||||
List<SaleOrderBVO> list = new ArrayList<SaleOrderBVO>();
|
||||
for (PMOAggVO vo : vos) {
|
||||
//判断是否是需要控制的业务单元
|
||||
//判断是否是需要控制的业务单元
|
||||
PMOHeadVO pmoHeadVO = vo.getParentVO();
|
||||
String pkstockorgStr = getPk_stockorg(pmoHeadVO.getPk_org());
|
||||
if (pkstockorgStr == null || pkstockorgStr.equals("")) {
|
||||
|
@ -37,20 +37,20 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
PMOItemVO[] iSuperVOs = vo.getChildrenVO();
|
||||
for (int i = 0; i < iSuperVOs.length; i++) {
|
||||
PMOItemVO itemvo = iSuperVOs[i];
|
||||
//判断是否类型是否为30
|
||||
//判断是否类型是否为30
|
||||
if (itemvo.getVsrctype() == null || !itemvo.getVsrctype().equals("30")) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Object> valMap = getVbdef6(itemvo.getVsrcbid());
|
||||
if (valMap == null || valMap.isEmpty()) {
|
||||
throw new BusinessException("无法关联到销售订单,无法保存!");
|
||||
throw new BusinessException("无法关联到销售订单,无法保存!");
|
||||
}
|
||||
//销售发票表头pk_billtypecode=30-Cxx-12
|
||||
//销售发票表头pk_billtypecode=30-Cxx-12
|
||||
if (valMap.get("pk_billtypecode").equals("30-Cxx-12")||valMap.get("pk_billtypecode").equals("30-Cxx-02")||valMap.get("pk_billtypecode").equals("30-Cxx-08")||valMap.get("pk_billtypecode").equals("30-Cxx-13")) {
|
||||
return;
|
||||
}
|
||||
//历史数据不考虑
|
||||
//历史数据不考虑
|
||||
String storedDateStr = (String) valMap.get("creationtime");
|
||||
String targetDateStr = "2024-12-27 00:00:00";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -61,22 +61,22 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
}
|
||||
if (valMap.get("vbdef12") == null) {
|
||||
throw new BusinessException(
|
||||
"生产订单明细" + (i + 1) + ",累计排产申请数量为0,无法保存!");
|
||||
"生产订单明细" + (i + 1) + ",累计排产申请数量为0,无法保存!");
|
||||
} else {
|
||||
try {
|
||||
double sQty = Double.parseDouble((String) valMap.get("vbdef12"));//累计排产申请数量
|
||||
double sQty = Double.parseDouble((String) valMap.get("vbdef12"));//累计排产申请数量
|
||||
Object ntotaloutnumsObj = valMap.get("nastnum");
|
||||
String ntotaloutnums = (ntotaloutnumsObj != null) ? ntotaloutnumsObj.toString() : "";
|
||||
double ntotaloutnum =
|
||||
(ntotaloutnums.isEmpty()) ? 0 : Double.parseDouble(ntotaloutnums);//累计生产数量
|
||||
(ntotaloutnums.isEmpty()) ? 0 : Double.parseDouble(ntotaloutnums);//累计生产数量
|
||||
double bdnum = itemvo.getNastnum().getDouble();
|
||||
if (sQty < (ntotaloutnum + bdnum)) {
|
||||
throw new BusinessException(
|
||||
"生产订单明细" + (i + 1) + ",累计生产数量'" + (ntotaloutnum + bdnum)
|
||||
+ "'大于销售订单累计排产申请数量'" + sQty + "',无法保存!");
|
||||
"生产订单明细" + (i + 1) + ",累计生产数量'" + (ntotaloutnum + bdnum)
|
||||
+ "'大于销售订单累计排产申请数量'" + sQty + "',无法保存!");
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
throw new BusinessException("累计排产申请数量转化数值失败" + e);
|
||||
throw new BusinessException("累计排产申请数量转化数值失败" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,49 +21,49 @@ public class PMOToFinishPickMRule
|
|||
return;
|
||||
}
|
||||
/**
|
||||
* 业务逻辑:
|
||||
* 1.循环生产订单明细表
|
||||
* 2.查看生产订单明细行的状态是否为完工(2)
|
||||
* 3.若为完工状态,则根据生产订单明细表中生产订单行查询备料计划
|
||||
* 4.修改备料计划为完成状态(3)
|
||||
* 业务逻辑:
|
||||
* 1.循环生产订单明细表
|
||||
* 2.查看生产订单明细行的状态是否为完工(2)
|
||||
* 3.若为完工状态,则根据生产订单明细表中生产订单行查询备料计划
|
||||
* 4.修改备料计划为完成状态(3)
|
||||
*/
|
||||
for(int i = 0; i < vos.length; i++) {
|
||||
PMOAggVO vo = vos[i];
|
||||
PMOItemVO[] items = vo.getChildrenVO();
|
||||
//循环生产订单明细
|
||||
//循环生产订单明细
|
||||
for(int j = 0; j < items.length; j++) {
|
||||
PMOItemVO item = items[j];
|
||||
//查看生产订单行状态是否为完工(2)
|
||||
//查看生产订单行状态是否为完工(2)
|
||||
int fitemStatus = item.getFitemstatus();
|
||||
if(fitemStatus != 2) {
|
||||
continue;
|
||||
}
|
||||
//根据生产订单行查询备料计划
|
||||
//根据生产订单行查询备料计划
|
||||
String cmoid = item.getCmoid();
|
||||
String whereSql = "nvl(mm_pickm.dr,0) = 0 and mm_pickm.vsourcemorowid = '" + cmoid + "'";
|
||||
IMDPersistenceQueryService aggvoQueryService = NCLocator.getInstance().lookup(IMDPersistenceQueryService.class);
|
||||
// 根据主键查询得到aggvo
|
||||
// 根据主键查询得到aggvo
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
ArrayList<AggPickmVO> aggVOs = (ArrayList<AggPickmVO>)aggvoQueryService.queryBillOfVOByCond(AggPickmVO.class, whereSql, true, false);
|
||||
if(aggVOs.size() <= 0) {
|
||||
continue;
|
||||
}
|
||||
//数组转换
|
||||
//数组转换
|
||||
AggPickmVO[] aggVOsArr = new AggPickmVO[aggVOs.size()];
|
||||
boolean flag = false;
|
||||
for(int z=0; z<aggVOs.size(); z++) {
|
||||
AggPickmVO aggPickmVO = aggVOs.get(z);
|
||||
PickmHeadVO pickmHeadVO = aggPickmVO.getParentVO();
|
||||
Integer fbillstatus = pickmHeadVO.getFbillstatus();
|
||||
//已经位完工态的备料计划不修改
|
||||
//已经位完工态的备料计划不修改
|
||||
if(fbillstatus != 2){
|
||||
aggVOsArr[z] =aggVOs.get(z);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if(flag) {
|
||||
//备料计划完工
|
||||
//备料计划完工
|
||||
IPickmMaintainService ipickmMaintainService = NCLocator.getInstance().lookup(IPickmMaintainService.class);
|
||||
ipickmMaintainService.finishPickm(aggVOsArr);
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ public class WrInsertBP {
|
|||
processor.addAfterRule(moDiscadNumRewriteRule);
|
||||
IRule<AggWrVO> snSaveRule = new WrSerialNoSaveRule();
|
||||
processor.addAfterRule(snSaveRule);
|
||||
/** 同步修改备料计划完成 */
|
||||
/** 同步修改备料计划完成 */
|
||||
IRule<AggWrVO> pickMFinishRule = new PickMFinishRule();
|
||||
processor.addAfterRule(pickMFinishRule);
|
||||
/** ******************** */
|
||||
|
|
|
@ -33,43 +33,43 @@ public class PickMFinishRule
|
|||
return;
|
||||
}
|
||||
/**
|
||||
* 业务逻辑:
|
||||
* 1.根据生产报告子表中生产订单行查看生产订单明细表
|
||||
* 2.查看生产订单明细行的状态是否为完工(2)
|
||||
* 3.若为完工状态,则根据生成报告子表中生产订单行查询备料计划
|
||||
* 4.修改备料计划为完成状态(3)
|
||||
* 业务逻辑:
|
||||
* 1.根据生产报告子表中生产订单行查看生产订单明细表
|
||||
* 2.查看生产订单明细行的状态是否为完工(2)
|
||||
* 3.若为完工状态,则根据生成报告子表中生产订单行查询备料计划
|
||||
* 4.修改备料计划为完成状态(3)
|
||||
*/
|
||||
for(int i = 0; i < vos.length; i++) {
|
||||
AggWrVO vo = vos[i];
|
||||
WrItemVO[] items = vo.getChildrenVO();
|
||||
//循环生产报告子表
|
||||
//循环生产报告子表
|
||||
for(int j = 0; j < items.length; j++) {
|
||||
WrItemVO item = items[j];
|
||||
String cbmobid = item.getCbmobid();
|
||||
String[] keys = {cbmobid};
|
||||
//生产订单行查询
|
||||
//生产订单行查询
|
||||
PMOItemVO[] pmoItemvos = (new PMOItemVOQueryBP()).getPMOItemVOsByids(keys);
|
||||
//查看生产订单行状态是否为完工(2)
|
||||
//查看生产订单行状态是否为完工(2)
|
||||
if(pmoItemvos.length > 0) {
|
||||
PMOItemVO pmoItem = pmoItemvos[0];
|
||||
int fitemStatus = pmoItem.getFitemstatus();
|
||||
if(fitemStatus != 2) {
|
||||
continue;
|
||||
}
|
||||
//根据生产订单行查询备料计划
|
||||
//根据生产订单行查询备料计划
|
||||
// BillQuery<AggPickmVO> query = new BillQuery<AggPickmVO>(AggPickmVO.class);
|
||||
// AggPickmVO[] aggVOs = (AggPickmVO[])query.query(keys);
|
||||
|
||||
String whereSql = "nvl(mm_pickm.dr,0) = 0 and mm_pickm.vsourcemorowid = '" + cbmobid + "'";
|
||||
IMDPersistenceQueryService aggvoQueryService = NCLocator.getInstance().lookup(IMDPersistenceQueryService.class);
|
||||
// 根据主键查询得到aggvo
|
||||
// 根据主键查询得到aggvo
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
ArrayList<AggPickmVO> aggVOs = (ArrayList<AggPickmVO>)aggvoQueryService.queryBillOfVOByCond(AggPickmVO.class, whereSql, true, false);
|
||||
if(aggVOs.size() <= 0) {
|
||||
continue;
|
||||
}
|
||||
//数组转换
|
||||
//数组转换
|
||||
AggPickmVO[] aggVOsArr = new AggPickmVO[aggVOs.size()];
|
||||
boolean flag = false;
|
||||
for(int z=0; z<aggVOs.size(); z++) {
|
||||
|
@ -83,7 +83,7 @@ public class PickMFinishRule
|
|||
|
||||
}
|
||||
if(flag){
|
||||
//备料计划完工
|
||||
//备料计划完工
|
||||
IPickmMaintainService ipickmMaintainService = NCLocator.getInstance().lookup(IPickmMaintainService.class);
|
||||
ipickmMaintainService.finishPickm(aggVOsArr);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<component name="pu" displayname="pu">
|
||||
<dependencies/>
|
||||
</component>
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<actions>
|
||||
<action>
|
||||
<name>ic.sapplybill.query</name>
|
||||
<label>出库申请单查询</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.queryPage</name>
|
||||
<label>出库申请单查询</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillPageQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.maintain</name>
|
||||
<label>出库申请单删除、提交、收回</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillMaintainAction</clazz>
|
||||
<btncode>Commit,UnCommit,Delete</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.save</name>
|
||||
<label>出库申请单保存</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillSaveAction</clazz>
|
||||
<btncode>Save</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.saveAndCommit</name>
|
||||
<label>出库申请单保存提交</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillSaveCommitAction</clazz>
|
||||
<btncode>SaveCommit, Commit</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.canbecopy</name>
|
||||
<label>出库申请单查询是否可以复制</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillBeforeCopyAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.copy</name>
|
||||
<label>出库申请单复制</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillCopyAction</clazz>
|
||||
<btncode>Copy</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.cardquery</name>
|
||||
<label>出库申请单卡片态查询</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillQueryCardAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.query422x</name>
|
||||
<label>拉单物资需求申请单查询</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.Query422XFor4455Action</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.transfervo</name>
|
||||
<label>物资需求申请单-转单</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.TransToSapplyBillAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.queryPickm</name>
|
||||
<label>拉单备料计划查询</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.QueryPickmFor4455Action</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.transfervo1</name>
|
||||
<label>备料计划申请单-转单</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.TransToSapplyBill1Action</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.print</name>
|
||||
<label>出库申请单打印</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillPrintAction</clazz>
|
||||
<btncode>Print,output,Print_list</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.combine</name>
|
||||
<label>出库申请单合并显示</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillCombineAction</clazz>
|
||||
<btncode>CombinePrint</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.checkprem</name>
|
||||
<label>出库申请单修改、打印校验权限</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillDataPermissionAction</clazz>
|
||||
<btncode>Edit,Print</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.headAfterEdit</name>
|
||||
<label>出库申请单表头区域改变事件</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.events.SapplyBillHeadAfterEventAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.bodyAfterEdit</name>
|
||||
<label>出库申请单表体区域改变事件</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.events.SapplyBillBodyAfterEditAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.rowOpenClose</name>
|
||||
<label>出库申请单表体行打开关闭操作</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillRowOpenCloseAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.billOpenClose</name>
|
||||
<label>出库申请单整单打开关闭操作</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillOpenCloseAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>ic.sapplybill.ntpLinkList</name>
|
||||
<label>预算联查出库申请列表数据加载</label>
|
||||
<clazz>nccloud.web.ic.outbound.sapplybill.action.SapplyBillNtpLinkListAction</clazz>
|
||||
</action>
|
||||
</actions>
|
|
@ -0,0 +1,27 @@
|
|||
<authorizes>
|
||||
<authorize>
|
||||
<appcode>400801200,400801204</appcode>
|
||||
<actions>
|
||||
<action>ic.sapplybill.query</action>
|
||||
<action>ic.sapplybill.queryPage</action>
|
||||
<action>ic.sapplybill.maintain</action>
|
||||
<action>ic.sapplybill.save</action>
|
||||
<action>ic.sapplybill.saveAndCommit</action>
|
||||
<action>ic.sapplybill.canbecopy</action>
|
||||
<action>ic.sapplybill.copy</action>
|
||||
<action>ic.sapplybill.cardquery</action>
|
||||
<action>ic.sapplybill.query422x</action>
|
||||
<action>ic.sapplybill.transfervo</action>
|
||||
<action>ic.sapplybill.queryPickm</action>
|
||||
<action>ic.sapplybill.transfervo1</action>
|
||||
<action>ic.sapplybill.print</action>
|
||||
<action>ic.sapplybill.combine</action>
|
||||
<action>ic.sapplybill.checkprem</action>
|
||||
<action>ic.sapplybill.headAfterEdit</action>
|
||||
<action>ic.sapplybill.bodyAfterEdit</action>
|
||||
<action>ic.sapplybill.rowOpenClose</action>
|
||||
<action>ic.sapplybill.billOpenClose</action>
|
||||
<action>ic.sapplybill.ntpLinkList</action>
|
||||
</actions>
|
||||
</authorize>
|
||||
</authorizes>
|
|
@ -0,0 +1,262 @@
|
|||
package nc.bs.bd.pfxx.plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.yonyou.cloud.utils.CollectionUtils;
|
||||
|
||||
import nc.bs.dao.BaseDAO;
|
||||
import nc.bs.dao.DAOException;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.bs.logging.Logger;
|
||||
import nc.bs.pfxx.ISwapContext;
|
||||
import nc.itf.bd.material.baseinfo.IMaterialBaseInfoService;
|
||||
import nc.jdbc.framework.processor.ColumnListProcessor;
|
||||
import nc.itf.bd.material.plan.IMaterialPlanQueryService;
|
||||
import nc.itf.bd.material.plan.IMaterialPlanService;
|
||||
import nc.itf.bd.material.stock.IMaterialStockQueryService;
|
||||
import nc.itf.bd.material.stock.IMaterialStockService;
|
||||
import nc.vo.bd.errorlog.ErrLogReturnValue;
|
||||
import nc.vo.bd.errorlog.ErrorMsgVO;
|
||||
import nc.vo.bd.material.IMaterialEnumConst;
|
||||
import nc.vo.bd.material.MaterialConvertVO;
|
||||
import nc.vo.bd.material.MaterialTaxTypeVO;
|
||||
import nc.vo.bd.material.MaterialVO;
|
||||
import nc.vo.bd.material.plan.MaterialPlanVO;
|
||||
import nc.vo.bd.material.stock.MaterialStockVO;
|
||||
import nc.vo.bd.pub.IPubEnumConst;
|
||||
import nc.vo.pfxx.auxiliary.AggxsysregisterVO;
|
||||
import nc.vo.pfxx.util.PfxxPluginUtils;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.pub.VOStatus;
|
||||
import nc.vo.pub.lang.UFBoolean;
|
||||
|
||||
import nccloud.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* 物料基本信息外部交互平台导入
|
||||
*
|
||||
* @author jiangjuna
|
||||
* @since NC6.0
|
||||
*/
|
||||
public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
|
||||
|
||||
private BaseDAO baseDAO = null;
|
||||
|
||||
private IMaterialBaseInfoService service = null;
|
||||
|
||||
@Override
|
||||
protected Object processBill(Object vo, ISwapContext swapContext, AggxsysregisterVO aggxsysvo) throws BusinessException {
|
||||
String pk = null;
|
||||
try {
|
||||
MaterialVO materialVO = (MaterialVO) vo;
|
||||
// by_zhangzhyz_20220113//项目专项需求 根据物料编码和组织进行查询,不通过ID对照表
|
||||
String whereSql = MaterialVO.CODE + " = '" + materialVO.getCode() + "'";
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<MaterialVO> cols = new BaseDAO().retrieveByClause(MaterialVO.class, whereSql);
|
||||
if (cols != null && !cols.isEmpty()) {
|
||||
MaterialVO[] vos = cols.toArray(new MaterialVO[0]);
|
||||
pk = vos[0].getPk_material();
|
||||
}
|
||||
if (StringUtils.isBlank(pk)) {
|
||||
materialVO = this.insertMaterialVO(materialVO);
|
||||
PfxxPluginUtils.addDocIDVsPKContrast(swapContext.getBilltype(), swapContext.getDocID(), materialVO.getPrimaryKey());
|
||||
return materialVO.getPrimaryKey();
|
||||
} else {
|
||||
this.getService().updateMaterial(this.getUpdateVO(materialVO, pk));
|
||||
String sender = swapContext.getSender();
|
||||
if("pdm".equalsIgnoreCase(sender)) {
|
||||
// 物料更新后更新计划信息
|
||||
updatePlanVOsAfterMaterialUpdate(materialVO);
|
||||
// 物料更新后更新库存信息
|
||||
updateStockVOsAfterMaterialUpdate(materialVO);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.error(ex.getMessage(), ex.getCause());
|
||||
throw new BusinessException(ex.getMessage(), ex.getCause());
|
||||
}
|
||||
return pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料更新后更新计划信息
|
||||
*
|
||||
* @param materialVO
|
||||
* @throws BusinessException
|
||||
*/
|
||||
private void updatePlanVOsAfterMaterialUpdate(MaterialVO materialVO) throws BusinessException {
|
||||
if (materialVO.getDef19() == null)
|
||||
return;
|
||||
String pk_org = materialVO.getPk_org();
|
||||
String pk_material = materialVO.getPk_material();
|
||||
IMaterialPlanQueryService queryService = NCLocator.getInstance().lookup(IMaterialPlanQueryService.class);
|
||||
// 查询物料计划信息
|
||||
MaterialPlanVO[] pvos = queryService.queryMaterialPlanVOs(new String[] { pk_org }, pk_material);
|
||||
IMaterialPlanService planService = NCLocator.getInstance().lookup(IMaterialPlanService.class);
|
||||
for (MaterialPlanVO planVO : pvos) {
|
||||
// PLM计划虚项映射到计划信息
|
||||
if (materialVO.getDef19() != null && UFBoolean.TRUE.toString().equals(materialVO.getDef19()))
|
||||
planVO.setIsvirtual(UFBoolean.TRUE);
|
||||
else
|
||||
planVO.setIsvirtual(UFBoolean.FALSE);
|
||||
planVO.setStatus(VOStatus.UPDATED);
|
||||
planService.updateMaterialPlanVO(planVO);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料更新后更新库存信息
|
||||
*
|
||||
* @param materialVO
|
||||
* @throws BusinessException
|
||||
*/
|
||||
private void updateStockVOsAfterMaterialUpdate(MaterialVO materialVO) throws BusinessException {
|
||||
if (materialVO.getDef18() == null)
|
||||
return;
|
||||
IMaterialStockQueryService queryService = NCLocator.getInstance().lookup(IMaterialStockQueryService.class);
|
||||
MaterialStockVO[] svos = queryService.queryMaterialStockVOs(new String[] { materialVO.getPk_org() }, materialVO.getPk_material());
|
||||
IMaterialStockService stockService = NCLocator.getInstance().lookup(IMaterialStockService.class);
|
||||
for (MaterialStockVO stockVO : svos) {
|
||||
if (stockVO.getMartype() != null) {
|
||||
// PLM物料类型映射到库存信息
|
||||
switch (materialVO.getDef18()) {
|
||||
case IMaterialEnumConst.MATERTYPE_DR:
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_DR);
|
||||
break;
|
||||
case IMaterialEnumConst.MATERTYPE_FR:
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_FR);
|
||||
break;
|
||||
case IMaterialEnumConst.MATERTYPE_MR:
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_MR);
|
||||
break;
|
||||
case IMaterialEnumConst.MATERTYPE_PR:
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_PR);
|
||||
break;
|
||||
case IMaterialEnumConst.MATERTYPE_OT:
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_OT);
|
||||
break;
|
||||
case IMaterialEnumConst.MATERTYPE_ET:
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_ET);
|
||||
break;
|
||||
default:
|
||||
// 物料类型默认为“MR”
|
||||
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_MR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
stockService.updateMaterialStockVOs(svos);
|
||||
}
|
||||
|
||||
private BaseDAO getBaseDAO() {
|
||||
if (this.baseDAO == null) {
|
||||
this.baseDAO = new BaseDAO();
|
||||
}
|
||||
return this.baseDAO;
|
||||
}
|
||||
|
||||
private MaterialVO getInsertVO(MaterialVO materialVO) throws DAOException {
|
||||
materialVO.setEnablestate(IPubEnumConst.ENABLESTATE_ENABLE);
|
||||
materialVO.setStatus(VOStatus.NEW);
|
||||
materialVO.setMaterialconvert(this.getMaterialConvertVOs(materialVO));
|
||||
materialVO.setMaterialtaxtype(this.getMaterialTaxTypeVOs(materialVO));
|
||||
return materialVO;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private MaterialConvertVO[] getMaterialConvertVOs(MaterialVO MaterialVO) throws DAOException {
|
||||
List<MaterialConvertVO> newConverts = new ArrayList<MaterialConvertVO>();
|
||||
if (StringUtils.isNotBlank(MaterialVO.getPrimaryKey())) {
|
||||
Collection<MaterialConvertVO> oldAgentStores = this.getBaseDAO().retrieveByClause(MaterialConvertVO.class,
|
||||
MaterialConvertVO.PK_MATERIAL + " = '" + MaterialVO.getPrimaryKey() + "'", new String[] { MaterialConvertVO.PK_MATERIALCONVERT });
|
||||
for (MaterialConvertVO agentstore : oldAgentStores) {
|
||||
agentstore.setStatus(VOStatus.DELETED);
|
||||
newConverts.add(agentstore);
|
||||
}
|
||||
}
|
||||
if (MaterialVO.getMaterialconvert() != null && MaterialVO.getMaterialconvert().length > 0) {
|
||||
for (MaterialConvertVO agentstore : MaterialVO.getMaterialconvert()) {
|
||||
agentstore.setStatus(VOStatus.NEW);
|
||||
newConverts.add(agentstore);
|
||||
}
|
||||
}
|
||||
return newConverts.toArray(new MaterialConvertVO[0]);
|
||||
}
|
||||
|
||||
private MaterialTaxTypeVO[] getMaterialTaxTypeVOs(MaterialVO MaterialVO) throws DAOException {
|
||||
List<MaterialTaxTypeVO> newConverts = new ArrayList<MaterialTaxTypeVO>();
|
||||
if (StringUtils.isNotBlank(MaterialVO.getPrimaryKey())) {
|
||||
Collection<MaterialTaxTypeVO> oldAgentStores = this.getBaseDAO().retrieveByClause(MaterialTaxTypeVO.class,
|
||||
MaterialTaxTypeVO.PK_MATERIAL + " = '" + MaterialVO.getPrimaryKey() + "'", new String[] { MaterialTaxTypeVO.PK_MATERIALTAXTYPE });
|
||||
for (MaterialTaxTypeVO agentstore : oldAgentStores) {
|
||||
agentstore.setStatus(VOStatus.DELETED);
|
||||
newConverts.add(agentstore);
|
||||
}
|
||||
}
|
||||
if (MaterialVO.getMaterialtaxtype() != null && MaterialVO.getMaterialtaxtype().length > 0) {
|
||||
for (MaterialTaxTypeVO agentstore : MaterialVO.getMaterialtaxtype()) {
|
||||
agentstore.setStatus(VOStatus.NEW);
|
||||
newConverts.add(agentstore);
|
||||
}
|
||||
}
|
||||
return newConverts.toArray(new MaterialTaxTypeVO[0]);
|
||||
}
|
||||
|
||||
private IMaterialBaseInfoService getService() {
|
||||
if (this.service == null) {
|
||||
this.service = NCLocator.getInstance().lookup(IMaterialBaseInfoService.class);
|
||||
}
|
||||
return this.service;
|
||||
}
|
||||
|
||||
private MaterialVO getUpdateVO(MaterialVO materialVO, String pk) throws BusinessException {
|
||||
MaterialVO oldVO = (MaterialVO) this.getBaseDAO().retrieveByPK(MaterialVO.class, pk,
|
||||
new String[] { MaterialVO.CREATOR, MaterialVO.CREATIONTIME, MaterialVO.PK_SOURCE, MaterialVO.VERSION, MaterialVO.LATEST, MaterialVO.ENABLESTATE });
|
||||
if (oldVO == null) {
|
||||
throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("bdpub", "0bdpub0057")
|
||||
/* @res "该数据已被删除" */);
|
||||
}
|
||||
materialVO.setPrimaryKey(pk);
|
||||
materialVO.setCreator(oldVO.getCreator());
|
||||
materialVO.setCreationtime(oldVO.getCreationtime());
|
||||
materialVO.setPk_source(oldVO.getPk_source());
|
||||
materialVO.setVersion(oldVO.getVersion());
|
||||
materialVO.setLatest(oldVO.getLatest());
|
||||
materialVO.setEnablestate(oldVO.getEnablestate());
|
||||
materialVO.setStatus(VOStatus.UPDATED);
|
||||
materialVO.setTs(oldVO.getTs());
|
||||
materialVO.setMaterialconvert(this.getMaterialConvertVOs(materialVO));
|
||||
materialVO.setMaterialtaxtype(this.getMaterialTaxTypeVOs(materialVO));
|
||||
return materialVO;
|
||||
}
|
||||
|
||||
private MaterialVO insertMaterialVO(MaterialVO materialVO) throws BusinessException, DAOException {
|
||||
if (StringUtils.isBlank(materialVO.getPk_source())) {
|
||||
materialVO = this.getService().insertMaterial(this.getInsertVO(materialVO));
|
||||
} else {
|
||||
ErrLogReturnValue value = this.getService().createMaterialVersion(materialVO, materialVO.getPk_source());
|
||||
if (value.getReturnValue() == null || !value.getReturnValue().getClass().isArray()) {
|
||||
return materialVO;
|
||||
}
|
||||
materialVO = (MaterialVO) ((Object[]) value.getReturnValue())[0];
|
||||
this.LogErrorMessage(value);
|
||||
}
|
||||
return materialVO;
|
||||
}
|
||||
|
||||
private void LogErrorMessage(ErrLogReturnValue value) {
|
||||
ErrorMsgVO[] vos = value.getErrLogResult().getErrorMsgs();
|
||||
if (vos != null && vos.length > 0) {
|
||||
String message = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("10140mag", "010140mag0200", null,
|
||||
new String[] { Integer.toString(value.getTotalNum()), Integer.toString(value.getErrLogResult().getErrorMessagegNum()) })
|
||||
/* @res "外部交换平台导入物料新版本数据时,分配操作部分成功,共处理了{0}条记录,其中有{1}条处理失败:" */+ "\n";
|
||||
for (int i = 0; i < vos.length; i++) {
|
||||
message += vos[i].getErrormsg() + "\n";
|
||||
}
|
||||
Logger.debug(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue