|
|
@@ -9,7 +9,6 @@ import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
import com.lc.ibps.components.reagent.persistence.entity.LingYongDetailPo;
|
|
|
import com.lc.ibps.components.reagent.service.InventoryService;
|
|
|
import com.lc.ibps.form.dao.ReagentConsumableDao;
|
|
|
-import com.lc.ibps.form.vo.DataTemplateRequestVo;
|
|
|
import com.lc.ibps.untils.StrUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
|
|
@@ -21,7 +20,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;
|
|
|
@@ -106,6 +104,9 @@ public class LingYongProvider extends GenericProvider implements ILingYongServic
|
|
|
try {
|
|
|
logger.info(" com.lc.ibps.components.provider.LingYongProvider.save()--->lingYongPo: {}", lingYongPo.toString());
|
|
|
if(!lingYongPo.getLingYongDetailPoList().isEmpty()){
|
|
|
+ /** 把流水id转换为库存id */
|
|
|
+ ReagentConsumabConvertAndPadId(lingYongPo);
|
|
|
+
|
|
|
List<Map<String, Object>> records = new ArrayList<>(lingYongPo.getLingYongDetailPoList().size());
|
|
|
for (LingYongDetailPo bean : lingYongPo.getLingYongDetailPoList()) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
@@ -138,39 +139,81 @@ public class LingYongProvider extends GenericProvider implements ILingYongServic
|
|
|
/**
|
|
|
* 恒生医院 试剂耗材 出库流水hrp接入逻辑
|
|
|
*/
|
|
|
- private void ReagentConsumabOutputForHSYY(LingYongPo lingYongPo)throws Exception{
|
|
|
+ private void ReagentConsumabOutputForHSYY(LingYongPo lingYongPo){
|
|
|
/**
|
|
|
* 出库流水保存成功后,要从 试剂耗材出库流水表(t_sjhccklsb)里删除对应数据
|
|
|
*/
|
|
|
|
|
|
- /** 1.是否 恒生医院环境 */
|
|
|
- String setting = ContextUtil.getSetting();
|
|
|
- //ContextUtil.getSetting()的作用:从t_ipcc表的id_为1的数据的setting字段获取每个环境的独有的标识参数
|
|
|
- //恒生环境的特有标识:"HSYY":"true"
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- HashMap<String, Object> map =(HashMap) objectMapper.readValue(setting, Map.class);
|
|
|
- String hsyy = Optional.ofNullable(map)
|
|
|
- .map(m -> m.get("HSYY"))
|
|
|
- .map(Object::toString)
|
|
|
- .orElse("");
|
|
|
- boolean flag1 = Boolean.parseBoolean(hsyy);
|
|
|
- //flag1为 是否 恒生医院环境 的标识
|
|
|
-
|
|
|
- /** 2.如果 <是 恒生医院环境> */
|
|
|
- if(flag1){
|
|
|
- /** 3. 则删除 试剂耗材入库流水表(t_sjhccklsb)里对应数据 */
|
|
|
-
|
|
|
- /** 3-1.从 weiZhiLingYong 字段 中获取数据id */
|
|
|
- String ids = lingYongPo.getWeiZhiLingYong();
|
|
|
- if(StringUtils.isNotEmpty(ids)){
|
|
|
- /** 3-2. 数据库操作,删除已保存确认的入库流水记录 */
|
|
|
- List<String> idsList = Arrays.asList(ids.split(","));
|
|
|
- reagentConsumableDao.deleteByIdsForOutput(idsList);
|
|
|
+ try {
|
|
|
+ /** 1.是否 恒生医院环境 */
|
|
|
+ String setting = ContextUtil.getSetting();
|
|
|
+ //ContextUtil.getSetting()的作用:从t_ipcc表的id_为1的数据的setting字段获取每个环境的独有的标识参数
|
|
|
+ //恒生环境的特有标识:"HSYY":"true"
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ HashMap<String, Object> map =(HashMap) objectMapper.readValue(setting, Map.class);
|
|
|
+ String hsyy = Optional.ofNullable(map)
|
|
|
+ .map(m -> m.get("HSYY"))
|
|
|
+ .map(Object::toString)
|
|
|
+ .orElse("");
|
|
|
+ boolean flag1 = Boolean.parseBoolean(hsyy);
|
|
|
+ //flag1为 是否 恒生医院环境 的标识
|
|
|
+
|
|
|
+ /** 2.如果 <是 恒生医院环境> */
|
|
|
+ if(flag1){
|
|
|
+ /** 3. 则删除 试剂耗材入库流水表(t_sjhccklsb)里对应数据 */
|
|
|
+
|
|
|
+ /** 3-1.从 weiZhiLingYong 字段 中获取数据id */
|
|
|
+ String ids = lingYongPo.getWeiZhiLingYong();
|
|
|
+ if(StringUtils.isNotEmpty(ids)){
|
|
|
+ /** 3-2. 数据库操作,删除已保存确认的入库流水记录 */
|
|
|
+ List<String> idsList = Arrays.asList(ids.split(","));
|
|
|
+ reagentConsumableDao.deleteByIdsForOutput(idsList);
|
|
|
+ }
|
|
|
}
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("",e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ private void ReagentConsumabConvertAndPadId(LingYongPo lingYongPo){
|
|
|
+ try {
|
|
|
+ /** 1.是否 恒生医院环境 */
|
|
|
+ String setting = ContextUtil.getSetting();
|
|
|
+ //ContextUtil.getSetting()的作用:从t_ipcc表的id_为1的数据的setting字段获取每个环境的独有的标识参数
|
|
|
+ //恒生环境的特有标识:"HSYY":"true"
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ HashMap<String, Object> map =(HashMap) objectMapper.readValue(setting, Map.class);
|
|
|
+ String hsyy = Optional.ofNullable(map)
|
|
|
+ .map(m -> m.get("HSYY"))
|
|
|
+ .map(Object::toString)
|
|
|
+ .orElse("");
|
|
|
+ boolean flag1 = Boolean.parseBoolean(hsyy);
|
|
|
+ //flag1为 是否 恒生医院环境 的标识
|
|
|
+
|
|
|
+ /** 2.如果 <是 恒生医院环境> */
|
|
|
+ if(flag1){
|
|
|
+ /** 3. 将流水id转换为库存id */
|
|
|
+ String resultString = "";
|
|
|
+ StringJoiner joiner = new StringJoiner(",");
|
|
|
+ for (LingYongDetailPo bean : lingYongPo.getLingYongDetailPoList()) {
|
|
|
+ List<String> idList = reagentConsumableDao.getidBySid(bean.getInventoryId());
|
|
|
+ String id = idList.get(0);
|
|
|
+ bean.setInventoryId(id);
|
|
|
+ joiner.add(id);
|
|
|
+ }
|
|
|
+ resultString = joiner.toString();
|
|
|
+ lingYongPo.setWeiZhiLingYong(resultString);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("",e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@ApiOperation(value = "删除", notes = "删除试剂耗材领用主表",
|
|
|
extensions = {
|
|
|
@Extension(properties = {
|