Commit 5d60da91 by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com:8800/platform/hg-smart into dev

parents 308869c9 75e0ff61
...@@ -119,11 +119,10 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -119,11 +119,10 @@ public class ServiceHGSC005A extends ServiceBase {
public EiInfo schedule(EiInfo inInfo) { public EiInfo schedule(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String processName = MapUtils.getString(queryMap, "processName");
String planCode = MapUtils.getString(queryMap, "planCode"); String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode); HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005); this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(planCode, processName); int count = HGSCTools.THGSC005A.schedule(queryMap);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1); dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005); DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -1059,12 +1059,11 @@ public class HGSCTools { ...@@ -1059,12 +1059,11 @@ public class HGSCTools {
/** /**
* 排产 * 排产
* *
* @param planCode * @param queryMap
* @param processName 工序
* @return * @return
*/ */
public static int schedule(String planCode, String processName) { public static int schedule(Map queryMap) {
List<HGSC005A> hgsc005AList = queryByPlanCode(planCode, processName); List<HGSC005A> hgsc005AList = DaoBase.getInstance().query(HGSC005A.QUERY, queryMap);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder())); // hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置 //通过工序编码查询工序设置
List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode) List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode)
...@@ -1103,9 +1102,13 @@ public class HGSCTools { ...@@ -1103,9 +1102,13 @@ public class HGSCTools {
} }
for (HGSC005A planInfo : partList) { for (HGSC005A planInfo : partList) {
remainder = calculateWordHour(planInfo, hgsj001List, hgpz005List, hgpz005AList, minDate, remainder); remainder = calculateWordHour(planInfo, hgsj001List, hgpz005List, hgpz005AList, minDate, remainder);
if (StringUtils.isBlank(minDate)) {
minDate = planInfo.getPlanStartDate();
} else {
minDate = DateUtil.toDate(planInfo.getPlanStartDate(), DateUtil.DATE10_PATTERN) minDate = DateUtil.toDate(planInfo.getPlanStartDate(), DateUtil.DATE10_PATTERN)
.compareTo(DateUtil.toDate(minDate, DateUtil.DATE10_PATTERN)) <= 0 ? planInfo.getPlanStartDate() .compareTo(DateUtil.toDate(minDate, DateUtil.DATE10_PATTERN)) <= 0
: minDate; ? planInfo.getPlanStartDate() : minDate;
}
DaoUtils.update(HGSC005A.UPDATE, planInfo); DaoUtils.update(HGSC005A.UPDATE, planInfo);
} }
return hgsc005AList.size(); return hgsc005AList.size();
......
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