Эх сурвалжийг харах

出入库时间字段修改

fgd 1 жил өмнө
parent
commit
e96a42e310

+ 0 - 4
sd-business/src/main/java/com/sd/business/controller/in/InOutStorageBomController.java

@@ -8,7 +8,6 @@ import com.sd.business.entity.in.dto.InOutStorageBomSelectDto;
 import com.sd.business.entity.in.vo.InOutStorageBomExportVo;
 import com.sd.business.entity.in.vo.InOutStorageBomVo;
 import com.sd.business.service.in.InOutStorageBomService;
-import com.sd.framework.util.TemplateExcelUtil;
 import com.sd.framework.util.excel.util.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -17,10 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 
 
 /**

+ 1 - 1
sd-business/src/main/java/com/sd/business/entity/in/po/InOutStorage.java

@@ -63,7 +63,7 @@ public class InOutStorage extends BasePo {
     private String applicant;
 
     /**
-     * 入库时间
+     * 入库时间
      */
     private Date inOutStorageTime;
 

+ 1 - 1
sd-business/src/main/java/com/sd/business/entity/in/vo/InOutStorageBomExportVo.java

@@ -94,7 +94,7 @@ public class InOutStorageBomExportVo {
     @ColumnWidth(20)
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ExcelProperty(value = "操作时间", index = 8)
-    private Date createTime;
+    private Date inOutStorageTime;
 
     /**
      * 申请人

+ 7 - 0
sd-business/src/main/java/com/sd/business/entity/in/vo/InOutStorageBomVo.java

@@ -4,6 +4,8 @@ import com.sd.business.entity.in.po.InOutStorageBom;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+
 /**
  * 出入库bom列表查询返回值实体
  *
@@ -73,4 +75,9 @@ public class InOutStorageBomVo extends InOutStorageBom {
      * 备注
      */
     private String remark;
+
+    /**
+     * 出入库时间
+     */
+    private Date inOutStorageTime;
 }

+ 10 - 8
sd-business/src/main/java/com/sd/business/service/in/impl/InOutStorageBomServiceImpl.java

@@ -63,8 +63,8 @@ public class InOutStorageBomServiceImpl extends ServiceImpl<InOutStorageBomMappe
         wrapper.eq("w", Warehouse::getId, dto.getWarehouseId());
         wrapper.eq("ios", InOutStorage::getType, dto.getType());
         wrapper.eq("ios", InOutStorage::getDetailType, dto.getDetailType());
-        wrapper.ge("ios", InOutStorage::getCreateTime, dto.getBeginTime());
-        wrapper.le("ios", InOutStorage::getCreateTime, dto.getEndTime());
+        wrapper.ge("ios", InOutStorage::getInOutStorageTime, dto.getBeginTime());
+        wrapper.le("ios", InOutStorage::getInOutStorageTime, dto.getEndTime());
 
         Page<InOutStorageBomVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         return page;
@@ -119,7 +119,7 @@ public class InOutStorageBomServiceImpl extends ServiceImpl<InOutStorageBomMappe
         }
         List<InOutStorage> inOutStorageList = inOutStorageService.list(q -> q
                 .in(BaseIdPo::getId, inOutStorageIds)
-                .orderByAsc(InOutStorage::getCreateTime));
+                .orderByAsc(InOutStorage::getInOutStorageTime));
 
         List<InOutStorageErpExportVo> inOutStorageErpExportVoList = new ArrayList<>();
         int codeNum = 1;
@@ -133,20 +133,22 @@ public class InOutStorageBomServiceImpl extends ServiceImpl<InOutStorageBomMappe
             } else {
                 inOutStorageErpExportVo.setDocCode("T119");
             }
-            // 获取单号
-            String format = DateUtil.format(inOutStorage.getCreateTime(), "-yyyyMM");
+            // 获取单号 系统单号 XX-yyMMdd-000001
+            String[] codes = inOutStorage.getCode().split("-");
+            String substring = codes[1].substring(0, codes[1].length() - 2);
+            String format = "-20" + substring;
             if (!Objects.equals(dateFormat, format)) {
                 dateFormat = format;
-                codeNum = 1;
+                // 后四位生成规则,取系统单号 dd01
+                codeNum = Integer.parseInt(codes[1].substring(codes[1].length() - 2) + codes[2].substring(codes[2].length() - 2));
             }
             String code = inOutStorageErpExportVo.getDocCode() + format + String.format("%04d", codeNum);
             inOutStorageErpExportVo.setCode(code);
-            inOutStorageErpExportVo.setCreateTime(DateUtil.format(inOutStorage.getCreateTime(), "yyyy/MM/dd HH:mm:ss"));
+            inOutStorageErpExportVo.setCreateTime(DateUtil.format(inOutStorage.getInOutStorageTime(), "yyyy/MM/dd HH:mm:ss"));
             inOutStorageErpExportVo.setDeptCode("GPIT");
             inOutStorageErpExportVo.setEmployeeCode("GPIT02");
 
             inOutStorageErpExportVoList.add(inOutStorageErpExportVo);
-            codeNum++;
         }
 
         Map<Long, String> map = inOutStorageErpExportVoList.stream()

+ 2 - 2
sd-business/src/main/java/com/sd/business/service/in/impl/InOutStorageServiceImpl.java

@@ -61,8 +61,8 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
         wrapper.eq("ios", InOutStorage::getDepartmentId, dto.getDepartmentId());
         wrapper.eq("w", Warehouse::getId, dto.getWarehouseId());
         wrapper.eq("ios", InOutStorage::getDetailType, dto.getDetailType());
-        wrapper.ge("ios", InOutStorage::getCreateTime, dto.getBeginTime());
-        wrapper.le("ios", InOutStorage::getCreateTime, dto.getEndTime());
+        wrapper.ge("ios", InOutStorage::getInOutStorageTime, dto.getBeginTime());
+        wrapper.le("ios", InOutStorage::getInOutStorageTime, dto.getEndTime());
 
         return this.baseMapper.getPage(dto.getPage(), wrapper);
     }

+ 2 - 2
sd-business/src/main/java/com/sd/business/service/in/impl/PurchaseWarehousingServiceImpl.java

@@ -64,8 +64,8 @@ public class PurchaseWarehousingServiceImpl implements PurchaseWarehousingServic
         wrapper.like("s", Supplier::getName, dto.getSupplierName());
         wrapper.like("bs", BomSpec::getCode, dto.getBomSpecCode());
         wrapper.like("bs", BomSpec::getName, dto.getBomSpecName());
-        wrapper.ge("ios", InOutStorage::getCreateTime, dto.getBeginTime());
-        wrapper.le("ios", InOutStorage::getCreateTime, dto.getEndTime());
+        wrapper.ge("ios", InOutStorage::getInOutStorageTime, dto.getBeginTime());
+        wrapper.le("ios", InOutStorage::getInOutStorageTime, dto.getEndTime());
         return wrapper;
     }
 

+ 1 - 1
sd-business/src/main/resources/mapper/in/InOutStorageBomMapper.xml

@@ -9,7 +9,7 @@
                iosb.quantity,
                iosb.unit_price,
                iosb.balance_inventory_quantity,
-               ios.create_time,
+               ios.in_out_storage_time,
                w.type  warehouseType,
                w.name  warehouseName,
                w.code  warehouseCode,

+ 1 - 0
sd-business/src/main/resources/mapper/in/InOutStorageMapper.xml

@@ -15,6 +15,7 @@
                ios.create_time,
                ios.update_user,
                ios.update_time,
+               ios.in_out_storage_time,
                w.type warehouseType,
                w.name warehouseName,
                d.name departmentName,

+ 1 - 1
sd-business/src/main/resources/mapper/in/PurchaseWarehousingServiceMapper.xml

@@ -11,7 +11,7 @@
     </select>
 
     <sql id="select">
-        select ios.create_time outboundTime,
+        select ios.in_out_storage_time outboundTime,
                p.code          purchaseCode,
                ios.code        outboundCode,
                w.name          warehouseName,