فهرست منبع

:art: 格式化代码

Twelve615 1 سال پیش
والد
کامیت
c68c0e8be6

+ 1 - 1
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_file_export/controller/AdminFileExportController.java

@@ -71,7 +71,7 @@ public class AdminFileExportController extends JeecgController<AdminFileExport,
                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                    HttpServletRequest req) {
-        if (adminFileExport !=null && !Strings.isNullOrEmpty(adminFileExport.getName())) {
+        if (adminFileExport != null && !Strings.isNullOrEmpty(adminFileExport.getName())) {
             adminFileExport.setName("*" + adminFileExport.getName() + "*");
         }
         QueryWrapper<AdminFileExport> queryWrapper = QueryGenerator.initQueryWrapper(adminFileExport, req.getParameterMap());

+ 3 - 1
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_file_export/service/IAdminFileExportService.java

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 /**
  * @Description: 文件导出目录
  * @Author: jeecg-boot
- * @Date:   2023-10-30
+ * @Date: 2023-10-30
  * @Version: V1.0
  */
 public interface IAdminFileExportService extends IService<AdminFileExport> {
@@ -21,6 +21,7 @@ public interface IAdminFileExportService extends IService<AdminFileExport> {
 
     /**
      * 原封不动保存修改不添加信息
+     *
      * @param adminFileExport
      * @return
      */
@@ -28,6 +29,7 @@ public interface IAdminFileExportService extends IService<AdminFileExport> {
 
     /**
      * 从表中获取一个文件导出记录,如果没有则新建一个
+     *
      * @param id
      * @return
      */

+ 7 - 7
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_file_export/service/impl/AdminFileExportServiceImpl.java

@@ -15,7 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 /**
  * @Description: 文件导出目录
  * @Author: jeecg-boot
- * @Date:   2023-10-30
+ * @Date: 2023-10-30
  * @Version: V1.0
  */
 @Service
@@ -25,20 +25,20 @@ public class AdminFileExportServiceImpl extends ServiceImpl<AdminFileExportMappe
     public void setUpdateInfo(AdminFileExport adminFileExport) {
         //用户信息
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if(sysUser!=null){
+        if (sysUser != null) {
             adminFileExport.setUpdateBy(sysUser.getUsername());
             adminFileExport.setUpdateById(sysUser.getId());
-            if (Strings.isNullOrEmpty(adminFileExport.getExportUser())){
+            if (Strings.isNullOrEmpty(adminFileExport.getExportUser())) {
                 adminFileExport.setExportUser(sysUser.getUsername());
                 adminFileExport.setExportUserId(sysUser.getId());
             }
         }
         //文件信息
         if (!Strings.isNullOrEmpty(adminFileExport.getName())) {
-            if (Strings.isNullOrEmpty(adminFileExport.getFileType())){
+            if (Strings.isNullOrEmpty(adminFileExport.getFileType())) {
                 String name = adminFileExport.getName();
                 String[] splitName = name.split("\\.");
-                if (splitName.length>0) {
+                if (splitName.length > 0) {
                     adminFileExport.setFileType(splitName[splitName.length - 1].toLowerCase());
                 }
             }
@@ -73,8 +73,8 @@ public class AdminFileExportServiceImpl extends ServiceImpl<AdminFileExportMappe
     public AdminFileExport getAdminFileExport(String id) {
         LambdaQueryWrapper<AdminFileExport> adminFileExportQueryWrapper = new LambdaQueryWrapper<>(AdminFileExport.class);
         adminFileExportQueryWrapper.eq(AdminFileExport::getExportParam, id)
-                .eq(AdminFileExport::getFileType,"pdf")
-                .eq(AdminFileExport::getExportType,"AdminOrderList");
+                .eq(AdminFileExport::getFileType, "pdf")
+                .eq(AdminFileExport::getExportType, "AdminOrderList");
         AdminFileExport adminFileExport = this.getOne(adminFileExportQueryWrapper);
         if (adminFileExport == null) {
             adminFileExport = new AdminFileExport();

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

@@ -140,13 +140,13 @@ public class AdminOrderController {
         String fileNameHtml = "";
         try {
             QueryWrapper<AdminOrderExamine> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq( "order_id", id );
-            List<AdminOrderExamine> list = adminOrderExamineService.list( queryWrapper );
+            queryWrapper.eq("order_id", id);
+            List<AdminOrderExamine> list = adminOrderExamineService.list(queryWrapper);
             if (list.size() == 0) {
-                return Result.error( "未找到对应数据" );
+                return Result.error("未找到对应数据");
             }
             SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
-            AdminOrder byId = adminOrderService.getById( id );
+            AdminOrder byId = adminOrderService.getById(id);
 
             //fileNameQ = id + "_" + System.currentTimeMillis();
             fileNameQ = yyyyMMdd.format(byId.getCreateTime()) + "-" + byId.getAircraftNum();
@@ -163,38 +163,38 @@ public class AdminOrderController {
 //            OutputStream outputStream = Files.newOutputStream( Paths.get( outputFolder ) );
             //获取水印
             List<AdminPlatform> adminPlatformList = adminPlatformService.list();
-            AdminPlatform adminPlatform = adminPlatformList.get( 0 );
+            AdminPlatform adminPlatform = adminPlatformList.get(0);
 
             Context context = new Context();
             //订单号
-            context.setVariable( "OrderNum", byId.getOrderNum() );
+            context.setVariable("OrderNum", byId.getOrderNum());
             //飞机号
-            context.setVariable( "AircraftNum", byId.getAircraftNum() );
+            context.setVariable("AircraftNum", byId.getAircraftNum());
             //航班号
-            context.setVariable( "FlightNum", byId.getFlightNum() );
+            context.setVariable("FlightNum", byId.getFlightNum());
             //落地机位
-            context.setVariable( "AircraftPositionNum", byId.getAircraftPositionNum() );
+            context.setVariable("AircraftPositionNum", byId.getAircraftPositionNum());
 
 //            context.setVariable( "sy", "temp/sy.png" );
             //创建时间
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            context.setVariable( "Time", sdf.format( byId.getCreateTime() ) );
+            context.setVariable("Time", sdf.format(byId.getCreateTime()));
 //            context.setVariable( "order", byId );
             //阶段数据
-            List<AdminOrderExamine2> list2 = new ArrayList<>(  );
+            List<AdminOrderExamine2> list2 = new ArrayList<>();
             for (AdminOrderExamine main : list) {
                 AdminOrderExamine2 vo = new AdminOrderExamine2();
-                BeanUtils.copyProperties( main, vo );
+                BeanUtils.copyProperties(main, vo);
                 String[] arrPic = main.getPic().split(",");
                 String[] arrExamineYes = main.getExamineYes().split(",");
-                vo.setPic( arrPic );
-                vo.setExamineYes( arrExamineYes );
-                list2.add( vo );
+                vo.setPic(arrPic);
+                vo.setExamineYes(arrExamineYes);
+                list2.add(vo);
             }
-            context.setVariable( "date", list2 );
-            context.setVariable( "SystemHost", systemHost );
+            context.setVariable("date", list2);
+            context.setVariable("SystemHost", systemHost);
 
-            String htmlStr = templateEngine.process( "template", context );
+            String htmlStr = templateEngine.process("template", context);
 
 //            // 创建一个新的HTML文件
             FileWriter writer = new FileWriter(outputFolderHtml);
@@ -202,26 +202,26 @@ public class AdminOrderController {
             writer.write(htmlStr);
             // 关闭文件写入器
             writer.close();
-            HtmlToPdf.convert( outputFolderHtml, outputFolder );
+            HtmlToPdf.convert(outputFolderHtml, outputFolder);
 
 //            AddWatermarkToPDF.convert(fileName,"temp\\sy.png");
             long after24HoursInMillis = byId.getQifeiTime().getTime() + 24 * 60 * 60 * 1000; // 将毫秒数增加 24 小时
             Date after24Hours = new Date(after24HoursInMillis);
-            if (after24Hours.before(new Date(  ))) {
+            if (after24Hours.before(new Date())) {
                 //打印加水印
-                AddWatermarkToPDF.convert(fileName,adminPlatform.getSy());
-            }else {
-                fileName = systemHost+"/sys/common/static/tempFile/" + fileName;
-                return Result.OK( fileName );
+                AddWatermarkToPDF.convert(fileName, adminPlatform.getSy());
+            } else {
+                fileName = systemHost + "/sys/common/static/tempFile/" + fileName;
+                return Result.OK(fileName);
             }
 
         } catch (Exception e) {
-            return Result.error( "导出错误" );
+            return Result.error("导出错误");
         }
 //        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/tempFile/sy_" + fileName;
-        return Result.OK( fileName );
+        fileName = systemHost + "/sys/common/static/tempFile/sy_" + fileName;
+        return Result.OK(fileName);
     }
 
     @AutoLog(value = "订单管理-分页列表导出PDF")
@@ -344,7 +344,7 @@ public class AdminOrderController {
 
     private void deleteFile(String outputFolderHtml) {
         File file1 = new File(outputFolderHtml);
-        if (file1.exists()){
+        if (file1.exists()) {
             file1.delete();
         }
     }
@@ -353,7 +353,7 @@ public class AdminOrderController {
     @ApiOperation(value = "订单管理-分页列表添加导出多个PDF任务", notes = "订单管理-分页列表查询")
     @RequestMapping(value = "/addExportPdfFilesTask", method = {RequestMethod.POST})
     public Result<?> addExportPdfFilesTask(@RequestBody String[] orderIds) {
-        if (orderIds == null || orderIds.length <=0) {
+        if (orderIds == null || orderIds.length <= 0) {
             return Result.error("请选择订单");
         }
         boolean r = adminOrderService.addExportPdfFilesTask(Arrays.asList(orderIds));

+ 38 - 37
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_order/service/IAdminOrderService.java

@@ -4,6 +4,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.admin_order.entity.AdminOrderExamine;
 import org.jeecg.modules.admin_order.entity.AdminOrder;
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.List;
@@ -11,54 +12,54 @@ import java.util.List;
 /**
  * @Description: 订单管理
  * @Author: jeecg-boot
- * @Date:   2023-05-06
+ * @Date: 2023-05-06
  * @Version: V1.0
  */
 public interface IAdminOrderService extends IService<AdminOrder> {
 
-	/**
-	 * 添加一对多
-	 *
-	 */
-	public void saveMain(AdminOrder adminOrder, List<AdminOrderExamine> adminOrderExamineList) ;
+    /**
+     * 添加一对多
+     */
+    public void saveMain(AdminOrder adminOrder, List<AdminOrderExamine> adminOrderExamineList);
 
-	/**
-	 * 修改一对多
-	 *
-	 */
-	public void updateMain(AdminOrder adminOrder, List<AdminOrderExamine> adminOrderExamineList);
+    /**
+     * 修改一对多
+     */
+    public void updateMain(AdminOrder adminOrder, List<AdminOrderExamine> adminOrderExamineList);
 
-	/**
-	 * 删除一对多
-	 */
-	public void delMain(String id);
+    /**
+     * 删除一对多
+     */
+    public void delMain(String id);
 
-	/**
-	 * 批量删除一对多
-	 */
-	public void delBatchMain(Collection<? extends Serializable> idList);
+    /**
+     * 批量删除一对多
+     */
+    public void delBatchMain(Collection<? extends Serializable> idList);
 
-	/**
-	 * 恢复订单
-	 *
-	 * @param adminOrder 要恢复的订单
-	 * @param name 当前用户名
-	 * @return
-	 */
+    /**
+     * 恢复订单
+     *
+     * @param adminOrder 要恢复的订单
+     * @param name       当前用户名
+     * @return
+     */
     Result<Boolean> recoveryOrder(AdminOrder adminOrder, String name);
 
-	/**
-	 * 创建导出任务
-	 * @param orderIdList
-	 * @return
-	 */
+    /**
+     * 创建导出任务
+     *
+     * @param orderIdList
+     * @return
+     */
     boolean addExportPdfFilesTask(List<String> orderIdList);
 
-	/**
-	 * 重新执行导出任务
-	 * @param id
-	 * @return
-	 */
-	boolean reExportPdfFilesTask(String id);
+    /**
+     * 重新执行导出任务
+     *
+     * @param id
+     * @return
+     */
+    boolean reExportPdfFilesTask(String id);
 
 }

+ 2 - 2
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_order/service/impl/AdminOrderServiceImpl.java

@@ -230,7 +230,7 @@ public class AdminOrderServiceImpl extends ServiceImpl<AdminOrderMapper, AdminOr
                 });
             }
             return true;
-        }else {
+        } else {
             return false;
         }
     }
@@ -394,7 +394,7 @@ public class AdminOrderServiceImpl extends ServiceImpl<AdminOrderMapper, AdminOr
             Date after24Hours = new Date(after24HoursInMillis);
             if (after24Hours.before(new Date())) {
                 //打印加水印
-                AddWatermarkToPDF.convert(fileName, adminPlatform.getSy(),path);
+                AddWatermarkToPDF.convert(fileName, adminPlatform.getSy(), path);
                 // 删除旧文件
                 File oldFile = new File(outputFolder);
                 if (oldFile.exists()) {