Просмотр исходного кода

2022-09-13 对接修改领用归还接口。

zhuchangxue лет назад: 3
Родитель
Сommit
4adf2dbded

+ 3 - 0
zd-modules/zd-bottle-parent/zd-bottle-api/src/main/java/com/zd/bottle/dto/UseRecordDto.java

@@ -27,6 +27,9 @@ public class UseRecordDto {
     /** 联系方式 */
     @ApiModelProperty(value = "联系方式")
     private String phone;
+    /** 实验id */
+    @ApiModelProperty(value = "实验id")
+    private Long subjectId;
     /** 实验地点 */
     @ApiModelProperty(value = "实验地点")
     private String subjectName;

+ 2 - 1
zd-modules/zd-bottle-parent/zd-bottle/src/main/java/com/zd/bottle/ZdBottleApplication.java

@@ -1,6 +1,7 @@
 package com.zd.bottle;
 
 import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
+import com.zd.common.core.constant.Constants;
 import com.zd.common.security.annotation.EnableCustomConfig;
 import com.zd.common.security.annotation.EnableRyFeignClients;
 import lombok.extern.slf4j.Slf4j;
@@ -16,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
  */
 @EnableCustomConfig
 @EnableRyFeignClients
-@SpringBootApplication
+@SpringBootApplication(scanBasePackages = Constants.BASE_PACKAGE)
 @EnableScheduling
 @NacosPropertySource(dataId = "zd-bottle", autoRefreshed = true)
 @Slf4j

+ 1 - 1
zd-modules/zd-bottle-parent/zd-bottle/src/main/java/com/zd/bottle/service/impl/BottleStorageServiceImpl.java

@@ -75,7 +75,7 @@ public class BottleStorageServiceImpl extends ServiceImpl<BottleStorageMapper, B
     @Override
     public List <BottleStorage> receivingGasList(BottleStorage bottleStorage) {
         LambdaQueryWrapper <BottleStorage> wrapper = Wrappers.lambdaQuery();
-        wrapper.ge(BottleStorage::getStorageStatus,1);
+        wrapper.eq(BottleStorage::getStorageStatus,1);
         wrapper.orderByDesc(BottleStorage::getCreateTime);
         wrapper.setEntity(bottleStorage);
         List <BottleStorage> list = list(wrapper);

+ 6 - 5
zd-modules/zd-bottle-parent/zd-bottle/src/main/java/com/zd/bottle/service/impl/UseRecordServiceImpl.java

@@ -158,9 +158,10 @@ public class UseRecordServiceImpl extends ServiceImpl<UseRecordMapper, UseRecord
         queryWrapper.eq(UsegasApply::getUserId, user.getSysUser().getUserId())
                 .ge(UsegasApply::getEndTime, new Date())
                 //todo 气体ID待确认
-                .eq(UsegasApply::getUseGasName, recordDto.getBottleName());
-        UsegasApply usegasApply = usegasApplyService.getOne(queryWrapper);
-        if (usegasApply == null) {
+                .eq(UsegasApply::getUseGasName, recordDto.getBottleName())
+                .eq(UsegasApply::getLeadAuditStaus,1);
+        List <UsegasApply> list = usegasApplyService.list(queryWrapper);
+        if (list.isEmpty()) {
             result = 3;
         }
         LambdaQueryWrapper<UseRecord> wrapper = Wrappers.lambdaQuery(UseRecord.class);
@@ -200,7 +201,7 @@ public class UseRecordServiceImpl extends ServiceImpl<UseRecordMapper, UseRecord
             throw new ServiceException("入库数据异常");
         }
         //设置其他公共字段
-        useRecord.setUserId(user.getUserid());
+        useRecord.setUserId(user.getSysUser().getUserId());
         useRecord.setCommonValue(user.getSysUser().getUserName());
         if (save(useRecord)) {
             return result;
@@ -212,7 +213,7 @@ public class UseRecordServiceImpl extends ServiceImpl<UseRecordMapper, UseRecord
     public Integer updateUseRecord(UseRecord useRecord) {
         Long storageId = useRecord.getStorageId();
         LambdaQueryWrapper<UseRecord> queryWrapper = Wrappers.lambdaQuery(UseRecord.class);
-        queryWrapper.eq(UseRecord::getStorageId,storageId).eq(UseRecord::getBackTime,null);
+        queryWrapper.eq(UseRecord::getStorageId,storageId).isNull(UseRecord::getBackTime);
         UseRecord temp = getOne(queryWrapper);
         if (temp==null) {
             throw new ServiceException("数据异常");