Browse Source

企业备案信息:优化回执单查询

heguanxun 4 months ago
parent
commit
e8c6e0bdbb

+ 2 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfo/controller/QyRecordInfoController.java

@@ -102,8 +102,8 @@ public class QyRecordInfoController {
     @SaCheckPermission("/biz/qyrecordinfo/add")
     @PostMapping("/biz/qyrecordinfo/add")
     public CommonResult<String> add(@RequestBody @Valid QyRecordInfoAddParam qyRecordInfoAddParam) {
-        QyRecordInfoPageParam qyRecordInfoPageParam = BeanUtil.toBean(qyRecordInfoAddParam, QyRecordInfoPageParam.class);
-        qyRecordInfoPageParam.setSortOrder("createTime");
+        QyRecordInfoPageParam qyRecordInfoPageParam = new QyRecordInfoPageParam();
+        qyRecordInfoPageParam.setSortOrder("DESCEND");
         IPage<QyRecordInfo> page = qyRecordInfoService.page(qyRecordInfoPageParam);
         List<QyRecordInfo> records = page.getRecords();
         String ylTzCode_;

+ 7 - 5
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfo/entity/BusinessIdGenerator.java

@@ -7,7 +7,7 @@ public class BusinessIdGenerator {
 
     private static final String PREFIX = "EPD";
     private static final String FIXED_MIDDLE_PART = "000";
-    private static final int SERIAL_NUMBER_LENGTH = 5;
+    private static final int SERIAL_NUMBER_LENGTH = 1;
 
     private static final String PREFIX_ = "LHTWL";
 
@@ -23,23 +23,25 @@ public class BusinessIdGenerator {
         businessId.append(getDatePart());
         businessId.append(FIXED_MIDDLE_PART);
         businessId.append(getSerialNumberPart(currentSerialNumber));
-
+        System.out.println(businessId);
         return businessId.toString();
     }
 
     private static String getDatePart() {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
+        SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
         return sdf.format(new Date());
     }
 
     private static String getSerialNumberPart(int currentSerialNumber) {
         // 如果序列号不足长度,前面补0
-        return String.format("%0" + SERIAL_NUMBER_LENGTH + "d", currentSerialNumber);
+        String format = String.format("%0" + SERIAL_NUMBER_LENGTH + "d", currentSerialNumber);
+        System.out.println(format);
+        return format;
     }
 
     public static void main(String[] args) {
         for (int i = 0; i < 10; i++) {
-            String code = generateCode(i);
+            String code = generateBusinessId(i);
             System.out.println("Generated Code: " + code);
         }
     }

+ 1 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfo/service/impl/QyRecordInfoServiceImpl.java

@@ -91,7 +91,7 @@ public class QyRecordInfoServiceImpl extends ServiceImpl<QyRecordInfoMapper, QyR
             queryWrapper.orderBy(true, qyRecordInfoPageParam.getSortOrder().equalsIgnoreCase(CommonSortOrderEnum.DESC.getValue()),
                     StrUtil.toUnderlineCase(qyRecordInfoPageParam.getSortField()));
         } else {
-            queryWrapper.lambda().orderByAsc(QyRecordInfo::getId);
+            queryWrapper.lambda().orderByDesc(QyRecordInfo::getCreateTime);
         }
         return this.page(CommonPageRequest.defaultPage(), queryWrapper);
     }

+ 5 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfochecklist/param/QyRecordInfoCheckListPageParam.java

@@ -15,6 +15,8 @@ package vip.xiaonuo.biz.modular.qyrecordinfochecklist.param;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Getter;
 import lombok.Setter;
+import vip.xiaonuo.biz.modular.qyrecordinfochecklist.entity.QyRecordInfoCheckList;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -48,4 +50,7 @@ public class QyRecordInfoCheckListPageParam {
     @Schema(description = "关键词")
     private String searchKey;
 
+    /** 关键词 */
+    @Schema(description = "关键词")
+    private String ylTzCode;
 }

+ 4 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfochecklist/service/impl/QyRecordInfoCheckListServiceImpl.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.biz.modular.qyrecordinfo.entity.QyRecordInfo;
 import vip.xiaonuo.common.enums.CommonSortOrderEnum;
 import vip.xiaonuo.common.exception.CommonException;
 import vip.xiaonuo.common.page.CommonPageRequest;
@@ -46,6 +47,9 @@ public class QyRecordInfoCheckListServiceImpl extends ServiceImpl<QyRecordInfoCh
     @Override
     public Page<QyRecordInfoCheckList> page(QyRecordInfoCheckListPageParam qyRecordInfoCheckListPageParam) {
         QueryWrapper<QyRecordInfoCheckList> queryWrapper = new QueryWrapper<QyRecordInfoCheckList>().checkSqlInjection();
+        if (ObjectUtil.isNotEmpty(qyRecordInfoCheckListPageParam.getYlTzCode())) {
+            queryWrapper.lambda().like(QyRecordInfoCheckList::getYlTzCode, qyRecordInfoCheckListPageParam.getYlTzCode());
+        }
         if(ObjectUtil.isAllNotEmpty(qyRecordInfoCheckListPageParam.getSortField(), qyRecordInfoCheckListPageParam.getSortOrder())) {
             CommonSortOrderEnum.validate(qyRecordInfoCheckListPageParam.getSortOrder());
             queryWrapper.orderBy(true, qyRecordInfoCheckListPageParam.getSortOrder().equalsIgnoreCase(CommonSortOrderEnum.ASC.getValue()),