Przeglądaj źródła

[task-3847]子试剂耗材库存管理/【后端】盘点接口联调-出入库处理

szjbdgzl 1 rok temu
rodzic
commit
640e9b984f
44 zmienionych plików z 3091 dodań i 80 usunięć
  1. 19 0
      ibps-base-root/modules/base-cloud/src/main/java/com/lc/ibps/cloud/utils/RequestUtil.java
  2. 82 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/api/ILingYongDetailService.java
  3. 82 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/api/ILingYongService.java
  4. 16 2
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/api/IReagentConsumablesInventoryService.java
  5. 108 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/domain/LingYong.java
  6. 71 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/domain/LingYongDetail.java
  7. 27 7
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/dto/InventoryDTO.java
  8. 24 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/dto/KcDto.java
  9. 26 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/dto/StockDto.java
  10. 16 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongDao.java
  11. 22 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongDetailDao.java
  12. 24 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongDetailQueryDao.java
  13. 16 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongQueryDao.java
  14. 26 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongDaoImpl.java
  15. 29 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongDetailDaoImpl.java
  16. 31 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongDetailQueryDaoImpl.java
  17. 27 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongQueryDaoImpl.java
  18. 35 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongDetailPo.java
  19. 467 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongDetailTbl.java
  20. 51 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongPo.java
  21. 275 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongTbl.java
  22. 72 1
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/ReagentConsumablesInventoryTbl.java
  23. 31 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/ReagentConsumablesTransactionTbl.java
  24. 123 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/provider/LingYongDetailProvider.java
  25. 150 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/provider/LingYongProvider.java
  26. 90 6
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/provider/ReagentConsumablesInventoryProvider.java
  27. 26 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/LingYongDetailRepository.java
  28. 23 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/LingYongRepository.java
  29. 2 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/ReagentConsumablesInventoryRepository.java
  30. 63 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/impl/LingYongDetailRepositoryImpl.java
  31. 79 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/impl/LingYongRepositoryImpl.java
  32. 9 1
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/impl/ReagentConsumablesInventoryRepositoryImpl.java
  33. 231 34
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/InventoryService.java
  34. 21 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/LinYongService.java
  35. 58 1
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/ReturnService.java
  36. 56 5
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/StoreService.java
  37. 122 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/TakeStockService.java
  38. 11 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/untils/StrUtil.java
  39. 112 0
      ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/LingYong.map.xml
  40. 168 0
      ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/LingYongDetail.map.xml
  41. 94 19
      ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/ReagentConsumablesInventory.map.xml
  42. 14 3
      ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/ReagentConsumablesTransaction.map.xml
  43. 36 0
      ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/cloud/timer/job/TakeStockJob.java
  44. 26 1
      ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/cloud/timer/utils/HttpUtil.java

+ 19 - 0
ibps-base-root/modules/base-cloud/src/main/java/com/lc/ibps/cloud/utils/RequestUtil.java

@@ -131,6 +131,25 @@ public class RequestUtil {
 		return str;
 	}
 
+	public static String sqlFilterInject(String str) {
+		if (str == null) {
+			return null;
+		}
+		// 定义需要过滤的关键字
+		String[] injectKeywords = {"exec", "insert", "select", "delete", "update", "count", "chr", "truncate", "char"};
+		// 过滤关键字
+		for (String keyword : injectKeywords) {
+			str = str.replaceAll("(?i)" + keyword, ""); // 忽略大小写
+		}
+		// 转义特殊字符
+		str = str.replace("'", "''");
+		str = str.replace("-", "—");
+		str = str.replace("(", "(");
+		str = str.replace(")", ")");
+		str = str.replace("%", "%");
+		return str;
+	}
+
 	/**
 	 * 从Request中取得指定的小写值
 	 * 

+ 82 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/api/ILingYongDetailService.java

@@ -0,0 +1,82 @@
+package com.lc.ibps.components.reagent.api;
+
+import java.util.List;
+
+import org.hibernate.validator.constraints.NotBlank;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import javax.validation.Valid;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+
+
+/**
+ * 试剂耗材领用子表 接口
+ *
+ *<pre> 
+ * 构建组:ibps-provider-lingYongDetail-api
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:53
+ *</pre>
+ */
+@Validated
+@RequestMapping(value = "/reagent/lingYongDetail")
+@RestController
+public interface ILingYongDetailService {
+
+	/**
+	 * 
+	 * 【试剂耗材领用子表】列表(分页条件查询)数据
+	 *
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/query", method = RequestMethod.POST)
+	public APIResult<APIPageList<LingYongDetailPo>> query(
+			@RequestBody(required = true) APIRequest request);
+	
+	/**
+	 * 
+	 * 根据id查询【试剂耗材领用子表】
+	 *
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/get", method = { RequestMethod.GET })
+	public APIResult<LingYongDetailPo> get(
+//			@NotBlank(message = "{com.lc.ibps.components.provider.LingYongDetailProvider.id}") 
+			@RequestParam(name = "id", required = true) String id);
+	
+	/**
+	 * 
+	 * 批量删除【试剂耗材领用子表】记录
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/remove", method = { RequestMethod.POST })
+	public APIResult<Void> remove(
+//			@NotEmpty(message = "{com.lc.ibps.components.provider.LingYongDetailProvider.ids}")
+			@RequestParam(name = "ids", required = true) String[] ids);
+	
+	/**
+	 * 
+	 * 保存【试剂耗材领用子表】记录
+	 *
+	 * @param lingYongDetailPo
+	 * @return
+	 */
+	@RequestMapping(value = "/save", method = { RequestMethod.POST })
+	public APIResult<Void> save(
+ 			@RequestBody(required = true) @Valid LingYongDetailPo lingYongDetailPo);
+}

+ 82 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/api/ILingYongService.java

@@ -0,0 +1,82 @@
+package com.lc.ibps.components.reagent.api;
+
+import java.util.List;
+
+import org.hibernate.validator.constraints.NotBlank;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import javax.validation.Valid;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+
+
+
+/**
+ * 试剂耗材领用主表 接口
+ *
+ *<pre> 
+ * 构建组:ibps-provider-lingYong-api
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:47
+ *</pre>
+ */
+@Validated
+@RequestMapping(value = "/reagent/lingYong")
+@RestController
+public interface ILingYongService {
+
+	/**
+	 * 
+	 * 【试剂耗材领用主表】列表(分页条件查询)数据
+	 *
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/query", method = RequestMethod.POST)
+	public APIResult<APIPageList<LingYongPo>> query(
+			@RequestBody(required = true) APIRequest request);
+	
+	/**
+	 * 
+	 * 根据id查询【试剂耗材领用主表】
+	 *
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/get", method = { RequestMethod.GET })
+	public APIResult<LingYongPo> get(
+//			@NotBlank(message = "{com.lc.ibps.components.provider.LingYongProvider.id}") 
+			@RequestParam(name = "id", required = true) String id);
+	
+	/**
+	 * 
+	 * 批量删除【试剂耗材领用主表】记录
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/remove", method = { RequestMethod.POST })
+	public APIResult<Void> remove(
+//			@NotEmpty(message = "{com.lc.ibps.components.provider.LingYongProvider.ids}")
+			@RequestParam(name = "ids", required = true) String[] ids);
+	
+	/**
+	 * 
+	 * 保存【试剂耗材领用主表】记录
+	 *
+	 * @param lingYongPo
+	 * @return
+	 */
+	@RequestMapping(value = "/save", method = { RequestMethod.POST })
+	public APIResult<Void> save(
+ 			@RequestBody(required = true) @Valid LingYongPo lingYongPo);
+}

+ 16 - 2
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/api/IReagentConsumablesInventoryService.java

@@ -1,9 +1,9 @@
 package com.lc.ibps.components.reagent.api;
 
 import java.util.List;
+import java.util.Map;
 
-import org.hibernate.validator.constraints.NotBlank;
-import org.hibernate.validator.constraints.NotEmpty;
+import com.lc.ibps.components.reagent.dto.StockDto;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -85,5 +85,19 @@ public interface IReagentConsumablesInventoryService {
 			@RequestParam(name = "id", required = true) String id,
 			@RequestParam(name = "action", required = true) String action);
 
+	@RequestMapping(value = "/updateStock", method = { RequestMethod.POST })
+	public APIResult<Void> updateStock(@RequestBody StockDto stockDto);
+
+	@RequestMapping(value = "/issue", method = { RequestMethod.POST })
+	public APIResult<Void> issue(
+			@RequestParam(name = "id", required = true) String id,
+			@RequestParam(name = "type", required = true) String type,
+			@RequestParam(name = "status", required = false) String status);
+
+	@RequestMapping(value = "/takeStock", method = { RequestMethod.POST })
+	public APIResult<List<Map<String,Object>>> takeStock(
+			@RequestParam(name = "ckId", required = false) String ckId,
+			@RequestParam(name = "date", required = false) String date,
+			@RequestParam(name = "type", required = false) String type);
 
 }

+ 108 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/domain/LingYong.java

@@ -0,0 +1,108 @@
+package com.lc.ibps.components.reagent.domain;
+
+
+import javax.annotation.Resource;
+
+import org.springframework.context.annotation.Scope;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.stereotype.Service;
+
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.core.util.string.StringUtil;
+import com.lc.ibps.base.core.util.AppUtil;
+import com.lc.ibps.base.framework.domain.AbstractDomain;
+import com.lc.ibps.base.framework.persistence.dao.IDao;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDao;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongQueryDao;
+import com.lc.ibps.components.reagent.repository.LingYongRepository;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+import com.lc.ibps.components.reagent.repository.LingYongDetailRepository;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用主表 领域对象实体
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:46
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@Service
+@Transactional
+@Scope("prototype")
+public class LingYong extends AbstractDomain<String, LingYongPo>{
+	
+	@Resource
+	private LingYongDao lingYongDao;
+	@Resource
+	private LingYongQueryDao lingYongQueryDao;
+	@Resource
+	private LingYongRepository lingYongRepository;
+
+	@Resource
+	private LingYongDetailRepository lingYongDetailRepository;
+
+	protected void init(){
+		//
+	}
+	
+	@Override
+	protected IQueryDao<String, LingYongPo> getInternalQueryDao() {
+		return lingYongQueryDao;
+	}
+	
+	@Override
+	protected IDao<String, LingYongPo> getInternalDao() {
+		return lingYongDao;
+	}
+	
+	@Override
+	public String getInternalCacheName() {
+		return "lingYong";
+	}
+	
+	/**
+	 * 主从表一并保存 
+	 * void
+	 * @exception 
+	 * @since  1.0.0
+	 */
+	public void saveCascade(){
+		save();
+		if(getData().isDelBeforeSave()){
+			LingYongDetail lingYongDetail = lingYongDetailRepository.newInstance();
+			lingYongDetail.deleteByMainId(getData().getId());
+		}
+		
+		LingYongDetail lingYongDetail = lingYongDetailRepository.newInstance();
+		if(BeanUtils.isNotEmpty(getData().getLingYongDetailPoList())){
+			for(LingYongDetailPo lingYongDetailPo:getData().getLingYongDetailPoList()){
+				//设置外键
+				lingYongDetailPo.setParentId(getData().getId());
+				lingYongDetail.save(lingYongDetailPo);
+			}
+		}
+	}	
+	
+	/**
+	 * 主从表一并删除 
+	 * void
+	 * @exception 
+	 * @since  1.0.0
+	 */
+	public void deleteByIdsCascade(String[] ids){
+		for(String id : ids){
+			LingYongPo po = lingYongRepository.get(id);
+			LingYongDetail lingYongDetail = lingYongDetailRepository.newInstance();
+			if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
+				lingYongDetail.deleteByMainId(po.getId());
+			}	
+		}
+		deleteByIds(ids);
+	}
+	
+	
+}

+ 71 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/domain/LingYongDetail.java

@@ -0,0 +1,71 @@
+package com.lc.ibps.components.reagent.domain;
+
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.context.annotation.Scope;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.stereotype.Service;
+
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.core.util.AppUtil;
+import com.lc.ibps.base.framework.domain.AbstractDomain;
+import com.lc.ibps.base.framework.persistence.dao.IDao;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDetailDao;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDetailQueryDao;
+import com.lc.ibps.components.reagent.repository.LingYongDetailRepository;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用子表 领域对象实体
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:53
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@Service
+@Transactional
+@Scope("prototype")
+public class LingYongDetail extends AbstractDomain<String, LingYongDetailPo>{
+	
+	@Resource
+	private LingYongDetailDao lingYongDetailDao;
+	@Resource
+	private LingYongDetailQueryDao lingYongDetailQueryDao;
+	@Resource
+	private LingYongDetailRepository lingYongDetailRepository;
+
+
+	protected void init(){
+		//
+	}
+	
+	@Override
+	protected IQueryDao<String, LingYongDetailPo> getInternalQueryDao() {
+		return lingYongDetailQueryDao;
+	}
+	
+	@Override
+	protected IDao<String, LingYongDetailPo> getInternalDao() {
+		return lingYongDetailDao;
+	}
+	
+	@Override
+	public String getInternalCacheName() {
+		return "lingYongDetail";
+	}
+	
+	
+	public void deleteByMainId(String mainId) {
+		List<LingYongDetailPo> list = lingYongDetailRepository.findByMainId(mainId);
+		for (LingYongDetailPo po : list) {
+			delete(po.getId());
+		}
+	}
+	
+}

+ 27 - 7
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/dto/InventoryDTO.java

@@ -1,11 +1,9 @@
 package com.lc.ibps.components.reagent.dto;
 
 import com.lc.ibps.base.core.util.Collections;
-import com.lc.ibps.business.dto.EquipIntactDTO;
-import com.lc.ibps.components.reagent.domain.ReagentConsumablesInventory;
-import com.lc.ibps.components.reagent.domain.ReagentConsumablesTransaction;
 import com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesInventoryPo;
 import com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesTransactionPo;
+import com.lc.ibps.untils.StrUtil;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -14,8 +12,8 @@ import java.util.Map;
 
 public class InventoryDTO {
 
-    private ReagentConsumablesInventoryPo inventory;
-    private ReagentConsumablesTransactionPo transaction;
+    private ReagentConsumablesInventoryPo inventory;// 库存表
+    private ReagentConsumablesTransactionPo transaction; // 台账表
 
     public InventoryDTO() {
         this.inventory = new ReagentConsumablesInventoryPo();
@@ -50,6 +48,11 @@ public class InventoryDTO {
                 Object createBy = data.get("createBy");
                 Object inventoryId = data.get("inventoryId");
                 Object diDian = data.get("diDian");
+                Object zui_di_ku_cun_ = data.get("zui_di_ku_cun_");
+                Object cang_ku_ = data.get("cang_ku_");
+                Object pi_hao_ = data.get("pi_hao_");
+                Object gui_ge_ = data.get("gui_ge_");
+                Object dao_huo_ri_qi_ = data.get("dao_huo_ri_qi_");
 
 //                Object createTime = data.get("createTime");
                 if(expDate !=null){
@@ -65,8 +68,8 @@ public class InventoryDTO {
                     iv.getTransaction().setReagentCode(reagentCode.toString());
                 }
                 if(quantity !=null){
-                    iv.getInventory().setQuantity(Long.parseLong(quantity.toString()) );
-                    iv.getTransaction().setQuantity(Long.parseLong(quantity.toString()));
+                    iv.getInventory().setQuantity(StrUtil.parseLongSafe(quantity) );
+                    iv.getTransaction().setQuantity(StrUtil.parseLongSafe(quantity));
                 }
                 if(boId !=null){
                     iv.getTransaction().setBoId(boId.toString());
@@ -85,6 +88,23 @@ public class InventoryDTO {
                 if(inventoryId !=null){
                     iv.getInventory().setId(inventoryId.toString());
                 }
+                if(zui_di_ku_cun_ !=null){
+                    iv.getInventory().setMinStock(StrUtil.parseLongSafe(zui_di_ku_cun_));
+                }
+                if(cang_ku_ !=null){
+                    iv.getInventory().setPosition(cang_ku_.toString());
+                    iv.getTransaction().setPosition(cang_ku_.toString());
+                }
+                if (pi_hao_ != null){
+                    iv.getInventory().setBatchNum(pi_hao_.toString());
+                    iv.getTransaction().setBatchNum(pi_hao_.toString());
+                }
+                if (gui_ge_ != null){
+                    iv.getInventory().setGuiGe(gui_ge_.toString());
+                }
+                if (dao_huo_ri_qi_ != null){
+                    iv.getInventory().setArrivalDate(dao_huo_ri_qi_.toString());
+                }
                 iv.getTransaction().setType((Long)data.get("type_"));
                 list.add(iv);
             }

+ 24 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/dto/KcDto.java

@@ -0,0 +1,24 @@
+package com.lc.ibps.components.reagent.dto;
+
+public class KcDto {
+
+    private String id;
+
+    private Long quantity;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Long getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(Long quantity) {
+        this.quantity = quantity;
+    }
+}

+ 26 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/dto/StockDto.java

@@ -0,0 +1,26 @@
+package com.lc.ibps.components.reagent.dto;
+
+import java.util.List;
+
+public class StockDto {
+
+    private String type;// 操作类型(只更新库存(库存编辑)-only,更新库存和冻结状态(盘点完成)-both)
+
+    private List<KcDto> kcList;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public List<KcDto> getKcList() {
+        return kcList;
+    }
+
+    public void setKcList(List<KcDto> kcList) {
+        this.kcList = kcList;
+    }
+}

+ 16 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongDao.java

@@ -0,0 +1,16 @@
+package com.lc.ibps.components.reagent.persistence.dao;
+
+import com.lc.ibps.base.framework.persistence.dao.IDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+
+/**
+ * 试剂耗材领用主表 Dao接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:45
+ *</pre>
+ */
+public interface LingYongDao extends IDao<String, LingYongPo> {
+}

+ 22 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongDetailDao.java

@@ -0,0 +1,22 @@
+package com.lc.ibps.components.reagent.persistence.dao;
+
+import com.lc.ibps.base.framework.persistence.dao.IDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用子表 Dao接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:51
+ *</pre>
+ */
+public interface LingYongDetailDao extends IDao<String, LingYongDetailPo> {
+	/**
+	 * 根据主表id删除 试剂耗材领用子表 记录
+	 * @param mainId 
+	 * void
+	 */
+	public void deleteByMainId(String mainId);
+}

+ 24 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongDetailQueryDao.java

@@ -0,0 +1,24 @@
+package com.lc.ibps.components.reagent.persistence.dao;
+
+import java.util.List;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用子表 查询Dao接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:51
+ *</pre>
+ */
+public interface LingYongDetailQueryDao extends IQueryDao<String, LingYongDetailPo> {
+	/**
+	 * 根据主表ID查询 试剂耗材领用子表 列表
+	 * @param mainId
+	 * @return 
+	 * List<LingYongDetailPo>
+	 */
+	public List<LingYongDetailPo> findByMainId(String mainId);
+}

+ 16 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/LingYongQueryDao.java

@@ -0,0 +1,16 @@
+package com.lc.ibps.components.reagent.persistence.dao;
+
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+
+/**
+ * 试剂耗材领用主表 查询Dao接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:44
+ *</pre>
+ */
+public interface LingYongQueryDao extends IQueryDao<String, LingYongPo> {
+}

+ 26 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongDaoImpl.java

@@ -0,0 +1,26 @@
+package com.lc.ibps.components.reagent.persistence.dao.impl;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.db.ddd.dao.MyBatisDaoImpl;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+
+/**
+ * 试剂耗材领用主表 Dao接口的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:45
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@Repository
+public class LingYongDaoImpl extends MyBatisDaoImpl<String, LingYongPo> implements LingYongDao{
+
+    @Override
+    public String getNamespace() {
+        return LingYongPo.class.getName();
+    }
+}

+ 29 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongDetailDaoImpl.java

@@ -0,0 +1,29 @@
+package com.lc.ibps.components.reagent.persistence.dao.impl;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.db.ddd.dao.MyBatisDaoImpl;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDetailDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用子表 Dao接口的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:51
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@Repository
+public class LingYongDetailDaoImpl extends MyBatisDaoImpl<String, LingYongDetailPo> implements LingYongDetailDao{
+
+    @Override
+    public String getNamespace() {
+        return LingYongDetailPo.class.getName();
+    }
+	public void deleteByMainId(String mainId) {
+		deleteByKey("deleteByMainId", b().a("mainId", mainId).p());		
+	}
+}

+ 31 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongDetailQueryDaoImpl.java

@@ -0,0 +1,31 @@
+package com.lc.ibps.components.reagent.persistence.dao.impl;
+
+import java.util.List;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.db.ddd.dao.MyBatisQueryDaoImpl;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDetailQueryDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ *试剂耗材领用子表 查询Dao的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:51
+ *</pre>
+ */
+ @SuppressWarnings("serial")
+@Repository
+public class LingYongDetailQueryDaoImpl extends MyBatisQueryDaoImpl<String, LingYongDetailPo> implements LingYongDetailQueryDao{
+
+    @Override
+    public String getNamespace() {
+        return LingYongDetailPo.class.getName();
+    }
+	public List<LingYongDetailPo> findByMainId(String mainId) {
+		return findByKey("findByMainId", b().a("mainId", mainId).p());
+	}
+}

+ 27 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/dao/impl/LingYongQueryDaoImpl.java

@@ -0,0 +1,27 @@
+package com.lc.ibps.components.reagent.persistence.dao.impl;
+
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.db.ddd.dao.MyBatisQueryDaoImpl;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongQueryDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+
+/**
+ *试剂耗材领用主表 查询Dao的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:44
+ *</pre>
+ */
+ @SuppressWarnings("serial")
+@Repository
+public class LingYongQueryDaoImpl extends MyBatisQueryDaoImpl<String, LingYongPo> implements LingYongQueryDao{
+
+    @Override
+    public String getNamespace() {
+        return LingYongPo.class.getName();
+    }
+}

+ 35 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongDetailPo.java

@@ -0,0 +1,35 @@
+package com.lc.ibps.components.reagent.persistence.entity;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import com.lc.ibps.base.core.util.JacksonUtil;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 试剂耗材领用子表 实体对象
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:50
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "试剂耗材领用子表对象")
+public class LingYongDetailPo extends LingYongDetailTbl{
+
+	public static LingYongDetailPo fromJsonString(String data){
+		if(JacksonUtil.isNotJsonObject(data)){
+			return null;
+		}
+		return JacksonUtil.getDTO(data, LingYongDetailPo.class);
+	}
+	
+	public static List<LingYongDetailPo> fromJsonArrayString(String listData){
+		if(JacksonUtil.isNotJsonArray(listData)){
+			return Collections.emptyList();
+		}
+		return JacksonUtil.getDTOList(listData, LingYongDetailPo.class);
+	}
+}

+ 467 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongDetailTbl.java

@@ -0,0 +1,467 @@
+package com.lc.ibps.components.reagent.persistence.entity;
+
+import java.util.Date;
+
+import com.lc.ibps.base.framework.persistence.entity.AbstractPo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 试剂耗材领用子表 表对象
+ * 
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:50
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "试剂耗材领用子表对象")
+public class LingYongDetailTbl extends AbstractPo<String>{
+	@ApiModelProperty(value = "主键")
+	protected String  id; 		/*主键*/
+	@ApiModelProperty(value = "外键")
+	protected String  parentId; 		/*外键*/
+	@ApiModelProperty(value = "租户ID")
+	protected String  tenantId; 		/*租户ID*/
+	@ApiModelProperty(value = "IP地址")
+	protected String  ip; 		/*IP地址*/
+	@ApiModelProperty(value = "是否过审")
+	protected String  shiFouGuoShen; 		/*是否过审*/
+	@ApiModelProperty(value = "地点")
+	protected String  diDian; 		/*地点*/
+	@ApiModelProperty(value = "编制人")
+	protected String  bianZhiRen; 		/*编制人*/
+	@ApiModelProperty(value = "编制部门")
+	protected String  bianZhiBuMen; 		/*编制部门*/
+	@ApiModelProperty(value = "编制时间")
+	protected String  bianZhiShiJian; 		/*编制时间*/
+	@ApiModelProperty(value = "快照")
+	protected String  kuaiZhao; 		/*快照*/
+	@ApiModelProperty(value = "试剂名称")
+	protected String  shiJiMingCheng; 		/*试剂名称*/
+	@ApiModelProperty(value = "规格")
+	protected String  guiGe; 		/*规格*/
+	@ApiModelProperty(value = "单位")
+	protected String  danWei; 		/*单位*/
+	@ApiModelProperty(value = "生产厂家")
+	protected String  sCChangJia; 		/*生产厂家*/
+	@ApiModelProperty(value = "发货时间")
+	protected String  faHuoShiJian; 		/*发货时间*/
+	@ApiModelProperty(value = "入库编号")
+	protected String  ruKuBianHao; 		/*入库编号*/
+	@ApiModelProperty(value = "编码")
+	protected String  bianMa; 		/*编码*/
+	@ApiModelProperty(value = "批号")
+	protected String  piHao; 		/*批号*/
+	@ApiModelProperty(value = "有效期")
+	protected String  youXiaoQi; 		/*有效期*/
+	@ApiModelProperty(value = "库存ID")
+	protected String  inventoryId; 		/*库存ID*/
+	@ApiModelProperty(value = "存储位置")
+	protected String  cunChuWeiZhi; 		/*存储位置*/
+	@ApiModelProperty(value = "存储条件")
+	protected String  cunChuTiaoJian; 		/*存储条件*/
+	@ApiModelProperty(value = "验证状态")
+	protected String  zhuangTai; 		/*验证状态*/
+	@ApiModelProperty(value = "经手人")
+	protected String  jingShouRen; 		/*经手人*/
+	@ApiModelProperty(value = "备注")
+	protected String  beiZhu; 		/*备注*/
+	@ApiModelProperty(value = "领用日期")
+	protected String  lingYongRiQi; 		/*领用日期*/
+	@ApiModelProperty(value = "数量")
+	protected String  shuLiang; 		/*数量*/
+	@ApiModelProperty(value = "类别")
+	protected String  leiBie; 		/*类别*/
+	@ApiModelProperty(value = "库存量")
+	protected String  kuCunLiang; 		/*库存量*/
+	@ApiModelProperty(value = "经手人2")
+	protected String  jingShouRen2; 		/*经手人2*/
+	@ApiModelProperty(value = "仓库id")
+	protected String  cangKuId; 		/*仓库id*/
+	@ApiModelProperty(value = "台账id")
+	protected String  taiZhangId; 		/*台账id*/
+
+	public String getTaiZhangId() {
+		return taiZhangId;
+	}
+
+	public void setTaiZhangId(String taiZhangId) {
+		this.taiZhangId = taiZhangId;
+	}
+
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+	/**
+	 * 返回 主键
+	 * @return
+	 */
+	public String getId() 
+	{
+		return this.id;
+	}
+	public void setParentId(String parentId) 
+	{
+		this.parentId = parentId;
+	}
+	/**
+	 * 返回 外键
+	 * @return
+	 */
+	public String getParentId() 
+	{
+		return this.parentId;
+	}
+	public void setTenantId(String tenantId) 
+	{
+		this.tenantId = tenantId;
+	}
+	/**
+	 * 返回 租户ID
+	 * @return
+	 */
+	public String getTenantId() 
+	{
+		return this.tenantId;
+	}
+	public void setIp(String ip) 
+	{
+		this.ip = ip;
+	}
+	/**
+	 * 返回 IP地址
+	 * @return
+	 */
+	public String getIp() 
+	{
+		return this.ip;
+	}
+	public void setShiFouGuoShen(String shiFouGuoShen) 
+	{
+		this.shiFouGuoShen = shiFouGuoShen;
+	}
+	/**
+	 * 返回 是否过审
+	 * @return
+	 */
+	public String getShiFouGuoShen() 
+	{
+		return this.shiFouGuoShen;
+	}
+	public void setDiDian(String diDian) 
+	{
+		this.diDian = diDian;
+	}
+	/**
+	 * 返回 地点
+	 * @return
+	 */
+	public String getDiDian() 
+	{
+		return this.diDian;
+	}
+	public void setBianZhiRen(String bianZhiRen) 
+	{
+		this.bianZhiRen = bianZhiRen;
+	}
+	/**
+	 * 返回 编制人
+	 * @return
+	 */
+	public String getBianZhiRen() 
+	{
+		return this.bianZhiRen;
+	}
+	public void setBianZhiBuMen(String bianZhiBuMen) 
+	{
+		this.bianZhiBuMen = bianZhiBuMen;
+	}
+	/**
+	 * 返回 编制部门
+	 * @return
+	 */
+	public String getBianZhiBuMen() 
+	{
+		return this.bianZhiBuMen;
+	}
+	public void setBianZhiShiJian(String bianZhiShiJian) 
+	{
+		this.bianZhiShiJian = bianZhiShiJian;
+	}
+	/**
+	 * 返回 编制时间
+	 * @return
+	 */
+	public String getBianZhiShiJian() 
+	{
+		return this.bianZhiShiJian;
+	}
+	public void setKuaiZhao(String kuaiZhao) 
+	{
+		this.kuaiZhao = kuaiZhao;
+	}
+	/**
+	 * 返回 快照
+	 * @return
+	 */
+	public String getKuaiZhao() 
+	{
+		return this.kuaiZhao;
+	}
+	public void setShiJiMingCheng(String shiJiMingCheng) 
+	{
+		this.shiJiMingCheng = shiJiMingCheng;
+	}
+	/**
+	 * 返回 试剂名称
+	 * @return
+	 */
+	public String getShiJiMingCheng() 
+	{
+		return this.shiJiMingCheng;
+	}
+	public void setGuiGe(String guiGe) 
+	{
+		this.guiGe = guiGe;
+	}
+	/**
+	 * 返回 规格
+	 * @return
+	 */
+	public String getGuiGe() 
+	{
+		return this.guiGe;
+	}
+	public void setDanWei(String danWei) 
+	{
+		this.danWei = danWei;
+	}
+	/**
+	 * 返回 单位
+	 * @return
+	 */
+	public String getDanWei() 
+	{
+		return this.danWei;
+	}
+	public void setSCChangJia(String sCChangJia) 
+	{
+		this.sCChangJia = sCChangJia;
+	}
+	/**
+	 * 返回 生产厂家
+	 * @return
+	 */
+	public String getSCChangJia() 
+	{
+		return this.sCChangJia;
+	}
+	public void setFaHuoShiJian(String faHuoShiJian) 
+	{
+		this.faHuoShiJian = faHuoShiJian;
+	}
+	/**
+	 * 返回 发货时间
+	 * @return
+	 */
+	public String getFaHuoShiJian() 
+	{
+		return this.faHuoShiJian;
+	}
+	public void setRuKuBianHao(String ruKuBianHao) 
+	{
+		this.ruKuBianHao = ruKuBianHao;
+	}
+	/**
+	 * 返回 入库编号
+	 * @return
+	 */
+	public String getRuKuBianHao() 
+	{
+		return this.ruKuBianHao;
+	}
+	public void setBianMa(String bianMa) 
+	{
+		this.bianMa = bianMa;
+	}
+	/**
+	 * 返回 编码
+	 * @return
+	 */
+	public String getBianMa() 
+	{
+		return this.bianMa;
+	}
+	public void setPiHao(String piHao) 
+	{
+		this.piHao = piHao;
+	}
+	/**
+	 * 返回 批号
+	 * @return
+	 */
+	public String getPiHao() 
+	{
+		return this.piHao;
+	}
+	public void setYouXiaoQi(String youXiaoQi) 
+	{
+		this.youXiaoQi = youXiaoQi;
+	}
+	/**
+	 * 返回 有效期
+	 * @return
+	 */
+	public String getYouXiaoQi() 
+	{
+		return this.youXiaoQi;
+	}
+	public void setInventoryId(String inventoryId) 
+	{
+		this.inventoryId = inventoryId;
+	}
+	/**
+	 * 返回 库存ID
+	 * @return
+	 */
+	public String getInventoryId() 
+	{
+		return this.inventoryId;
+	}
+	public void setCunChuWeiZhi(String cunChuWeiZhi) 
+	{
+		this.cunChuWeiZhi = cunChuWeiZhi;
+	}
+	/**
+	 * 返回 存储位置
+	 * @return
+	 */
+	public String getCunChuWeiZhi() 
+	{
+		return this.cunChuWeiZhi;
+	}
+	public void setCunChuTiaoJian(String cunChuTiaoJian) 
+	{
+		this.cunChuTiaoJian = cunChuTiaoJian;
+	}
+	/**
+	 * 返回 存储条件
+	 * @return
+	 */
+	public String getCunChuTiaoJian() 
+	{
+		return this.cunChuTiaoJian;
+	}
+	public void setZhuangTai(String zhuangTai) 
+	{
+		this.zhuangTai = zhuangTai;
+	}
+	/**
+	 * 返回 验证状态
+	 * @return
+	 */
+	public String getZhuangTai() 
+	{
+		return this.zhuangTai;
+	}
+	public void setJingShouRen(String jingShouRen) 
+	{
+		this.jingShouRen = jingShouRen;
+	}
+	/**
+	 * 返回 经手人
+	 * @return
+	 */
+	public String getJingShouRen() 
+	{
+		return this.jingShouRen;
+	}
+	public void setBeiZhu(String beiZhu) 
+	{
+		this.beiZhu = beiZhu;
+	}
+	/**
+	 * 返回 备注
+	 * @return
+	 */
+	public String getBeiZhu() 
+	{
+		return this.beiZhu;
+	}
+	public void setLingYongRiQi(String lingYongRiQi) 
+	{
+		this.lingYongRiQi = lingYongRiQi;
+	}
+	/**
+	 * 返回 领用日期
+	 * @return
+	 */
+	public String getLingYongRiQi() 
+	{
+		return this.lingYongRiQi;
+	}
+	public void setShuLiang(String shuLiang) 
+	{
+		this.shuLiang = shuLiang;
+	}
+	/**
+	 * 返回 数量
+	 * @return
+	 */
+	public String getShuLiang() 
+	{
+		return this.shuLiang;
+	}
+	public void setLeiBie(String leiBie) 
+	{
+		this.leiBie = leiBie;
+	}
+	/**
+	 * 返回 类别
+	 * @return
+	 */
+	public String getLeiBie() 
+	{
+		return this.leiBie;
+	}
+	public void setKuCunLiang(String kuCunLiang) 
+	{
+		this.kuCunLiang = kuCunLiang;
+	}
+	/**
+	 * 返回 库存量
+	 * @return
+	 */
+	public String getKuCunLiang() 
+	{
+		return this.kuCunLiang;
+	}
+	public void setJingShouRen2(String jingShouRen2) 
+	{
+		this.jingShouRen2 = jingShouRen2;
+	}
+	/**
+	 * 返回 经手人2
+	 * @return
+	 */
+	public String getJingShouRen2() 
+	{
+		return this.jingShouRen2;
+	}
+	public void setCangKuId(String cangKuId) 
+	{
+		this.cangKuId = cangKuId;
+	}
+	/**
+	 * 返回 仓库id
+	 * @return
+	 */
+	public String getCangKuId() 
+	{
+		return this.cangKuId;
+	}
+	
+}

+ 51 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongPo.java

@@ -0,0 +1,51 @@
+package com.lc.ibps.components.reagent.persistence.entity;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import com.lc.ibps.base.core.util.JacksonUtil;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 试剂耗材领用主表 实体对象
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:44
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "试剂耗材领用主表对象")
+public class LingYongPo extends LingYongTbl{
+	private boolean delBeforeSave = true;
+	public boolean isDelBeforeSave() {
+		return delBeforeSave;
+	}
+	public void setDelBeforeSave(boolean delBeforeSave) {
+		this.delBeforeSave = delBeforeSave;
+	}	
+	
+	private List<LingYongDetailPo> lingYongDetailPoList = new ArrayList<LingYongDetailPo>();
+	public List<LingYongDetailPo> getLingYongDetailPoList() {
+		return lingYongDetailPoList;
+	}
+	public void setLingYongDetailPoList(List<LingYongDetailPo> lingYongDetailPoList) {
+		this.lingYongDetailPoList = lingYongDetailPoList;
+	}
+
+	public static LingYongPo fromJsonString(String data){
+		if(JacksonUtil.isNotJsonObject(data)){
+			return null;
+		}
+		return JacksonUtil.getDTO(data, LingYongPo.class);
+	}
+	
+	public static List<LingYongPo> fromJsonArrayString(String listData){
+		if(JacksonUtil.isNotJsonArray(listData)){
+			return Collections.emptyList();
+		}
+		return JacksonUtil.getDTOList(listData, LingYongPo.class);
+	}
+}

+ 275 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/LingYongTbl.java

@@ -0,0 +1,275 @@
+package com.lc.ibps.components.reagent.persistence.entity;
+
+import java.util.Date;
+
+import com.lc.ibps.base.framework.persistence.entity.AbstractPo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 试剂耗材领用主表 表对象
+ * 
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:44
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "试剂耗材领用主表对象")
+public class LingYongTbl extends AbstractPo<String>{
+	@ApiModelProperty(value = "主键")
+	protected String  id; 		/*主键*/
+	@ApiModelProperty(value = "租户ID")
+	protected String  tenantId; 		/*租户ID*/
+	@ApiModelProperty(value = "IP地址")
+	protected String  ip; 		/*IP地址*/
+	@ApiModelProperty(value = "是否过审")
+	protected String  shiFouGuoShen; 		/*是否过审*/
+	@ApiModelProperty(value = "地点")
+	protected String  diDian; 		/*地点*/
+	@ApiModelProperty(value = "编制人")
+	protected String  bianZhiRen; 		/*编制人*/
+	@ApiModelProperty(value = "编制部门")
+	protected String  bianZhiBuMen; 		/*编制部门*/
+	@ApiModelProperty(value = "编制时间")
+	protected String  bianZhiShiJian; 		/*编制时间*/
+	@ApiModelProperty(value = "快照")
+	protected String  kuaiZhao; 		/*快照*/
+	@ApiModelProperty(value = "编号")
+	protected String  bianHao; 		/*编号*/
+	@ApiModelProperty(value = "领用试剂耗材")
+	protected String  lYShiJiHaoCa; 		/*领用试剂耗材*/
+	@ApiModelProperty(value = "试剂耗材名称")
+	protected String  sJHCMC; 		/*试剂耗材名称*/
+	@ApiModelProperty(value = "领用日期")
+	protected String  lingYongRiQi; 		/*领用日期*/
+	@ApiModelProperty(value = "经手人")
+	protected String  jingShouRen; 		/*经手人*/
+	@ApiModelProperty(value = "备注")
+	protected String  beiZhu; 		/*备注*/
+	@ApiModelProperty(value = "领用方式")
+	protected String  lingYongFangSh; 		/*领用方式*/
+	@ApiModelProperty(value = "位置领用")
+	protected String  weiZhiLingYong; 		/*位置领用*/
+	@ApiModelProperty(value = "经手人2")
+	protected String  jingShouRen2; 		/*经手人2*/
+
+	public void setId(String id) 
+	{
+		this.id = id;
+	}
+	/**
+	 * 返回 主键
+	 * @return
+	 */
+	public String getId() 
+	{
+		return this.id;
+	}
+	public void setTenantId(String tenantId) 
+	{
+		this.tenantId = tenantId;
+	}
+	/**
+	 * 返回 租户ID
+	 * @return
+	 */
+	public String getTenantId() 
+	{
+		return this.tenantId;
+	}
+	public void setIp(String ip) 
+	{
+		this.ip = ip;
+	}
+	/**
+	 * 返回 IP地址
+	 * @return
+	 */
+	public String getIp() 
+	{
+		return this.ip;
+	}
+	public void setShiFouGuoShen(String shiFouGuoShen) 
+	{
+		this.shiFouGuoShen = shiFouGuoShen;
+	}
+	/**
+	 * 返回 是否过审
+	 * @return
+	 */
+	public String getShiFouGuoShen() 
+	{
+		return this.shiFouGuoShen;
+	}
+	public void setDiDian(String diDian) 
+	{
+		this.diDian = diDian;
+	}
+	/**
+	 * 返回 地点
+	 * @return
+	 */
+	public String getDiDian() 
+	{
+		return this.diDian;
+	}
+	public void setBianZhiRen(String bianZhiRen) 
+	{
+		this.bianZhiRen = bianZhiRen;
+	}
+	/**
+	 * 返回 编制人
+	 * @return
+	 */
+	public String getBianZhiRen() 
+	{
+		return this.bianZhiRen;
+	}
+	public void setBianZhiBuMen(String bianZhiBuMen) 
+	{
+		this.bianZhiBuMen = bianZhiBuMen;
+	}
+	/**
+	 * 返回 编制部门
+	 * @return
+	 */
+	public String getBianZhiBuMen() 
+	{
+		return this.bianZhiBuMen;
+	}
+	public void setBianZhiShiJian(String bianZhiShiJian) 
+	{
+		this.bianZhiShiJian = bianZhiShiJian;
+	}
+	/**
+	 * 返回 编制时间
+	 * @return
+	 */
+	public String getBianZhiShiJian() 
+	{
+		return this.bianZhiShiJian;
+	}
+	public void setKuaiZhao(String kuaiZhao) 
+	{
+		this.kuaiZhao = kuaiZhao;
+	}
+	/**
+	 * 返回 快照
+	 * @return
+	 */
+	public String getKuaiZhao() 
+	{
+		return this.kuaiZhao;
+	}
+	public void setBianHao(String bianHao) 
+	{
+		this.bianHao = bianHao;
+	}
+	/**
+	 * 返回 编号
+	 * @return
+	 */
+	public String getBianHao() 
+	{
+		return this.bianHao;
+	}
+	public void setLYShiJiHaoCa(String lYShiJiHaoCa) 
+	{
+		this.lYShiJiHaoCa = lYShiJiHaoCa;
+	}
+	/**
+	 * 返回 领用试剂耗材
+	 * @return
+	 */
+	public String getLYShiJiHaoCa() 
+	{
+		return this.lYShiJiHaoCa;
+	}
+	public void setSJHCMC(String sJHCMC) 
+	{
+		this.sJHCMC = sJHCMC;
+	}
+	/**
+	 * 返回 试剂耗材名称
+	 * @return
+	 */
+	public String getSJHCMC() 
+	{
+		return this.sJHCMC;
+	}
+	public void setLingYongRiQi(String lingYongRiQi) 
+	{
+		this.lingYongRiQi = lingYongRiQi;
+	}
+	/**
+	 * 返回 领用日期
+	 * @return
+	 */
+	public String getLingYongRiQi() 
+	{
+		return this.lingYongRiQi;
+	}
+	public void setJingShouRen(String jingShouRen) 
+	{
+		this.jingShouRen = jingShouRen;
+	}
+	/**
+	 * 返回 经手人
+	 * @return
+	 */
+	public String getJingShouRen() 
+	{
+		return this.jingShouRen;
+	}
+	public void setBeiZhu(String beiZhu) 
+	{
+		this.beiZhu = beiZhu;
+	}
+	/**
+	 * 返回 备注
+	 * @return
+	 */
+	public String getBeiZhu() 
+	{
+		return this.beiZhu;
+	}
+	public void setLingYongFangSh(String lingYongFangSh) 
+	{
+		this.lingYongFangSh = lingYongFangSh;
+	}
+	/**
+	 * 返回 领用方式
+	 * @return
+	 */
+	public String getLingYongFangSh() 
+	{
+		return this.lingYongFangSh;
+	}
+	public void setWeiZhiLingYong(String weiZhiLingYong) 
+	{
+		this.weiZhiLingYong = weiZhiLingYong;
+	}
+	/**
+	 * 返回 位置领用
+	 * @return
+	 */
+	public String getWeiZhiLingYong() 
+	{
+		return this.weiZhiLingYong;
+	}
+	public void setJingShouRen2(String jingShouRen2) 
+	{
+		this.jingShouRen2 = jingShouRen2;
+	}
+	/**
+	 * 返回 经手人2
+	 * @return
+	 */
+	public String getJingShouRen2() 
+	{
+		return this.jingShouRen2;
+	}
+	
+}

+ 72 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/ReagentConsumablesInventoryTbl.java

@@ -40,7 +40,54 @@ public class ReagentConsumablesInventoryTbl extends AbstractPo<String>{
 	protected String  position; 		/*存放位置*/
 	@ApiModelProperty(value = "地点")
 	protected String  diDian; 		/*地点*/
-	public void setId(String id) 
+	@ApiModelProperty(value = "最低库存量")
+	protected Long  minStock; 		/*最低库存量*/
+	@ApiModelProperty(value = "库存预警")
+	protected String  stockWarn; 		/*库存预警*/
+	@ApiModelProperty(value = "是否可用")
+	protected String  enable; 		/*是否可用*/
+	@ApiModelProperty(value = "批号")
+	protected String  batchNum; 		/*批号*/
+	@ApiModelProperty(value = "预扣数量")
+	protected Long  withhold; 		/*预扣数量*/
+	@ApiModelProperty(value = "规格")
+	protected String  guiGe; 		/*规格*/
+	@ApiModelProperty(value = "到货日期")
+	protected String  arrivalDate; 		/*到货日期*/
+
+	public String getGuiGe() {
+		return guiGe;
+	}
+
+	public void setGuiGe(String guiGe) {
+		this.guiGe = guiGe;
+	}
+
+	public String getArrivalDate() {
+		return arrivalDate;
+	}
+
+	public void setArrivalDate(String arrivalDate) {
+		this.arrivalDate = arrivalDate;
+	}
+
+	public Long getWithhold() {
+		return withhold;
+	}
+
+	public void setWithhold(Long withhold) {
+		this.withhold = withhold;
+	}
+
+	public String getBatchNum() {
+		return batchNum;
+	}
+
+	public void setBatchNum(String batchNum) {
+		this.batchNum = batchNum;
+	}
+
+	public void setId(String id)
 	{
 		this.id = id;
 	}
@@ -168,4 +215,28 @@ public class ReagentConsumablesInventoryTbl extends AbstractPo<String>{
 	public void setDiDian(String diDian) {
 		this.diDian = diDian;
 	}
+
+	public Long getMinStock() {
+		return minStock;
+	}
+
+	public void setMinStock(Long minStock) {
+		this.minStock = minStock;
+	}
+
+	public String getStockWarn() {
+		return stockWarn;
+	}
+
+	public void setStockWarn(String stockWarn) {
+		this.stockWarn = stockWarn;
+	}
+
+	public String getEnable() {
+		return enable;
+	}
+
+	public void setEnable(String enable) {
+		this.enable = enable;
+	}
 }

+ 31 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/persistence/entity/ReagentConsumablesTransactionTbl.java

@@ -40,6 +40,37 @@ public class ReagentConsumablesTransactionTbl extends AbstractPo<String>{
 	protected String  boId; 		/*流程BO主表ID*/
 	@ApiModelProperty(value = "地点")
 	protected String  diDian; 		/*地点*/
+	@ApiModelProperty(value = "批号")
+	protected String  batchNum; 		/*批号*/
+	@ApiModelProperty(value = "库存ID")
+	protected String  inventoryId; 		/*库存ID*/
+	@ApiModelProperty(value = "流程状态")
+	protected String  flow; 		/*流程状态*/
+
+	public String getFlow() {
+		return flow;
+	}
+
+	public void setFlow(String flow) {
+		this.flow = flow;
+	}
+
+	public String getInventoryId() {
+		return inventoryId;
+	}
+
+	public void setInventoryId(String inventoryId) {
+		this.inventoryId = inventoryId;
+	}
+
+	public String getBatchNum() {
+		return batchNum;
+	}
+
+	public void setBatchNum(String batchNum) {
+		this.batchNum = batchNum;
+	}
+
 	public void setId(String id) 
 	{
 		this.id = id;

+ 123 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/provider/LingYongDetailProvider.java

@@ -0,0 +1,123 @@
+package com.lc.ibps.components.reagent.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.lc.ibps.api.base.constants.StateEnum;
+import com.lc.ibps.api.base.query.QueryFilter;
+import com.lc.ibps.base.core.constants.StringPool;
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.cloud.provider.GenericProvider;
+import com.lc.ibps.components.reagent.api.ILingYongDetailService;
+import com.lc.ibps.components.reagent.domain.LingYongDetail;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+import com.lc.ibps.components.reagent.repository.LingYongDetailRepository;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.Extension;
+import io.swagger.annotations.ExtensionProperty;
+
+/**
+ * 试剂耗材领用子表 服务类
+ * <pre>
+ * 构建组:ibps-provider-lingYongDetail
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:54
+ *</pre>
+ */
+@Api(tags = "试剂耗材领用子表管理", value = "试剂耗材领用子表数据")
+@Service
+public class LingYongDetailProvider extends GenericProvider implements ILingYongDetailService{
+
+	@Resource
+	private LingYongDetailRepository lingYongDetailRepository;
+
+	@ApiOperation(value = "试剂耗材领用子表列表(分页条件查询)数据", notes = "试剂耗材领用子表列表(分页条件查询)数据")
+	@Override
+	public APIResult<APIPageList<LingYongDetailPo>> query(
+			@ApiParam(name = "request", value = "传入查询请求json字符串", required = true) 
+			@RequestBody(required = true) APIRequest request) {
+		APIResult<APIPageList<LingYongDetailPo>> result = new APIResult<>();
+		try {
+			QueryFilter queryFilter = getQueryFilter(request);
+			List<LingYongDetailPo> data = lingYongDetailRepository.query(queryFilter);
+			APIPageList<LingYongDetailPo> apiPageData = getAPIPageList(data);
+			result.setData(apiPageData);
+		} catch (Exception e) {
+			// TODO ERROR => other error message
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "根据id查询试剂耗材领用子表", notes = "根据id查询试剂耗材领用子表")
+	@Override
+	public APIResult<LingYongDetailPo> get(
+			@ApiParam(name = "id", value = "查询id", required = true) 
+			@RequestParam(name = "id", required = true) String id) {
+		APIResult<LingYongDetailPo> result = new APIResult<>();
+		try {
+			LingYongDetailPo lingYongDetailPo = lingYongDetailRepository.get(id);
+			result.setData(lingYongDetailPo);
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+	
+	@ApiOperation(value = "保存", notes = "保存试剂耗材领用子表信息", 
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> save(
+			@ApiParam(name = "lingYongDetailPo", value = "试剂耗材领用子表对象", required = true)  
+			@RequestBody(required = true) LingYongDetailPo lingYongDetailPo) {
+		APIResult<Void> result = new APIResult<Void>();
+		try {
+			logger.info(" com.lc.ibps.components.provider.LingYongDetailProvider.save()--->lingYongDetailPo: {}", lingYongDetailPo.toString());
+			LingYongDetail domain = lingYongDetailRepository.newInstance(lingYongDetailPo);
+			domain.save();
+			result.setMessage("保存试剂耗材领用子表成功");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "删除", notes = "删除试剂耗材领用子表", 
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> remove(
+			@ApiParam(name = "ids", value = "试剂耗材领用子表ID数组", required = true)  
+			@RequestParam(name = "ids", required = true) String[] ids) {
+		APIResult<Void> result = new APIResult<Void>();
+		try {
+			LingYongDetail domain = lingYongDetailRepository.newInstance();
+			domain.deleteByIds(ids);
+			result.setMessage("删除试剂耗材领用子表成功");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+	
+}

+ 150 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/provider/LingYongProvider.java

@@ -0,0 +1,150 @@
+package com.lc.ibps.components.reagent.provider;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import com.lc.ibps.base.framework.id.UniqueIdUtil;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+import com.lc.ibps.components.reagent.service.InventoryService;
+import com.lc.ibps.untils.StrUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.lc.ibps.api.base.constants.StateEnum;
+import com.lc.ibps.api.base.query.QueryFilter;
+import com.lc.ibps.base.core.constants.StringPool;
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.cloud.provider.GenericProvider;
+import com.lc.ibps.components.reagent.api.ILingYongService;
+import com.lc.ibps.components.reagent.domain.LingYong;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+import com.lc.ibps.components.reagent.repository.LingYongRepository;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.Extension;
+import io.swagger.annotations.ExtensionProperty;
+
+/**
+ * 试剂耗材领用主表 服务类
+ * <pre>
+ * 构建组:ibps-provider-lingYong
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:47
+ *</pre>
+ */
+@Api(tags = "试剂耗材领用主表管理", value = "试剂耗材领用主表数据")
+@Service
+public class LingYongProvider extends GenericProvider implements ILingYongService{
+
+	@Resource
+	private LingYongRepository lingYongRepository;
+
+	@Autowired
+	private InventoryService inventoryService;
+
+	@ApiOperation(value = "试剂耗材领用主表列表(分页条件查询)数据", notes = "试剂耗材领用主表列表(分页条件查询)数据")
+	@Override
+	public APIResult<APIPageList<LingYongPo>> query(
+			@ApiParam(name = "request", value = "传入查询请求json字符串", required = true) 
+			@RequestBody(required = true) APIRequest request) {
+		APIResult<APIPageList<LingYongPo>> result = new APIResult<>();
+		try {
+			QueryFilter queryFilter = getQueryFilter(request);
+			List<LingYongPo> data = lingYongRepository.query(queryFilter);
+			APIPageList<LingYongPo> apiPageData = getAPIPageList(data);
+			result.setData(apiPageData);
+		} catch (Exception e) {
+			// TODO ERROR => other error message
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "根据id查询试剂耗材领用主表", notes = "根据id查询试剂耗材领用主表")
+	@Override
+	public APIResult<LingYongPo> get(
+			@ApiParam(name = "id", value = "查询id", required = true) 
+			@RequestParam(name = "id", required = true) String id) {
+		APIResult<LingYongPo> result = new APIResult<>();
+		try {
+			LingYongPo lingYongPo = lingYongRepository.loadCascade(id);
+			result.setData(lingYongPo);
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+	
+	@ApiOperation(value = "保存", notes = "保存试剂耗材领用主表信息", 
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> save(
+			@ApiParam(name = "lingYongPo", value = "试剂耗材领用主表对象", required = true)  
+			@RequestBody(required = true) LingYongPo lingYongPo) {
+		APIResult<Void> result = new APIResult<Void>();
+		try {
+			logger.info(" com.lc.ibps.components.provider.LingYongProvider.save()--->lingYongPo: {}", lingYongPo.toString());
+			if(!lingYongPo.getLingYongDetailPoList().isEmpty()){
+				List<Map<String, Object>> records = new ArrayList<>(lingYongPo.getLingYongDetailPoList().size());
+				for (LingYongDetailPo bean : lingYongPo.getLingYongDetailPoList()) {
+					Map<String, Object> map = new HashMap<>();
+					String id = UniqueIdUtil.getId();
+					map.put("id_", id);
+					bean.setTaiZhangId(id);
+					map.put("ming_cheng_", StrUtil.str(bean.getShiJiMingCheng()));
+					map.put("pi_hao_", StrUtil.str(bean.getPiHao()));
+					map.put("bian_ma_", StrUtil.str(bean.getBianMa()));
+					map.put("inventory_id", StrUtil.str(bean.getInventoryId()));
+					map.put("shu_liang_", StrUtil.str(bean.getShuLiang()));
+					map.put("you_xiao_qi_", StrUtil.str(bean.getYouXiaoQi()));
+					records.add(map);
+				}
+				inventoryService.handleOperation("not","领用",records);
+			}
+			LingYong domain = lingYongRepository.newInstance(lingYongPo);
+			domain.saveCascade();
+			result.setMessage("保存试剂耗材领用主表成功");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "删除", notes = "删除试剂耗材领用主表", 
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> remove(
+			@ApiParam(name = "ids", value = "试剂耗材领用主表ID数组", required = true)  
+			@RequestParam(name = "ids", required = true) String[] ids) {
+		APIResult<Void> result = new APIResult<Void>();
+		try {
+			LingYong domain = lingYongRepository.newInstance();
+			domain.deleteByIdsCascade(ids);
+			result.setMessage("删除试剂耗材领用主表成功");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+	
+}

+ 90 - 6
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/provider/ReagentConsumablesInventoryProvider.java

@@ -1,13 +1,14 @@
 package com.lc.ibps.components.reagent.provider;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import javax.annotation.Resource;
 
+import com.lc.ibps.components.reagent.dto.StockDto;
 import com.lc.ibps.components.reagent.service.InventoryService;
+import com.lc.ibps.components.reagent.service.TakeStockService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -15,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 import com.lc.ibps.api.base.constants.StateEnum;
 import com.lc.ibps.api.base.query.QueryFilter;
 import com.lc.ibps.base.core.constants.StringPool;
-import com.lc.ibps.base.core.util.BeanUtils;
 import com.lc.ibps.cloud.entity.APIPageList;
 import com.lc.ibps.cloud.entity.APIRequest;
 import com.lc.ibps.cloud.entity.APIResult;
@@ -50,6 +50,9 @@ public class ReagentConsumablesInventoryProvider extends GenericProvider impleme
 	@Autowired
 	private InventoryService inventoryService;
 
+	@Autowired
+	private TakeStockService takeStockService;
+
 	@ApiOperation(value = "试剂耗材库存表列表(分页条件查询)数据", notes = "试剂耗材库存表列表(分页条件查询)数据")
 	@Override
 	public APIResult<APIPageList<ReagentConsumablesInventoryPo>> query(
@@ -105,7 +108,7 @@ public class ReagentConsumablesInventoryProvider extends GenericProvider impleme
 		return result;
 	}
 
-	@ApiOperation(value = "删除", notes = "删除试剂耗材库存表", 
+	@ApiOperation(value = "删除", notes = "删除试剂耗材库存表",
 			extensions = {
 					@Extension(properties = {
 							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
@@ -126,11 +129,92 @@ public class ReagentConsumablesInventoryProvider extends GenericProvider impleme
 		return result;
 	}
 
+	@ApiOperation(value = "入库处理", notes = "入库处理",
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
 	@Override
 	public APIResult<Void> sync(String id, String action) {
 		APIResult<Void> result = new APIResult<>();
-		 inventoryService.sync(id,action);
+		try {
+			inventoryService.sync(id,action);
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
 		 return result;
 	}
-	
+
+	@ApiOperation(value = "修改库存量", notes = "修改库存量",
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> updateStock(
+			@ApiParam(name = "stockDto", value = "{type : '',kcList: [{id:'',quantity : ''}] };" +
+					"操作类型type(只更新库存(库存编辑)-only,更新库存和冻结状态(盘点完成)-both);" +
+					"id-库存id;quantity-修改后的库存值", required = true)
+			@RequestBody StockDto stockDto) {
+		APIResult<Void> result = new APIResult<>();
+		try {
+			inventoryService.updateStock(stockDto);
+			result.setMessage("保存成功!");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "领用/退货/报废", notes = "领用/退货/报废",
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> issue(
+			@ApiParam(name = "id", value = "领用/退货/报废记录id", required = true)
+			@RequestParam(name = "id", required = true) String id,
+			@ApiParam(name = "type", value = "操作类型(领用-withdraw/退货-return/报废-scrap)", required = true)
+			@RequestParam(name = "type", required = true) String type,
+			@ApiParam(name = "status", value = "流程状态(start/end),非必要参数,不传表示没有流程提交直接扣减库存", required = false)
+			@RequestParam(name = "status", required = false) String status) {
+		APIResult<Void> result = new APIResult<>();
+		try {
+			inventoryService.issue(id,type,status);
+			result.setMessage("保存成功!");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "试剂耗材盘点", notes = "试剂耗材盘点",
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<List<Map<String,Object>>> takeStock(
+			@ApiParam(name = "ckId", value = "仓库id(多个用逗号隔开,为空查所有)", required = false)
+			@RequestParam(name = "ckId", required = false) String ckId,
+			@ApiParam(name = "date", value = "盘点月份(默认当前月份)", required = false)
+			@RequestParam(name = "date", required = false) String date,
+			@ApiParam(name = "type", value = "备用(可忽略)", required = false)
+			@RequestParam(name = "type", required = false) String type) {
+		APIResult<List<Map<String,Object>>> result = new APIResult<>();
+		try {
+			List<Map<String,Object>> list = takeStockService.takeStock( ckId , date , type );
+			result.setData(list);
+			result.setMessage("保存成功!");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
 }

+ 26 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/LingYongDetailRepository.java

@@ -0,0 +1,26 @@
+package com.lc.ibps.components.reagent.repository;
+
+import java.util.List;
+import com.lc.ibps.base.framework.repository.IRepository;
+import com.lc.ibps.components.reagent.domain.LingYongDetail;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用子表 仓库接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:52
+ *</pre>
+ */
+public interface LingYongDetailRepository extends IRepository<String, LingYongDetailPo,LingYongDetail>{
+	 /**
+	 * 根据主表ID查询 试剂耗材领用子表 列表
+	 * @param mainId
+	 * @return 
+	 * List<LingYongDetailPo>
+	 */
+	public List<LingYongDetailPo> findByMainId(String mainId);
+
+}

+ 23 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/LingYongRepository.java

@@ -0,0 +1,23 @@
+package com.lc.ibps.components.reagent.repository;
+
+import com.lc.ibps.base.framework.repository.IRepository;
+import com.lc.ibps.components.reagent.domain.LingYong;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+
+/**
+ * 试剂耗材领用主表 仓库接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:46
+ *</pre>
+ */
+public interface LingYongRepository extends IRepository<String, LingYongPo,LingYong>{
+
+	/**
+	 * 查询全部子表的数据,并设置到主表Po中 
+	 * void
+	 */
+	public LingYongPo loadCascade(String id);
+}

+ 2 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/ReagentConsumablesInventoryRepository.java

@@ -23,4 +23,6 @@ public interface ReagentConsumablesInventoryRepository extends IRepository<Strin
 	 */
 	public List<ReagentConsumablesInventoryPo> findByMainId(String mainId);
 
+	public List<ReagentConsumablesInventoryPo> findByPhAndCodeOrPosition(String piHao,String code,String position);
+
 }

+ 63 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/impl/LingYongDetailRepositoryImpl.java

@@ -0,0 +1,63 @@
+package com.lc.ibps.components.reagent.repository.impl;
+
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.core.util.AppUtil;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.base.framework.repository.AbstractRepository;
+import com.lc.ibps.components.reagent.domain.LingYongDetail;
+import com.lc.ibps.components.reagent.repository.LingYongDetailRepository;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongDetailQueryDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用子表 仓库的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:52
+ *</pre>
+ */
+@Repository
+public class LingYongDetailRepositoryImpl extends AbstractRepository<String, LingYongDetailPo,LingYongDetail> implements LingYongDetailRepository{
+	  
+	@Resource
+	private  LingYongDetailQueryDao lingYongDetailQueryDao;
+
+	public LingYongDetail newInstance() {
+		LingYongDetailPo po = new LingYongDetailPo();
+		LingYongDetail lingYongDetail = AppUtil.getBean(LingYongDetail.class);
+		lingYongDetail.setData(po);
+		return lingYongDetail;
+	}
+
+	public LingYongDetail newInstance(LingYongDetailPo po) {
+		LingYongDetail lingYongDetail = AppUtil.getBean(LingYongDetail.class);
+		lingYongDetail.setData(po);
+		return lingYongDetail;
+	} 
+	
+	@Override
+	protected IQueryDao<String, LingYongDetailPo> getQueryDao() {
+		return lingYongDetailQueryDao;
+	}
+	
+	@Override
+	public String getInternalCacheName() {
+		return "lingYongDetail";
+	}
+	
+	@Override
+	public List<LingYongDetailPo> findByMainId(String mainId) {
+		List<LingYongDetailPo> list = findByKey("findByMainId", "findIdsByMainId",
+				b().a("mainId", mainId).p());
+		return list;
+	}
+
+	
+}

+ 79 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/impl/LingYongRepositoryImpl.java

@@ -0,0 +1,79 @@
+package com.lc.ibps.components.reagent.repository.impl;
+
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.core.util.string.StringUtil;
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.core.util.AppUtil;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.base.framework.repository.AbstractRepository;
+import com.lc.ibps.components.reagent.domain.LingYong;
+import com.lc.ibps.components.reagent.repository.LingYongRepository;
+import com.lc.ibps.components.reagent.persistence.dao.LingYongQueryDao;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongPo;
+import com.lc.ibps.components.reagent.repository.LingYongDetailRepository;
+import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
+
+/**
+ * 试剂耗材领用主表 仓库的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2025-03-20 17:22:45
+ *</pre>
+ */
+@Repository
+public class LingYongRepositoryImpl extends AbstractRepository<String, LingYongPo,LingYong> implements LingYongRepository{
+	  
+	@Resource
+	private  LingYongQueryDao lingYongQueryDao;
+	@Resource
+	private  LingYongDetailRepository lingYongDetailRepository;
+
+	public LingYong newInstance() {
+		LingYongPo po = new LingYongPo();
+		LingYong lingYong = AppUtil.getBean(LingYong.class);
+		lingYong.setData(po);
+		return lingYong;
+	}
+
+	public LingYong newInstance(LingYongPo po) {
+		LingYong lingYong = AppUtil.getBean(LingYong.class);
+		lingYong.setData(po);
+		return lingYong;
+	} 
+	
+	@Override
+	protected IQueryDao<String, LingYongPo> getQueryDao() {
+		return lingYongQueryDao;
+	}
+	
+	@Override
+	public String getInternalCacheName() {
+		return "lingYong";
+	}
+	
+
+	/**
+	 * 查询全部子表的数据,并设置到主表Po中 
+	 * void
+	 */
+	@Override
+	public LingYongPo loadCascade(String id){
+		LingYongPo lingYongPo = null;
+		if(StringUtil.isNotEmpty(id)){
+			lingYongPo = get(id);
+			if(BeanUtils.isNotEmpty(lingYongPo) && BeanUtils.isNotEmpty(lingYongPo.getId())){
+				List<LingYongDetailPo> lingYongDetailPoList = lingYongDetailRepository.findByMainId(lingYongPo.getId());
+				lingYongPo.setLingYongDetailPoList(lingYongDetailPoList);
+			}
+		}
+		return lingYongPo;
+	}
+	
+}

+ 9 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/repository/impl/ReagentConsumablesInventoryRepositoryImpl.java

@@ -1,5 +1,6 @@
 package com.lc.ibps.components.reagent.repository.impl;
 
+import java.util.Collections;
 import java.util.List;
 
 import javax.annotation.Resource;
@@ -59,5 +60,12 @@ public class ReagentConsumablesInventoryRepositoryImpl extends AbstractRepositor
 		return list;
 	}
 
-	
+	@Override
+	public List<ReagentConsumablesInventoryPo> findByPhAndCodeOrPosition(String piHao, String code, String position) {
+		List<ReagentConsumablesInventoryPo> list = findByKey("findByPhAndCodeOrPosition", "findByPhAndCodeOrPosition",
+				b().a("piHao", piHao).a("code",code).a("position",position).p());
+		return list;
+	}
+
+
 }

+ 231 - 34
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/InventoryService.java

@@ -1,35 +1,32 @@
 package com.lc.ibps.components.reagent.service;
 
-import com.lc.ibps.api.base.query.QueryFilter;
-import com.lc.ibps.base.core.util.string.StringUtil;
-import com.lc.ibps.base.db.model.DefaultQueryFilter;
-import com.lc.ibps.base.framework.table.ICommonDao;
-import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.core.util.Collections;
+import com.lc.ibps.cloud.provider.GenericProvider;
 import com.lc.ibps.components.reagent.domain.ReagentConsumablesInventory;
 import com.lc.ibps.components.reagent.domain.ReagentConsumablesTransaction;
 import com.lc.ibps.components.reagent.dto.InventoryDTO;
+import com.lc.ibps.components.reagent.dto.KcDto;
+import com.lc.ibps.components.reagent.dto.StockDto;
 import com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesInventoryPo;
+import com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesTransactionPo;
 import com.lc.ibps.components.reagent.repository.ReagentConsumablesInventoryRepository;
-import com.lc.ibps.components.reagent.repository.ReagentConsumablesItemRepository;
 import com.lc.ibps.components.reagent.repository.ReagentConsumablesTransactionRepository;
+import com.lc.ibps.untils.StrUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
-public class InventoryService {
-
-    @Resource
-    private ReagentConsumablesItemRepository reagentConsumablesItemRepository;
+public class InventoryService extends GenericProvider {
 
     @Resource
     private ReagentConsumablesInventoryRepository reagentConsumablesInventoryRepository;
     @Resource
     private ReagentConsumablesTransactionRepository reagentConsumablesTransactionRepository;
-    @Resource
-    private ICommonDao commonDao;
 
     @Autowired
     private StoreService storeService;
@@ -37,42 +34,242 @@ public class InventoryService {
     @Autowired
     private LinYongService linYongService;
 
-    public boolean sync(String id, String action) {
+    @Autowired
+    private ReturnService returnService;
+
+    public boolean sync(String id, String action) throws Exception {
+        logger.warn("com.lc.ibps.components.reagent.service.InventoryService.sync()--->id={},action={}",  id,action);
         OperationService service = getService(action);
-        if(service == null) throw new IllegalArgumentException();
         for (InventoryDTO item : service.getItems(id)) {
             ReagentConsumablesInventoryPo inventory = item.getInventory();
-            if(StringUtil.isNotBlank(inventory.getId())){
-                //出库操作,根据库存id计算数量
-                ReagentConsumablesInventoryPo inventoryPo = reagentConsumablesInventoryRepository.get(inventory.getId());
-                inventory.setReagentCode(inventoryPo.getReagentCode());
-                inventory.setExpDate(inventoryPo.getExpDate());
-                item.getTransaction().setReagentCode(inventoryPo.getReagentCode());
-                item.getTransaction().setExpDate(inventoryPo.getExpDate());
-                calcQuantity(inventory, inventoryPo.getQuantity(),service.getPolicy());
-            }else{
-                //入库,根据试剂id+过期时间判断是否在库
-                List<ReagentConsumablesInventoryPo> query = reagentConsumablesInventoryRepository.findByMainId(inventory.getReagentCode());
-                for (ReagentConsumablesInventoryPo inventoryPo: query) {
-                    if(inventoryPo.getExpDate().equalsIgnoreCase(inventory.getExpDate())){
-                        inventory.setId(inventoryPo.getId());
-                        calcQuantity(inventory, inventoryPo.getQuantity(),service.getPolicy());
-                        break;
-                    }
+            Map<String,Object> map = new HashMap<>();
+            map.put("batch_num",inventory.getBatchNum());
+            map.put("reagent_code",inventory.getReagentCode());
+            map.put("position",inventory.getPosition());
+            List<Map<String, Object>> inv = storeService.queryInventoryByRuKu(map);
+            if(Collections.isNotEmpty(inv)){
+                if (inv.get(0).get("").equals("否")) {
+                    throw new Exception("编码为:"+inventory.getReagentCode()+"的试剂耗材正在盘点,请等待盘点完成后再操作!");
                 }
+                inventory.setId(inv.get(0).get("id_").toString());
+                calcQuantity(inventory, Long.parseLong(inv.get(0).get("quantity").toString()),service.getPolicy());
+            }else {
+                // 新库存
+                inventory.setStatus("入库");
+                inventory.setEnable("是");
+                inventory.setStatus("未验证");
             }
+
             ReagentConsumablesInventory domain = reagentConsumablesInventoryRepository.newInstance(inventory);
             domain.save();
 
             ReagentConsumablesTransaction transaction = reagentConsumablesTransactionRepository.newInstance();
+            item.getTransaction().setInventoryId(inventory.getId());
+            item.getTransaction().setFlow("not");
             transaction.setData(item.getTransaction());
             transaction.save();
-
         }
-        service.updateStatus(id);
         return true;
     }
 
+    public void issue(String id, String type, String status) throws Exception {
+        status = StrUtil.str(status);
+        if ("return".equals(type)) {
+            returnStock(id, status,"退货");
+        } else if ("scrap".equals(type)) {
+            scrap(id, status,"报废");
+        } else if ("withdraw".equals(type)) {
+            decrementStock(id, status,"领用");
+        }
+    }
+
+    public void scrap(String id, String status,String type) throws Exception {
+        logger.warn("com.lc.ibps.components.reagent.service.InventoryService.scrap()--->id={},status={},type={}", id, status, type);
+        handleOperation(status, type, storeService.queryBfRecord(id));
+    }
+
+    public void returnStock(String id, String status,String type) throws Exception {
+        logger.warn("com.lc.ibps.components.reagent.service.InventoryService.returnStock()--->id={},status={},type={}", id, status, type);
+        handleOperation(status, type, storeService.queryThRecord(id));
+    }
+
+    public void decrementStock(String id, String status,String type) throws Exception {
+        logger.warn("com.lc.ibps.components.reagent.service.InventoryService.decrementStock()--->id={},status={},type={}", id, status, type);
+        handleOperation(status, type, storeService.queryLingYongRecord(id));
+    }
+
+    public void handleOperation(String status, String operationType, List<Map<String, Object>> records) throws Exception {
+        if (records == null || records.isEmpty()) {
+            throw new Exception("未查询到对应的" + operationType + "记录,操作失败!");
+        }
+
+        List<String> ids = records.stream().map(record -> record.get("id_").toString()).collect(Collectors.toList());
+        returnService.updateBillAndInventory(String.join(",",ids),operationType);
+
+        for (Map<String, Object> record : records) {
+            record.put("type", operationType);
+            record.put("status", status);
+            String name1 = StrUtil.str(record.get("ming_cheng_"));
+            String name2 = StrUtil.str(record.get("shi_ji_ming_cheng"));
+            String reagentName = !name1.isEmpty() ? name1 : !name2.isEmpty() ? name2 : "";
+            record.put("ming_cheng_", reagentName);
+            String batchNum = StrUtil.str(record.get("pi_hao_"));
+            String reagentCode = StrUtil.str(record.get("bian_ma_"));
+            String position = operationType.equals("领用") ? StrUtil.str(record.get("cang_ku_id_")) : "";
+            String kcId = StrUtil.str(record.get("inventory_id"));
+
+            List<Map<String, Object>> inventoryList;
+            if (BeanUtils.isNotEmpty(kcId)) {
+                inventoryList = storeService.queryInventoryById(kcId);
+            }else if (operationType.equals("领用")) {
+                Map<String, Object> queryParams = new HashMap<>();
+                queryParams.put("batch_num", batchNum);
+                queryParams.put("reagent_code", reagentCode);
+                queryParams.put("position", position);
+                inventoryList = storeService.queryInventoryByLingYong(queryParams);
+            } else {
+                inventoryList = storeService.queryInventoryByPhAndCode(batchNum, reagentCode);
+            }
+
+            checkEnable(inventoryList, reagentName);
+
+            if (inventoryList.size() == 1) {
+                handleSingleInventory(inventoryList.get(0), record);
+            } else {
+                handleMultipleInventories(inventoryList, record);
+            }
+        }
+    }
+
+    private void handleSingleInventory(Map<String, Object> inventory, Map<String, Object> record) throws Exception {
+        long quantity = Long.parseLong(record.get("shu_liang_").toString());
+        long currentQuantity = StrUtil.parseLongSafe(inventory.get("quantity"));
+        long currentWithhold = StrUtil.parseLongSafe(inventory.get("withhold"));
+        long available = currentQuantity - currentWithhold;
+
+        if (available < quantity) {
+            throw new Exception(record.get("ming_cheng_") + " 可用量不足!可用量:" + available + ",需要:" + quantity);
+        }
+
+        String inventoryId = StrUtil.str(inventory.get("id_"));
+        String status = StrUtil.str(record.get("status"));
+        if ("start".equals(status)) {
+            linYongService.updateWithhold(inventoryId, currentWithhold + quantity);
+        } else if ("end".equals(status)) {
+            linYongService.updateWithholdAndInventory(inventoryId, currentQuantity - quantity, currentWithhold - quantity);
+        } else {
+            linYongService.updateInventory(inventoryId, currentQuantity - quantity);
+        }
+        record.put("inventory_id", inventoryId);
+        record.put("quantity", quantity);
+        record.put("flow", status.isEmpty()?"not":status);
+        record.put("position", StrUtil.str(inventory.get("position")));
+        addTrans(record);
+    }
+
+    private void handleMultipleInventories(List<Map<String, Object>> inventoryList, Map<String, Object> record) throws Exception {
+        long quantity = Long.parseLong(record.get("shu_liang_").toString());
+        long totalAvailable = inventoryList.stream()
+                .mapToLong(inv -> {
+                    long qty = StrUtil.parseLongSafe(inv.get("quantity"));
+                    long wh = StrUtil.parseLongSafe(inv.get("withhold"));
+                    return qty - wh;
+                })
+                .sum();
+
+        if (totalAvailable < quantity) {
+            throw new Exception(record.get("ming_cheng_") + " 总可用量不足!总可用量:" + totalAvailable + ",需要:" + quantity);
+        }
+
+        long remainingQuantity = quantity;
+        String status = StrUtil.str(record.get("status"));
+        for (Map<String, Object> inventory : inventoryList) {
+            if (remainingQuantity <= 0) break;
+
+            String inventoryId = StrUtil.str(inventory.get("id_"));
+            long currentQuantity = StrUtil.parseLongSafe(inventory.get("quantity"));
+            long currentWithhold = StrUtil.parseLongSafe(inventory.get("withhold"));
+            long available = currentQuantity - currentWithhold;
+
+            if (available <= 0) continue;
+
+            long actualDeduction;
+            if ("start".equals(status)) {
+                actualDeduction = Math.min(available, remainingQuantity);
+                linYongService.updateWithhold(inventoryId, currentWithhold + actualDeduction);
+            } else if ("end".equals(status)) {
+                actualDeduction = Math.min(available, remainingQuantity);
+                linYongService.updateWithholdAndInventory(inventoryId, currentQuantity - actualDeduction, currentWithhold - actualDeduction);
+            } else {
+                actualDeduction = Math.min(available, remainingQuantity);
+                linYongService.updateInventory(inventoryId, currentQuantity - actualDeduction);
+            }
+
+            remainingQuantity -= actualDeduction;
+
+            record.put("inventory_id", inventoryId);
+            record.put("quantity", actualDeduction);
+            record.put("flow", status.isEmpty()?"not":status);
+            record.put("position", StrUtil.str(inventory.get("position")));
+            addTrans(record);
+        }
+    }
+
+    public void checkEnable(List<Map<String, Object>> inventoryList, String reagentName) {
+        for (Map<String, Object> inventory : inventoryList) {
+            if ("否".equals(inventory.get("enable_"))) {
+                throw new RuntimeException(reagentName + " 正在盘点,请等待完成!");
+            }
+        }
+    }
+
+    public void addTrans(Map<String, Object> map) {
+        ReagentConsumablesTransactionPo tran = new ReagentConsumablesTransactionPo();
+        tran.setReagentCode(StrUtil.str(map.get("bian_ma_")));
+        tran.setQuantity(Long.parseLong(StrUtil.str(map.get("quantity"))));
+        String value1 = StrUtil.str(map.get("you_xiao_qi_"));
+        String value2 = StrUtil.str(map.get("you_xiao_qi_zhi_"));
+        String date = !value1.isEmpty() ? value1 : !value2.isEmpty() ? value2 : "";
+        tran.setExpDate(date);
+        tran.setPosition(StrUtil.str(map.get("position")));
+        tran.setStatus(StrUtil.str(map.get("type")));
+        tran.setType(Long.valueOf("-1"));
+        tran.setBoId(StrUtil.str(map.get("id_")));
+        tran.setDiDian(StrUtil.str(map.get("di_dian_")));
+        tran.setBatchNum(StrUtil.str(map.get("pi_hao_")));
+        tran.setInventoryId(StrUtil.str(map.get("inventory_id")));
+        tran.setFlow(StrUtil.str(map.get("flow")));
+
+        ReagentConsumablesTransaction transaction = reagentConsumablesTransactionRepository.newInstance();
+        transaction.setData(tran);
+        transaction.save();
+    }
+
+    public void updateStock(StockDto stockDto) throws Exception {
+        logger.warn("com.lc.ibps.components.reagent.service.InventoryService.updateStock()--->stockDto={}", stockDto);
+        if (Collections.isEmpty(stockDto.getKcList())){
+            return;
+        }
+        for (KcDto kcDto : stockDto.getKcList()){
+            ReagentConsumablesInventoryPo inventory = reagentConsumablesInventoryRepository.get(kcDto.getId());
+            if (BeanUtils.isEmpty(inventory)){
+                throw new Exception("未查询到对应库存,请核对后再修改!");
+            }
+            if ("both".equals(stockDto.getType()) && "否".equals(inventory.getEnable())) {
+                throw new RuntimeException("试剂耗材编码为:" +inventory.getReagentCode() + " 正在盘点,请等待完成!");
+            }
+            if (BeanUtils.isNotEmpty(inventory.getWithhold()) && kcDto.getQuantity() < inventory.getWithhold()){
+                throw new Exception("修改失败!当前库存的预扣量为:"+inventory.getWithhold()+",修改后的库存不能小于预扣量!");
+            }
+            if ("both".equals(stockDto.getType())){
+                linYongService.updateInventoryAndStatus(kcDto.getId(),kcDto.getQuantity());
+            }else {
+                linYongService.updateInventory(kcDto.getId(),kcDto.getQuantity());
+            }
+        }
+    }
+
+
     private static void calcQuantity( ReagentConsumablesInventoryPo inventory, Long inventoryQuantity,OperationService.Policy policy) {
         switch (policy) {
             case plus:

+ 21 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/LinYongService.java

@@ -29,4 +29,25 @@ public class LinYongService implements OperationService{
     public Policy getPolicy() {
         return Policy.minus;
     }
+
+    public void updateWithhold(String id, long withhold) {
+        String sql = "update t_reagent_inventory set withhold=%s where id_='%s'";
+        commonDao.execute(String.format(sql,Math.max(withhold,0),id));
+    }
+
+    public void updateWithholdAndInventory(String id, long quantity,long withhold) {
+        String sql = "update t_reagent_inventory set quantity=%s, withhold=%s where id_='%s'";
+        commonDao.execute(String.format(sql,Math.max(quantity,0),Math.max(withhold,0),id));
+    }
+
+    public void updateInventory(String id,long quantity){
+        String sql = "update t_reagent_inventory set quantity=%s where id_='%s'";
+        commonDao.execute(String.format(sql,Math.max(quantity,0),id));
+    }
+
+    public void updateInventoryAndStatus(String id,long quantity){
+        String sql = "update t_reagent_inventory set enable_='是' quantity=%s where id_='%s'";
+        commonDao.execute(String.format(sql,Math.max(quantity,0),id));
+    }
+
 }

+ 58 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/ReturnService.java

@@ -1,7 +1,64 @@
 package com.lc.ibps.components.reagent.service;
 
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.framework.table.ICommonDao;
+import com.lc.ibps.components.reagent.dto.InventoryDTO;
+import com.lc.ibps.untils.StrUtil;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
 
 @Service
-public class ReturnService {
+public class ReturnService implements OperationService{
+
+    @Resource
+    private ICommonDao commonDao;
+
+    @Override
+    public List<InventoryDTO> getItems(String id) {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public void updateStatus(String id) {
+
+    }
+
+    @Override
+    public Policy getPolicy() {
+        return Policy.minus;
+    }
+
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    public void updateBillAndInventory(String id, String type) throws Exception {
+        // 查询是否已经存在台账记录  查询到的结果 减去预扣量、删除台账记录
+        String sql= "SELECT *from t_reagent_trans WHERE flow_='start' and status_='%s' and bo_id in (%s) ";
+        List<Map<String, Object>> bills = commonDao.query(String.format( sql, type, id ));
+        if(com.lc.ibps.base.core.util.Collections.isNotEmpty(bills)){
+            for (Map<String, Object> bill : bills) {
+                if (BeanUtils.isNotEmpty(bill.get("inventory_id")) && BeanUtils.isNotEmpty(bill.get("status_"))){
+                    String kcId = StrUtil.str(bill.get("id_"));
+                    long count = StrUtil.parseLongSafe(bill.get("quantity"));
+                    updateWithholdByDel(kcId,count);
+                    deleteTaiZhangRecord(bill.get("id_").toString());
+                }
+            }
+        }
+    }
+
+    private void updateWithholdByDel(String id, long withhold) {
+        String sql = "update t_reagent_inventory set withhold=GREATEST(0,withhold - %s) where id_='%s'";
+        commonDao.execute(String.format(sql,Math.max(withhold,0),id));
+    }
+
+    private void deleteTaiZhangRecord(String id){
+        String sql = "delete from t_reagent_trans where id_='%s'";
+        commonDao.execute(String.format( sql, id ));
+    }
+
 }

+ 56 - 5
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/StoreService.java

@@ -1,10 +1,12 @@
 package com.lc.ibps.components.reagent.service;
 
+import com.lc.ibps.base.core.util.BeanUtils;
 import com.lc.ibps.base.framework.table.ICommonDao;
 import com.lc.ibps.components.reagent.dto.InventoryDTO;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -14,12 +16,19 @@ public class StoreService implements OperationService {
     @Resource
     private ICommonDao commonDao;
 
+    private final static Map<String, String> table = new HashMap<>();
+    static {
+        table.put("退回", "t_sjhcthb");
+        table.put("报废", "t_sjhcbfsqbzb");
+        table.put("领用", "t_sjhclyzb");
+    }
+
     public List<InventoryDTO> getItems(String id){
         List<Map<String,Object>> query = (List<Map<String,Object>>)commonDao.query(
                 "SELECT c.xiao_qi_ expDate,c.bian_ma_ reagentCode,c.shu_liang_ quantity,c.id_ boId,1 as type_," +
-                " p.bian_zhi_ren_ createBy,p.bian_zhi_shi_jian createTime,p.di_dian_ diDian,p.bian_zhi_bu_men_  " +
-                " FROM t_sjhxhclrkysdjb p, t_sjhxhclrkysdjbzb c " +
-                " WHERE p.id_=c.parent_id_ AND p.shi_fou_guo_shen_='已完成' AND c.yan_shou_jie_guo_='合格' and p.id_=#{p0}", new String[]{id});
+                " p.bian_zhi_ren_ createBy,p.bian_zhi_shi_jian createTime,p.di_dian_ diDian,p.bian_zhi_bu_men_,  " +
+                " c.zui_di_ku_cun_,c.cang_ku_,c.pi_hao_,c.gui_ge_,c.dao_huo_ri_qi_ FROM t_sjhxhclrkysdjb p, t_sjhxhclrkysdjbzb c " +
+                " WHERE p.id_=c.parent_id_ AND c.yan_shou_jie_guo_='合格' and p.id_=#{p0}", new String[]{id});
         return InventoryDTO.build(query);
     }
     public void updateStatus(String id){
@@ -31,9 +40,51 @@ public class StoreService implements OperationService {
         return Policy.plus;
     }
 
+    public List<Map<String, Object>> queryInventoryByRuKu(Map<String,Object> map){
+        String sql= "SELECT * from t_reagent_inventory WHERE batch_num='%s' and reagent_code='%s' ";
+        sql = String.format(sql,map.get("batch_num"),map.get("reagent_code"));
+        if(BeanUtils.isNotEmpty(map.get("position"))){
+            sql = sql + " and position='%s' ";
+            sql = String.format(sql,map.get("position"));
+        }else {
+            sql = sql + " and (position='' or position is null)";
+        }
+        return commonDao.query(sql);
+    }
+
+    public List<Map<String,Object>> queryInventoryByLingYong(Map<String,Object> map){
+        String sql= "SELECT * from t_reagent_inventory WHERE batch_num='%s' and reagent_code='%s' ";
+        sql = String.format(sql,map.get("batch_num"),map.get("reagent_code"));
+        if(BeanUtils.isNotEmpty(map.get("position"))){
+            sql = sql + " and position='%s' ";
+            sql = String.format(sql,map.get("position"));
+        }
+        sql = sql + "order by exp_date";
+        return commonDao.query(sql);
+    }
+
+    public List<Map<String,Object>> queryInventoryById(String id) {
+        String sql = "select * from t_reagent_inventory where id_='%s'";
+        return commonDao.query(String.format(sql,id));
+    }
+
+    public List<Map<String,Object>> queryLingYongRecord(String parentId) {
+        String sql = "select * from t_sjhclyzb where parent_id_='%s'";
+        return commonDao.query(String.format(sql,parentId));
+    }
 
-    public List<String> findRecordByStatus(String status){
-        return null;
+    public List<Map<String,Object>> queryBfRecord(String parentId) {
+        String sql = "select * from t_sjhcbfsqbzb where parent_id_='%s'";
+        return commonDao.query(String.format(sql,parentId));
+    }
+
+    public List<Map<String,Object>> queryThRecord(String id) {
+        String sql = "select * from t_sjhcthb where id_='%s'";
+        return commonDao.query(String.format(sql,id));
+    }
 
+    public List<Map<String, Object>> queryInventoryByPhAndCode(String piHao,String reagentCode) {
+        String sql= "SELECT * from t_reagent_inventory WHERE batch_num='%s' and reagent_code='%s' order by exp_date";
+        return commonDao.query(String.format(sql,piHao,reagentCode));
     }
 }

+ 122 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/reagent/service/TakeStockService.java

@@ -0,0 +1,122 @@
+package com.lc.ibps.components.reagent.service;
+
+
+import cn.hutool.core.date.DateUtil;
+import com.lc.ibps.api.form.sql.util.BeanUtils;
+import com.lc.ibps.base.core.util.Collections;
+import com.lc.ibps.base.framework.id.UniqueIdUtil;
+import com.lc.ibps.base.framework.table.ICommonDao;
+import com.lc.ibps.cloud.provider.GenericProvider;
+import com.lc.ibps.untils.SqlUtil;
+import com.lc.ibps.untils.StrUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class TakeStockService extends GenericProvider {
+
+    @Resource
+    private ICommonDao commonDao;
+
+
+    public List<Map<String,Object>> takeStock(String ckId, String date,String type) throws Exception {
+        logger.warn("com.lc.ibps.components.reagent.service.TakeStockService.takeStock()--->ckId={},date={},type={}", ckId, date, type);
+        String sql = "SELECT *from v_reagentinventory WHERE withhold=0 ORDER BY ming_cheng_";
+        if(BeanUtils.isNotEmpty(ckId)){
+            sql = "SELECT *from v_reagentinventory where withhold=0 and position in('%s') ORDER BY ming_cheng_";
+        }
+        List<Map<String,Object>> list = commonDao.query(sql);
+        if(Collections.isEmpty(list)){
+            return new ArrayList<>();
+        }
+        String currDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
+
+        if (BeanUtils.isEmpty(date)){
+            date = currDate;
+        }
+        String mainId = UniqueIdUtil.getId();
+        Map<String,Object> main = new HashMap<>();
+
+        for(Map<String,Object> map : list){
+            String transSql = "SELECT sum(quantity) as quantity,type_ from t_reagent_trans WHERE DATE_FORMAT(create_time_,'%%Y-%%m')='%s' and inventory_id='%s' GROUP BY type_";
+            String id = StrUtil.str(map.get("id_"));
+            long lastMonth = 0L;
+            long currIn = 0L;
+            long currOut = 0L;
+            long currBalance = StrUtil.parseLongSafe(map.get("quantity"));
+            List<Map<String,Object>> trans = commonDao.query(String.format(transSql, date, id));
+            if(Collections.isNotEmpty(trans)){
+                lastMonth = currBalance;
+                for (Map<String,Object> tran : trans){
+                    String lei = StrUtil.str(tran.get("type_"));
+                    if ("-1".equals(lei)){
+                        currOut = StrUtil.parseLongSafe(tran.get("quantity"));
+                        lastMonth = lastMonth + currOut;
+                    }else {
+                        currIn = StrUtil.parseLongSafe(tran.get("quantity"));
+                        lastMonth = lastMonth - currIn;
+                    }
+                }
+            }
+            lastMonth = Math.max(lastMonth, 0);
+            map.put("lastMonth" , lastMonth);
+            map.put("currIn" , currIn);
+            map.put("currOut" , currOut);
+            map.put("currBalance" , currBalance);
+            if ("job".equals(type)){
+                // 定时任务执行 需要在每月最后一天 自动推送盘点记录流程  添加盘点主子表数据
+                // 主表 t_sjhcpdb  子表 t_sjhcpdzb
+                main.put("di_dian_",map.get("di_dian_"));
+                Map<String,Object> sub = new HashMap<>();
+                sub.put("id_" , UniqueIdUtil.getId());
+                sub.put("parent_id_",mainId);
+                sub.put("create_by_","1");
+                sub.put("create_time_", DateUtil.now());
+                sub.put("shi_fou_guo_shen_","待处理");
+                sub.put("di_dian_","");
+                sub.put("shi_ji_ming_cheng",StrUtil.str(map.get("ming_cheng_")));
+                sub.put("bian_ma_",StrUtil.str(map.get("bian_ma")));
+                sub.put("pi_hao_",StrUtil.str(map.get("batch_num")));
+                sub.put("lei_bie_",StrUtil.str(map.get("lei_bie_")));
+                sub.put("gui_ge_",StrUtil.str(map.get("gui_ge_")));
+                sub.put("dan_wei_",StrUtil.str(map.get("dan_wei_")));
+                //sub.put("sheng_chan_ri_qi_","");
+                sub.put("you_xiao_qi_",StrUtil.str(map.get("exp_date")));
+                sub.put("sheng_chan_shang_",StrUtil.str(map.get("chang_jia_")));
+                sub.put("ku_cun_liang_", StrUtil.parseLongSafe(map.get("quantity")));
+                sub.put("cun_chu_wei_zhi_",StrUtil.str(map.get("position")));
+                sub.put("shang_yue_jie_cun",lastMonth);
+                sub.put("ben_yue_ru_ku_",currIn);
+                sub.put("ben_yue_chu_ku_",currOut);
+                sub.put("ben_yue_jie_cun_",currBalance);
+                commonDao.execute(SqlUtil.buildInsertSql(sub,"t_sjhcpdzb"));
+            }
+        }
+        if ("job".equals(type)){
+            // 定时任务执行 需要在每月最后一天 自动推送盘点记录流程  添加盘点主子表数据
+            // 主表 t_sjhcpdb
+            main.put("id_" , mainId);
+            main.put("create_by_","1");
+            main.put("create_time_", DateUtil.now());
+            main.put("shi_fou_guo_shen_","待处理");
+            main.put("yue_fen_",date);
+            commonDao.execute(SqlUtil.buildInsertSql(main,"t_sjhcpdb"));
+
+            // 更新库存为 是否可用为 否 即冻结库存
+            List<String> ids = list.stream().map(record -> record.get("id_").toString()).collect(Collectors.toList());
+            String updSql = "update t_reagent_inventory set enable_='否' where id_ in (%s)";
+            commonDao.execute(String.format(updSql,String.join(",",ids)));
+            logger.warn("库存冻结,盘点记录推送成功");
+        }
+        return list;
+    }
+
+}

+ 11 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/untils/StrUtil.java

@@ -9,4 +9,15 @@ public class StrUtil {
         return obj.toString();
     }
 
+    public static long parseLongSafe(Object value) {
+        if (value == null) {
+            return 0L;
+        }
+        try {
+            return Long.parseLong(value.toString());
+        } catch (NumberFormatException e) {
+            return 0L;
+        }
+    }
+
 }

+ 112 - 0
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/LingYong.map.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.lc.ibps.components.reagent.persistence.entity.LingYongPo">
+	<!--<cache type="net.oschina.j2cache.mybatis.J2CacheAdapter"/>-->
+	<resultMap id="LingYongPo" type="com.lc.ibps.components.reagent.persistence.entity.LingYongPo">
+		<id property="id" column="ID_" jdbcType="VARCHAR"/>
+		<result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
+		<result property="ip" column="IP_" jdbcType="VARCHAR"/>
+		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
+		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
+		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
+		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
+		<result property="shiFouGuoShen" column="SHI_FOU_GUO_SHEN_" jdbcType="VARCHAR"/>
+		<result property="diDian" column="DI_DIAN_" jdbcType="VARCHAR"/>
+		<result property="bianZhiRen" column="BIAN_ZHI_REN_" jdbcType="VARCHAR"/>
+		<result property="bianZhiBuMen" column="BIAN_ZHI_BU_MEN_" jdbcType="VARCHAR"/>
+		<result property="bianZhiShiJian" column="BIAN_ZHI_SHI_JIAN" jdbcType="VARCHAR"/>
+		<result property="kuaiZhao" column="KUAI_ZHAO_" jdbcType="VARCHAR"/>
+		<result property="bianHao" column="BIAN_HAO_" jdbcType="VARCHAR"/>
+		<result property="lYShiJiHaoCa" column="L_Y_SHI_JI_HAO_CA" jdbcType="BLOB"/>
+		<result property="sJHCMC" column="S_J_H_C_M_C_" jdbcType="BLOB"/>
+		<result property="lingYongRiQi" column="LING_YONG_RI_QI_" jdbcType="VARCHAR"/>
+		<result property="jingShouRen" column="JING_SHOU_REN_" jdbcType="BLOB"/>
+		<result property="beiZhu" column="BEI_ZHU_" jdbcType="BLOB"/>
+		<result property="lingYongFangSh" column="LING_YONG_FANG_SH" jdbcType="VARCHAR"/>
+		<result property="weiZhiLingYong" column="WEI_ZHI_LING_YONG" jdbcType="VARCHAR"/>
+		<result property="jingShouRen2" column="JING_SHOU_REN_2_" jdbcType="VARCHAR"/>
+	</resultMap>
+	
+	<sql id="columns">
+		ID_,TENANT_ID_,IP_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,SHI_FOU_GUO_SHEN_,DI_DIAN_,BIAN_ZHI_REN_,BIAN_ZHI_BU_MEN_,BIAN_ZHI_SHI_JIAN,KUAI_ZHAO_,BIAN_HAO_,L_Y_SHI_JI_HAO_CA,S_J_H_C_M_C_,LING_YONG_RI_QI_,JING_SHOU_REN_,BEI_ZHU_,LING_YONG_FANG_SH,WEI_ZHI_LING_YONG,JING_SHOU_REN_2_
+	</sql>
+	
+	<insert id="create" parameterType="com.lc.ibps.components.reagent.persistence.entity.LingYongPo">
+		INSERT INTO T_SJHCLY
+		(<include refid="columns"/>)
+		VALUES 
+		(#{id,jdbcType=VARCHAR}, #{tenantId,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{shiFouGuoShen,jdbcType=VARCHAR}, #{diDian,jdbcType=VARCHAR}, #{bianZhiRen,jdbcType=VARCHAR}, #{bianZhiBuMen,jdbcType=VARCHAR}, #{bianZhiShiJian,jdbcType=VARCHAR}, #{kuaiZhao,jdbcType=VARCHAR}, #{bianHao,jdbcType=VARCHAR}, #{lYShiJiHaoCa,jdbcType=BLOB}, #{sJHCMC,jdbcType=BLOB}, #{lingYongRiQi,jdbcType=VARCHAR}, #{jingShouRen,jdbcType=BLOB}, #{beiZhu,jdbcType=BLOB}, #{lingYongFangSh,jdbcType=VARCHAR}, #{weiZhiLingYong,jdbcType=VARCHAR}, #{jingShouRen2,jdbcType=VARCHAR})
+	</insert>
+	
+	<select id="get" parameterType="java.lang.String" resultMap="LingYongPo">
+		SELECT <include refid="columns"/> FROM T_SJHCLY 
+		WHERE 
+		ID_=#{id}
+	</select>
+	
+	
+	<sql id="querySql" >
+		SELECT <include refid="columns"/> FROM T_SJHCLY
+		<where>
+			<if test="@o.Ognl@isNotEmpty(whereSql)">
+				${whereSql}
+			</if>
+		</where>
+		<if test="@o.Ognl@isNotEmpty(orderBySql)">
+			ORDER BY ${orderBySql}
+		</if>
+		<if test="@o.Ognl@isEmpty(orderBySql)">
+			ORDER BY ID_ DESC
+		</if>
+	</sql>
+	
+	<select id="query" parameterType="java.util.Map" resultMap="LingYongPo">
+		<include refid="querySql"/>
+	</select>
+	
+	<select id="queryIds" parameterType="java.util.Map" resultMap="LingYongPo">
+		SELECT ID_ FROM (<include refid="querySql"/>) T
+	</select>
+	
+	<select id="findByIds" resultMap="LingYongPo">
+		SELECT <include refid="columns"/> FROM T_SJHCLY
+			WHERE ID_ in 
+			<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">  
+				#{id}  
+			</foreach>  		
+			ORDER BY ID_ DESC			
+	</select>	
+	
+	<update id="update" parameterType="com.lc.ibps.components.reagent.persistence.entity.LingYongPo">
+		UPDATE T_SJHCLY SET
+		TENANT_ID_=#{tenantId,jdbcType=VARCHAR},
+		IP_=#{ip,jdbcType=VARCHAR},
+		UPDATE_BY_=#{updateBy,jdbcType=VARCHAR},
+		UPDATE_TIME_=#{updateTime,jdbcType=TIMESTAMP},
+		SHI_FOU_GUO_SHEN_=#{shiFouGuoShen,jdbcType=VARCHAR},
+		DI_DIAN_=#{diDian,jdbcType=VARCHAR},
+		BIAN_ZHI_REN_=#{bianZhiRen,jdbcType=VARCHAR},
+		BIAN_ZHI_BU_MEN_=#{bianZhiBuMen,jdbcType=VARCHAR},
+		BIAN_ZHI_SHI_JIAN=#{bianZhiShiJian,jdbcType=VARCHAR},
+		KUAI_ZHAO_=#{kuaiZhao,jdbcType=VARCHAR},
+		BIAN_HAO_=#{bianHao,jdbcType=VARCHAR},
+		L_Y_SHI_JI_HAO_CA=#{lYShiJiHaoCa,jdbcType=BLOB},
+		S_J_H_C_M_C_=#{sJHCMC,jdbcType=BLOB},
+		LING_YONG_RI_QI_=#{lingYongRiQi,jdbcType=VARCHAR},
+		JING_SHOU_REN_=#{jingShouRen,jdbcType=BLOB},
+		BEI_ZHU_=#{beiZhu,jdbcType=BLOB},
+		LING_YONG_FANG_SH=#{lingYongFangSh,jdbcType=VARCHAR},
+		WEI_ZHI_LING_YONG=#{weiZhiLingYong,jdbcType=VARCHAR},
+		JING_SHOU_REN_2_=#{jingShouRen2,jdbcType=VARCHAR}
+		WHERE
+		ID_=#{id}
+	</update>
+	
+	<delete id="remove" parameterType="java.lang.String">
+		DELETE FROM T_SJHCLY 
+		WHERE
+		ID_=#{id}
+	</delete>
+	
+	
+</mapper>

+ 168 - 0
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/LingYongDetail.map.xml

@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo">
+	<!--<cache type="net.oschina.j2cache.mybatis.J2CacheAdapter"/>-->
+	<resultMap id="LingYongDetailPo" type="com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo">
+		<id property="id" column="ID_" jdbcType="VARCHAR"/>
+		<result property="parentId" column="PARENT_ID_" jdbcType="VARCHAR"/>
+		<result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
+		<result property="ip" column="IP_" jdbcType="VARCHAR"/>
+		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
+		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
+		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
+		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
+		<result property="shiFouGuoShen" column="SHI_FOU_GUO_SHEN_" jdbcType="VARCHAR"/>
+		<result property="diDian" column="DI_DIAN_" jdbcType="VARCHAR"/>
+		<result property="bianZhiRen" column="BIAN_ZHI_REN_" jdbcType="VARCHAR"/>
+		<result property="bianZhiBuMen" column="BIAN_ZHI_BU_MEN_" jdbcType="VARCHAR"/>
+		<result property="bianZhiShiJian" column="BIAN_ZHI_SHI_JIAN" jdbcType="VARCHAR"/>
+		<result property="kuaiZhao" column="KUAI_ZHAO_" jdbcType="VARCHAR"/>
+		<result property="shiJiMingCheng" column="SHI_JI_MING_CHENG" jdbcType="VARCHAR"/>
+		<result property="guiGe" column="GUI_GE_" jdbcType="VARCHAR"/>
+		<result property="danWei" column="DAN_WEI_" jdbcType="VARCHAR"/>
+		<result property="sCChangJia" column="S_C_CHANG_JIA_" jdbcType="VARCHAR"/>
+		<result property="faHuoShiJian" column="FA_HUO_SHI_JIAN_" jdbcType="VARCHAR"/>
+		<result property="ruKuBianHao" column="RU_KU_BIAN_HAO_" jdbcType="VARCHAR"/>
+		<result property="bianMa" column="BIAN_MA_" jdbcType="VARCHAR"/>
+		<result property="piHao" column="PI_HAO_" jdbcType="VARCHAR"/>
+		<result property="youXiaoQi" column="YOU_XIAO_QI_" jdbcType="VARCHAR"/>
+		<result property="inventoryId" column="INVENTORY_ID" jdbcType="VARCHAR"/>
+		<result property="cunChuWeiZhi" column="CUN_CHU_WEI_ZHI_" jdbcType="VARCHAR"/>
+		<result property="cunChuTiaoJian" column="CUN_CHU_TIAO_JIAN" jdbcType="VARCHAR"/>
+		<result property="zhuangTai" column="ZHUANG_TAI_" jdbcType="VARCHAR"/>
+		<result property="jingShouRen" column="JING_SHOU_REN_" jdbcType="VARCHAR"/>
+		<result property="beiZhu" column="BEI_ZHU_" jdbcType="BLOB"/>
+		<result property="lingYongRiQi" column="LING_YONG_RI_QI_" jdbcType="VARCHAR"/>
+		<result property="shuLiang" column="SHU_LIANG_" jdbcType="VARCHAR"/>
+		<result property="leiBie" column="LEI_BIE_" jdbcType="VARCHAR"/>
+		<result property="kuCunLiang" column="KU_CUN_LIANG_" jdbcType="VARCHAR"/>
+		<result property="jingShouRen2" column="JING_SHOU_REN_2_" jdbcType="VARCHAR"/>
+		<result property="cangKuId" column="CANG_KU_ID_" jdbcType="VARCHAR"/>
+		<result property="taiZhangId" column="TAI_ZHANG_ID_" jdbcType="VARCHAR"/>
+	</resultMap>
+	
+	<sql id="columns">
+		ID_,PARENT_ID_,TENANT_ID_,IP_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,SHI_FOU_GUO_SHEN_,DI_DIAN_,BIAN_ZHI_REN_,
+		BIAN_ZHI_BU_MEN_,BIAN_ZHI_SHI_JIAN,KUAI_ZHAO_,SHI_JI_MING_CHENG,GUI_GE_,DAN_WEI_,S_C_CHANG_JIA_,FA_HUO_SHI_JIAN_,
+		RU_KU_BIAN_HAO_,BIAN_MA_,PI_HAO_,YOU_XIAO_QI_,INVENTORY_ID,CUN_CHU_WEI_ZHI_,CUN_CHU_TIAO_JIAN,ZHUANG_TAI_,JING_SHOU_REN_,
+		BEI_ZHU_,LING_YONG_RI_QI_,SHU_LIANG_,LEI_BIE_,KU_CUN_LIANG_,JING_SHOU_REN_2_,CANG_KU_ID_,TAI_ZHANG_ID_
+	</sql>
+	
+	<insert id="create" parameterType="com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo">
+		INSERT INTO T_SJHCLYZB
+		(<include refid="columns"/>)
+		VALUES 
+		(#{id,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{tenantId,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
+		#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{shiFouGuoShen,jdbcType=VARCHAR},
+		#{diDian,jdbcType=VARCHAR}, #{bianZhiRen,jdbcType=VARCHAR}, #{bianZhiBuMen,jdbcType=VARCHAR}, #{bianZhiShiJian,jdbcType=VARCHAR},
+		#{kuaiZhao,jdbcType=VARCHAR}, #{shiJiMingCheng,jdbcType=VARCHAR}, #{guiGe,jdbcType=VARCHAR}, #{danWei,jdbcType=VARCHAR},
+		#{sCChangJia,jdbcType=VARCHAR}, #{faHuoShiJian,jdbcType=VARCHAR}, #{ruKuBianHao,jdbcType=VARCHAR}, #{bianMa,jdbcType=VARCHAR},
+		#{piHao,jdbcType=VARCHAR}, #{youXiaoQi,jdbcType=VARCHAR}, #{inventoryId,jdbcType=VARCHAR}, #{cunChuWeiZhi,jdbcType=VARCHAR},
+		#{cunChuTiaoJian,jdbcType=VARCHAR}, #{zhuangTai,jdbcType=VARCHAR}, #{jingShouRen,jdbcType=VARCHAR}, #{beiZhu,jdbcType=BLOB},
+		#{lingYongRiQi,jdbcType=VARCHAR}, #{shuLiang,jdbcType=VARCHAR}, #{leiBie,jdbcType=VARCHAR}, #{kuCunLiang,jdbcType=VARCHAR},
+		#{jingShouRen2,jdbcType=VARCHAR}, #{cangKuId,jdbcType=VARCHAR}, #{taiZhangId,jdbcType=VARCHAR})
+	</insert>
+	
+	<select id="get" parameterType="java.lang.String" resultMap="LingYongDetailPo">
+		SELECT <include refid="columns"/> FROM T_SJHCLYZB 
+		WHERE 
+		ID_=#{id}
+	</select>
+	
+	
+	<sql id="querySql" >
+		SELECT <include refid="columns"/> FROM T_SJHCLYZB
+		<where>
+			<if test="@o.Ognl@isNotEmpty(whereSql)">
+				${whereSql}
+			</if>
+		</where>
+		<if test="@o.Ognl@isNotEmpty(orderBySql)">
+			ORDER BY ${orderBySql}
+		</if>
+		<if test="@o.Ognl@isEmpty(orderBySql)">
+			ORDER BY ID_ DESC
+		</if>
+	</sql>
+	
+	<select id="query" parameterType="java.util.Map" resultMap="LingYongDetailPo">
+		<include refid="querySql"/>
+	</select>
+	
+	<select id="queryIds" parameterType="java.util.Map" resultMap="LingYongDetailPo">
+		SELECT ID_ FROM (<include refid="querySql"/>) T
+	</select>
+	
+	<select id="findByIds" resultMap="LingYongDetailPo">
+		SELECT <include refid="columns"/> FROM T_SJHCLYZB
+			WHERE ID_ in 
+			<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">  
+				#{id}  
+			</foreach>  		
+			ORDER BY ID_ DESC			
+	</select>	
+	
+	<update id="update" parameterType="com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo">
+		UPDATE T_SJHCLYZB SET
+		PARENT_ID_=#{parentId,jdbcType=VARCHAR},
+		TENANT_ID_=#{tenantId,jdbcType=VARCHAR},
+		IP_=#{ip,jdbcType=VARCHAR},
+		UPDATE_BY_=#{updateBy,jdbcType=VARCHAR},
+		UPDATE_TIME_=#{updateTime,jdbcType=TIMESTAMP},
+		SHI_FOU_GUO_SHEN_=#{shiFouGuoShen,jdbcType=VARCHAR},
+		DI_DIAN_=#{diDian,jdbcType=VARCHAR},
+		BIAN_ZHI_REN_=#{bianZhiRen,jdbcType=VARCHAR},
+		BIAN_ZHI_BU_MEN_=#{bianZhiBuMen,jdbcType=VARCHAR},
+		BIAN_ZHI_SHI_JIAN=#{bianZhiShiJian,jdbcType=VARCHAR},
+		KUAI_ZHAO_=#{kuaiZhao,jdbcType=VARCHAR},
+		SHI_JI_MING_CHENG=#{shiJiMingCheng,jdbcType=VARCHAR},
+		GUI_GE_=#{guiGe,jdbcType=VARCHAR},
+		DAN_WEI_=#{danWei,jdbcType=VARCHAR},
+		S_C_CHANG_JIA_=#{sCChangJia,jdbcType=VARCHAR},
+		FA_HUO_SHI_JIAN_=#{faHuoShiJian,jdbcType=VARCHAR},
+		RU_KU_BIAN_HAO_=#{ruKuBianHao,jdbcType=VARCHAR},
+		BIAN_MA_=#{bianMa,jdbcType=VARCHAR},
+		PI_HAO_=#{piHao,jdbcType=VARCHAR},
+		YOU_XIAO_QI_=#{youXiaoQi,jdbcType=VARCHAR},
+		INVENTORY_ID=#{inventoryId,jdbcType=VARCHAR},
+		CUN_CHU_WEI_ZHI_=#{cunChuWeiZhi,jdbcType=VARCHAR},
+		CUN_CHU_TIAO_JIAN=#{cunChuTiaoJian,jdbcType=VARCHAR},
+		ZHUANG_TAI_=#{zhuangTai,jdbcType=VARCHAR},
+		JING_SHOU_REN_=#{jingShouRen,jdbcType=VARCHAR},
+		BEI_ZHU_=#{beiZhu,jdbcType=BLOB},
+		LING_YONG_RI_QI_=#{lingYongRiQi,jdbcType=VARCHAR},
+		SHU_LIANG_=#{shuLiang,jdbcType=VARCHAR},
+		LEI_BIE_=#{leiBie,jdbcType=VARCHAR},
+		KU_CUN_LIANG_=#{kuCunLiang,jdbcType=VARCHAR},
+		JING_SHOU_REN_2_=#{jingShouRen2,jdbcType=VARCHAR},
+		CANG_KU_ID_=#{cangKuId,jdbcType=VARCHAR},
+		TAI_ZHANG_ID_=#{taiZhangId,jdbcType=VARCHAR}
+		WHERE
+		ID_=#{id}
+	</update>
+	
+	<delete id="remove" parameterType="java.lang.String">
+		DELETE FROM T_SJHCLYZB 
+		WHERE
+		ID_=#{id}
+	</delete>
+	
+	<delete id="deleteByMainId">
+	    DELETE FROM T_SJHCLYZB
+	    WHERE
+	    PARENT_ID_=#{mainId}
+	</delete>    
+	
+	<select id="findByMainId" resultMap="LingYongDetailPo">
+	    SELECT <include refid="columns"/>
+	    FROM T_SJHCLYZB 
+	    WHERE PARENT_ID_=#{mainId}
+	</select>
+	
+	<select id="findIdsByMainId" parameterType="java.util.Map" resultMap="LingYongDetailPo">
+		SELECT ID_ FROM T_SJHCLYZB
+	    WHERE
+	    PARENT_ID_=#{mainId}
+	</select>
+	
+</mapper>

+ 94 - 19
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/ReagentConsumablesInventory.map.xml

@@ -18,17 +18,30 @@
 		<result property="status" column="STATUS_" jdbcType="VARCHAR"/>
 		<result property="position" column="POSITION" jdbcType="VARCHAR"/>
 		<result property="diDian" column="DI_DIAN_" jdbcType="VARCHAR"/>
+		<result property="minStock" column="MIN_STOCK" jdbcType="NUMERIC"/>
+		<result property="stockWarn" column="STOCK_WARN" jdbcType="VARCHAR"/>
+		<result property="enable" column="ENABLE_" jdbcType="VARCHAR"/>
+		<result property="batchNum" column="BATCH_NUM" jdbcType="VARCHAR"/>
+		<result property="withhold" column="WITHHOLD" jdbcType="NUMERIC"/>
+		<result property="guiGe" column="GUI_GE_" jdbcType="VARCHAR"/>
+		<result property="arrivalDate" column="ARRIVAL_DATE" jdbcType="VARCHAR"/>
 	</resultMap>
 	
 	<sql id="columns">
-		ID_,REAGENT_CODE,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,FREEZE,QUANTITY,EXP_DATE,DI_DIAN_,COMMENTS,CHECKER,CHECKED_DATE,STATUS_,POSITION
+		ID_,REAGENT_CODE,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,FREEZE,QUANTITY,EXP_DATE,DI_DIAN_,COMMENTS,CHECKER,
+		CHECKED_DATE,STATUS_,POSITION,MIN_STOCK,STOCK_WARN,ENABLE_,BATCH_NUM,WITHHOLD,GUI_GE_,ARRIVAL_DATE
 	</sql>
 	
 	<insert id="create" parameterType="com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesInventoryPo">
 		INSERT INTO T_REAGENT_INVENTORY
 		(<include refid="columns"/>)
 		VALUES 
-		(#{id,jdbcType=VARCHAR}, #{reagentCode,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{freeze,jdbcType=VARCHAR}, #{quantity,jdbcType=NUMERIC}, #{expDate,jdbcType=VARCHAR}, #{diDian,jdbcType=VARCHAR}, #{comments,jdbcType=BLOB}, #{checker,jdbcType=VARCHAR}, #{checkedDate,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR})
+		(#{id,jdbcType=VARCHAR}, #{reagentCode,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+		#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{freeze,jdbcType=VARCHAR}, #{quantity,jdbcType=NUMERIC},
+		#{expDate,jdbcType=VARCHAR}, #{diDian,jdbcType=VARCHAR}, #{comments,jdbcType=BLOB}, #{checker,jdbcType=VARCHAR},
+		#{checkedDate,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{minStock,jdbcType=NUMERIC},
+		#{stockWarn,jdbcType=VARCHAR}, #{enable,jdbcType=VARCHAR},#{batchNum,jdbcType=VARCHAR},#{withhold,jdbcType=NUMERIC},
+		#{guiGe,jdbcType=VARCHAR},#{arrivalDate,jdbcType=VARCHAR})
 	</insert>
 	
 	<select id="get" parameterType="java.lang.String" resultMap="ReagentConsumablesInventoryPo">
@@ -68,24 +81,70 @@
 				#{id}  
 			</foreach>  		
 			ORDER BY ID_ DESC			
-	</select>	
-	
+	</select>
+
 	<update id="update" parameterType="com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesInventoryPo">
-		UPDATE T_REAGENT_INVENTORY SET
-		REAGENT_CODE=#{reagentCode,jdbcType=VARCHAR},
-		UPDATE_BY_=#{updateBy,jdbcType=VARCHAR},
-		UPDATE_TIME_=#{updateTime,jdbcType=TIMESTAMP},
-		FREEZE=#{freeze,jdbcType=VARCHAR},
-		QUANTITY=#{quantity,jdbcType=NUMERIC},
-		EXP_DATE=#{expDate,jdbcType=VARCHAR},
-		COMMENTS=#{comments,jdbcType=BLOB},
-		CHECKER=#{checker,jdbcType=VARCHAR},
-		DI_DIAN_=#{diDian,jdbcType=VARCHAR},
-		CHECKED_DATE=#{checkedDate,jdbcType=VARCHAR},
-		STATUS_=#{status,jdbcType=VARCHAR},
-		POSITION=#{position,jdbcType=VARCHAR}
-		WHERE
-		ID_=#{id}
+		UPDATE T_REAGENT_INVENTORY
+		<set>
+			<if test="reagentCode != null and reagentCode != ''">
+				REAGENT_CODE = #{reagentCode,jdbcType=VARCHAR},
+			</if>
+			<if test="updateBy != null and updateBy != ''">
+				UPDATE_BY_ = #{updateBy,jdbcType=VARCHAR},
+			</if>
+			<if test="updateTime != null">
+				UPDATE_TIME_ = #{updateTime,jdbcType=TIMESTAMP},
+			</if>
+			<if test="freeze != null and freeze != ''">
+				FREEZE = #{freeze,jdbcType=VARCHAR},
+			</if>
+			<if test="quantity != null">
+				QUANTITY = #{quantity,jdbcType=NUMERIC},
+			</if>
+			<if test="expDate != null and expDate != ''">
+				EXP_DATE = #{expDate,jdbcType=VARCHAR},
+			</if>
+			<if test="comments != null and comments != ''">
+				COMMENTS = #{comments,jdbcType=BLOB},
+			</if>
+			<if test="checker != null and checker != ''">
+				CHECKER = #{checker,jdbcType=VARCHAR},
+			</if>
+			<if test="diDian != null and diDian != ''">
+				DI_DIAN_ = #{diDian,jdbcType=VARCHAR},
+			</if>
+			<if test="checkedDate != null and checkedDate != ''">
+				CHECKED_DATE = #{checkedDate,jdbcType=VARCHAR},
+			</if>
+			<if test="status != null and status != ''">
+				STATUS_ = #{status,jdbcType=VARCHAR},
+			</if>
+			<if test="position != null and position != ''">
+				POSITION = #{position,jdbcType=VARCHAR},
+			</if>
+			<if test="minStock != null">
+				MIN_STOCK = #{minStock,jdbcType=NUMERIC},
+			</if>
+			<if test="stockWarn != null and stockWarn != ''">
+				STOCK_WARN = #{stockWarn,jdbcType=VARCHAR},
+			</if>
+			<if test="enable != null and enable != ''">
+				ENABLE_ = #{enable,jdbcType=VARCHAR},
+			</if>
+			<if test="batchNum != null and batchNum != ''">
+				BATCH_NUM = #{batchNum,jdbcType=VARCHAR},
+			</if>
+			<if test="withhold != null">
+				WITHHOLD = #{withhold,jdbcType=NUMERIC},
+			</if>
+			<if test="guiGe != null and guiGe != ''">
+				GUI_GE_ = #{guiGe,jdbcType=VARCHAR},
+			</if>
+			<if test="arrivalDate != null and arrivalDate != ''">
+				ARRIVAL_DATE = #{arrivalDate,jdbcType=VARCHAR},
+			</if>
+		</set>
+		WHERE ID_ = #{id}
 	</update>
 	
 	<delete id="remove" parameterType="java.lang.String">
@@ -111,5 +170,21 @@
 	    WHERE
 	    REAGENT_CODE=#{mainId}
 	</select>
+
+	<select id="findByPhAndCodeOrPosition" parameterType="java.lang.Object" resultMap="ReagentConsumablesInventoryPo">
+		SELECT * FROM T_REAGENT_INVENTORY
+		<where>
+			<if test="@o.Ognl@isNotEmpty(piHao)">
+				AND BATCH_NUM = #{piHao}
+			</if>
+			<if test="@o.Ognl@isNotEmpty(code)">
+				AND REAGENT_CODE = #{code}
+			</if>
+			<if test="@o.Ognl@isNotEmpty(position)">
+				AND POSITION = #{position}
+			</if>
+		</where>
+		ORDER BY EXP_DATE
+	</select>
 	
 </mapper>

+ 14 - 3
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/reagent/persistence/mapping/ReagentConsumablesTransaction.map.xml

@@ -18,17 +18,25 @@
 		<result property="type" column="TYPE_" jdbcType="NUMERIC"/>
 		<result property="boId" column="BO_ID" jdbcType="VARCHAR"/>
 		<result property="diDian" column="DI_DIAN_" jdbcType="VARCHAR"/>
+		<result property="batchNum" column="BATCH_NUM" jdbcType="VARCHAR"/>
+		<result property="inventoryId" column="INVENTORY_ID" jdbcType="VARCHAR"/>
+		<result property="flow" column="FLOW_" jdbcType="VARCHAR"/>
 	</resultMap>
 	
 	<sql id="columns">
-		ID_,PARENT_ID_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,REAGENT_CODE,QUANTITY,EXP_DATE,DI_DIAN_,POSITION,COMMENTS,STATUS_,TYPE_,BO_ID
+		ID_,PARENT_ID_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,REAGENT_CODE,QUANTITY,EXP_DATE,DI_DIAN_,POSITION,
+		COMMENTS,STATUS_,TYPE_,BO_ID,BATCH_NUM,INVENTORY_ID,FLOW_
 	</sql>
 	
 	<insert id="create" parameterType="com.lc.ibps.components.reagent.persistence.entity.ReagentConsumablesTransactionPo">
 		INSERT INTO T_REAGENT_TRANS
 		(<include refid="columns"/>)
 		VALUES 
-		(#{id,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{reagentCode,jdbcType=VARCHAR}, #{quantity,jdbcType=NUMERIC}, #{expDate,jdbcType=VARCHAR}, #{diDian,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{comments,jdbcType=BLOB}, #{status,jdbcType=VARCHAR}, #{type,jdbcType=NUMERIC}, #{boId,jdbcType=VARCHAR})
+		(#{id,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+		#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{reagentCode,jdbcType=VARCHAR}, #{quantity,jdbcType=NUMERIC},
+		#{expDate,jdbcType=VARCHAR}, #{diDian,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{comments,jdbcType=BLOB},
+		#{status,jdbcType=VARCHAR}, #{type,jdbcType=NUMERIC}, #{boId,jdbcType=VARCHAR},#{batchNum,jdbcType=VARCHAR}
+		,#{inventoryId,jdbcType=VARCHAR},#{flow,jdbcType=VARCHAR})
 	</insert>
 	
 	<select id="get" parameterType="java.lang.String" resultMap="ReagentConsumablesTransactionPo">
@@ -83,7 +91,10 @@
 		DI_DIAN_=#{diDian,jdbcType=VARCHAR},
 		STATUS_=#{status,jdbcType=VARCHAR},
 		TYPE_=#{type,jdbcType=NUMERIC},
-		BO_ID=#{boId,jdbcType=VARCHAR}
+		BO_ID=#{boId,jdbcType=VARCHAR},
+		BATCH_NUM=#{batchNum,jdbcType=VARCHAR},
+		INVENTORY_ID=#{inventoryId,jdbcType=VARCHAR},
+		FLOW_=#{flow,jdbcType=VARCHAR}
 		WHERE
 		ID_=#{id}
 	</update>

+ 36 - 0
ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/cloud/timer/job/TakeStockJob.java

@@ -0,0 +1,36 @@
+package com.lc.ibps.cloud.timer.job;
+
+import com.lc.ibps.base.core.util.JacksonUtil;
+import com.lc.ibps.base.core.util.string.StringUtil;
+import com.lc.ibps.cloud.timer.utils.HttpUtil;
+import com.lc.ibps.components.quartz.BaseJob2;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TakeStockJob extends BaseJob2 {
+
+    private static final Logger logger = LoggerFactory.getLogger(TakeStockJob.class);
+    public static final String SERVICE_CODE = "service-code";
+
+    @Override
+    public void executeJob(JobExecutionContext context) throws Exception {
+        JobDataMap dataMap = context.getMergedJobDataMap();
+        if(logger.isInfoEnabled()) {
+            logger.warn("group={} job={} trigger={} is running.",
+                    context.getJobDetail().getKey().getGroup(),
+                    context.getJobDetail().getKey().getName(),
+                    context.getTrigger().getKey().getName());
+            logger.warn("jobDataMap=is {}.", JacksonUtil.toJsonString(dataMap.getWrappedMap()));
+        }
+
+        String serverCode = dataMap.getString(SERVICE_CODE);
+        if(StringUtil.isBlank(serverCode)){
+            throw new RuntimeException("service url is empty.");
+        }
+        HttpUtil.doPostByParams(serverCode,"job");
+    }
+
+
+}

+ 26 - 1
ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/cloud/timer/utils/HttpUtil.java

@@ -36,7 +36,7 @@ public class HttpUtil {
         Header header = new BasicHeader(ParameterKey.HEADER_AUTHORIZATION, accessToken);
         String runqianServer = EnvUtil.getProperty("runqian.server", "");
         // http://192.168.2.247:5100/ibps/business/v3/sys/CronNotify/data
-        // runqianServer = "http://192.168.2.247:5100";
+        //runqianServer = "http://192.168.2.8:5100";
         url = runqianServer + url;
         String responseData = ApacheHttpClient.doPost(url, nameValuePairs, header);
         APIResult<Void> result = JacksonUtil.getDTO(responseData, APIResult.class);
@@ -48,4 +48,29 @@ public class HttpUtil {
         }
     }
 
+    public static void doPostByParams(String url,String type) throws Exception{
+        ITenantTokenService tenantTokenService = AppUtil.getBean(ITenantTokenService.class);
+        String accessToken = tenantTokenService.getAccessToken();
+        ContextUtil.setCurrentAccessToken(accessToken);
+        List<NameValuePair> params = ApacheHttpClient.NameValuePairBuilder.create()
+                .add(ParameterKey.PARAMETER_ACCESS_TOKEN, accessToken)
+                .add("ckId", "")
+                .add("date", "")
+                .add("type", type)
+                .build();
+        Header header = new BasicHeader(ParameterKey.HEADER_AUTHORIZATION, accessToken);
+        String runqianServer = EnvUtil.getProperty("runqian.server", "");
+        // http://192.168.2.247:5100/ibps/business/v3/sys/CronNotify/data
+        //runqianServer = "http://192.168.2.8:5100";
+        url = runqianServer + url;
+        String responseData = ApacheHttpClient.doPost(url, params, header);
+        APIResult result = JacksonUtil.getDTO(responseData, APIResult.class);
+        if(null == result){
+            throw new RuntimeException("response is empty.");
+        }
+        if(StateEnum.SUCCESS.getCode() != result.getState()){
+            throw new BaseException(result.getCause());
+        }
+    }
+
 }