Commit 7e3db567 by zhangzhen

Merge remote-tracking branch 'origin/dev' into dev

parents e5a0154a dcdc99ce
...@@ -11,15 +11,13 @@ import com.baosight.hggp.hg.pz.domain.HGPZ004; ...@@ -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.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A; import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools; 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.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A; import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.tools.HGSJTools; import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.*;
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.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -27,11 +25,7 @@ import com.baosight.iplat4j.core.exception.PlatException; ...@@ -27,11 +25,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 存货档案 * 存货档案
...@@ -228,6 +222,8 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -228,6 +222,8 @@ public class ServiceHGPZ005 extends ServiceBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); 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) { for (Map resultRow : resultRows) {
HGPZ005 hgpz005 = new HGPZ005(); HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRow); hgpz005.fromMap(resultRow);
...@@ -236,6 +232,8 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -236,6 +232,8 @@ public class ServiceHGPZ005 extends ServiceBase {
if (count > 0) { if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz005.getAccountName())); // 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); DaoUtils.update(HGPZ005.DELETE, hgpz005);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -70,7 +70,7 @@ public class ServiceHGSB010 extends ServiceEPBase { ...@@ -70,7 +70,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (params.containsKey("date")){ if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("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> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100); 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()); List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
...@@ -103,7 +103,7 @@ public class ServiceHGSB010 extends ServiceEPBase { ...@@ -103,7 +103,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (params.containsKey("date")){ if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("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> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100); 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()); List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
...@@ -127,7 +127,7 @@ public class ServiceHGSB010 extends ServiceEPBase { ...@@ -127,7 +127,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
} }
public void sbYes(EiInfo inInfo, Map params){ 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> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>(); List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100); List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
...@@ -152,7 +152,7 @@ public class ServiceHGSB010 extends ServiceEPBase { ...@@ -152,7 +152,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
} }
public void sbNo(EiInfo inInfo, Map params){ 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> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>(); List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100); List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
......
...@@ -67,6 +67,7 @@ public class ServiceHGSC005 extends ServiceBase { ...@@ -67,6 +67,7 @@ public class ServiceHGSC005 extends ServiceBase {
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes); List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes);
this.checkCommitDate(hgsc005AList); 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()); 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);}}); DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}});
//生成生产订单 //生成生产订单
HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBases(inInfo,HGSC005.class), hgsc005AList); HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBases(inInfo,HGSC005.class), hgsc005AList);
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc PLAN_MATERIAL_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -789,6 +789,15 @@ public class HGSCTools { ...@@ -789,6 +789,15 @@ public class HGSCTools {
return CollectionUtils.isEmpty(results) ? null : results; 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;
}
/** /**
* 根据工序查询 * 根据工序查询
* *
......
...@@ -374,13 +374,14 @@ public class ServiceHGWD001D extends TreeService { ...@@ -374,13 +374,14 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("filePath", dbWd001.getFilePath()); leafMap.put("filePath", dbWd001.getFilePath());
if (!isManager && !isSpare) { if (!isManager && !isSpare) {
leafMap.put("isAuth", "1"); leafMap.put("isAuth", "1");
} else {
leafMap.put("isAuth", "0");
}
// 从已授权的信息中查找出自己 // 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
-> item.getUserId().equals(userId)).findFirst().orElse(null); -> item.getUserId().equals(userId)).findFirst().orElse(null);
leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag()); leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag());
} else {
leafMap.put("isAuth", "0");
leafMap.put("downloadFlag", "1");
}
results.add(leafMap); results.add(leafMap);
} }
// 设置叶子节点 // 设置叶子节点
......
...@@ -105,9 +105,16 @@ function commit() { ...@@ -105,9 +105,16 @@ function commit() {
message2("提交","没有选中的行"); message2("提交","没有选中的行");
return; return;
} }
var flag = true;
rows.forEach(function (row,index) {
if (row.commitStatus == "2") {
message("选中的第"+(index+1)+"行数据已提交,无法重复提交!");
flag = false;
}
})
if (flag){
IPLAT.confirm({ IPLAT.confirm({
title:'提交', title:'提交', message:'确认提交此数据么?',
message:'确认提交此数据么?',
okFn:function () { okFn:function () {
var post = new EiInfo(); var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData()); post.addBlock(resultGrid.getCheckedBlockData());
...@@ -128,4 +135,6 @@ function commit() { ...@@ -128,4 +135,6 @@ function commit() {
}); });
} }
}) })
}
} }
...@@ -75,7 +75,7 @@ $(function (){ ...@@ -75,7 +75,7 @@ $(function (){
}) })
} }
}, },
template: function (dataItem) { /*template: function (dataItem) {
for (let i = 0; i < processCodes.length; i++) { for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) { if (processCodes[i]['valueField'] === dataItem['processCode']) {
dataItem['processName'] = processCodes[i]['textField'].split("]")[1]; dataItem['processName'] = processCodes[i]['textField'].split("]")[1];
...@@ -84,7 +84,7 @@ $(function (){ ...@@ -84,7 +84,7 @@ $(function (){
} }
} }
return dataItem['processCode']; return dataItem['processCode'];
}, },*/
editor: function (container, options) { editor: function (container, options) {
this.filter(options); this.filter(options);
} }
...@@ -123,11 +123,19 @@ $(function (){ ...@@ -123,11 +123,19 @@ $(function (){
if (e.field == "factoryCode") { if (e.field == "factoryCode") {
loadChange(grid,e,"processCode"); loadChange(grid,e,"processCode");
}else if (e.field == "processCode") { }else if (e.field == "processCode") {
let dataItem = e.items[0];
for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) {
resultGrid.setCellValue(dataItem,"unit",processCodes[i]['param3Field']);
resultGrid.setCellValue(dataItem,"processName",processCodes[i]['textField'].split("]")[1])
break;
}
}
if (e.items[0].factoryCode.length===0){ if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode"); loadChange(grid,e,"factoryCode");
} }else {
loadChange(grid,e,"unit"); loadChange(grid,e,"unit");
loadChange(grid,e,"processClass"); }
} }
}); });
}, },
...@@ -173,7 +181,7 @@ $(function (){ ...@@ -173,7 +181,7 @@ $(function (){
exportGrid : { exportGrid : {
exportFileName: function (gridInstance) { exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss // 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR); return "工序单价_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
}, },
exportFileType: "xls", exportFileType: "xls",
exportBlockId: "result", exportBlockId: "result",
......
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