Преглед на файлове

:white_check_mark: 导出pdf优化,解决到岗人数限制更改后仍旧不能到岗的问题

Twelve615 преди 1 година
родител
ревизия
aaa1c2893f
променени са 13 файла, в които са добавени 57 реда и са изтрити 9 реда
  1. 5 0
      airport-vue/src/views/admin/subTables/AdminOrderExamineSubTable.vue
  2. 10 0
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin/controller/AdminPlatformController.java
  3. 2 3
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/mapper/AdminAircraftPositionMapper.java
  4. 6 0
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/mapper/xml/AdminAircraftPositionMapper.xml
  5. 6 0
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/service/IAdminAircraftPositionService.java
  6. 5 0
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/service/impl/AdminAircraftPositionServiceImpl.java
  7. 4 4
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_order/controller/AdminOrderController.java
  8. 2 2
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/AddWatermarkToPDF.java
  9. 4 0
      airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/utils/AirportUtil.java
  10. 1 0
      airport/jeecg-boot-module-system/src/main/resources/application-dev.yml
  11. 1 0
      airport/jeecg-boot-module-system/src/main/resources/application-local.yml
  12. 1 0
      airport/jeecg-boot-module-system/src/main/resources/application-prod.yml
  13. 10 0
      airport/jeecg-boot-module-system/src/main/resources/templates/doc.html

+ 5 - 0
airport-vue/src/views/admin/subTables/AdminOrderExamineSubTable.vue

@@ -115,6 +115,11 @@
             align: 'center',
             dataIndex: 'createRen',
           },
+          {
+            title: '交接时间',
+            align: 'createTime',
+            dataIndex: 'createRen',
+          },
         ],
         url: {
           listByMainId: '/admin_order/adminOrder/queryAdminOrderExamineByMainId',

+ 10 - 0
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin/controller/AdminPlatformController.java

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
+import org.jeecg.modules.admin_aircraft_position.service.IAdminAircraftPositionService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -46,6 +47,9 @@ public class AdminPlatformController extends JeecgController<AdminPlatform, IAdm
 	@Autowired
 	private IAdminPlatformService adminPlatformService;
 
+	@Autowired
+	private IAdminAircraftPositionService adminAircraftPositionService;
+
 	 @PostMapping(value = "/one")
 	 public Result<AdminPlatform> queryPageList() {
 		 List<AdminPlatform> list = adminPlatformService.list();
@@ -63,6 +67,12 @@ public class AdminPlatformController extends JeecgController<AdminPlatform, IAdm
 	 @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
 	 public Result<String> edit(@RequestBody AdminPlatform PlatformParameter) {
 		 adminPlatformService.updateById(PlatformParameter);
+		 //同时更新机位到岗限制
+		 Integer attendance = PlatformParameter.getAttendance();
+		 if (attendance != null) {
+			 boolean res = adminAircraftPositionService.updateIsAttendance(attendance);
+			 log.info("到岗人数限制更新{}!", res ? "成功" : "失败");
+		 }
 		 return Result.OK("编辑成功!");
 	 }
 }

+ 2 - 3
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/mapper/AdminAircraftPositionMapper.java

@@ -1,11 +1,8 @@
 package org.jeecg.modules.admin_aircraft_position.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.admin_aircraft_position.entity.AdminAircraftPosition;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -25,4 +22,6 @@ public interface AdminAircraftPositionMapper extends BaseMapper<AdminAircraftPos
                                                             @Param(Constants.WRAPPER) Wrapper<AdminAircraftPositionR> wrapper);
 
 
+    boolean updateIsAttendance(Integer attendance);
+
 }

+ 6 - 0
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/mapper/xml/AdminAircraftPositionMapper.xml

@@ -8,6 +8,12 @@
         flight_num = NULL,flight_sole = NULL WHERE
          id = #{id}
     </update>
+    <update id="updateIsAttendance" parameterType="integer">
+        <![CDATA[
+        update admin_aircraft_position
+        set is_attendance = IF(IFNULL(attendance,0) < #{attendance}, 1, 2)
+        ]]>
+    </update>
 
     <select id="getAdminAircraftPositionR" resultType="org.jeecg.modules.admin_aircraft_position.entity.AdminAircraftPositionR">
         select * from admin_aircraft_position ${ew.customSqlSegment}

+ 6 - 0
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/service/IAdminAircraftPositionService.java

@@ -19,4 +19,10 @@ public interface IAdminAircraftPositionService extends IService<AdminAircraftPos
 
     IPage<AdminAircraftPositionR> getAdminAircraftPositionR(Page<AdminAircraftPositionR> page, QueryWrapper<AdminAircraftPositionR> queryWrapper);
 
+    /**
+     * 更新机位是否可以到岗字段
+     * @return
+     */
+    boolean updateIsAttendance(Integer attendance);
+
 }

+ 5 - 0
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_aircraft_position/service/impl/AdminAircraftPositionServiceImpl.java

@@ -32,4 +32,9 @@ public class AdminAircraftPositionServiceImpl extends ServiceImpl<AdminAircraftP
                                                                    QueryWrapper<AdminAircraftPositionR> queryWrapper) {
         return adminAircraftPositionMapper.getAdminAircraftPositionR(page,queryWrapper);
     }
+
+    @Override
+    public boolean updateIsAttendance(Integer attendance) {
+        return adminAircraftPositionMapper.updateIsAttendance(attendance);
+    }
 }

+ 4 - 4
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_order/controller/AdminOrderController.java

@@ -145,8 +145,8 @@ public class AdminOrderController {
 //            String outputFolder = "D:\\AJeecgBootFiles\\" + fileName;
 //            String outputFolderHtml = "D:\\AJeecgBootFiles\\" + fileNameHtml;
 
-            String outputFolder = AirportUtil.getLocalUploadPath() + "/" + fileName;
-            String outputFolderHtml = AirportUtil.getLocalUploadPath() + "/" + fileNameHtml;
+            String outputFolder = AirportUtil.getLocalUploadTempPath() + "/" + fileName;
+            String outputFolderHtml = AirportUtil.getLocalUploadTempPath() + "/" + fileNameHtml;
 
 //            String outputFolderPic = "/usr/java/AJeecgBootFiles/" + fileNameQ+".png";
 //            OutputStream outputStream = Files.newOutputStream( Paths.get( outputFolder ) );
@@ -200,7 +200,7 @@ public class AdminOrderController {
                //打印加水印
                 AddWatermarkToPDF.convert(fileName,adminPlatform.getSy());
             }else {
-                fileName = systemHost+"/sys/common/static/" + fileName;
+                fileName = systemHost+"/sys/common/static/tempFile/" + fileName;
                 return Result.OK( fileName );
             }
 
@@ -209,7 +209,7 @@ public class AdminOrderController {
         }
 //        fileName = "http://127.0.0.1:9999/sys/common/static/sy_" + fileName;
 //        fileName = "http://120.79.86.50:9999/sys/common/static/" + fileNameHtml;
-        fileName = systemHost+"/sys/common/static/sy_" + fileName;
+        fileName = systemHost+"/sys/common/static/tempFile/sy_" + fileName;
         return Result.OK( fileName );
     }
 

+ 2 - 2
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/AddWatermarkToPDF.java

@@ -39,10 +39,10 @@ public class AddWatermarkToPDF {
 //        String syFileName = "sy_"+fileName;
 //        String outputPdf = "D:\\AJeecgBootFiles\\"+syFileName;
 
-        String inputPdfPath = AirportUtil.getLocalUploadPath() + "/"+fileName;
+        String inputPdfPath = AirportUtil.getLocalUploadTempPath() + "/"+fileName;
         String watermarkImagePath = AirportUtil.getLocalUploadPath()+"/"+syPath;
         String syFileName = "sy_"+fileName;
-        String outputPdf = AirportUtil.getLocalUploadPath()+"/"+syFileName;
+        String outputPdf = AirportUtil.getLocalUploadTempPath()+"/"+syFileName;
 
         try {
             PDDocument document = PDDocument.load( new File( inputPdfPath ) );

+ 4 - 0
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/utils/AirportUtil.java

@@ -50,5 +50,9 @@ public class AirportUtil implements ApplicationContextAware {
         return getEnvironment().getProperty("jeecg.path.upload");
     }
 
+    public static String getLocalUploadTempPath() {
+        return getLocalUploadPath() + getEnvironment().getProperty("jeecg.path.temp");
+    }
+
 
 }

+ 1 - 0
airport/jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -260,6 +260,7 @@ jeecg:
   path:
     #文件上传根目录 设置
     upload: D:\\AJeecgBootFiles
+    temp: \\tempFile
     #webapp文件路径
     webapp: D:\\AJeecgBootFiles
   shiro:

+ 1 - 0
airport/jeecg-boot-module-system/src/main/resources/application-local.yml

@@ -260,6 +260,7 @@ jeecg:
   path:
     #文件上传根目录 设置
     upload: D:\\AJeecgBootFiles
+    temp: /tempFile
     #webapp文件路径
     webapp: D:\\AJeecgBootFiles
   shiro:

+ 1 - 0
airport/jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -267,6 +267,7 @@ jeecg:
   path:
     #文件上传根目录 设置
     upload: /usr/java/AJeecgBootFiles
+    temp: /tempFile
     #    upload: D:\\AJeecgBootFiles
     #webapp文件路径
     webapp: /usr/java/AJeecgBootFiles

+ 10 - 0
airport/jeecg-boot-module-system/src/main/resources/templates/doc.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+
+</body>
+</html>