chen 2 tahun lalu
induk
melakukan
8a41c2cb9c

+ 13 - 1
src/main/java/org/jeecg/modules/appInterface/controller/FbsWorkingStatisticsController.java

@@ -8,6 +8,7 @@ import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.text.DecimalFormat;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.io.IOException;
@@ -1273,7 +1274,7 @@ public class FbsWorkingStatisticsController {
 		 queryWrapper.orderByAsc("ftpi.sort");
 		 Page<FbsWorkingStatistics> page = new Page<FbsWorkingStatistics>(pageNo, pageSize);
 		 IPage<FbsWorkingStatistics> pageList = fbsWorkingStatisticsService.getEfficiencyReport(page, queryWrapper);
-
+		 getFirstFinalTime(pageList.getRecords());
 		//获取工单完工情况
 //		 if(pageList.getRecords()!=null&&pageList.getRecords().size()>0){
 //			 for(FbsWorkingStatistics fbsWorkingStatistics1:pageList.getRecords()){
@@ -1806,4 +1807,15 @@ public class FbsWorkingStatisticsController {
 		 return result;
 	 }
 
+	 //获取工单最晚扫码日期
+	 public void getFirstFinalTime(List<FbsWorkingStatistics> fbsWorkingStatisticsList){
+		 List<Map<String,Object>>  list=new ArrayList<>();
+		 for(FbsWorkingStatistics fbsWorkingStatistics:fbsWorkingStatisticsList){
+			 FbsWorkshopDispatchList fbsWorkshopDispatchListTime=fbsWorkshopDispatchListService.getFirstFinalTime(fbsWorkingStatistics.getPkWorkshopDispatchList());
+			 if(fbsWorkshopDispatchListTime!=null){
+				 fbsWorkingStatistics.setLatestTime(fbsWorkshopDispatchListTime.getFinalTime());
+			 }
+		 }
+	 }
+
  }

+ 5 - 0
src/main/java/org/jeecg/modules/appInterface/entity/FbsWorkingStatistics.java

@@ -228,4 +228,9 @@ public class FbsWorkingStatistics implements Serializable {
 	private String isWorkState;//是否完工
 	@TableField(exist = false)
 	private List<String> stateList;
+	//工单最晚扫码日期
+	@TableField(exist = false)
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date  latestTime;
 }

+ 2 - 1
src/main/java/org/jeecg/modules/appInterface/mapper/xml/FbsWorkingStatisticsMapper.xml

@@ -235,7 +235,8 @@
             fwdl.state,
             fwdl.sap_state,
             (fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 )) AS standardWorkingHoursProcess,
-            ROUND((fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 ))/sum( fws.working_hours )*100,0) AS efficiency
+            ROUND((fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 ))/sum( fws.working_hours )*100,0) AS efficiency,
+            fwdl.id as pkWorkshopDispatchList
         FROM
             fbs_working_statistics fws
             LEFT JOIN fbs_workshop_dispatch_list fwdl ON fws.pk_workshop_dispatch_list = fwdl.id

+ 1 - 1
src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: test
+    active: prodnew
   devtools:
     restart:
       enabled: true