增加修改试剂耗材位置信息日志功能

main
杨海航 1 year ago
parent 6f7a8de1ea
commit 2ba2ad0219
  1. 2
      src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java
  2. 5
      src/main/java/digital/laboratory/platform/reagent/controller/BatchDetailsController.java
  3. 2
      src/main/java/digital/laboratory/platform/reagent/service/BatchDetailsService.java
  4. 21
      src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java
  5. 15
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java

@ -90,7 +90,7 @@ public class ApplicationForUseController {
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<ApplicationForUseVO> applicationForUseVOList = applicationForUseService.getApplicationForUseVOPage(page, Wrappers.<ApplicationForUse>query().eq("create_by", dlpUser.getId()).orderByDesc("create_time"));
IPage<ApplicationForUseVO> applicationForUseVOList = applicationForUseService.getApplicationForUseVOPage(page, Wrappers.<ApplicationForUse>query().eq("create_by", dlpUser.getId()).eq(applicationForUse.getStatus()!=null,"status",applicationForUse.getStatus()).orderByDesc("create_time"));
return R.ok(applicationForUseVOList);

@ -147,5 +147,10 @@ public class BatchDetailsController {
}
}
@PutMapping("/update/data")
public R updateCabinetData(){
batchDetailsService.updateCabinetData();
return R.ok("更新数据成功");
}
}

@ -15,4 +15,6 @@ import java.util.List;
public interface BatchDetailsService extends IService<BatchDetails> {
List<BatchDetailsVO> getBatchDetailsList(String reagentConsumableInventoryId);
void updateCabinetData();
}

@ -6,13 +6,12 @@ import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.BatchDetailsMapper;
import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.vo.BatchDetailsVO;
import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -34,6 +33,9 @@ public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, Bat
@Autowired
private ReagentConsumableStashService reagentConsumableStashService;
@Autowired
private RemoteCabinetService remoteCabinetService;
@Override
public List<BatchDetailsVO> getBatchDetailsList(String reagentConsumableInventoryId) {
@ -84,4 +86,17 @@ public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, Bat
}
}
@Override
@Transactional
public void updateCabinetData() {
List<BatchDetails> list = this.list(new LambdaQueryWrapper<BatchDetails>().gt(BatchDetails::getQuantity, 0));
int x = 1;
for (BatchDetails batchDetails : list) {
String latticeId = batchDetails.getLatticeId();
reagentConsumableInventoryService.updateCabinet(latticeId, batchDetails.getReagentConsumableInventoryId(), 1);
System.out.println("已成功更新" + batchDetails.getReagentConsumableName() + "的柜子信息");
System.out.println("已成功更新" + x + "条记录");
x++;
}
}
}

@ -86,6 +86,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Autowired
private StandardMaterialApplicationService standardMaterialApplicationService;
@Autowired
private LocationInfoService locationInfoService;
@Autowired
private OssFile ossFile;
@ -787,9 +790,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
orgFullVO.setGender(1);
orgFullVOS.add(orgFullVO);
}
}
System.out.println("总个数" + orgFullVOS.size());
return orgFullVOS;
}
@ -798,18 +799,19 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
public boolean updateLocation(BatchDetails batchDetails) {
BatchDetails oldBatchDetails = batchDetailsService.getById(batchDetails.getBatchDetailsId());
String oldLocation = oldBatchDetails.getLocation();
this.updateCabinet(oldBatchDetails.getLatticeId(), oldBatchDetails.getReagentConsumableInventoryId(), -1);//清除原来位置信息ID
oldBatchDetails.setLocation(batchDetails.getLocation());
oldBatchDetails.setBoxId(batchDetails.getBoxId());
oldBatchDetails.setLocation(batchDetails.getLocation());
oldBatchDetails.setLatticeId(batchDetails.getLatticeId());
String[] split = batchDetails.getLocation().split("_");
String roomNo = split[1];
oldBatchDetails.setRoomNo(roomNo);
if (batchDetailsService.updateById(oldBatchDetails)) {
this.updateCabinet(oldBatchDetails.getLatticeId(), oldBatchDetails.getReagentConsumableInventoryId(), 1);
locationInfoService.addInfo(oldBatchDetails.getBatchDetailsId(), oldLocation, batchDetails.getLocation());
return true;
} else return false;
@ -826,12 +828,15 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
BeanUtils.copyProperties(batchDetails, batchDetailsVO);
batchDetailsVO.setSupplierName(supplierInformationService.getById(batchDetails.getSupplierId()).getSupplierName());
ReagentConsumableInventory reagentConsumableInventory = this.getById(batchDetails.getReagentConsumableInventoryId());
List<LocationInfoVO> locationInfoVOList = locationInfoService.getListById(id);
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("batchDetails", batchDetailsVO);
objectObjectHashMap.put("reagentConsumableInventory", reagentConsumableInventory);
objectObjectHashMap.put("locationInfoVOList", locationInfoVOList);
return objectObjectHashMap;
}
}

Loading…
Cancel
Save