Browse Source

feat: [填报表单] 增加所属部门字段、试剂的部门修改

master
memorylkf 3 weeks ago
parent
commit
401d93b6c7
6 changed files with 49 additions and 27 deletions
  1. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java
  2. +5
    -7
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java
  3. +6
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java
  4. +9
    -12
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java
  5. +16
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java
  6. +2
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/TemplateServiceImpl.java

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

@ -27,6 +27,9 @@ public class StudyFormFill extends MpBaseEntity
/** 所属试验学科id */
private Long studySubjectId;
/** 所属部门(试验就是学科的部门,非试验和麻精药就是当前人的部门) */
private Long belongDeptId;
/** 所属试验学科id */
private Long studyFormPreId;
@ -427,6 +430,14 @@ public class StudyFormFill extends MpBaseEntity
this.studySubjectId = studySubjectId;
}
public Long getBelongDeptId() {
return belongDeptId;
}
public void setBelongDeptId(Long belongDeptId) {
this.belongDeptId = belongDeptId;
}
public Long getStudyFormPreId() {
return studyFormPreId;
}

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

@ -32,7 +32,7 @@ public class Template extends MpBaseEntity
private String exportMethod;
/** 所属部门/学科 */
private Long deptId;
private String deptId;
/** 状态:1:禁用:10:启用 */
private Integer status;
@ -177,14 +177,12 @@ public class Template extends MpBaseEntity
return name;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
public String getDeptId() {
return deptId;
}
public Long getDeptId()
{
return deptId;
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public void setStatus(Integer status)

+ 6
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java View File

@ -27,25 +27,28 @@ public interface ISjService extends IService
/**
* 开始配置
* @param form
* @param studyFormFill
* @return
*/
public void startConfiguration(StudyFormConfigurationForm form);
public void startConfiguration(StudyFormConfigurationForm form,StudyFormFill studyFormFill);
/**
* 配置完成
* @param form
* @param studyFormFill
* @return
*/
public void configurationCompleted(StudyFormConfigurationForm form);
public void configurationCompleted(StudyFormConfigurationForm form,StudyFormFill studyFormFill);
/**
* 分装
* @param form
* @param studyFormFill
* @return
*/
public void subpackage(StudyFormFillSubpackageForm form);
public void subpackage(StudyFormFillSubpackageForm form,StudyFormFill studyFormFill);
/**
* 查询试剂列表

+ 9
- 12
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java View File

@ -691,7 +691,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
}
sj.setStudyId(studyFormFill.getStudyId());
sj.setStudyFormId(studyFormFill.getId());
sj.setDeptId(template.getDeptId());
sj.setDeptId(studyFormFill.getBelongDeptId());
sj.setZjzt(ZjztEnum.rk.getValue());
sj.setJyzt(JyztEnum.wjy.getValue());
sj.setMc(studyFormFillResource.getMc());
@ -771,22 +771,21 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
* @return
*/
@Override
public void startConfiguration(StudyFormConfigurationForm form) {
public void startConfiguration(StudyFormConfigurationForm form,StudyFormFill studyFormFill) {
Sj sj = this.getSjByBh(form.getBh());
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
if (sj == null) {
sj = new Sj();
sj.setBh(form.getBh());
sj.setPzrq(new Date());
sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(studySubject.getDeptId());
sj.setDeptId(studyFormFill.getBelongDeptId());
this.save(sj);
} else {
sj.setPzrq(new Date());
sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(studySubject.getDeptId());
sj.setDeptId(studyFormFill.getBelongDeptId());
this.updateById(sj);
}
sjJcgjService.saveJcgj(sj, JcgjlxEnum.lc.getValue(), "开始配置", "Start Configuration", JcmcysEnum.blue.getValue(), null, null);
@ -800,9 +799,8 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
* @return
*/
@Override
public void configurationCompleted(StudyFormConfigurationForm form) {
public void configurationCompleted(StudyFormConfigurationForm form,StudyFormFill studyFormFill) {
Sj sj = this.getSjByBh(form.getBh());
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
if (sj == null) {
sj = new Sj();
@ -811,7 +809,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sj.setKcdw(form.getKcdw());
sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(studySubject.getDeptId());
sj.setDeptId(studyFormFill.getBelongDeptId());
sj.setNd(form.getNd());
sj.setNddw(form.getNddw());
sj.setZjzt(ZjztEnum.rk.getValue());
@ -823,7 +821,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sj.setKcdw(form.getKcdw());
sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(studySubject.getDeptId());
sj.setDeptId(studyFormFill.getBelongDeptId());
sj.setNd(form.getNd());
sj.setNddw(form.getNddw());
sj.setZjzt(ZjztEnum.rk.getValue());
@ -843,7 +841,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
* @return
*/
@Override
public void subpackage(StudyFormFillSubpackageForm form) {
public void subpackage(StudyFormFillSubpackageForm form,StudyFormFill studyFormFill) {
Sj sj = this.getSjByBh(form.getBh());
if (sj == null) {
sj = new Sj();
@ -851,7 +849,6 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
this.save(sj);
}
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
LambdaQueryWrapper<Sj> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Sj::getParentBh, form.getBh());
@ -869,7 +866,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
subpackageSj.setNddw(form.getNddw());
subpackageSj.setStudyId(form.getStudyId());
subpackageSj.setStudyFormId(form.getStudyFormId());
subpackageSj.setDeptId(studySubject.getDeptId());
subpackageSj.setDeptId(studyFormFill.getBelongDeptId());
sjList.add(subpackageSj);
fz.add(sjSubpackageItemForm.getBh() + "(" + sjSubpackageItemForm.getKc() + sjSubpackageItemForm.getKcdw() + ")");

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

@ -117,7 +117,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
Template template = templateService.getById(studyFormFill.getTemplateId());
// 试剂
if(template.getProduct().equals(ProductEnum.Sj.getValue())){
sjService.startConfiguration(form);
sjService.startConfiguration(form,studyFormFill);
}
// 给药制剂
if(template.getProduct().equals(ProductEnum.Gyzj.getValue())){
@ -140,7 +140,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
Template template = templateService.getById(studyFormFill.getTemplateId());
// 试剂
if(template.getProduct().equals(ProductEnum.Sj.getValue())){
sjService.configurationCompleted(form);
sjService.configurationCompleted(form,studyFormFill);
}
// 给药制剂
if(template.getProduct().equals(ProductEnum.Gyzj.getValue())){
@ -167,7 +167,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
Template template = templateService.getById(studyFormFill.getTemplateId());
// 试剂
if(template.getProduct().equals(ProductEnum.Sj.getValue())){
sjService.subpackage(form);
sjService.subpackage(form,studyFormFill);
}
// 给药制剂
if(template.getProduct().equals(ProductEnum.Gyzj.getValue())){
@ -444,6 +444,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFill.setBdbh(getSn(studyFormFill));
studyFormFill.setStartDate(new Date());
studyFormFill.setUserMc(SecurityUtils.getNickName());
studyFormFill.setBelongDeptId(getDeptId(studyFormFill));
this.save(studyFormFill);
result = studyFormFill;
//签名信息
@ -470,6 +471,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFill.setBdbh(getSn(studyFormFill));
studyFormFill.setStartDate(new Date());
studyFormFill.setUserMc(SecurityUtils.getNickName());
studyFormFill.setBelongDeptId(getDeptId(studyFormFill));
this.save(studyFormFill);
//稽查轨迹
studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "创建记录", JcmcysEnum.green.getValue(), null, qmr, studyFormFill.getRemark(), now);
@ -505,6 +507,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFill.setBdbh(getSn(studyFormFill));
studyFormFill.setStartDate(new Date());
studyFormFill.setUserMc(SecurityUtils.getNickName());
studyFormFill.setBelongDeptId(getDeptId(studyFormFill));
this.save(studyFormFill);
result = studyFormFill;
}
@ -663,6 +666,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFill.setSftb(NormalEnum.yes.getValue());
studyFormFill.setBdbh(getSn(studyFormFill));
studyFormFill.setTjsj(new Date());
studyFormFill.setBelongDeptId(getDeptId(studyFormFill));
this.save(studyFormFill);
//生成检测板
genJcbList(studyFormFill, studyFormFill.getRemark());
@ -708,6 +712,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFill.setBdnr(studyFormFill.getBdnr());
studyFormFill.setUserMc(SecurityUtils.getNickName());
studyFormFill.setBdbh(getSn(studyFormFill));
studyFormFill.setBelongDeptId(getDeptId(studyFormFill));
this.save(studyFormFill);
//稽查轨迹
Map<String, String> formData = new LinkedHashMap<>();
@ -1187,4 +1192,12 @@ public class StudyFormFillServiceImpl extends ServiceImpl
return study.getType().equals(StudyTypeEnum.sy.getValue()) ? ("/study/enter/" + study.getId() + "/" + tab) : study.getType().equals(StudyTypeEnum.fsy.getValue()) ? ("/nonTrial/enter/" + study.getId() + "/" + tab) : study.getType().equals(StudyTypeEnum.mjy.getValue()) ? ("/drug/enter/" + study.getId() + "/" + tab) : "";
}
private Long getDeptId(StudyFormFill form){
if(form.getStudySubjectId()!=null){
return studySubjectService.getById(form.getStudyId()).getDeptId();
}
return SecurityUtils.getLoginUser().getSysUser().getDeptId();
}
}

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

@ -41,8 +41,8 @@ public class TemplateServiceImpl extends ServiceImpl i
if(StringUtils.isNoneBlank(template.getName())){
queryWrapper.like("t.name",template.getName());
}
if(template.getDeptId()!=null && template.getDeptId().longValue()>0){
queryWrapper.eq("t.dept_id",template.getDeptId());
if(StringUtils.isNoneBlank(template.getDeptId())){
queryWrapper.and(p -> p.apply("find_in_set( {0},t.dept_id)", template.getDeptId()));
}
if(template.getStatus()!=null && template.getStatus().intValue()>0){
queryWrapper.eq("t.status",template.getStatus());

Loading…
Cancel
Save