Commit 37d89ea1 by liuyang

生产计划添加提交过滤,材料计划排序调整,设备驾驶舱调整

parent 1a925e7f
......@@ -11,15 +11,13 @@ import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -27,11 +25,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 存货档案
......@@ -228,6 +222,8 @@ public class ServiceHGPZ005 extends ServiceBase {
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> inventCodes = ObjectUtils.listKey(resultRows, HGPZ005.FIELD_INVENT_CODE);
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByProductCodes(inventCodes);
for (Map resultRow : resultRows) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRow);
......@@ -236,6 +232,8 @@ public class ServiceHGPZ005 extends ServiceBase {
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz005.getAccountName()));
}
Long num = Optional.ofNullable(hgsc005AList).orElse(new ArrayList<>()).stream().filter(hgsc005A -> hgsc005A.getProductCode().equals(hgpz005.getInventCode())).count();
AssertUtils.isTrue(num > 0, String.format("存货[%s]已关联生产任务,无法删除", hgpz005.getInventName()));
DaoUtils.update(HGPZ005.DELETE, hgpz005);
}
inInfo = this.query(inInfo);
......
......@@ -70,7 +70,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("1", "2", "4"));
params.put("logValues", Arrays.asList("1", "2", "3", "4"));
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
......@@ -103,7 +103,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("3", "5", "6"));
params.put("logValues", Arrays.asList("5", "6"));
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
......@@ -127,7 +127,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
}
public void sbYes(EiInfo inInfo, Map params){
params.put("logValues", Arrays.asList("1", "2", "4"));
params.put("logValues", Arrays.asList("1", "2", "3", "4"));
List<Map> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
......@@ -152,7 +152,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
}
public void sbNo(EiInfo inInfo, Map params){
params.put("logValues", Arrays.asList("3", "5", "6"));
params.put("logValues", Arrays.asList("5", "6"));
List<Map> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
......
......@@ -67,6 +67,7 @@ public class ServiceHGSC005 extends ServiceBase {
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes);
this.checkCommitDate(hgsc005AList);
List<Long> ids = MapUtils.toDaoEPBases(resultRows,HGSC005.class).stream().filter(o -> o.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==0).map(HGSC005::getId).collect(Collectors.toList());
AssertUtils.isEmpty(ids, "没有找到未提交生产计划,无法提交!");
DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}});
//生成生产订单
HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBases(inInfo,HGSC005.class), hgsc005AList);
......
......@@ -88,7 +88,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
PLAN_MATERIAL_DATE desc
</isEmpty>
</dynamic>
......
......@@ -789,6 +789,15 @@ public class HGSCTools {
return CollectionUtils.isEmpty(results) ? null : results;
}
public static List<HGSC005A> queryByProductCodes(List<String> ProductCodes){
AssertUtils.isEmpty(ProductCodes, "产品编码不能为空!");
Map paramMap = new HashMap();
paramMap.put("productCodes", ProductCodes);
List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
/**
* 根据工序查询
*
......
......@@ -105,9 +105,16 @@ function commit() {
message2("提交","没有选中的行");
return;
}
var flag = true;
rows.forEach(function (row,index) {
if (row.commitStatus == "2") {
message("选中的第"+(index+1)+"行数据已提交,无法重复提交!");
flag = false;
}
})
if (flag){
IPLAT.confirm({
title:'提交',
message:'确认提交此数据么?',
title:'提交', message:'确认提交此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
......@@ -128,4 +135,6 @@ function commit() {
});
}
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment