Browse Source

框架分页根据自己要求排序

yejian016332 4 years ago
parent
commit
88f0679346

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/externalApi/dao/AgvHikOrderDetailInfoMapper.java

@@ -15,11 +15,11 @@ import java.util.Map;
 /**
  * <p>
  * Mapper 接口
- * 出入库管理
+ * agv任务管理
  * </p>
  *
  * @author imcs
- * @date 2021-07-12
+ * @date 2021-12-28
  */
 @Repository
 public interface AgvHikOrderDetailInfoMapper extends SuperMapper<AgvHikOrderDetailInfo> {

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/externalApi/dao/AgvHikOrderInfoMapper.java

@@ -12,11 +12,11 @@ import org.springframework.stereotype.Repository;
 /**
  * <p>
  * Mapper 接口
- * 出入库管理
+ * agv任务管理
  * </p>
  *
  * @author imcs
- * @date 2021-07-12
+ * @date 2021-12-28
  */
 @Repository
 public interface AgvHikOrderInfoMapper extends SuperMapper<AgvHikOrderInfo> {

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/externalApi/AgvHikOrderDetailInfoMapper.xml

@@ -33,7 +33,7 @@
     <!-- 分页 -->
     <select id="pageList" resultMap="BaseResultMap">
         SELECT
-        1 as id,tmp5.statisticalDate,SUM(tmp5.statisticalHours) as statisticalHours
+        tmp5.statisticalDate as statisticalDate,SUM(tmp5.statisticalHours) as statisticalHours
         FROM (SELECT
         tmp3.statisticalDate,
         tmp3.task_code,

+ 7 - 12
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/externalApi/AgvHikOrderDetailInfoController.java

@@ -3,6 +3,7 @@ package com.github.zuihou.business.controller.externalApi;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperController;
 import com.github.zuihou.base.request.PageParams;
@@ -39,9 +40,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Map;
+import java.util.*;
 
 
 /**
@@ -57,7 +56,7 @@ import java.util.Map;
 @Validated
 @RestController
 @RequestMapping("/agvHikOrderDetailInfo")
-@Api(value = "task", tags = "测量")
+@Api(value = "agvHikOrderDetailInfo", tags = "测量")
 @SysLog(enabled = true)
 public class AgvHikOrderDetailInfoController extends SuperController<AgvHikOrderDetailInfoService, Long, AgvHikOrderDetailInfo, AgvHikOrderDetailInfoPageDTO, AgvHikOrderDetailInfoSaveDTO, AgvHikOrderDetailInfoUpdateDTO> {
 
@@ -77,14 +76,10 @@ public class AgvHikOrderDetailInfoController extends SuperController<AgvHikOrder
             statisticalEndDate =  data.getStatisticalDate() + " 23:59:59";
         }
         wrapper.between(AgvHikOrderDetailInfo::getRequestTime,statisticalBeginDate,statisticalEndDate);
+        OrderItem orderItem = new OrderItem();
+        orderItem.setColumn("statisticalDate").setAsc(false);
+        page.orders().remove(0);
+        page.orders().add(orderItem);
         baseService.pageList(page, wrapper);
     }
-
-    private static int getFirstDayOfMonth(Date date){
-        return DateUtil.beginOfMonth(date).dayOfMonth();
-    }
-
-    private static int getLastDayOfMonth(Date date){
-        return DateUtil.endOfMonth(date).dayOfMonth();
-    }
 }

+ 6 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/dto/TaskNodePageDTO.java

@@ -121,4 +121,10 @@ public class TaskNodePageDTO implements Serializable {
     @ApiModelProperty(value = "节点类型(0-普通节点1-上料节点2-下料节点3-质检节点)")
     private String nodeType;
 
+
+    /**
+     * 统计月
+     */
+    @ApiModelProperty(value = "统计月")
+    private String statisticalDate;
 }

+ 16 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/TaskNode.java

@@ -343,6 +343,22 @@ public class TaskNode extends Entity<Long> {
     @Excel(name = "推迟(1-是0-否)")
     private String delayFlag;
 
+    /**
+     * 产线名称
+     */
+    @TableField(exist = false)
+    private String productionlineName;
+
+    /**
+     * 生产工时汇总(小时)
+     */
+    @TableField(exist = false)
+    private String statisticalHours;
+
+    @ApiModelProperty(value="统计月")
+    @TableField(exist = false)
+    private String statisticalDate;
+
     /**
      * 上料类型判断
      * @return

+ 28 - 28
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/util/SmbShareFileUtil.java

@@ -1,15 +1,15 @@
 package com.github.zuihou.common.util;
 
+import cn.hutool.core.date.DateUtil;
 import jcifs.smb.NtlmPasswordAuthentication;
 import jcifs.smb.SmbFile;
 import jcifs.smb.SmbFileInputStream;
 import jcifs.smb.SmbFileOutputStream;
 
 import java.io.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
 
 /**
  * 提供共享文件夹的操作的通用程序
@@ -218,29 +218,29 @@ public class SmbShareFileUtil {
     }
 
     public static void main(String[] args) {
-        String ip="192.168.170.23";
-        String url="smb://192.168.170.23/measuring/1111-1111-2021-09-12-10-36-32.csv";
-        String name="measuring";
-        String password="Imcs@123456";
-        NtlmPasswordAuthentication auth =new NtlmPasswordAuthentication(ip, name, password);
-        SmbFile file = null;
-        try {
-            file = new SmbFile(url,auth);
-            file.connect();
-            if(file.exists()){
-//                SmbFile[] files = file.listFiles();
-//                for(SmbFile f : files){
-//                    System.out.println(f.getName());
-//                }
-                boolean downloadFlag = downLoadShareFileContent("D:\\1111-1111-2021-09-12-10-36-32.csv",file);
-                System.out.println(downloadFlag);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-
-
-
+//        String ip="192.168.170.23";
+//        String url="smb://192.168.170.23/measuring/1111-1111-2021-09-12-10-36-32.csv";
+//        String name="measuring";
+//        String password="Imcs@123456";
+//        NtlmPasswordAuthentication auth =new NtlmPasswordAuthentication(ip, name, password);
+//        SmbFile file = null;
+//        try {
+//            file = new SmbFile(url,auth);
+//            file.connect();
+//            if(file.exists()){
+////                SmbFile[] files = file.listFiles();
+////                for(SmbFile f : files){
+////                    System.out.println(f.getName());
+////                }
+//                boolean downloadFlag = downLoadShareFileContent("D:\\1111-1111-2021-09-12-10-36-32.csv",file);
+//                System.out.println(downloadFlag);
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
+////        }
+//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+//        System.out.println(Date.parse("2021-12-23"));
+        System.out.println( DateUtil.beginOfMonth(new Date()).dayOfMonth());
+        System.out.println( DateUtil.endOfMonth(new Date()).dayOfMonth());
     }
 }