From e8bea05605e2cd68f3075449ce8d51e6075b4a64 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Wed, 18 Mar 2026 10:17:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E9=BA=BB=E7=B2=BE=E8=8D=AF=E8=A1=A8?= =?UTF-8?q?=E5=8D=95]=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/domain/StudyFormApply.java | 7 +- .../form/study/StudyFormApplySearchForm.java | 4 +- .../hxhq/business/mapper/StudyFormApplyMapper.java | 5 +- .../service/impl/StudyFormApplyServiceImpl.java | 194 ++++++++++++--------- .../mapper/business/StudyFormApplyMapper.xml | 2 +- 5 files changed, 122 insertions(+), 90 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormApply.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormApply.java index 8cac75f..3f96aa6 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormApply.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormApply.java @@ -49,7 +49,8 @@ public class StudyFormApply extends MpBaseEntity /** 需要时间 */ @TableField(updateStrategy = FieldStrategy.IGNORED) - private String xysj; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date xysj; /** 表单编号 */ private String bdbh; @@ -158,11 +159,11 @@ public class StudyFormApply extends MpBaseEntity this.xynd = xynd; } - public String getXysj() { + public Date getXysj() { return xysj; } - public void setXysj(String xysj) { + public void setXysj(Date xysj) { this.xysj = xysj; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormApplySearchForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormApplySearchForm.java index 140df29..91b62d1 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormApplySearchForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormApplySearchForm.java @@ -34,10 +34,10 @@ public class StudyFormApplySearchForm { /** 需要时间结束 */ private String xysjjs; - /** 需要时间排序 */ + /** 需要时间排序 1升序 10降序 */ private Integer xyssort; - /** 提交时间排序 */ + /** 提交时间排序 1升序 10降序*/ private Integer tjsjsort; /** 表单状态 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormApplyMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormApplyMapper.java index 2eb4da4..2239c83 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormApplyMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormApplyMapper.java @@ -9,6 +9,7 @@ import com.hxhq.business.dto.study.StudyFormApplyListDto; import com.hxhq.business.dto.study.StudyFormPreListDto; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; /** @@ -42,7 +43,7 @@ public interface StudyFormApplyMapper extends BaseMapper * @param bmId * @param sdId */ - void updateBdnrZdxgjl(@Param("id") Long id,@Param("bdnr") String bdnr,@Param("zdxgjl") String zdxgjl,@Param("syId") Long syId,@Param("bmId") Long bmId,@Param("sdId") Long sdId,@Param("sywzmc") String sywzmc,@Param("xynd") String xynd,@Param("xysj") String xysj); + void updateBdnrZdxgjl(@Param("id") Long id,@Param("bdnr") String bdnr,@Param("zdxgjl") String zdxgjl,@Param("syId") Long syId,@Param("bmId") Long bmId,@Param("sdId") Long sdId,@Param("sywzmc") String sywzmc,@Param("xynd") String xynd,@Param("xysj") Date xysj); /** * 更新表单内容 @@ -52,7 +53,7 @@ public interface StudyFormApplyMapper extends BaseMapper * @param bmId * @param sdId */ - void updateBdnr(@Param("id") Long id,@Param("bdnr") String bdnr,@Param("syId") Long syId,@Param("bmId") Long bmId,@Param("sdId") Long sdId); + void updateBdnr(@Param("id") Long id,@Param("bdnr") String bdnr,@Param("syId") Long syId,@Param("bmId") Long bmId,@Param("sdId") Long sdId,@Param("sywzmc") String sywzmc,@Param("xynd") String xynd,@Param("xysj") Date xysj); /** * 更新复核意见 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java index 413bfe3..2b585a9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java @@ -21,6 +21,7 @@ import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.business.utils.lang.StudyFormUtil; import com.hxhq.common.core.exception.ServiceException; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.system.api.domain.SysUser; @@ -80,6 +81,10 @@ public class StudyFormApplyServiceImpl extends ServiceImpl p.like("t.`bdbh`", form.getBdbh())); } @@ -119,7 +124,20 @@ public class StudyFormApplyServiceImpl extends ServiceImpl studyFormApplyJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(now,studyFormApply, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormApply.getRemark())); + studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(now, studyFormApply, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormApply.getRemark())); } studyFormApplyJcgjService.saveBatchWithLog(studyFormApplyJcgjs); } result = studyFormApplyOld; } else { //更新特殊字段 - if(StringUtils.isNoneBlank(studyFormApply.getBdnr())){ - JSONObject jsonObject=JSONObject.parseObject(studyFormApply.getBdnr()); + if (StringUtils.isNoneBlank(studyFormApply.getBdnr())) { + JSONObject jsonObject = JSONObject.parseObject(studyFormApply.getBdnr()); studyFormApply.setSdId(jsonObject.getLong("sdId")); studyFormApply.setSyId(jsonObject.getLong("syId")); studyFormApply.setBmId(jsonObject.getLong("bmId")); studyFormApply.setSywzmc(jsonObject.getString("sywzmc")); studyFormApply.setXynd(jsonObject.getString("xynd")); - studyFormApply.setXysj(jsonObject.getString("xysj")); + if (StringUtils.isNoneBlank(jsonObject.getString("xysj"))) { + studyFormApply.setXysj(DateUtils.parseDate(jsonObject.getString("xysj"))); + } } studyFormApply.setBdzt(StudyFormApplyBdztEnum.tbz.getValue()); studyFormApply.setUserId(qmr.getUserId()); @@ -355,7 +377,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl studyFormApplyJcgjs = new ArrayList<>(); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = jsonArray.getJSONObject(i); - Map formData = new LinkedHashMap<>(); - Map formDataEn = new LinkedHashMap<>(); - if (StringUtils.isNoneBlank(jsonObject.getString("oldValue"))) { - //zh - formData.put("字段名", jsonObject.getString("fieldCn")); - formData.put("原值", jsonObject.getString("oldValue")); - formData.put("新值", jsonObject.getString("value")); - formData.put("原因", jsonObject.getString("reason")); - //en - formDataEn.put("字段名", jsonObject.getString("fieldEn")); - formDataEn.put("原值", jsonObject.getString("oldValue")); - formDataEn.put("新值", jsonObject.getString("value")); - formDataEn.put("原因", jsonObject.getString("reason")); - studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(jsonObject.getDate("time"),studyFormApplyOld, JcgjlxEnum.xg.getValue(), "修改记录", JcmcysEnum.orange.getValue(), JctUtil.formatStr(formData), StudyFormUtil.getJcnrEn(formDataEn), qmr, null)); - } else { - //zh - formData.put("字段名", jsonObject.getString("fieldCn")); - formData.put("填入值", jsonObject.getString("value")); - formData.put("填写人", qmr.getNickName()); - //en - formDataEn.put("字段名", jsonObject.getString("fieldEn")); - formDataEn.put("填入值", jsonObject.getString("value")); - formDataEn.put("填写人", qmr.getNickName()); - studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(jsonObject.getDate("time"),studyFormApplyOld, JcgjlxEnum.bj.getValue(), "填写", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), StudyFormUtil.getJcnrEn(formDataEn), qmr, null)); + if (StringUtils.isNoneBlank(form.getBdnr())) { + JSONObject bdnr = JSONObject.parseObject(form.getBdnr()); + if (StringUtils.isNoneBlank(form.getZdxgjl())) { + baseMapper.updateBdnrZdxgjl(form.getId(), form.getBdnr(), form.getZdxgjl(), bdnr.getLong("syId"), bdnr.getLong("bmId"), bdnr.getLong("sdId"), bdnr.getString("sywzmc"), bdnr.getString("xynd"), bdnr.getDate("xysj")); + } else { + baseMapper.updateBdnr(form.getId(), form.getBdnr(), bdnr.getLong("syId"), bdnr.getLong("bmId"), bdnr.getLong("sdId"), bdnr.getString("sywzmc"), bdnr.getString("xynd"), bdnr.getDate("xysj")); + } + //稽查轨迹 + if (StringUtils.isNoneBlank(form.getFiledValue())) { + StudyFormApply studyFormApplyOld = this.getById(form.getId()); + JSONArray jsonArray = JSONArray.parseArray(form.getFiledValue()); + List studyFormApplyJcgjs = new ArrayList<>(); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + Map formData = new LinkedHashMap<>(); + Map formDataEn = new LinkedHashMap<>(); + if (StringUtils.isNoneBlank(jsonObject.getString("oldValue"))) { + //zh + formData.put("字段名", jsonObject.getString("fieldCn")); + formData.put("原值", jsonObject.getString("oldValue")); + formData.put("新值", jsonObject.getString("value")); + formData.put("原因", jsonObject.getString("reason")); + //en + formDataEn.put("字段名", jsonObject.getString("fieldEn")); + formDataEn.put("原值", jsonObject.getString("oldValue")); + formDataEn.put("新值", jsonObject.getString("value")); + formDataEn.put("原因", jsonObject.getString("reason")); + studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(jsonObject.getDate("time"), studyFormApplyOld, JcgjlxEnum.xg.getValue(), "修改记录", JcmcysEnum.orange.getValue(), JctUtil.formatStr(formData), StudyFormUtil.getJcnrEn(formDataEn), qmr, null)); + } else { + //zh + formData.put("字段名", jsonObject.getString("fieldCn")); + formData.put("填入值", jsonObject.getString("value")); + formData.put("填写人", qmr.getNickName()); + //en + formDataEn.put("字段名", jsonObject.getString("fieldEn")); + formDataEn.put("填入值", jsonObject.getString("value")); + formDataEn.put("填写人", qmr.getNickName()); + studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(jsonObject.getDate("time"), studyFormApplyOld, JcgjlxEnum.bj.getValue(), "填写", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), StudyFormUtil.getJcnrEn(formDataEn), qmr, null)); + } } + studyFormApplyJcgjService.saveBatchWithLog(studyFormApplyJcgjs); } - studyFormApplyJcgjService.saveBatchWithLog(studyFormApplyJcgjs); } } @@ -717,8 +747,8 @@ public class StudyFormApplyServiceImpl extends ServiceImpl - update t_study_form_apply set bdnr=#{bdnr},zdxgjl=#{zdxgjl},sy_id=#{syId},bm_id=#{bmId},sd_id=#{sdId} where id=#{id}; + update t_study_form_apply set bdnr=#{bdnr},zdxgjl=#{zdxgjl},sy_id=#{syId},bm_id=#{bmId},sd_id=#{sdId},sywzmc=#{sywzmc},xynd=#{xynd},xysj=#{xysj} where id=#{id};