|
@@ -2,7 +2,6 @@ package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
import com.rongwei.bscommon.sys.dao.ApsProcessOperationProcessEquDao;
|
|
|
import com.rongwei.bscommon.sys.service.GanttService;
|
|
|
-import com.rongwei.bsentity.domain.ApsProcessOperationProcessEquDo;
|
|
|
import com.rongwei.bsentity.vo.GanttVos;
|
|
|
import com.rongwei.bsentity.vo.ScheduleGanttProcessVo;
|
|
|
import com.rongwei.bsentity.vo.ScheduleGanttVo;
|
|
@@ -13,6 +12,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -30,8 +30,8 @@ public class GanttServiceImpl implements GanttService {
|
|
|
private ApsProcessOperationProcessEquDao apsProcessOperationProcessEquDao;
|
|
|
public static final String GANTT_ITEM_NAME ="%s %d卷 %tF";
|
|
|
public static final String GANTT_ITEM_NAME_PREFIX ="%s %s";
|
|
|
- public static final String GANTT_DESC_PREFIX=" 计划时间:%tF %tD-%tF %tD \n" +
|
|
|
- "实际时间:%tF %tD-%tF %tD \n" +
|
|
|
+ public static final String GANTT_DESC_PREFIX=" 计划时间:%s-%s \n" +
|
|
|
+ "实际时间:%s-%s \n" +
|
|
|
"设备:%s/%s \n" ;
|
|
|
public static final String GANTT_DESC="订单产品:%s \n" +
|
|
|
"交货期:%tF\n" +
|
|
@@ -39,6 +39,8 @@ public class GanttServiceImpl implements GanttService {
|
|
|
"计划加工卷数:%d卷\n" +
|
|
|
"完成情况:已开工 %d/已报工 %d/已检验 %d/未完工 %d\n" +
|
|
|
"作业状态:%s" ;
|
|
|
+
|
|
|
+ public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
/**
|
|
|
* 根据条件获取gantt
|
|
|
*
|
|
@@ -82,17 +84,17 @@ public class GanttServiceImpl implements GanttService {
|
|
|
String itemName = collect.values().stream().map(info -> {
|
|
|
String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
|
|
|
.collect(Collectors.joining(","));
|
|
|
- return String.format(GANTT_ITEM_NAME, prefix, info.get(0).getPlanprocessrall(), nullDateReplace(info.get(0).getDeliverydate()));
|
|
|
+ return String.format(GANTT_ITEM_NAME, prefix, info.get(0).getPlanprocessrall(), info.get(0).getDeliverydate());
|
|
|
}).collect(Collectors.joining("/n"));
|
|
|
- String itemPrefix=String.format(GANTT_DESC_PREFIX,processs.get(0).getPlanstartdate(),processs.get(0).getPlanstartdate(),
|
|
|
- processs.get(0).getPlanenddate(),processs.get(0).getPlanenddate(),
|
|
|
- nullDateReplace(processs.get(0).getActualstartdate()),
|
|
|
- nullDateReplace(processs.get(0).getActualstartdate()),
|
|
|
- nullDateReplace(processs.get(0).getActualfinishdate()),
|
|
|
- nullDateReplace(processs.get(0).getActualfinishdate()),
|
|
|
+ String itemPrefix=String.format(GANTT_DESC_PREFIX,
|
|
|
+ dateFormat(processs.get(0).getPlanstartdate()),
|
|
|
+ dateFormat(processs.get(0).getPlanenddate()),
|
|
|
+ dateFormat(processs.get(0).getActualstartdate()),
|
|
|
+ dateFormat(processs.get(0).getActualfinishdate()),
|
|
|
+
|
|
|
processs.get(0).getProcessworkshop(),processs.get(0).getProcessdevice());
|
|
|
String itemDesc= processs.stream().map(info->{
|
|
|
- return String.format(GANTT_DESC, info.getProductname(),nullDateReplace(info.getDeliverydate()),
|
|
|
+ return String.format(GANTT_DESC, info.getProductname(),info.getDeliverydate(),
|
|
|
info.getProcessname(),info.getPlanprocessrall(),info.getStartingroll(),info.getReportroll(),
|
|
|
info.getCheckoutroll(),info.getUnfinishroll(),info.getWorkstatus() );
|
|
|
}).collect(Collectors.joining("/n"));
|
|
@@ -107,10 +109,10 @@ public class GanttServiceImpl implements GanttService {
|
|
|
return R.ok(resultVo);
|
|
|
}
|
|
|
|
|
|
- public Object nullDateReplace(Date date){
|
|
|
+ public String dateFormat(Date date){
|
|
|
if(date==null){
|
|
|
- return null;
|
|
|
+ return "";
|
|
|
}
|
|
|
- return date;
|
|
|
+ return dateFormat.format(date);
|
|
|
}
|
|
|
}
|