Browse Source

feat:[试验管理][表单填报]试剂关联

master
HanLong 3 hours ago
parent
commit
64b80b30e8
5 changed files with 44 additions and 38 deletions
  1. +0
    -13
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java
  2. +18
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillResource.java
  3. +18
    -18
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java
  4. +6
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java
  5. +2
    -2
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml

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

@ -30,9 +30,6 @@ public class SjJcgj extends MpBaseEntity
/** 稽查内容 */ /** 稽查内容 */
private String jcnr; private String jcnr;
/** 签名意义 */
private String qmyy;
/** 签名人id */ /** 签名人id */
private Long qmrId; private Long qmrId;
@ -90,16 +87,6 @@ public class SjJcgj extends MpBaseEntity
return jcnr; return jcnr;
} }
public void setQmyy(String qmyy)
{
this.qmyy = qmyy;
}
public String getQmyy()
{
return qmyy;
}
public void setQmrId(Long qmrId) public void setQmrId(Long qmrId)
{ {
this.qmrId = qmrId; this.qmrId = qmrId;

+ 18
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillResource.java View File

@ -34,7 +34,8 @@ public class StudyFormFillResource {
private String kcdw; private String kcdw;
private String syl; private String syl;
private String syldw; private String syldw;
private String yxzq;
private String yxzqdw;
public String getMc() { public String getMc() {
return mc; return mc;
} }
@ -138,4 +139,20 @@ public class StudyFormFillResource {
public void setSyldw(String syldw) { public void setSyldw(String syldw) {
this.syldw = syldw; this.syldw = syldw;
} }
public String getYxzq() {
return yxzq;
}
public void setYxzq(String yxzq) {
this.yxzq = yxzq;
}
public String getYxzqdw() {
return yxzqdw;
}
public void setYxzqdw(String yxzqdw) {
this.yxzqdw = yxzqdw;
}
} }

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

@ -114,17 +114,16 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
List<SjJcgj> sjJcgjList = new ArrayList<>(); List<SjJcgj> sjJcgjList = new ArrayList<>();
//region 稽查轨迹 //region 稽查轨迹
for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) {
SjJcgj mjyJcgj = new SjJcgj();
mjyJcgj.setSjId(sjOld.getId());
mjyJcgj.setJcgjlx(JcgjlxEnum.lc.getValue());
mjyJcgj.setJcmc("修改库存");
mjyJcgj.setJcmcys(JcmcysEnum.green.getValue());
mjyJcgj.setJcnr(fieldChange.toString());
mjyJcgj.setQmyy("修改库存");
mjyJcgj.setQmrId(qmr.getUserId());
mjyJcgj.setQmrMc(qmr.getNickName());
mjyJcgj.setRemark(form.getKcbjbz());
sjJcgjList.add(mjyJcgj);
SjJcgj jcgj = new SjJcgj();
jcgj.setSjId(sjOld.getId());
jcgj.setJcgjlx(JcgjlxEnum.lc.getValue());
jcgj.setJcmc("修改库存");
jcgj.setJcmcys(JcmcysEnum.green.getValue());
jcgj.setJcnr(fieldChange.toString());
jcgj.setQmrId(qmr.getUserId());
jcgj.setQmrMc(qmr.getNickName());
jcgj.setRemark(form.getKcbjbz());
sjJcgjList.add(jcgj);
} }
sjJcgjService.saveBatch(sjJcgjList); sjJcgjService.saveBatch(sjJcgjList);
//endregion //endregion
@ -170,7 +169,6 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sjJcgj.setJcmc("处置"); sjJcgj.setJcmc("处置");
sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap));
sjJcgj.setJcmcys(JcmcysEnum.green.getValue()); sjJcgj.setJcmcys(JcmcysEnum.green.getValue());
sjJcgj.setQmyy("处置");
sjJcgj.setQmrId(qmr.getUserId()); sjJcgj.setQmrId(qmr.getUserId());
sjJcgj.setQmrMc(qmr.getNickName()); sjJcgj.setQmrMc(qmr.getNickName());
sjJcgjService.save(sjJcgj); sjJcgjService.save(sjJcgj);
@ -230,7 +228,6 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sjJcgj.setJcmc("处置"); sjJcgj.setJcmc("处置");
sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap));
sjJcgj.setJcmcys(JcmcysEnum.green.getValue()); sjJcgj.setJcmcys(JcmcysEnum.green.getValue());
sjJcgj.setQmyy("处置");
sjJcgj.setQmrId(qmr.getUserId()); sjJcgj.setQmrId(qmr.getUserId());
sjJcgj.setQmrMc(qmr.getNickName()); sjJcgj.setQmrMc(qmr.getNickName());
sjJcgjList.add(sjJcgj); sjJcgjList.add(sjJcgj);
@ -518,6 +515,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
@Override @Override
public void genResource(StudyFormFill studyFormFill, Template template) { public void genResource(StudyFormFill studyFormFill, Template template) {
System.out.println(System.currentTimeMillis());
SysUser qmr = sysUserService.selectUserById(SecurityUtils.getUserId()); SysUser qmr = sysUserService.selectUserById(SecurityUtils.getUserId());
Long studyId = studyFormFill.getStudyId(); Long studyId = studyFormFill.getStudyId();
@ -525,8 +523,8 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
// 生成/使用 // 生成/使用
String resource = studyFormFill.getResource(); String resource = studyFormFill.getResource();
Map<String, Sj> sjMap = new HashMap<>(); Map<String, Sj> sjMap = new HashMap<>();
List<SjJcgj> jcgjList = new ArrayList<>();
List<SjTz> tzList = new ArrayList<>();
LinkedList<SjJcgj> jcgjList = new LinkedList<>();
LinkedList<SjTz> tzList = new LinkedList<>();
if(StringUtils.isNotEmpty(resource) && !StringUtils.equals("[]", resource)) { if(StringUtils.isNotEmpty(resource) && !StringUtils.equals("[]", resource)) {
List<StudyFormFillResource> studyFormFillResourceList = JSONUtil.toList(resource, StudyFormFillResource.class); List<StudyFormFillResource> studyFormFillResourceList = JSONUtil.toList(resource, StudyFormFillResource.class);
List<String> bhList = studyFormFillResourceList.stream().map(StudyFormFillResource::getBh).collect(Collectors.toList()); List<String> bhList = studyFormFillResourceList.stream().map(StudyFormFillResource::getBh).collect(Collectors.toList());
@ -557,7 +555,8 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sj.setLy(studyFormFillResource.getSource()); sj.setLy(studyFormFillResource.getSource());
sj.setSxr(DateUtils.parseDate(studyFormFillResource.getSxrq())); sj.setSxr(DateUtils.parseDate(studyFormFillResource.getSxrq()));
sj.setPzrq(studyFormFill.getStartDate()); sj.setPzrq(studyFormFill.getStartDate());
// TODO 规格有效周期
sj.setYxzq(studyFormFillResource.getYxzq());
sj.setYxzqdw(studyFormFillResource.getYxzqdw());
if(sj.getId() == null) { if(sj.getId() == null) {
this.save(sj); this.save(sj);
// 稽查轨迹 // 稽查轨迹
@ -635,7 +634,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
jcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); jcgj.setJcgjlx(JcgjlxEnum.bj.getValue());
jcgj.setJcnr(JctUtil.formatStr(jcnrMap)); jcgj.setJcnr(JctUtil.formatStr(jcnrMap));
jcgj.setJcmcys(JcmcysEnum.green.getValue()); jcgj.setJcmcys(JcmcysEnum.green.getValue());
jcgj.setQmyy("存储");
jcgj.setJcmc("存储");
jcgj.setQmrId(qmr.getUserId()); jcgj.setQmrId(qmr.getUserId());
jcgj.setQmrMc(qmr.getNickName()); jcgj.setQmrMc(qmr.getNickName());
jcgjList.add(jcgj); jcgjList.add(jcgj);
@ -670,7 +669,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
jcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); jcgj.setJcgjlx(JcgjlxEnum.bj.getValue());
jcgj.setJcnr(JctUtil.formatStr(jcnrMap)); jcgj.setJcnr(JctUtil.formatStr(jcnrMap));
jcgj.setJcmcys(JcmcysEnum.green.getValue()); jcgj.setJcmcys(JcmcysEnum.green.getValue());
jcgj.setQmyy("处置");
jcgj.setJcmc("处置");
jcgj.setQmrId(qmr.getUserId()); jcgj.setQmrId(qmr.getUserId());
jcgj.setQmrMc(qmr.getNickName()); jcgj.setQmrMc(qmr.getNickName());
jcgjList.add(jcgj); jcgjList.add(jcgj);
@ -690,6 +689,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
} }
sjJcgjService.saveBatch(jcgjList); sjJcgjService.saveBatch(jcgjList);
sjTzService.saveBatch(tzList); sjTzService.saveBatch(tzList);
System.out.println(System.currentTimeMillis());
} }

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

@ -17,9 +17,7 @@ import com.hxhq.business.enums.zykgl.JcmcysEnum;
import com.hxhq.business.enums.zykgl.JlztEnum; import com.hxhq.business.enums.zykgl.JlztEnum;
import com.hxhq.business.form.study.*; import com.hxhq.business.form.study.*;
import com.hxhq.business.form.study.StudyFormFillSearchForm; import com.hxhq.business.form.study.StudyFormFillSearchForm;
import com.hxhq.business.service.IStudyFormFillJcgjService;
import com.hxhq.business.service.IStudyFormFillQmxxService;
import com.hxhq.business.service.ITemplateService;
import com.hxhq.business.service.*;
import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.JctUtil;
import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.business.utils.ObjectCompareUtil;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
@ -31,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StudyFormFillMapper; import com.hxhq.business.mapper.StudyFormFillMapper;
import com.hxhq.business.domain.StudyFormFill; import com.hxhq.business.domain.StudyFormFill;
import com.hxhq.business.service.IStudyFormFillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/** /**
@ -51,6 +48,8 @@ public class StudyFormFillServiceImpl extends ServiceImpl
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired @Autowired
private ITemplateService templateService; private ITemplateService templateService;
@Autowired
private ISjService sjService;
/** /**
* 查询试验-填报单列表 * 查询试验-填报单列表
@ -382,6 +381,9 @@ public class StudyFormFillServiceImpl extends ServiceImpl
public void genResource(StudyFormFill studyFormFill){ public void genResource(StudyFormFill studyFormFill){
Template template = templateService.getById(studyFormFill.getTemplateId()); Template template = templateService.getById(studyFormFill.getTemplateId());
// todo 处置存放用量 // todo 处置存放用量
if (template.getProduct().equals(ProductEnum.Sj.getValue())) {
sjService.genResource(studyFormFill, template);
}
if (template.getProduct().equals(ProductEnum.Gsp.getValue())) { if (template.getProduct().equals(ProductEnum.Gsp.getValue())) {
} }

+ 2
- 2
hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml View File

@ -5,13 +5,13 @@
<mapper namespace="com.hxhq.business.mapper.SjMapper"> <mapper namespace="com.hxhq.business.mapper.SjMapper">
<update id="updateKcBatch"> <update id="updateKcBatch">
UPDATE t_sj SET kc = #{kc} WHERE bh in UPDATE t_sj SET kc = #{kc} WHERE bh in
<foreach item="item" index="index" collection="idList" separator=",">
<foreach item="item" index="index" collection="bhList" separator=",">
(#{item}) (#{item})
</foreach> </foreach>
</update> </update>
<update id="updateCc"> <update id="updateCc">
UPDATE t_sj SET cctj = #{cctj}, ccwz = #{ccwz} WHERE bh in UPDATE t_sj SET cctj = #{cctj}, ccwz = #{ccwz} WHERE bh in
<foreach item="item" index="index" collection="idList" separator=",">
<foreach item="item" index="index" collection="bhList" separator=",">
(#{item}) (#{item})
</foreach> </foreach>
</update> </update>

Loading…
Cancel
Save