优化
This commit is contained in:
@@ -127,6 +127,15 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
json.put("create_time", now);
|
||||
json.put("sysdeptid", deptId);
|
||||
json.put("syscompanyid", deptId);
|
||||
String create_mode = json.getString("create_mode");
|
||||
if("01".equals(create_mode)){
|
||||
String planstart_time = json.getString("planstart_time");
|
||||
Date date = DateUtil.parse(planstart_time);
|
||||
int days = this.getDays(json.getString("material_id"));
|
||||
Date planend_date = DateUtil.offsetDay(date,days-1);
|
||||
String planend_time = DateUtil.formatDate(planend_date).substring(0,10);
|
||||
json.put("planend_time",planend_time+" 23:59:59");
|
||||
}
|
||||
mstTab.insert(json);
|
||||
this.updatePcsn(json);
|
||||
}
|
||||
@@ -167,6 +176,15 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
this.updatePcsn(whereJson);
|
||||
}
|
||||
}
|
||||
String create_mode = whereJson.getString("create_mode");
|
||||
if("01".equals(create_mode)){
|
||||
String planstart_time = whereJson.getString("planstart_time");
|
||||
Date date = DateUtil.parse(planstart_time);
|
||||
int days = this.getDays(whereJson.getString("material_id"));
|
||||
Date planend_date = DateUtil.offsetDay(date,days-1);
|
||||
String planend_time = DateUtil.formatDate(planend_date).substring(0,10);
|
||||
whereJson.put("planend_time",planend_time+" 23:59:59");
|
||||
}
|
||||
mstTab.update(whereJson);
|
||||
|
||||
}
|
||||
@@ -818,6 +836,19 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int getDays(String material_id) {
|
||||
JSONArray ProcessRoutes = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",material_id).process().getResultJSONArray(0);
|
||||
int days = 0;
|
||||
for(int i=0;i<ProcessRoutes.size();i++){
|
||||
JSONObject jo = ProcessRoutes.getJSONObject(i);
|
||||
int plan_time = jo.getInteger("plan_time");
|
||||
days = days + (int) Math.ceil(plan_time/24.0);
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user