|
@@ -1,8 +1,11 @@
|
|
|
package u8c.bs.mmpac.bp;
|
|
|
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
import nc.bs.framework.common.NCLocator;
|
|
|
import nc.itf.uap.IUAPQueryBS;
|
|
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
|
|
+import nc.jdbc.framework.processor.MapProcessor;
|
|
|
import nc.vo.pub.BusinessException;
|
|
|
import u8c.pubitf.rule.IRule;
|
|
|
import u8c.vo.ExAggOrderMainVO;
|
|
@@ -22,9 +25,56 @@ public class ValidateRule implements IRule<ExAggOrderMainVO>{
|
|
|
for(int i = 0; i < vos.length; i++) {
|
|
|
OrderInVO[] orderInVOs = (OrderInVO[]) vos[i].getChildrenVO();
|
|
|
for (int j = 0; j < orderInVOs.length; j++) {
|
|
|
+ Map<String,String> map = getInvbasdoc(orderInVOs[j].getCmaterialcode());
|
|
|
+ //颜色
|
|
|
+ String free1 = map.get("free1");
|
|
|
+ if (free1 == null) {
|
|
|
+ if (orderInVOs[j].getColor() != null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"没有启用颜色,颜色不允许输入");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (orderInVOs[j].getColor() == null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"启用了颜色,颜色不允许为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //定尺
|
|
|
+ String free3 = map.get("free3");
|
|
|
+ if (free3 == null) {
|
|
|
+ if (orderInVOs[j].getSizing() != null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"没有启用定尺,定尺不允许输入");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (orderInVOs[j].getSizing() == null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"启用了定尺,定尺不允许为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //合金
|
|
|
+ String free2 = map.get("free2");
|
|
|
+ if (free2 == null) {
|
|
|
+ if (orderInVOs[j].getAlloy() != null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"没有启用合金,合金不允许输入");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (orderInVOs[j].getAlloy() == null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"启用了合金,合金不允许为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //标准
|
|
|
+ String free4 = map.get("free4");
|
|
|
+ if (free4 == null) {
|
|
|
+ if (orderInVOs[j].getStandard() != null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"没有启用标准,标准不允许输入");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (orderInVOs[j].getStandard() == null) {
|
|
|
+ throw new BusinessException("存货档案:"+orderInVOs[j].getCmaterialcode()+"启用了标准,标准不允许为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
getDefdoc("HJ(合金)",orderInVOs[j].getAlloy());
|
|
|
getDefdoc("BZ(标准)",orderInVOs[j].getStandard());
|
|
|
getMeasdoc(orderInVOs[j].getCastunitid());
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -51,4 +101,12 @@ public class ValidateRule implements IRule<ExAggOrderMainVO>{
|
|
|
throw new BusinessException("以下档案在U8cloud系统中根据公司或者账簿信息找不到,请检查!详细信息:1、档案类型 计量档案,档案名称:"+shortname+"");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public Map<String,String> getInvbasdoc(String cmaterialcode)throws BusinessException {
|
|
|
+ String sql = "select free1,free2,free3,free4 from bd_invbasdoc where invcode = '"+cmaterialcode+"' and dr = 0";
|
|
|
+ return (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|