3254194295 7 месяцев назад
Родитель
Сommit
ff167ee616

+ 2 - 1
platform-dao/src/main/java/com/platform/dao/enums/SbMeasureLogOtherTypeEnum.java

@@ -62,7 +62,8 @@ public enum SbMeasureLogOtherTypeEnum {
     /**
      * 启用
      */
-    IN_USE(21)
+    IN_USE(21),
+    OUT_STORE(22)
     ;
 
 

+ 1 - 1
platform-dao/src/main/resources/mapper/upms/SysDictMapper.xml

@@ -8,7 +8,7 @@
 
     <select id="selectTreeByDTO"
             resultType="com.platform.dao.entity.upms.SysDict">
-        SELECT * from t_sys_dict
+        SELECT any_value(id) as id,any_value(code) as code,any_value(label) as label,any_value(`type`) as type,any_value(type_name) as typeName from t_sys_dict
         group by type
     </select>
 </mapper>

+ 8 - 0
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoController.java

@@ -69,6 +69,14 @@ public class SbInfoController {
         return new R<>();
     }
 
+    @SysLog("仪表批量出库")
+    @PutMapping("/yiBiao/batch/out-store")
+    //@PreAuthorize("@pms.hasPermission('sb-infos-edit')")
+    public R yiBiaoBatchOutStore(@RequestBody SbInfoDTO sbInfoDTO) {
+        sbInfoService.yiBiaoBatchOutStore(sbInfoDTO);
+        return new R<>();
+    }
+
     /**
      * 设备工作台数据
      *

+ 2 - 0
platform-service/src/main/java/com/platform/service/sb/SbInfoService.java

@@ -26,6 +26,8 @@ import java.util.Map;
  * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
  */
 public interface SbInfoService extends IBaseService<SbInfo, SbInfoDTO> {
+    void yiBiaoBatchOutStore(SbInfoDTO sbInfoDTO);
+
     void yiBiaoBatchBackStore(SbInfoDTO sbInfoDTO);
     AbstractPageResultBean<SbInfoVO> getSynchronousSb(SbModelSpareBomDTO dto, Integer pageNum, Integer pageSize);
 

+ 30 - 3
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -142,15 +142,42 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
     private final SbMeasureLogMapper sbMeasureLogMapper;
 
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void yiBiaoBatchOutStore(SbInfoDTO sbInfoDTO) {
+        List<String> sbIds = sbInfoDTO.getSbIds();
+        UserInfo userInfo = SecurityUtils.getUserInfo();
+        sbIds.forEach(item->{
+            SbInfo sbInfo = new SbInfo();
+            sbInfo.setStatus(SbInfoStatusEnum.IN_USE.getValue());
+            sbInfo.setPositionId(sbInfoDTO.getPositionId());
+
+            SbMeasureLog log = new SbMeasureLog();
+            log.setSbId(item);
+            log.setId(IdGeneratorUtils.getObjectId());
+            log.setOtherType(SbMeasureLogOtherTypeEnum.OUT_STORE.getValue());
+
+            log.setContent(sbInfoDTO.getRemark());
+            log.setCreatedTime(LocalDateTime.now());
+            log.setCreatedUserId(userInfo.getUserId());
+            log.setCreatedUserName(userInfo.getRealName());
+            log.setUpdateTime(LocalDateTime.now());
+            log.setUpdateUserId(userInfo.getUserId());
+            log.setUpdateUserName(userInfo.getRealName());
+            sbMeasureLogMapper.insert(log);
+
+        });
+    }
+
     @Override
     public void yiBiaoBatchBackStore(SbInfoDTO sbInfoDTO) {
-        //批量退库到‘仪表二级库’
+        //批量退库
         if (sbInfoDTO.getSbIds()!=null && sbInfoDTO.getSbIds().size()>0){
             SbInfo udpSb = new SbInfo();
             UserInfo userInfo = SecurityUtils.getUserInfo();
             sbInfoDTO.getSbIds().forEach(item->{
                 udpSb.setId(item);
-                udpSb.setPositionId("658d2817a6cf000dacd41698");
+                udpSb.setPositionId(sbInfoDTO.getPositionId());
                 udpSb.setStatus(sbInfoDTO.getStatus());
                 if (sbInfoDTO.getStatus() == SbInfoStatusEnum.SCRAPED.getValue()) {
                     udpSb.setScrapedDate(LocalDateTime.now());
@@ -160,7 +187,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
                 SbMeasureLog log = new SbMeasureLog();
                 log.setSbId(item);
                 log.setId(IdGeneratorUtils.getObjectId());
-                if (sbInfoDTO.getStatus() == SbInfoStatusEnum.IN_BACK.getValue()) {
+                if (sbInfoDTO.getStatus() == SbInfoStatusEnum.IN_STORE.getValue()) {
                     log.setOtherType(SbMeasureLogOtherTypeEnum.IN_STORE.getValue());
                 }
                 if (sbInfoDTO.getStatus() == SbInfoStatusEnum.SCRAPED.getValue()) {