生成不合格审批单调整
This commit is contained in:
parent
ff7ca07612
commit
2ac973c348
|
@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
|
||||
import com.informix.util.stringUtil;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
|
@ -575,13 +576,14 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
|
|||
AggDhjydMasterVO vo = dao.findByPk(AggDhjydMasterVO.class, pk, false);
|
||||
DhjydMasterVO mainVO = vo.getParentVO();
|
||||
// SuperVO mainVO = getMainVO(vo);
|
||||
String oldCode = mainVO.getCode();
|
||||
mainVO.setPrimaryKey(null);
|
||||
mainVO.setStatus(VOStatus.NEW);
|
||||
|
||||
mainVO.setAttributeValue("srcbilltype", null);
|
||||
// 来源单据主键改成当前传递的检验单的主键
|
||||
mainVO.setAttributeValue("srcbillid", pk);
|
||||
mainVO.setAttributeValue("vsourcecode", mainVO.getCode());
|
||||
mainVO.setAttributeValue("vsourcecode", oldCode);
|
||||
|
||||
mainVO.setAttributeValue("code", null);
|
||||
// mainVO.setAttributeValue("", null);
|
||||
|
@ -612,29 +614,30 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
|
|||
"pk_billtypecode = 'DHJY-Cxx-02' ");
|
||||
mainVO.setAttributeValue("transtypepk", billtypeid);
|
||||
mainVO.setAttributeValue("transtype", "DHJY-Cxx-02");
|
||||
// mainVO.setAttributeValue("vmemo", "mzr");
|
||||
// 获取子表的数据
|
||||
DhjydSlave0VO[] dhjydSlave0VOs = (DhjydSlave0VO[]) vo.getChildren(DhjydSlave0VO.class);
|
||||
DhjydSlave0VO[] newVOs = new DhjydSlave0VO[3];
|
||||
if (dhjydSlave0VOs != null && dhjydSlave0VOs.length > 0) {
|
||||
DhjydSlave0VO subvo = dhjydSlave0VOs[0];
|
||||
DhjydSlave0VO oldVo = dhjydSlave0VOs[0];
|
||||
// 检查结果 合格、回用、不合格
|
||||
String def1 = subvo.getDef1();
|
||||
Object def1Code = null;
|
||||
try {
|
||||
def1Code = new HYPubBO().findColValue("bd_defdoc", "code", " dr = 0 and pk_defdoc='" + def1 + "' ");
|
||||
} catch (UifException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
subvo.setPrimaryKey(null);
|
||||
subvo.setStatus(VOStatus.NEW);
|
||||
subvo.setAttributeValue("pk_chekbill_b", null);
|
||||
subvo.setAttributeValue("srcbilltype", null);
|
||||
subvo.setAttributeValue("srcbillid", null);
|
||||
subvo.setAttributeValue("rowno", null);
|
||||
subvo.setAttributeValue("srcrowno", null);
|
||||
String def1 = oldVo.getDef1();
|
||||
String getTestResCodeSql = "SELECT a.code,a.pk_defdoc " +
|
||||
"FROM bd_defdoc a LEFT JOIN bd_defdoclist b ON a.pk_defdoclist = b.pk_defdoclist " +
|
||||
"WHERE a.dr = 0 AND a.pk_defdoc = '[def1]' AND b.code = 'checkresult'";
|
||||
getTestResCodeSql = getTestResCodeSql.replace("[def1]", def1);
|
||||
HashMap<String,String> headMap = (HashMap<String,String>)getBaseDAO().executeQuery(getTestResCodeSql, new MapProcessor());
|
||||
String def1Code = headMap.getOrDefault("code", "");
|
||||
oldVo.setPrimaryKey(null);
|
||||
oldVo.setStatus(VOStatus.NEW);
|
||||
oldVo.setAttributeValue("pk_chekbill_b", null);
|
||||
oldVo.setAttributeValue("srcbilltype", null);
|
||||
oldVo.setAttributeValue("srcbillid", null);
|
||||
oldVo.setAttributeValue("rowno", null);
|
||||
oldVo.setAttributeValue("srcrowno", null);
|
||||
// 根据自定义档案的编码查询对应的主键
|
||||
String getTestResSql = "select code,pk_defdoc from bd_defdoc where dr = 0 and code in ('01','02','03')";
|
||||
String getTestResSql = "SELECT a.code,a.pk_defdoc " +
|
||||
"FROM bd_defdoc a LEFT JOIN bd_defdoclist b ON a.pk_defdoclist = b.pk_defdoclist " +
|
||||
"WHERE a.dr = 0 AND a.code IN ('01','02','03') AND b.code = 'checkresult'";
|
||||
List<Map<String, Object>> testResList = (List<Map<String, Object>>) getBaseDAO().executeQuery(getTestResSql,
|
||||
new MapListProcessor());
|
||||
Map<String, String> testResMap = new HashMap<>();
|
||||
|
@ -643,38 +646,57 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
|
|||
testResMap.put(map.getOrDefault("code", "") + "", map.getOrDefault("pk_defdoc", "") + "");
|
||||
}
|
||||
}
|
||||
DhjydSlave0VO vo0 = new DhjydSlave0VO();
|
||||
DhjydSlave0VO vo1 = new DhjydSlave0VO();
|
||||
DhjydSlave0VO vo2 = new DhjydSlave0VO();
|
||||
BeanUtil.copyProperties(oldVo, vo0);
|
||||
BeanUtil.copyProperties(oldVo, vo1);
|
||||
BeanUtil.copyProperties(oldVo, vo2);
|
||||
// 第1行 合格 第2行 回用 第3行 不合格
|
||||
if ("01".equals(def1Code)) {
|
||||
mainVO.setAttributeValue("vmemo", def1Code + new UFDateTime(InvocationInfoProxy.getInstance().getBizDateTime()));
|
||||
// 合格
|
||||
newVOs[0] = subvo;
|
||||
vo0.setNunqualifiednum(UFDouble.ZERO_DBL);
|
||||
newVOs[0] = vo0;
|
||||
|
||||
// 回用
|
||||
// 设置检验结果的值
|
||||
vo1.setAttributeValue("def1", testResMap.get("02"));
|
||||
newVOs[1] = vo1;
|
||||
|
||||
// 不合格
|
||||
DhjydSlave0VO vo2 = new DhjydSlave0VO();
|
||||
vo2 = subvo;
|
||||
vo2.setNunqualifiednum(UFDouble.ZERO_DBL);
|
||||
// 设置检验结果的值
|
||||
vo2.setAttributeValue("def1", testResMap.get("02"));
|
||||
newVOs[1] = vo2;
|
||||
vo2.setAttributeValue("def1", testResMap.get("03"));
|
||||
newVOs[2] = vo2;
|
||||
} else if ("02".equals(def1Code)) {
|
||||
// »ØÓÃ
|
||||
newVOs[1] = subvo;
|
||||
newVOs[0] = subvo;
|
||||
subvo.setAttributeValue("def1", testResMap.get("01"));
|
||||
newVOs[2] = subvo;
|
||||
subvo.setAttributeValue("def1", testResMap.get("03"));
|
||||
} else if ("03".equals(def1Code)) {
|
||||
// ²»ºÏ¸ñ
|
||||
newVOs[2] = subvo;
|
||||
mainVO.setAttributeValue("vmemo", def1Code + new UFDateTime(InvocationInfoProxy.getInstance().getBizDateTime()));
|
||||
// 合格
|
||||
vo0.setNunqualifiednum(UFDouble.ZERO_DBL);
|
||||
vo0.setAttributeValue("def1", testResMap.get("01"));
|
||||
newVOs[0] = vo0;
|
||||
|
||||
// 回用
|
||||
newVOs[1] = vo1;
|
||||
|
||||
// 不合格
|
||||
vo0.setAttributeValue("def1", testResMap.get("03"));
|
||||
newVOs[2] = vo2;
|
||||
} else if ("03".equals(def1Code)) {
|
||||
mainVO.setAttributeValue("vmemo", def1Code + new UFDateTime(InvocationInfoProxy.getInstance().getBizDateTime()));
|
||||
// 合格
|
||||
DhjydSlave0VO vo0 = new DhjydSlave0VO();
|
||||
vo0 = subvo;
|
||||
vo0.setQualifiednum(UFDouble.ZERO_DBL);
|
||||
// 设置检验结果的值
|
||||
vo0.setAttributeValue("def1", testResMap.get("01"));
|
||||
newVOs[0] = vo0;
|
||||
vo0.setAttributeValue("def1", testResMap.get("02"));
|
||||
newVOs[1] = vo0;
|
||||
|
||||
// 回用
|
||||
// 设置检验结果的值
|
||||
vo1.setAttributeValue("def1", testResMap.get("02"));
|
||||
newVOs[1] = vo1;
|
||||
|
||||
// 不合格
|
||||
newVOs[2] = vo2;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue