Jelajahi Sumber

feature 甘特图接口修改

xiahan 1 tahun lalu
induk
melakukan
a62d5389ee

+ 1 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/GanttService.java

@@ -13,6 +13,6 @@ import java.util.List;
  */
 public interface GanttService {
 
-    R getListByCondition(Date searchDate, String factoryId, List<String> workshopId, List<String> orderNo,
+    R getListByCondition(Date startDate,Date endDate, String factoryId, List<String> workshopId, List<String> orderNo,
                          List<String> productionLineId,List<String> equId);
 }

+ 11 - 4
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/GanttServiceImpl.java

@@ -69,16 +69,23 @@ public class GanttServiceImpl implements GanttService {
      * @return
      */
     @Override
-    public R getListByCondition(Date searchDate, String factoryId,
+    public R getListByCondition(Date startDate,
+                                Date endDate,
+                                String factoryId,
                                 List<String> workShopIdList,
                                 List<String> orderNoList,
                                 List<String> productionLineId,
                                 List<String> equId) {
         log.info("甘特图查询开始时间:"+ DateUtil.now());
-        List<Date> searchDateList = getSearchDate(searchDate);
+        if(endDate == null){
+            List<Date> searchDateList = getSearchDate(startDate);
+            startDate = searchDateList.get(0);
+            endDate = searchDateList.get(1);
+        }
+
         List<GanttVos> apsProcessOperationProcessEquDos = apsProcessOperationProcessEquDao.getGanttDataList(
-                searchDateList==null?null:searchDateList.get(0),
-                searchDateList==null?null:searchDateList.get(1),
+                startDate,
+                endDate,
                 factoryId,
                 workShopIdList,
                 orderNoList,

+ 4 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProcessGanttListVo.java

@@ -14,6 +14,10 @@ public class ProcessGanttListVo {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date startTime;
 
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+
     private String factoryId;
     /**
      * 车间

+ 1 - 1
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/GanttController.java

@@ -48,7 +48,7 @@ public class GanttController {
      */
     @PostMapping("/processGanttList")
     public R processGanttList(@RequestBody ProcessGanttListVo processGanttListVo) {
-        return ganttService.getListByCondition(processGanttListVo.getStartTime(), processGanttListVo.getFactoryId(),
+        return ganttService.getListByCondition(processGanttListVo.getStartTime(),processGanttListVo.getEndTime(), processGanttListVo.getFactoryId(),
                 processGanttListVo.getWorkshopId(), processGanttListVo.getOrderNo(),
                 processGanttListVo.getProductionLineId(), processGanttListVo.getEquId());
     }