|
@@ -1,5 +1,6 @@
|
|
|
package u8c.bs.mmpac.bp;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import nc.bs.framework.common.InvocationInfoProxy;
|
|
@@ -11,7 +12,9 @@ import nc.jdbc.framework.processor.MapProcessor;
|
|
|
import nc.vo.bd.def.DefdocVO;
|
|
|
import nc.vo.pub.BusinessException;
|
|
|
import nc.vo.pub.CircularlyAccessibleValueObject;
|
|
|
+import nc.vo.pub.lang.UFDate;
|
|
|
import nc.vo.pub.lang.UFDouble;
|
|
|
+import u8c.bs.upifsp.pub.UpifsTool;
|
|
|
import u8c.pubitf.rule.IRule;
|
|
|
import u8c.vo.ExAggOrderMainVO;
|
|
|
import u8c.vo.OrderInVO;
|
|
@@ -51,13 +54,19 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
|
|
|
//型号
|
|
|
orderInVO.setModel(invbasdocMap.get("invtype"));
|
|
|
//米重
|
|
|
- orderInVO.setWeight(invbasdocMap.get("def1"));
|
|
|
+ orderInVO.setWeight(invbasdocMap.get("def2"));
|
|
|
//装饰面周长
|
|
|
- orderInVO.setRound(invbasdocMap.get("def2"));
|
|
|
+ orderInVO.setRound(invbasdocMap.get("def3"));
|
|
|
//窗号
|
|
|
- orderInVO.setConf(invbasdocMap.get("def3"));
|
|
|
+ orderInVO.setConf(invbasdocMap.get("def1"));
|
|
|
//计量单位
|
|
|
orderInVO.setUnitid(invbasdocMap.get("measname"));
|
|
|
+
|
|
|
+ if(orderInVO.getNum() == null && !orderInVO.getCmaterialcode().startsWith("MA") ) {
|
|
|
+ throw new BusinessException("除了型材(MA开头),主数量必须填写");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if(invbasdocMap.get("measnames") != null) {
|
|
|
//辅单位
|
|
|
orderInVO.setCastunitid(invbasdocMap.get("measnames"));
|
|
@@ -68,9 +77,12 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
|
|
|
if(nastnum == null) {
|
|
|
throw new BusinessException("存货:"+orderInVO.getCmaterialcode()+"有辅计量单位,辅数量不能为空");
|
|
|
}
|
|
|
- //换算率
|
|
|
- UFDouble result = new UFDouble(number.div(nastnum).toString(),2);
|
|
|
- orderInVO.setBdef6(result.toString());
|
|
|
+ //MA开头的物料不传主数量所有换算率不需要计算
|
|
|
+ if(number != null && !orderInVO.getCmaterialcode().startsWith("MA")) {
|
|
|
+ //换算率
|
|
|
+ UFDouble result = new UFDouble(number.div(nastnum).toString(),2);
|
|
|
+ orderInVO.setBdef6(result.toString());
|
|
|
+ }
|
|
|
}else {
|
|
|
if(orderInVO.getNastnum() != null) {
|
|
|
//存货不管启没启动辅单位,辅数量都会填,没有启动的就不读取辅数量
|
|
@@ -145,7 +157,17 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
|
|
|
//公司
|
|
|
defdocVO.setPk_corp("0001");
|
|
|
//档案编码
|
|
|
- defdocVO.setDoccode(docname);
|
|
|
+ UFDate date = new UFDate();
|
|
|
+ //YSDC20231219000000
|
|
|
+ HashMap<String, String> billcode_map = UpifsTool
|
|
|
+ .GreatVbillcode("doccode", "YSDC", date,
|
|
|
+ "bd_defdoc",pk_defdoclist);
|
|
|
+ String billcode_s = billcode_map.get("billcode_s");// 单据号前段
|
|
|
+ String billcode_e = billcode_map.get("billcode_e");// 单据号流水号
|
|
|
+ Integer billcode_tj = new Integer(billcode_e);
|
|
|
+ billcode_tj=billcode_tj+1;
|
|
|
+ String billcode =billcode_s+UpifsTool.ChangeIntToStr(billcode_tj);
|
|
|
+ defdocVO.setDoccode(billcode);
|
|
|
//档案名称
|
|
|
defdocVO.setDocname(docname);
|
|
|
//档案系统属性
|