Commit 75e0ff61 by 宋祥

1.按查询内容进行排产

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