Browse Source

fix:[填报表单]药剂存储

master
15881625488@163.com 2 months ago
parent
commit
93fb5111e4
6 changed files with 46 additions and 11 deletions
  1. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java
  2. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java
  3. +7
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java
  4. +1
    -5
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java
  5. +2
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java
  6. +14
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java

+ 11
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java View File

@ -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")

+ 11
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java View File

@ -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;
}

+ 7
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java View File

@ -91,6 +91,13 @@ public interface IStudyFormFillService extends IService
*/
public void tj(StudyFormFill studyFormFill);
/**
* 药剂存储
* @param studyFormFill
* @return
*/
public void yjcc(StudyFormFill studyFormFill);
/**
* 观察

+ 1
- 5
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java View File

@ -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<StudyFormFillResource> studyFormFillResourceList = JSONUtil.toList(resource, StudyFormFillResource.class);
String ss = "1";
List<StudyFormFillResource> 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 {

+ 2
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java View File

@ -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<String, String> formData = new LinkedHashMap<>();
formData.put("使用量", syl + studyFormFillResource.getSyldw());

+ 14
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java View File

@ -382,6 +382,20 @@ public class StudyFormFillServiceImpl extends ServiceImpl
}
/**
* 药剂存储
*
* @param studyFormFill
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void yjcc(StudyFormFill studyFormFill) {
SysUser qmr = SecurityUtils.getLoginUser().getSysUser();
//验证签名人密码
checkPassword(SecurityUtils.getLoginUser().getSysUser(), studyFormFill.getQmrmm());
//todo
}
/**
* 提交
*
* @param studyFormFill

Loading…
Cancel
Save