Browse Source

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

master
HanLong 4 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 qmyy;
/** 签名人id */
private Long qmrId;
@ -90,16 +87,6 @@ public class SjJcgj extends MpBaseEntity
return jcnr;
}
public void setQmyy(String qmyy)
{
this.qmyy = qmyy;
}
public String getQmyy()
{
return qmyy;
}
public void setQmrId(Long 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 syl;
private String syldw;
private String yxzq;
private String yxzqdw;
public String getMc() {
return mc;
}
@ -138,4 +139,20 @@ public class StudyFormFillResource {
public void setSyldw(String 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<>();
//region 稽查轨迹
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);
//endregion
@ -170,7 +169,6 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sjJcgj.setJcmc("处置");
sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap));
sjJcgj.setJcmcys(JcmcysEnum.green.getValue());
sjJcgj.setQmyy("处置");
sjJcgj.setQmrId(qmr.getUserId());
sjJcgj.setQmrMc(qmr.getNickName());
sjJcgjService.save(sjJcgj);
@ -230,7 +228,6 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sjJcgj.setJcmc("处置");
sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap));
sjJcgj.setJcmcys(JcmcysEnum.green.getValue());
sjJcgj.setQmyy("处置");
sjJcgj.setQmrId(qmr.getUserId());
sjJcgj.setQmrMc(qmr.getNickName());
sjJcgjList.add(sjJcgj);
@ -518,6 +515,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
@Override
public void genResource(StudyFormFill studyFormFill, Template template) {
System.out.println(System.currentTimeMillis());
SysUser qmr = sysUserService.selectUserById(SecurityUtils.getUserId());
Long studyId = studyFormFill.getStudyId();
@ -525,8 +523,8 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
// 生成/使用
String resource = studyFormFill.getResource();
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)) {
List<StudyFormFillResource> studyFormFillResourceList = JSONUtil.toList(resource, StudyFormFillResource.class);
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.setSxr(DateUtils.parseDate(studyFormFillResource.getSxrq()));
sj.setPzrq(studyFormFill.getStartDate());
// TODO 规格有效周期
sj.setYxzq(studyFormFillResource.getYxzq());
sj.setYxzqdw(studyFormFillResource.getYxzqdw());
if(sj.getId() == null) {
this.save(sj);
// 稽查轨迹
@ -635,7 +634,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
jcgj.setJcgjlx(JcgjlxEnum.bj.getValue());
jcgj.setJcnr(JctUtil.formatStr(jcnrMap));
jcgj.setJcmcys(JcmcysEnum.green.getValue());
jcgj.setQmyy("存储");
jcgj.setJcmc("存储");
jcgj.setQmrId(qmr.getUserId());
jcgj.setQmrMc(qmr.getNickName());
jcgjList.add(jcgj);
@ -670,7 +669,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
jcgj.setJcgjlx(JcgjlxEnum.bj.getValue());
jcgj.setJcnr(JctUtil.formatStr(jcnrMap));
jcgj.setJcmcys(JcmcysEnum.green.getValue());
jcgj.setQmyy("处置");
jcgj.setJcmc("处置");
jcgj.setQmrId(qmr.getUserId());
jcgj.setQmrMc(qmr.getNickName());
jcgjList.add(jcgj);
@ -690,6 +689,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
}
sjJcgjService.saveBatch(jcgjList);
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.form.study.*;
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.ObjectCompareUtil;
import com.hxhq.common.core.exception.ServiceException;
@ -31,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StudyFormFillMapper;
import com.hxhq.business.domain.StudyFormFill;
import com.hxhq.business.service.IStudyFormFillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
@ -51,6 +48,8 @@ public class StudyFormFillServiceImpl extends ServiceImpl
private ISysUserService sysUserService;
@Autowired
private ITemplateService templateService;
@Autowired
private ISjService sjService;
/**
* 查询试验-填报单列表
@ -382,6 +381,9 @@ public class StudyFormFillServiceImpl extends ServiceImpl
public void genResource(StudyFormFill studyFormFill){
Template template = templateService.getById(studyFormFill.getTemplateId());
// todo 处置存放用量
if (template.getProduct().equals(ProductEnum.Sj.getValue())) {
sjService.genResource(studyFormFill, template);
}
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">
<update id="updateKcBatch">
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})
</foreach>
</update>
<update id="updateCc">
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})
</foreach>
</update>

Loading…
Cancel
Save