增加修改试剂耗材位置信息日志功能
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
|
||||
+5
@@ -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();
|
||||
}
|
||||
|
||||
+18
-3
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-5
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user