Browse Source

代码优化

ChenYang 1 year ago
parent
commit
658a9139bd

+ 3 - 1
warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotAttMapper.java

@@ -1,6 +1,8 @@
 package com.ruoyi.ams.inv.mapper;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 
 /**
@@ -9,7 +11,7 @@ import com.ruoyi.ams.inv.domain.InvLotAtt;
  * @author andy
  * @date 2022-03-09
  */
-public interface InvLotAttMapper
+public interface InvLotAttMapper extends BaseMapper<InvLotAtt>
 {
     /**
      * 查询批次属性

+ 1 - 1
warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java

@@ -19,7 +19,7 @@ import java.util.List;
  * @author andy
  * @date 2022-03-03
  */
-public interface InvLotLocIdMapper extends BaseMapper<InvLotAtt> {
+public interface InvLotLocIdMapper extends BaseMapper<InvLotLocId> {
     /**
      * 查询库位库存信息
      *

+ 7 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotAttService.java

@@ -66,4 +66,11 @@ public interface IInvLotAttService {
      * @return
      */
     int deleteInvLotAttBylocationId(Long locationId);
+
+    /**
+     * 根据批次号更新质检状态
+     * @param lotNo 批次号
+     * @param qcStatus 质检状态 HG-合格  DCL-待处理 BHG-不合格 DJ-待检
+     */
+    Boolean updateQcStatusByLotNo(String lotNo, String qcStatus);
 }

+ 0 - 7
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java

@@ -298,11 +298,4 @@ public interface IInvLotLocIdService {
      * @return
      */
     AjaxResult insertWeighingData(String taskNo,int weight);
-
-    /**
-     * 根据批次号更新质检状态
-     * @param lotNo 批次号
-     * @param qcStatus 质检状态 HG-合格  DCL-待处理 BHG-不合格 DJ-待检
-     */
-    Boolean updateQcStatusByLotNo(String lotNo, String qcStatus);
 }

+ 12 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotAttServiceImpl.java

@@ -2,12 +2,15 @@ package com.ruoyi.ams.inv.service.impl;
 
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.service.IInvLotAttService;
+import org.springframework.util.Assert;
 
 /**
  * 批次属性Service业务层处理
@@ -96,4 +99,13 @@ public class InvLotAttServiceImpl implements IInvLotAttService {
     public int deleteInvLotAttBylocationId(Long locationId) {
         return invLotAttMapper.deleteInvLotAttBylocationId(locationId);
     }
+
+
+    @Override
+    public Boolean updateQcStatusByLotNo(String lotNo, String qcStatus) {
+        Assert.isTrue(StringUtils.isNotBlank(lotNo) && StringUtils.isNotBlank(qcStatus), "lotNo or qcStatus is null");
+        return invLotAttMapper.update(null, Wrappers.<InvLotAtt>lambdaUpdate()
+                .set(InvLotAtt::getLotatt05, qcStatus).eq(InvLotAtt::getLotatt01, lotNo)) > 0;
+
+    }
 }

+ 0 - 6
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -719,11 +719,5 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         return AjaxResult.success();
     }
 
-    @Override
-    public Boolean updateQcStatusByLotNo(String lotNo, String qcStatus) {
-        Assert.isTrue(StringUtils.isNotBlank(lotNo) && StringUtils.isNotBlank(qcStatus), "lotNo or qcStatus is null");
-        return invLotLocIdMapper.update(null, Wrappers.<InvLotAtt>lambdaUpdate()
-                .set(InvLotAtt::getLotatt05, qcStatus).eq(InvLotAtt::getLotatt01, lotNo)) > 0;
 
-    }
 }

+ 3 - 3
warewms-ams/src/main/java/com/ruoyi/ams/nieyan/service/impl/QcInfoFctAgvService.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.ruoyi.ams.inv.service.IInvLotLocIdService;
+import com.ruoyi.ams.inv.service.IInvLotAttService;
 import com.ruoyi.ams.nieyan.dao.QcInfoFctAgvDao;
 import com.ruoyi.ams.nieyan.dto.QcInfoFctAgvDTO;
 import com.ruoyi.ams.nieyan.entity.QcInfoFctAgvEntity;
@@ -27,7 +27,7 @@ public class QcInfoFctAgvService extends CrudServiceImpl<QcInfoFctAgvDao, QcInfo
 
 
     @Autowired
-    private IInvLotLocIdService invLotLocIdService;
+    private IInvLotAttService invLotAttService;
 
     /**
      * 根据批次号获取质检信息
@@ -62,7 +62,7 @@ public class QcInfoFctAgvService extends CrudServiceImpl<QcInfoFctAgvDao, QcInfo
             //3.根据批号查询FCT_AGV2质检表中的未处理的状态改为已处理
             for(QcInfoFctAgvEntity qcInfoFctAgvEntity : qcInfoFctAgvEntities){
                 if(StringUtils.isBlank(qcInfoFctAgvEntity.getSlot())) continue;
-                if(invLotLocIdService.updateQcStatusByLotNo(qcInfoFctAgvEntity.getSlot(), "HG")){
+                if(invLotAttService.updateQcStatusByLotNo(qcInfoFctAgvEntity.getSlot(), "HG")){
                     updateQcInfoStatus(qcInfoFctAgvEntity.getSlot(), Constants.YES);
                 }
             }