update
This commit is contained in:
+7
-3
@@ -146,32 +146,38 @@ public class ReagentConsumableInventoryController {
|
|||||||
@ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表")
|
@ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表")
|
||||||
@GetMapping("/List")
|
@GetMapping("/List")
|
||||||
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
|
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
|
||||||
public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, Integer warning, String remark, HttpServletRequest theHttpServletRequest) {
|
public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, Integer warning, String remark, String category,HttpServletRequest theHttpServletRequest) {
|
||||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||||
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryREVOList(page, Wrappers.<ReagentConsumableInventory>query()
|
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryREVOList(page, Wrappers.<ReagentConsumableInventory>query()
|
||||||
|
|
||||||
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
||||||
|
.like(StrUtil.isNotBlank(category), "category", category)
|
||||||
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
||||||
.eq("category", "试剂").or()
|
.eq("category", "试剂").or()
|
||||||
|
|
||||||
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
|
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
|
||||||
|
.like(StrUtil.isNotBlank(category), "category", category)
|
||||||
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
||||||
.eq("category", "试剂").or()
|
.eq("category", "试剂").or()
|
||||||
|
|
||||||
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
||||||
|
.like(StrUtil.isNotBlank(category), "category", category)
|
||||||
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
||||||
.eq("category", "耗材").or()
|
.eq("category", "耗材").or()
|
||||||
|
|
||||||
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
|
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
|
||||||
|
.like(StrUtil.isNotBlank(category), "category", category)
|
||||||
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
.like(warning != null && warning == 1, "warning_information", "库存不足")
|
||||||
.eq("category", "耗材").or()
|
.eq("category", "耗材").or()
|
||||||
|
|
||||||
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
||||||
|
.like(StrUtil.isNotBlank(category), "category", category)
|
||||||
.like(warning != null && warning == 1, "species", "库存不足")
|
.like(warning != null && warning == 1, "species", "库存不足")
|
||||||
.eq("category", "试剂").or()
|
.eq("category", "试剂").or()
|
||||||
|
|
||||||
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
|
.like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName)
|
||||||
|
.like(StrUtil.isNotBlank(category), "category", category)
|
||||||
.like(warning != null && warning == 1, "species", "库存不足")
|
.like(warning != null && warning == 1, "species", "库存不足")
|
||||||
.eq("category", "耗材").or(), warning);
|
.eq("category", "耗材").or(), warning);
|
||||||
return R.ok(reagentConsumableInventoryRMVOList);
|
return R.ok(reagentConsumableInventoryRMVOList);
|
||||||
@@ -276,8 +282,6 @@ public class ReagentConsumableInventoryController {
|
|||||||
public String getBarCodeImageBase64(String code, HttpServletResponse httpServletResponse) throws IOException {
|
public String getBarCodeImageBase64(String code, HttpServletResponse httpServletResponse) throws IOException {
|
||||||
|
|
||||||
return reagentConsumableInventoryService.buildCodeLabelContent(code);
|
return reagentConsumableInventoryService.buildCodeLabelContent(code);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+6
-2
@@ -31,10 +31,14 @@ public interface PurchasingPlanService extends IService<PurchasingPlan> {
|
|||||||
|
|
||||||
PurchasingPlanVO getPurchasingPlanVO (String purchasingPlanId);
|
PurchasingPlanVO getPurchasingPlanVO (String purchasingPlanId);
|
||||||
|
|
||||||
@Transactional
|
PurchasingPlanVO addById(String[] idList, DLPUser user);
|
||||||
|
|
||||||
|
//创建计划
|
||||||
PurchasingPlanVO addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user);
|
PurchasingPlanVO addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user);
|
||||||
|
|
||||||
// ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO);
|
|
||||||
|
|
||||||
|
ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO);
|
||||||
|
|
||||||
ProcurementContent editById(PurchasingPlanDTO purchasingPlanDTO);
|
ProcurementContent editById(PurchasingPlanDTO purchasingPlanDTO);
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -252,12 +252,12 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
|||||||
|
|
||||||
List<CentralizedRequestVO> centralizedRequestVOArrayList = baseMapper.getVOList(qw);
|
List<CentralizedRequestVO> centralizedRequestVOArrayList = baseMapper.getVOList(qw);
|
||||||
|
|
||||||
for (CentralizedRequestVO centralizedRequestVO : centralizedRequestVOArrayList) {
|
// for (CentralizedRequestVO centralizedRequestVO : centralizedRequestVOArrayList) {
|
||||||
|
//
|
||||||
List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId());
|
// List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId());
|
||||||
|
//
|
||||||
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
|
// centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return centralizedRequestVOArrayList;
|
return centralizedRequestVOArrayList;
|
||||||
}
|
}
|
||||||
|
|||||||
+113
-13
@@ -20,6 +20,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -80,6 +81,105 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
|
|||||||
return purchasingPlanVO;
|
return purchasingPlanVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public PurchasingPlanVO addById(String[] idList, DLPUser user) {
|
||||||
|
|
||||||
|
List<CentralizedRequest> centralizedRequestList = requestService.list(Wrappers.<CentralizedRequest>query().in("id", idList));
|
||||||
|
|
||||||
|
List<DetailsOfCentralized> detailsOfCentralizedAllList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (CentralizedRequest centralizedRequest : centralizedRequestList) {
|
||||||
|
List<DetailsOfCentralized> detailsOfCentralizedList = detailsOfCentralizedService.list(Wrappers.<DetailsOfCentralized>query().eq("centralized_request_id", centralizedRequest.getId()));
|
||||||
|
detailsOfCentralizedAllList.addAll(detailsOfCentralizedList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PurchasingPlan purchasingPlan = new PurchasingPlan();//创建采购计划
|
||||||
|
purchasingPlan.setPurchasingPlanId(IdWorker.get32UUID().toUpperCase());
|
||||||
|
purchasingPlan.setCreateId(user.getId());//创建人ID
|
||||||
|
purchasingPlan.setStatus(0);//状态
|
||||||
|
purchasingPlan.setCreateName(user.getName());//创建人名称
|
||||||
|
List<ProcurementContent> list = new ArrayList<>();//需要整合的集合
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
|
||||||
|
for (DetailsOfCentralized detailsOfCentralized1 : detailsOfCentralizedAllList) {
|
||||||
|
|
||||||
|
PurchasingPlanDTO purchasingPlanDTO = new PurchasingPlanDTO();
|
||||||
|
BeanUtils.copyProperties(detailsOfCentralized1, purchasingPlanDTO);
|
||||||
|
purchasingPlanDTO.setDetailsOfCentralizedId(detailsOfCentralized1.getId());
|
||||||
|
//将列入计划的集中采购申请状态变为3
|
||||||
|
CentralizedRequest centralizedRequest = requestService.getById(detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId()).getCentralizedRequestId());
|
||||||
|
centralizedRequest.setStatus(3);
|
||||||
|
centralizedRequest.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
|
||||||
|
requestService.updateById(centralizedRequest);
|
||||||
|
|
||||||
|
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());//集中采购申请明细
|
||||||
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId());//试剂耗材信息
|
||||||
|
|
||||||
|
flag = true;
|
||||||
|
//合并相同的采购内容,若存在相同的采购物品,则无需创建计划明细,将采购申请明细与该计划明细关联即可
|
||||||
|
if (list.size() != 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
|
||||||
|
if (list.get(i).getReagentConsumableId().equals(purchasingPlanDTO.getReagentConsumableId())) {
|
||||||
|
|
||||||
|
list.get(i).setUnitPrice(reagentConsumables.getUnitPrice());//获取单价
|
||||||
|
//Set采购数量
|
||||||
|
list.get(i).setQuantityPurchased(list.get(i).getQuantityPurchased() + purchasingPlanDTO.getNumberOfApplications());//合并之前的数量加上被合并对象的数量
|
||||||
|
list.get(i).setSubtotal(list.get(i).getQuantityPurchased() * list.get(i).getUnitPrice());//计算小计
|
||||||
|
|
||||||
|
//添加采购申请明细的采购数量
|
||||||
|
|
||||||
|
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());
|
||||||
|
detailsOfCentralized.setProcurementContentId(list.get(i).getProcurementContentId());
|
||||||
|
detailsOfCentralizedService.updateById(detailsOfCentralized);
|
||||||
|
//被合并后,改变flag,进入下一个循环
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//无需合并的采购计划明细
|
||||||
|
if (flag) {
|
||||||
|
ProcurementContent procurementContent = new ProcurementContent();//新建计划明细
|
||||||
|
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);//拷贝
|
||||||
|
procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
|
||||||
|
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());//关联计划ID
|
||||||
|
procurementContent.setQuantityPurchased(purchasingPlanDTO.getNumberOfApplications());//赋值采购数量
|
||||||
|
detailsOfCentralized.setQuantityPurchased(detailsOfCentralized.getNumberOfApplications());//赋值采购数量
|
||||||
|
procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());//单价
|
||||||
|
procurementContent.setSubtotal(procurementContent.getUnitPrice() * procurementContent.getQuantityPurchased());//小计
|
||||||
|
detailsOfCentralized.setProcurementContentId(procurementContent.getProcurementContentId());//采购申请明细关联采购计划明细
|
||||||
|
|
||||||
|
detailsOfCentralizedService.updateById(detailsOfCentralized);
|
||||||
|
list.add(procurementContent);//将计划明细添加至集合
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {//对于首次循环,List一定为空,故执行下列语句,且只会执行一次
|
||||||
|
ProcurementContent procurementContent = new ProcurementContent();
|
||||||
|
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
|
||||||
|
DetailsOfCentralized byId = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());
|
||||||
|
byId.setQuantityPurchased(byId.getNumberOfApplications());
|
||||||
|
procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
|
||||||
|
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
|
||||||
|
procurementContent.setQuantityPurchased(procurementContent.getNumberOfApplications());
|
||||||
|
procurementContent.setUnitPrice(reagentConsumables.getUnitPrice());
|
||||||
|
procurementContent.setSubtotal(procurementContent.getQuantityPurchased() * procurementContent.getUnitPrice());
|
||||||
|
byId.setProcurementContentId(procurementContent.getProcurementContentId());
|
||||||
|
detailsOfCentralizedService.updateById(byId);
|
||||||
|
list.add(procurementContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.save(purchasingPlan) & procurementContentService.saveBatch(list)) {
|
||||||
|
calculatedAmount(purchasingPlan.getPurchasingPlanId());//计算经费预算
|
||||||
|
PurchasingPlanVO purchasingPlanVO = this.getPurchasingPlanVO(purchasingPlan.getPurchasingPlanId());//获取VO
|
||||||
|
return purchasingPlanVO;
|
||||||
|
} else throw new RuntimeException(String.format("保存失败"));
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override//创建计划
|
@Override//创建计划
|
||||||
public PurchasingPlanVO addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user) {
|
public PurchasingPlanVO addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user) {
|
||||||
@@ -164,19 +264,19 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
|
|||||||
} else throw new RuntimeException(String.format("保存失败"));
|
} else throw new RuntimeException(String.format("保存失败"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override//新增明细
|
@Override//新增明细
|
||||||
// public ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO) {
|
public ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO) {
|
||||||
//
|
|
||||||
// ProcurementContent procurementContent = new ProcurementContent();
|
ProcurementContent procurementContent = new ProcurementContent();
|
||||||
//
|
|
||||||
// BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
|
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
|
||||||
//
|
|
||||||
// if (procurementContentService.save(procurementContent)) {
|
if (procurementContentService.save(procurementContent)) {
|
||||||
// return procurementContent;
|
return procurementContent;
|
||||||
// } else {
|
} else {
|
||||||
// return null;
|
return null;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional//修改采购计划明细(已废弃)
|
@Transactional//修改采购计划明细(已废弃)
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package digital.laboratory.platform.reagent.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrgFullVO {
|
||||||
|
private String orgId;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
private String[] roleIds;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package digital.laboratory.platform.reagent.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrgVO {
|
||||||
|
|
||||||
|
private String areaCode;
|
||||||
|
private String orgId;
|
||||||
|
private String orgType;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
private String[] roleIds;
|
||||||
|
}
|
||||||
@@ -73,8 +73,12 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
|
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
|
||||||
SELECT *
|
SELECT user.name, user.user_id
|
||||||
FROM dlp_base.sys_user user
|
FROM dlp_base.sys_user user ,dlp_base. b_staff s1
|
||||||
|
WHERE s1.user_id = user.user_id
|
||||||
|
<if test="name !=null and name !=''">
|
||||||
|
and user.name like concat('%',#{name},'%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getOrgList" resultType="digital.laboratory.platform.reagent.vo.OrgVO">
|
<select id="getOrgList" resultType="digital.laboratory.platform.reagent.vo.OrgVO">
|
||||||
@@ -82,10 +86,6 @@
|
|||||||
FROM dlp_base.sys_org org
|
FROM dlp_base.sys_org org
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
|
|
||||||
SELECT *
|
|
||||||
FROM dlp_base.sys_user user
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- <sql id="getReferenceMaterialPageSQL">-->
|
<!-- <sql id="getReferenceMaterialPageSQL">-->
|
||||||
<!-- SELECT r1.*, r2.*, b1.*-->
|
<!-- SELECT r1.*, r2.*, b1.*-->
|
||||||
|
|||||||
Reference in New Issue
Block a user