|
@@ -20,6 +20,7 @@ import com.rongwei.rwcommon.base.BaseDo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
|
+import com.rongwei.safecommon.utils.SaveConstans;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
@@ -35,6 +36,9 @@ import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.JobStatus.*;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.ProductionStatus.*;
|
|
|
+
|
|
|
/**
|
|
|
* GanttServiceImpl class
|
|
|
*
|
|
@@ -64,6 +68,12 @@ public class GanttServiceImpl implements GanttService {
|
|
|
public static final String SCHEDULING_STR = "%s-正在排程";
|
|
|
public static final String SCHEDULING_TO_BE_PUBLISHED_STR = "%s-排程结束待发布";
|
|
|
public static final String DEFAULT_SPLIT = "-;-";
|
|
|
+ public static final Map<String,String> GANTT_PROCESS_STATUS_MAP=new HashMap<String,String>(){{
|
|
|
+ put(JOBSTATUS_TO_BE_START,COMPLETED);
|
|
|
+ put(JOBSTATUS_TO_BE_STARTING,PROCESSING);
|
|
|
+ put(JOBSTATUS_TO_BE_END,TO_BE_STARTED);
|
|
|
+ }};
|
|
|
+
|
|
|
private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
|
|
|
@Autowired
|
|
|
private ApsProcessOperationProcessEquDao apsProcessOperationProcessEquDao;
|
|
@@ -300,6 +310,18 @@ public class GanttServiceImpl implements GanttService {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<ScheduleGanttVo> assembleGanttData(List<GanttVos> apsProcessOperationProcessEquDos) {
|
|
|
+ // 修改工序作业的生产状态
|
|
|
+ apsProcessOperationProcessEquDos.parallelStream().forEach(data->{
|
|
|
+ /**
|
|
|
+ * 作业生产状态不是待发布 ——>作业明细的作业状态
|
|
|
+ * 作业生产状态是待发-> 待发布
|
|
|
+ */
|
|
|
+ if(SaveConstans.ProductionStatus.TO_BE_PUBLISHED.equals(data.getProcessstatus())){
|
|
|
+ data.setGanttprocessstatus(SaveConstans.ProductionStatus.TO_BE_PUBLISHED);
|
|
|
+ } else{
|
|
|
+ data.setGanttprocessstatus(GANTT_PROCESS_STATUS_MAP.getOrDefault(data.getWorkstatus(),""));
|
|
|
+ }
|
|
|
+ });
|
|
|
// 需要返回给前端的数据
|
|
|
List<ScheduleGanttVo> resultVo = new ArrayList<>();
|
|
|
if (apsProcessOperationProcessEquDos.isEmpty()) {
|
|
@@ -341,15 +363,16 @@ public class GanttServiceImpl implements GanttService {
|
|
|
itemNames.add(itemName);
|
|
|
dateVo = new ScheduleGanttVo();
|
|
|
dateVo.setId(String.valueOf(workShopIndex++));
|
|
|
- dateVo.setParent(planDateEntry.getValue().get(0).getProcessdeviceid());
|
|
|
+ dateVo.setParent(ganttVos.get(0).getProcessdeviceid());
|
|
|
dateVo.setText(StringUtils.join(itemNames, "</br>"));
|
|
|
dateVo.setOpen(false);
|
|
|
- dateVo.setStart_date(planDateEntry.getValue().get(0).getPlanstartdate());
|
|
|
- dateVo.setEnd_date(planDateEntry.getValue().get(0).getPlanenddate());
|
|
|
+ dateVo.setStart_date(ganttVos.get(0).getPlanstartdate());
|
|
|
+ dateVo.setEnd_date(ganttVos.get(0).getPlanenddate());
|
|
|
dateVo.setName(StringUtils.join(itemNames, "</br>"));
|
|
|
dateVo.setProcessdetailids(ganttVos.stream().map(GanttVos::getId).distinct().collect(Collectors.joining(",")));
|
|
|
dateVo.setProcessids(ganttVos.stream().map(GanttVos::getProcessid).distinct().collect(Collectors.joining(",")));
|
|
|
dateVo.setGanttVos(ganttVos);
|
|
|
+ dateVo.setGanttprocessstatus(ganttVos.get(0).getGanttprocessstatus());
|
|
|
dateVo.setWorkstatus(ganttVos.stream().map(GanttVos::getWorkstatus).distinct().collect(Collectors.joining(",")));
|
|
|
dateVo.setLockmark(ganttVos.stream().map(GanttVos::getLockmark).distinct().collect(Collectors.joining(",")));
|
|
|
dateVo.setProductionorderid(ganttVos.stream().map(GanttVos::getProductionorderid).collect(Collectors.joining(",")));
|