diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index 8bd5082..c5681dd 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -214,6 +214,17 @@ public class StudyFormFillController extends BaseController { /** + * 药剂存储 + */ + @PostMapping("/yjcc") + @RequiresPermissions(value = {"business:studyFormFill:bj", "business:nonTrialFormFill:bj", "business:drugFormFill:bj"}, logical = Logical.OR) + public AjaxResult yjcc(@RequestBody StudyFormFill studyFormFill) { + studyFormFillService.yjcc(studyFormFill); + return AjaxResult.success("操作成功"); + } + + + /** * 观察 */ @PostMapping("/gc") diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java index 83fb0c2..edecd43 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java @@ -52,6 +52,9 @@ public class Template extends MpBaseEntity /** 填报显示观察按钮:1:否;10:显示 */ private Integer showGc; + /** 填报显示药剂存储按钮:1:否;10:显示 */ + private Integer showYjcc; + /** 所属试验类型:1试验,5非试验表单,10麻精药表单,20全部 */ private Integer studyType; @@ -68,6 +71,14 @@ public class Template extends MpBaseEntity @TableField(exist = false) private String deptName; + public Integer getShowYjcc() { + return showYjcc; + } + + public void setShowYjcc(Integer showYjcc) { + this.showYjcc = showYjcc; + } + public Integer getStudyType() { return studyType; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java index 7435a99..f2bc2a5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java @@ -91,6 +91,13 @@ public interface IStudyFormFillService extends IService */ public void tj(StudyFormFill studyFormFill); + /** + * 药剂存储 + * @param studyFormFill + * @return + */ + public void yjcc(StudyFormFill studyFormFill); + /** * 观察 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java index 13ffbe8..1ba5f5b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java @@ -1324,7 +1324,6 @@ public class GyzjServiceImpl extends ServiceImpl implements IG public void genResource(StudyFormFill studyFormFill, Template template, String remark) { Boolean mark = template.getProduct().equals(StudyFormFillResourceTypeEnum.gyzj.getValue()) ? true : false; SysUser qmr = sysUserService.selectUserById(SecurityUtils.getUserId()); - Long studyId = studyFormFill.getStudyId(); Long studyFormId = studyFormFill.getId(); // 生成/使用 @@ -1336,7 +1335,6 @@ public class GyzjServiceImpl extends ServiceImpl implements IG String empty = "[]"; if (StringUtils.isNotEmpty(resource) && !StringUtils.equals(empty, resource)) { List studyFormFillResourceList = JSONUtil.toList(resource, StudyFormFillResource.class); - String ss = "1"; List tmp = studyFormFillResourceList.stream().filter(p -> (p.getType() == null && mark) || (p.getType() != null && StudyFormFillResourceTypeEnum.gyzj.getValue() == p.getType())).collect(Collectors.toList()); // 根据编号获取需要处置的列表 if (tmp.size() > 0) { @@ -1357,7 +1355,6 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzj.setBdId(studyFormId); gyzj.setZjzt(ZjztEnum.wrk.getValue()); gyzj.setJyzt(JyztEnum.wjy.getValue()); - gyzj.setMc(studyFormFillResource.getMc()); gyzj.setBh(studyFormFillResource.getBh()); gyzj.setLy(studyFormFillResource.getLy()); @@ -1367,7 +1364,6 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzj.setKcdw(studyFormFillResource.getKcdw()); gyzj.setSxrq(DateUtils.parseDate(studyFormFillResource.getSxrq())); } - if (gyzj.getId() == null) { this.save(gyzj); gyzjList.add(gyzj); @@ -1377,7 +1373,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG // 台账 tzList.add(gyzjTzService.getTzGen(gyzj.getId(), null, null, null, null, null, null, null, null, qmr, "配制完成", gyzj.getKc(), gyzj.getKcdw(), remark, studyFormFill.getId())); } else { -// this.updateById(gyzj); + this.updateById(gyzj); } studyFormFillResource.setType(StudyFormFillResourceTypeEnum.gyzj.getValue()); } else { diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java index 8bb092e..a0add31 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java @@ -1229,7 +1229,6 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS public void genResource(StudyFormFill studyFormFill, Template template, String remark) { Boolean mark = template.getProduct().equals(StudyFormFillResourceTypeEnum.mjy.getValue()) ? true : false; SysUser qmr = sysUserService.selectUserById(SecurityUtils.getUserId()); - Long studyId = studyFormFill.getStudyId(); Long studyFormId = studyFormFill.getId(); // 生成/使用 @@ -1251,7 +1250,6 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS for (Mjy mjy : mjyList) { mjyMap.put(mjy.getBh(), mjy); } - for (StudyFormFillResource studyFormFillResource : studyFormFillResourceList) { Mjy mjy = mjyMap.get(studyFormFillResource.getBh()); //配置的才保存,或更新 @@ -1262,7 +1260,6 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS mjy.setBdId(studyFormId); mjy.setZjzt(ZjztEnum.wrk.getValue()); mjy.setJyzt(JyztEnum.wjy.getValue()); - mjy.setMc(studyFormFillResource.getMc()); mjy.setBh(studyFormFillResource.getBh()); mjy.setNd(String.valueOf(studyFormFillResource.getNd())); @@ -1272,7 +1269,6 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS mjy.setKcdw(studyFormFillResource.getKcdw()); mjy.setSxrq(DateUtils.parseDate(studyFormFillResource.getSxrq())); } - if (mjy.getId() == null) { this.save(mjy); mjyList.add(mjy); @@ -1282,7 +1278,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS // 台账 tzList.add(mjyTzService.getTzGen(mjy.getId(), null, null, null, null, null, null, null, null, qmr, "配制完成", mjy.getKc(), mjy.getKcdw(), remark, studyFormFill.getId())); } else { -// this.updateById(mjy); + this.updateById(mjy); } studyFormFillResource.setType(StudyFormFillResourceTypeEnum.mjy.getValue()); } else { @@ -1300,7 +1296,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS if (StringUtils.isNotEmpty(syl) && NumberUtils.isParsable(syl)) { String kc = CalUnitTools.subTj(mjy.getKc(), mjy.getKcdw(), syl, studyFormFillResource.getSyldw()); mjy.setKc(kc); - baseMapper.updateKc(mjy.getId(), kc.toString()); + baseMapper.updateKc(mjy.getId(), kc); // 使用稽查轨迹 HashMap formData = new LinkedHashMap<>(); formData.put("使用量", syl + studyFormFillResource.getSyldw()); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java index 249bf5f..6de54c5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java @@ -382,6 +382,20 @@ public class StudyFormFillServiceImpl extends ServiceImpl