diff --git a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java index addf2fd..91225f2 100644 --- a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java +++ b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java @@ -86,7 +86,17 @@ public class SysDictType extends BaseEntity { this.status = status; } - + + @Override + public String getRemark() { + return remark; + } + + @Override + public void setRemark(String remark) { + this.remark = remark; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java index 27f0f3c..71c2ca8 100644 --- a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java +++ b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java @@ -39,6 +39,10 @@ public class SysLogininfor extends BaseEntity @Excel(name = "描述") private String msg; + /** 描述 */ + @Excel(name = "描述-英文") + private String msgEn; + /** 访问时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @@ -108,6 +112,14 @@ public class SysLogininfor extends BaseEntity this.msg = msg; } + public String getMsgEn() { + return msgEn; + } + + public void setMsgEn(String msgEn) { + this.msgEn = msgEn; + } + public Date getAccessTime() { return accessTime; diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java index 448ff3e..0c02618 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java @@ -54,28 +54,28 @@ public class SysLoginService // 用户名或密码为空 错误 if (StringUtils.isAnyBlank(username, password)) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户/密码必须填写"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户/密码必须填写"); throw new ServiceException("用户/密码必须填写"); } // 密码如果不在指定范围内 错误 if (password.length() < UserConstants.PASSWORD_MIN_LENGTH || password.length() > UserConstants.PASSWORD_MAX_LENGTH) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户密码不在指定范围"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户密码不在指定范围"); throw new ServiceException("用户密码不在指定范围"); } // 用户名不在指定范围内 错误 if (username.length() < UserConstants.USERNAME_MIN_LENGTH || username.length() > UserConstants.USERNAME_MAX_LENGTH) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户名不在指定范围"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户名不在指定范围"); throw new ServiceException("用户名不在指定范围"); } // IP黑名单校验 String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST)); if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单"); throw new ServiceException("很遗憾,访问IP已被列入系统黑名单"); } // 查询用户信息 @@ -91,12 +91,12 @@ public class SysLoginService if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); +// recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); } if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); +// recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); throw new ServiceException("对不起,您的账号:" + username + " 已停用"); } passwordService.validate(user, password); @@ -117,7 +117,7 @@ public class SysLoginService } } - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_SUCCESS, "登录成功"); + recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_SUCCESS, "登录成功","Login Successful"); recordLoginInfo(user.getUserId()); return userInfo; } @@ -140,7 +140,7 @@ public class SysLoginService public void logout(String loginName) { - recordLogService.recordLogininfor(loginName,null, Constants.LOGOUT, "退出成功"); +// recordLogService.recordLogininfor(loginName,null, Constants.LOGOUT, "退出成功"); } /** @@ -176,6 +176,6 @@ public class SysLoginService { throw new ServiceException(registerResult.getMsg()); } - recordLogService.recordLogininfor(username,null, Constants.REGISTER, "注册成功"); +// recordLogService.recordLogininfor(username,null, Constants.REGISTER, "注册成功"); } } diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java index b0e0210..42daebd 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java @@ -60,7 +60,7 @@ public class SysPasswordService if (!matches(user, password)) { retryCount = retryCount + 1; - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount)); +// recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount)); redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); throw new ServiceException("用户不存在/密码错误"); } diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java index b6cc877..3a39a5a 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java @@ -29,13 +29,14 @@ public class SysRecordLogService * @param message 消息内容 * @return */ - public void recordLogininfor(String username,String nickName, String status, String message) + public void recordLogininfor(String username,String nickName, String status, String message, String messageEn) { SysLogininfor logininfor = new SysLogininfor(); logininfor.setUserName(username); logininfor.setNickName(nickName); logininfor.setIpaddr(IpUtils.getIpAddr()); logininfor.setMsg(message); + logininfor.setMsgEn(messageEn); // 日志状态 if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { diff --git a/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java b/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java index 339886d..523f666 100644 --- a/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java +++ b/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java @@ -259,7 +259,7 @@ public class ExcelUtil if (Collection.class.isAssignableFrom(field.getType())) { Cell cell = subRow.createCell(column); - cell.setCellValue(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?attr.name():attr.nameEn()); + cell.setCellValue("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?attr.name():attr.nameEn()); cell.setCellStyle(cellStyle); int subFieldSize = subFieldsMap != null ? subFieldsMap.get(field.getName()).size() : 0; if (subFieldSize > 1) @@ -272,7 +272,7 @@ public class ExcelUtil else { Cell cell = subRow.createCell(column++); - cell.setCellValue(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?attr.name():attr.nameEn()); + cell.setCellValue("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?attr.name():attr.nameEn()); cell.setCellStyle(cellStyle); } } @@ -844,7 +844,7 @@ public class ExcelUtil // 创建列 Cell cell = row.createCell(column); // 写入列信息 - cell.setCellValue(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?attr.name():attr.nameEn()); + cell.setCellValue("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?attr.name():attr.nameEn()); setDataValidation(attr, row, column); cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); if (isSubList()) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java index dce1d3b..db5916e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java @@ -58,7 +58,7 @@ public class GspController extends BaseController { */ @RequiresPermissions(value={"business:resource:mjy:xq","business:archive:mjy:xq"}, logical= Logical.OR) @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id,String lang) { + public AjaxResult exportDetail(Long id,String lang,String version) { GspJcgj gspJcgj = new GspJcgj(); gspJcgj.setGspId(id); List jcgjList = gspJcgjService.queryList(gspJcgj); @@ -72,6 +72,7 @@ public class GspController extends BaseController { tzList, jcgjList, lang, + version, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java index ee429da..f6f80b9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java @@ -114,7 +114,7 @@ public class GyzjController extends BaseController */ @RequiresPermissions(value={"business:resource:gyzj:xq","business:archive:gyzj:xq"}, logical= Logical.OR) @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id,String lang) { + public AjaxResult exportDetail(Long id,String lang,String version) { GyzjJcgj gyzjJcgj = new GyzjJcgj(); gyzjJcgj.setGyzjId(id); List gyzjJcgjList = gyzjJcgjService.queryList(gyzjJcgj); @@ -128,6 +128,7 @@ public class GyzjController extends BaseController gyzjTzList, gyzjJcgjList, lang, + version, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java index 1e1b3df..09a1312 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java @@ -105,7 +105,7 @@ public class MjyController extends BaseController { */ @RequiresPermissions(value={"business:resource:mjy:xq","business:archive:mjy:xq"}, logical= Logical.OR) @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id,String lang) { + public AjaxResult exportDetail(Long id,String lang,String version) { MjyJcgj mjyJcgj = new MjyJcgj(); mjyJcgj.setMjyId(id); List mjyJcgjList = mjyJcgjService.queryList(mjyJcgj); @@ -119,6 +119,7 @@ public class MjyController extends BaseController { mjyTzList, mjyJcgjList, lang, + version, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java index 2dfcf45..b0ff569 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java @@ -78,6 +78,8 @@ public class PublicController extends BaseController { public ISystemLogService systemLogService; @Autowired public IJcbService jcbService; + @Autowired + public IStudyFormFillService studyFormFillService; /** @@ -331,4 +333,17 @@ public class PublicController extends BaseController { List list = jcbService.queryList(jcb); return getDataTable(list); } + + /** + * 前序表单列表 + * @param formFill + * @return + */ + @GetMapping("/qxFormFillList") + public TableDataInfo qxFormFillList(StudyFormFill formFill) + { + startPage(); + List list = studyFormFillService.queryQxList(formFill); + return getDataTable(list); + } } \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java index b2f286f..ac5cf00 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java @@ -16,9 +16,12 @@ import com.hxhq.business.service.ISjTzService; import com.hxhq.business.service.ISjJcgjService; import com.hxhq.business.service.IStudySubjectService; import com.hxhq.business.utils.JctUtil; +import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import com.hxhq.common.core.web.controller.BaseController; @@ -45,6 +48,16 @@ public class SjController extends BaseController @Autowired private ISjTzService sjTzService; + /** + * 上传文件存储在本地的根路径 + */ + @Value("${file.path}") + private String localFilePath; + /** + * 资源映射路径 前缀 + */ + @Value("${file.prefix}") + public String localFilePrefix; /** * 试验物资列表 @@ -70,6 +83,30 @@ public class SjController extends BaseController } /** + * 导出 + */ + @RequiresPermissions(value={"business:resource:sj:xq","business:archive:sj:xq"}, logical= Logical.OR) + @GetMapping(value = "/exportDetail") + public AjaxResult exportDetail(Long id,String lang) { + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(id); + List sjJcgjList = sjJcgjService.queryList(sjJcgj); + + SjTz sjTz = new SjTz(); + sjTz.setSjId(id); + List sjTzList = sjTzService.queryList(sjTz); + return AjaxResult.success(localFilePrefix + PdfExportUtil.export( + "com.hxhq.business.utils.pdf.resource.SjPdf", + "exportDetail", + sjService.getInfo(id), + sjTzList, + sjJcgjList, + lang, + localFilePath)); + } + + + /** * 台账列表 */ @GetMapping("/tzList") diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java index 46eafb6..f319675 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java @@ -3,6 +3,7 @@ package com.hxhq.business.controller; import java.util.Arrays; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +57,14 @@ public class StepController extends BaseController @RequiresPermissions("business:step:list") public AjaxResult save(@RequestBody Step step) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("sn",step.getSn()); + if(step.getId()!=null){ + queryWrapper.ne("id",step.getId()); + } + if(stepService.count(queryWrapper)>0){ + return AjaxResult.error("编号已存在"); + } return toAjax(stepService.saveOrUpdate(step)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java new file mode 100644 index 0000000..0066d19 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java @@ -0,0 +1,70 @@ +package com.hxhq.business.controller; + +import java.util.Arrays; +import java.util.List; + +import com.hxhq.business.form.yq.StorageLocationSearchForm; +import com.hxhq.common.security.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.hxhq.business.domain.StorageLocation; +import com.hxhq.business.service.IStorageLocationService; +import com.hxhq.common.core.web.controller.BaseController; +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.common.core.web.page.TableDataInfo; + + +/** + * 存储位置Controller + * + * @author hxhq + * @date 2026-03-02 + */ +@RestController +@RequestMapping("/business/storageLocation") +public class StorageLocationController extends BaseController +{ + @Autowired + private IStorageLocationService storageLocationService; + + /** + * 查询存储位置列表 + */ + @GetMapping("/list") + @RequiresPermissions("business:storageLocation:list") + public TableDataInfo list(StorageLocationSearchForm form) + { + startPage(); + List list = storageLocationService.queryList(form); + return getDataTable(list); + } + + /** + * 获取存储位置详细信息 + */ + @GetMapping(value = "/info") + public AjaxResult getInfo(Long id) + { + return AjaxResult.success(storageLocationService.getById(id)); + } + + /** + * 新增存储位置信息 + */ + @PostMapping("/save") + @RequiresPermissions("business:storageLocation:add") + public AjaxResult save(@RequestBody StorageLocation storageLocation) + { + return toAjax(storageLocationService.saveOrUpdate(storageLocation)); + } + + /** + * 新增存储位置信息 + */ + @PostMapping("/edit") + @RequiresPermissions("business:storageLocation:edit") + public AjaxResult edit(@RequestBody StorageLocation storageLocation) + { + return toAjax(storageLocationService.saveOrUpdate(storageLocation)); + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index dbfa769..2524bc8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -1,5 +1,6 @@ package com.hxhq.business.controller; +import java.io.File; import java.util.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -16,7 +17,10 @@ import com.hxhq.business.form.sj.SjSubpackageForm; import com.hxhq.business.form.study.*; import com.hxhq.business.service.*; import com.hxhq.business.utils.JctUtil; +import com.hxhq.business.utils.StudyFormFillUtil; import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.business.utils.pdf.template.TemplateBaseUtil; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.utils.SecurityUtils; @@ -40,6 +44,8 @@ public class StudyFormFillController extends BaseController { @Autowired private IStudyFormFillService studyFormFillService; @Autowired + private IStudyService studyService; + @Autowired private IStudyFormFillJcgjService studyFormFillJcgjService; @Autowired private IStudyFormFillQmxxService studyFormFillQmxxService; @@ -58,6 +64,7 @@ public class StudyFormFillController extends BaseController { /** * 开始配置 + * * @return */ @PostMapping("/startConfiguration") @@ -71,6 +78,7 @@ public class StudyFormFillController extends BaseController { /** * 配置完成 + * * @param form * @return */ @@ -85,6 +93,7 @@ public class StudyFormFillController extends BaseController { /** * 分装 + * * @param form * @return */ @@ -135,26 +144,26 @@ public class StudyFormFillController extends BaseController { */ @GetMapping("/jcgjqmxxList") @RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR) - public AjaxResult jcgjqmxxList(Integer jcgjlx,Long id) { - HashMap map=new HashMap(2); + public AjaxResult jcgjqmxxList(Integer jcgjlx, Long id) { + HashMap map = new HashMap(2); //稽查轨迹 QueryWrapper studyFormFillJcgjQueryWrapper = Wrappers.query(); - studyFormFillJcgjQueryWrapper.eq("form_id",id); - if(jcgjlx!=null&&jcgjlx.intValue()>0){ - Integer jcgjlxExport=999; - if(jcgjlx.intValue()==jcgjlxExport){ + studyFormFillJcgjQueryWrapper.eq("form_id", id); + if (jcgjlx != null && jcgjlx.intValue() > 0) { + Integer jcgjlxExport = 999; + if (jcgjlx.intValue() == jcgjlxExport) { studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue()); - }else{ - studyFormFillJcgjQueryWrapper.eq("jcgjlx",jcgjlx); + } else { + studyFormFillJcgjQueryWrapper.eq("jcgjlx", jcgjlx); } } studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); - map.put("jcgj",studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper)); + map.put("jcgj", studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper)); //签名信息 QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); - studyFormFillQmxxQueryWrapper.eq("form_id",id); + studyFormFillQmxxQueryWrapper.eq("form_id", id); studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); - map.put("qmxx",studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper)); + map.put("qmxx", studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper)); return AjaxResult.success(map); } @@ -182,6 +191,45 @@ public class StudyFormFillController extends BaseController { return AjaxResult.success(localFilePrefix + PdfExportUtil.export(studyFormFill.getTemplateExportClass(), studyFormFill.getTemplateExportMethod(), studyFormFill, studyFormFillQmxxList, studyFormFillJcgjList, form.getLang(), form.getJcgjlx(), localFilePath)); } + + /** + * 导出 + */ + @RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR) + @GetMapping(value = "/exportByFileUrl") + public AjaxResult exportByFileUrl(StudyFormFillExportForm form) { + StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId()); + Study study = studyService.getById(studyFormFill.getStudyId()); + //稽查轨迹 + List jcgjList = new ArrayList<>(); + Integer noExport=999; + Boolean jcgj=false; + if (form.getJcgjlx() != null && form.getJcgjlx().intValue() > 0&&!form.getJcgjlx().equals(noExport)) { + QueryWrapper studyFormFillJcgjQueryWrapper = Wrappers.query(); + studyFormFillJcgjQueryWrapper.eq("form_id", studyFormFill.getId()); + studyFormFillJcgjQueryWrapper.eq("jcgjlx", form.getJcgjlx()); + studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); + jcgjList = studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper); + jcgj=true; + } + + //签名信息 + QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); + studyFormFillQmxxQueryWrapper.eq("form_id", studyFormFill.getId()); + studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); + List qmxxList = studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper); + + String fileUrl = form.getUrl(); + fileUrl = fileUrl.replaceFirst(localFilePrefix, ""); + int indexOf = fileUrl.lastIndexOf("/"); + String path = fileUrl.substring(0, indexOf); + String exportFileName = StudyFormFillUtil.export(form.getVersion(), form.getLang(), study.getName() + "(" + study.getSn() + ") " + studyFormFill.getBdmc(), + localFilePath + fileUrl, localFilePath + File.separator + path, jcgjList, qmxxList,jcgj); + + + return AjaxResult.success(localFilePrefix + path + File.separator + exportFileName); + } + /** * 加签 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java index a56a068..ed814fb 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java @@ -72,6 +72,13 @@ public class StudyMethodController extends BaseController { return AjaxResult.success(); } + @PostMapping("/close") + public AjaxResult close(@RequestBody StudyMethodForm form) { + form.setQmrId(SecurityUtils.getUserId()); + studyMethodService.close(form); + return AjaxResult.success(); + } + @PostMapping("/read") @RequiresPermissions("business:studyMethod:read") public AjaxResult read(@RequestBody @Validated StudyMethodReadForm form) { diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java index 2d42cd4..040f829 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java @@ -71,9 +71,9 @@ public class SystemLogController extends BaseController List list = systemLogService.queryList(form); for(SystemLog l : list){ l.setCzsj(DateUtils.parseDateToStr(l.getCreateTime()==null?"": DateUtils.YYYY_MM_DD_HH_MM_SS,l.getCreateTime())); - l.setCzlx(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?l.getJcmc():l.getJcmcEn()); + l.setCzlx("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?l.getJcmc():l.getJcmcEn()); String czxq = ""; - if(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")){ + if("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))){ try{ JSONArray jsonArray = JSONArray.parseArray(l.getJcnr()); for(int i=0;i deptIdList; + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getShelfPlacement() { + return shelfPlacement; + } + + public void setShelfPlacement(String shelfPlacement) { + this.shelfPlacement = shelfPlacement; + } + + public String getCompartment() { + return compartment; + } + + public void setCompartment(String compartment) { + this.compartment = compartment; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public List getDeptIdList() { + return deptIdList; + } + + public void setDeptIdList(List deptIdList) { + this.deptIdList = deptIdList; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java new file mode 100644 index 0000000..1c2c553 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java @@ -0,0 +1,25 @@ +package com.hxhq.business.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.hxhq.business.domain.Bacteria; +import com.hxhq.business.domain.StorageLocation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 存储位置Mapper接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface StorageLocationMapper extends BaseMapper +{ + /** + * 列表 + * @param queryWrapper + * @return + */ + List queryList(@Param("ew") Wrapper queryWrapper); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormFillMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormFillMapper.java index 3bd50b7..7259c9c 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormFillMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyFormFillMapper.java @@ -62,4 +62,11 @@ public interface StudyFormFillMapper extends BaseMapper */ void updateZdgxjl(@Param("id") Long id,@Param("zdgxjl") String zdgxjl); + /** + * 前序表单列表 + * @param queryWrapper + * @return + */ + List queryQxbdList(@Param("ew") Wrapper queryWrapper); + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java new file mode 100644 index 0000000..598b47d --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java @@ -0,0 +1,14 @@ +package com.hxhq.business.mapper; + +import com.hxhq.business.domain.StudyMethodJcgj; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +/** + * 试验-试验方法-稽查轨迹Mapper接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface StudyMethodJcgjMapper extends BaseMapper +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodMapper.java index 966b802..56de772 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodMapper.java @@ -26,4 +26,10 @@ public interface StudyMethodMapper extends BaseMapper */ List queryList(@Param("ew") Wrapper queryWrapper, @Param("qmrId") Long qmrId); + /** + * 获取未读试验方法列表 + * @param queryWrapper + * @return + */ + List queryUnreadList(@Param("ew") Wrapper queryWrapper); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java new file mode 100644 index 0000000..d71324d --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java @@ -0,0 +1,24 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.StorageLocation; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.business.form.yq.StorageLocationSearchForm; + +/** + * 存储位置Service接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface IStorageLocationService extends IService +{ + /** + * 查询存储位置列表 + * + * @param form 存储位置 + * @return 存储位置集合 + */ + public List queryList(StorageLocationSearchForm form); + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java index 01005bf..a9a75bf 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java @@ -51,6 +51,7 @@ public interface IStudyFormApplyJcgjService extends IService /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormApply 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -60,10 +61,11 @@ public interface IStudyFormApplyJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormApplyJcgj getJcgj(StudyFormApply studyFormApply,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormApplyJcgj getJcgj(Date time,StudyFormApply studyFormApply,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormApply 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -74,6 +76,6 @@ public interface IStudyFormApplyJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormApplyJcgj getJcgj(StudyFormApply studyFormApply, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormApplyJcgj getJcgj(Date time,StudyFormApply studyFormApply, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java index 097af80..ab9b46b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormApplyQmxx; import com.baomidou.mybatisplus.extension.service.IService; @@ -25,10 +26,11 @@ public interface IStudyFormApplyQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java index 6f0fa34..4989887 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java @@ -57,7 +57,7 @@ public interface IStudyFormFillJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormFillJcgj getJcgj(StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormFillJcgj getJcgj(Date time,StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 @@ -71,6 +71,6 @@ public interface IStudyFormFillJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormFillJcgj getJcgj(StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormFillJcgj getJcgj(Date time,StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java index 10e2f12..bb6407b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormFillQmxx; import com.baomidou.mybatisplus.extension.service.IService; @@ -25,10 +26,11 @@ public interface IStudyFormFillQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java index fef1979..f87b040 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillService.java @@ -15,6 +15,13 @@ import com.hxhq.business.form.study.*; public interface IStudyFormFillService extends IService { /** + * 前序表单列表 + * @param form + * @return + */ + public List queryQxList(StudyFormFill form); + + /** * 查询试验-填报单列表 * * @param form 试验-填报单 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java index fed0cd5..898a45c 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java @@ -48,6 +48,7 @@ public interface IStudyFormPlanJcgjService extends IService /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPlan 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -57,10 +58,11 @@ public interface IStudyFormPlanJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPlanJcgj getJcgj(StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormPlanJcgj getJcgj(Date time,StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPlan 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -71,7 +73,7 @@ public interface IStudyFormPlanJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPlanJcgj getJcgj(StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormPlanJcgj getJcgj(Date time,StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java index b6c05bd..8e8f057 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormFillQmxx; @@ -26,10 +27,11 @@ public interface IStudyFormPlanQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java index e1e0456..987d4e3 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java @@ -47,6 +47,7 @@ public interface IStudyFormPreJcgjService extends IService /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPre 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -56,10 +57,11 @@ public interface IStudyFormPreJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPreJcgj getJcgj(StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormPreJcgj getJcgj(Date time,StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPre 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -70,7 +72,7 @@ public interface IStudyFormPreJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPreJcgj getJcgj(StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormPreJcgj getJcgj(Date time,StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java index d622766..fc49655 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormPreQmxx; import com.baomidou.mybatisplus.extension.service.IService; @@ -23,11 +24,12 @@ public interface IStudyFormPreQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java new file mode 100644 index 0000000..5c80532 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java @@ -0,0 +1,39 @@ +package com.hxhq.business.service; + +import java.util.List; + +import com.hxhq.business.domain.Sj; +import com.hxhq.business.domain.StudyMethod; +import com.hxhq.business.domain.StudyMethodJcgj; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.system.api.domain.SysUser; + +/** + * 试验-试验方法-稽查轨迹Service接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface IStudyMethodJcgjService extends IService +{ + /** + * 查询试验-试验方法-稽查轨迹列表 + * + * @param studMethodJcgj 试验-试验方法-稽查轨迹 + * @return 试验-试验方法-稽查轨迹集合 + */ + public List queryList(StudyMethodJcgj studMethodJcgj); + + /** + * 保存稽查轨迹 + * @param studyMethod 试验方法 + * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 + * @param jcmc 稽查名称 + * @param jcmcEn 稽查名称-英文 + * @param jcmcys 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 + * @param jcnr 稽查内容 + * @param jcnrEn 稽查内容-英文 + * @param qmr 签名人信息 + */ + void saveJcgj(StudyMethod studyMethod, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodReadService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodReadService.java index 3a3e4a2..b665485 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodReadService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodReadService.java @@ -21,4 +21,5 @@ public interface IStudyMethodReadService extends IService * @return 已读列表 */ List queryList(Long studyMethodId); + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java index 74629cf..c6ad0b7 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java @@ -45,4 +45,9 @@ public interface IStudyMethodService extends IService */ HashMap checkAllMethodReadStatus(Long userId, Long studyId, Long studySubjectId); + /** + * 关闭 + * @param form + */ + void close(StudyMethodForm form); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java index 9dc14ad..43650b9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.Study; @@ -31,15 +32,33 @@ public interface ISystemLogService extends IService * @param jcnr * @param jcnrEn * @param signForm + * @param time */ - void saveStudyInfo(Study study,String jcnr, String jcnrEn, SignForm signForm); + void saveStudyInfo(Study study,String jcnr, String jcnrEn, SignForm signForm,Date time); /** * 试验稽查轨迹-批量 * @param study * @param jcgjList + * @param time */ - void saveStudyBatch(Study study,List jcgjList); + void saveStudyBatch(Study study,List jcgjList,Date time); + + /** + * 普通日志-加上时间 + * @param name + * @param nameEn + * @param jcmc + * @param jcmcEn + * @param jcnr + * @param jcnrEn + * @param qmrid + * @param qmrMc + * @param qmrMcEn + * @param remark + * @param time + */ + void saveInfoWithData(String name, String nameEn, String jcmc, String jcmcEn, String jcnr, String jcnrEn, Long qmrid, String qmrMc, String qmrMcEn, String remark, Date time); /** * 普通日志 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java index fa1d077..794fb71 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -49,6 +50,8 @@ public class GspFfjlJcgjServiceImpl extends ServiceImpl impl @Override public void saveJcgj(Gsp gsp, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr) { + Date date = new Date(); + GspJcgj jcgj = new GspJcgj(); jcgj.setGspId(gsp.getId()); jcgj.setJcgjlx(jcgjlx); @@ -71,29 +74,36 @@ public class GspJcgjServiceImpl extends ServiceImpl impl jcgj.setQmrId(qmr.getUserId()); jcgj.setQmrMc(qmr.getNickName()); jcgj.setQmrMcEn(qmr.getUserName()); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override @Async public void saveBatchWithLog(Gsp gsp, List jcgjList) { + Date date = new Date(); + for (GspJcgj gspJcgj : jcgjList) { + gspJcgj.setCreateTime(date); + } this.saveBatch(jcgjList); for (GspJcgj jcgj : jcgjList) { - systemLogService.saveInfo(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } } @Override @Async public void saveWithLog(Gsp gsp, GspJcgj jcgj) { + Date date = new Date(); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java index 0e5458f..bac3f39 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -46,6 +47,7 @@ public class GspRkjlJcgjServiceImpl extends ServiceImpl jcgjList) { + Date date = new Date(); + for (GspRkjlJcgj gspRkjlJcgj : jcgjList) { + gspRkjlJcgj.setCreateTime(date); + } this.saveBatch(jcgjList); for (GspRkjlJcgj jcgj : jcgjList) { - systemLogService.saveInfo(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } } @Override @Async public void saveWithLog(GspRkjl gspRkjl, GspRkjlJcgj jcgj) { + Date date = new Date(); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java index 228a409..764949d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -58,17 +59,19 @@ public class SjJcgjServiceImpl extends ServiceImpl imple public void saveBatchWithLog(Sj sj, List sjJcgjList) { this.saveBatch(sjJcgjList); for (SjJcgj sjJcgj : sjJcgjList) { - systemLogService.saveInfo(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), - sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark()); + systemLogService.saveInfoWithData(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), + sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark(), sjJcgj.getCreateTime()); } } @Override @Async public void saveWithLog(Sj sj, SjJcgj sjJcgj) { + Date date = new Date(); + sjJcgj.setCreateTime(date); this.save(sjJcgj); - systemLogService.saveInfo(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), - sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark()); + systemLogService.saveInfoWithData(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), + sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark(), date); } @Override @@ -86,10 +89,12 @@ public class SjJcgjServiceImpl extends ServiceImpl imple sjJcgj.setQmrId(sysUser.getUserId()); sjJcgj.setQmrMc(sysUser.getNickName()); sjJcgj.setQmrMcEn(sysUser.getUserName()); + Date date = new Date(); + sjJcgj.setCreateTime(date); this.save(sjJcgj); - systemLogService.saveInfo(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), - sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark()); + systemLogService.saveInfoWithData(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), + sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark(), date); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java index b69bf04..7209ed7 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java @@ -171,6 +171,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi List sjJcgjList = new ArrayList<>(); //region 稽查轨迹 + Date date = new Date(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { SjJcgj jcgj = new SjJcgj(); jcgj.setSjId(sjOld.getId()); @@ -184,6 +185,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi jcgj.setQmrMc(qmr.getNickName()); jcgj.setQmrMcEn(qmr.getUserName()); jcgj.setRemark(form.getKcbjbz()); + jcgj.setCreateTime(date); sjJcgjList.add(jcgj); } sjJcgjService.saveBatchWithLog(sjOld, sjJcgjList); @@ -592,6 +594,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi updateById(sjOld); List gspJcgjList = new ArrayList<>(); + Date date = new Date(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { SjJcgj sjJcgj = new SjJcgj(); sjJcgj.setSjId(sjOld.getId()); @@ -605,6 +608,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi sjJcgj.setQmrMc(qmr.getNickName()); sjJcgj.setQmrMcEn(qmr.getUserName()); sjJcgj.setRemark(form.getQmbz()); + sjJcgj.setCreateTime(date); gspJcgjList.add(sjJcgj); } sjJcgjService.saveBatchWithLog(sjOld, gspJcgjList); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java new file mode 100644 index 0000000..0d666af --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java @@ -0,0 +1,54 @@ +package com.hxhq.business.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hxhq.business.form.yq.StorageLocationSearchForm; +import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.common.core.utils.StringUtils; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.StorageLocationMapper; +import com.hxhq.business.domain.StorageLocation; +import com.hxhq.business.service.IStorageLocationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 存储位置Service业务层处理 + * + * @author hxhq + * @date 2026-03-02 + */ +@Service +public class StorageLocationServiceImpl extends ServiceImpl implements IStorageLocationService +{ + /** + * 查询存储位置列表 + * + * @param form 存储位置 + * @return 存储位置 + */ + @Override + public List queryList(StorageLocationSearchForm form) + { + QueryWrapper queryWrapper = Wrappers.query(); + queryWrapper.eq("s.del_flag", 0); + if(StringUtils.isNotEmpty(form.getName())) { + queryWrapper.like("s.name", form.getName()); + } + if(StringUtils.isNotEmpty(form.getLocation())) { + queryWrapper.like("s.location", form.getLocation()); + } + if(StringUtils.isNotEmpty(form.getShelfPlacement())) { + queryWrapper.like("s.shelf_placement", form.getShelfPlacement()); + } + if(form.getStatus() != null) { + queryWrapper.eq("s.status", form.getStatus()); + } + if(CollectionUtils.isNotEmpty(form.getDeptIdList())) { + queryWrapper.in("s.dept_id", form.getDeptIdList()); + } + return baseMapper.queryList(queryWrapper); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java index 88cc56d..749e39b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java @@ -68,8 +68,8 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormApplyJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(),jcgj.getCreateTime()); } } @@ -107,13 +107,14 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormApplyJcgj getJcgj(Date time,StudyFormApply studyFormApply, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormApplyJcgj formJcgj = new StudyFormApplyJcgj(); formJcgj.setFormId(studyFormApply.getId()); formJcgj.setFormBh(studyFormApply.getBdbh()); @@ -135,17 +136,22 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl studyFormApplyJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(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); } @@ -309,11 +314,11 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); result = studyFormApply; } //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApply.getId(), "填写并保存记录", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApply.getId(), "填写并保存记录", qmr, studyFormApply.getRemark()); return baseMapper.queryInfo(result.getId()); } @@ -363,6 +368,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApply.getId(), "填写并提交记录", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApply.getId(), "填写并提交记录", qmr, studyFormApply.getRemark()); } @@ -390,6 +396,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "复核通过", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "复核通过", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -426,6 +433,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "复核拒绝", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "复核拒绝", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -461,6 +469,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), null, qmr, studyFormApply.getRemark(), null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), null, qmr, studyFormApply.getRemark(), now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "已审阅", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "已审阅", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -497,6 +506,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, studyFormApply.getRemark(), null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, studyFormApply.getRemark(), now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "审核拒绝", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "审核拒绝", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -603,7 +614,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormFillJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(),jcgj.getCreateTime()); } } @@ -104,7 +104,8 @@ public class StudyFormFillJcgjServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormFillJcgj getJcgj(Date time,StudyFormFill studyFormFill,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormFillJcgj formJcgj = new StudyFormFillJcgj(); formJcgj.setFormId(studyFormFill.getId()); formJcgj.setFormBh(studyFormFill.getBdbh()); @@ -148,12 +150,16 @@ public class StudyFormFillJcgjServiceImpl extends ServiceImpl queryQxList(StudyFormFill form) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("f.del_flag","0"); + queryWrapper.eq("f.study_id",form.getStudyId()); + queryWrapper.and(q->q.eq("f.bdzt",StudyFormFillBdztEnum.ywc.getValue()) + .or().eq("f.bdzt",StudyFormFillBdztEnum.ywcfh.getValue())); + if(StringUtils.isNoneBlank(form.getUserMc())){ + queryWrapper.like("f.user_mc",form.getUserMc()); + } + if(StringUtils.isNoneBlank(form.getBdmc())){ + queryWrapper.like("f.bdmc",form.getBdmc()); + } + queryWrapper.orderByDesc("f.id"); + return baseMapper.queryQxbdList(queryWrapper); + } /** * 开始配置 @@ -220,6 +236,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "废止通过", qmr, form.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "废止通过", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -308,9 +327,9 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "废止拒绝", qmr, form.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "废止拒绝", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -346,6 +365,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); } else { studyFormFill.setBdzt(StudyFormFillBdztEnum.tbz.getValue()); studyFormFill.setUserId(SecurityUtils.getUserId()); @@ -416,11 +437,11 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "创建记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "创建记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); } return baseMapper.queryInfo(result.getId()); } @@ -432,6 +453,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl0){ studyFormFillJcgjService.saveBatchWithLog(studyFormFillJcgjList); @@ -584,6 +607,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl studyFormFillJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormFillJcgjs.add(studyFormFillJcgjService.getJcgj(studyFormFillOld, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), qmr, studyFormFill.getRemark())); + studyFormFillJcgjs.add(studyFormFillJcgjService.getJcgj(now,studyFormFillOld, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), qmr, studyFormFill.getRemark())); } studyFormFillJcgjService.saveBatchWithLog(studyFormFillJcgjs); } //稽查轨迹 Map formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); } else { studyFormFill.setBdzt(StudyFormFillBdztEnum.ytj.getValue()); studyFormFill.setUserId(SecurityUtils.getUserId()); @@ -633,10 +657,10 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); } //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFill.getId(), "填写并提交记录", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFill.getId(), "填写并提交记录", qmr, studyFormFill.getRemark()); } @@ -684,6 +708,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("生长情况", form.getQmyy()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), form.getQmyy(), JcmcysEnum.orange.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), form.getRemark(), null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), form.getQmyy(), JcmcysEnum.orange.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), form.getRemark(), now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), form.getQmyy(), qmr, form.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), form.getQmyy(), qmr, form.getRemark()); } @@ -714,6 +739,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "复核通过", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "复核通过", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -751,6 +777,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "复核拒绝", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "复核拒绝", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -789,6 +816,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "免复核通过", JcmcysEnum.green.getValue(), null, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "免复核通过", JcmcysEnum.green.getValue(), null, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "免复核通过", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "免复核通过", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -826,6 +854,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "已审阅", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "已审阅", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -896,7 +925,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormPlanJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), jcgj.getCreateTime()); } } @@ -108,8 +108,8 @@ public class StudyFormPlanJcgjServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormPlanJcgj getJcgj(Date time,StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormPlanJcgj formJcgj = new StudyFormPlanJcgj(); formJcgj.setFormId(studyFormPlan.getId()); formJcgj.setFormBh(studyFormPlan.getBdbh()); @@ -135,11 +135,15 @@ public class StudyFormPlanJcgjServiceImpl extends ServiceImpl studyFormPlanJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormPlanJcgjs.add(studyFormPlanJcgjService.getJcgj(studyFormPlan, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPlan.getRemark())); + studyFormPlanJcgjs.add(studyFormPlanJcgjService.getJcgj(now,studyFormPlan, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPlan.getRemark())); } studyFormPlanJcgjService.saveBatchWithLog(studyFormPlanJcgjs); } @@ -181,11 +183,11 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); result = studyFormPlan; } //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlan.getId(), "填写并保存记录", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlan.getId(), "填写并保存记录", qmr, studyFormPlan.getRemark()); return baseMapper.queryInfo(result.getId()); } @@ -234,6 +236,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlan.getId(), "填写并提交记录", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlan.getId(), "填写并提交记录", qmr, studyFormPlan.getRemark()); } @@ -268,6 +271,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlanOld.getId(), "复核通过", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlanOld.getId(), "复核通过", qmr, studyFormPlan.getRemark()); //发送通知 Study study = studyService.getById(studyFormPlanOld.getStudyId()); String url = getUrlQz(study, "syxx"); @@ -304,6 +308,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlanOld.getId(), "复核拒绝", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlanOld.getId(), "复核拒绝", qmr, studyFormPlan.getRemark()); //发送通知 Study study = studyService.getById(studyFormPlanOld.getStudyId()); String url = getUrlQz(study, "syxx"); @@ -340,6 +345,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormPreJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(),jcgj.getCreateTime()); } } @@ -108,8 +108,8 @@ public class StudyFormPreJcgjServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormPreJcgj getJcgj(Date time,StudyFormPre studyFormPre,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormPreJcgj formJcgj = new StudyFormPreJcgj(); formJcgj.setFormId(studyFormPre.getId()); formJcgj.setFormBh(studyFormPre.getBdbh()); @@ -141,6 +141,9 @@ public class StudyFormPreJcgjServiceImpl extends ServiceImpl studyFormPreJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormPreJcgjs.add(studyFormPreJcgjService.getJcgj(studyFormPre, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPre.getRemark())); + studyFormPreJcgjs.add(studyFormPreJcgjService.getJcgj(now,studyFormPre, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPre.getRemark())); } studyFormPreJcgjService.saveBatchWithLog(studyFormPreJcgjs); } @@ -160,11 +161,11 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPre.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作保存预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作保存预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, now); result = studyFormPre; } //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPre.getId(), "制作保存预制表单", qmr, studyFormPre.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPre.getId(), "制作保存预制表单", qmr, studyFormPre.getRemark()); return baseMapper.queryInfo(result.getId()); } @@ -209,6 +210,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPre.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作提交预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作提交预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPre.getId(), "制作提交预制表单", qmr, studyFormPre.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPre.getId(), "制作提交预制表单", qmr, studyFormPre.getRemark()); //发送通知 Study study = studyService.getById(studyFormPre.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -269,6 +271,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核通过", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核通过", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "审核通过", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "审核通过", qmr, form.getRemark()); } /** @@ -328,6 +331,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "审核拒绝", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "审核拒绝", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -360,6 +364,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormPre.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "申请关闭", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "申请关闭", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormPreOld.getId(), "申请关闭", qmr, studyFormPre.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormPreOld.getId(), "申请关闭", qmr, studyFormPre.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -439,6 +445,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "关闭拒绝", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "关闭拒绝", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -474,6 +481,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭同意", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭同意", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "关闭同意", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "关闭同意", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -548,7 +556,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl implements IStudyMethodJcgjService +{ + + @Autowired + private ISystemLogService systemLogService; + + /** + * 查询试验-试验方法-稽查轨迹列表 + * + * @param studyMethodJcgj 试验-试验方法-稽查轨迹 + * @return 试验-试验方法-稽查轨迹 + */ + @Override + public List queryList(StudyMethodJcgj studyMethodJcgj) + { + QueryWrapper queryWrapper = Wrappers.query(); + return this.list(queryWrapper); + } + + @Override + @Async + public void saveJcgj(StudyMethod studyMethod, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr) { + Date date = new Date(); + StudyMethodJcgj studyMethodJcgj = new StudyMethodJcgj(); + studyMethodJcgj.setStudyMethodId(studyMethod.getId()); + studyMethodJcgj.setJcgjlx(jcgjlx); + studyMethodJcgj.setJcmc(jcmc); + studyMethodJcgj.setJcmcEn(jcmcEn); + studyMethodJcgj.setJcmcys(jcmcys); + studyMethodJcgj.setJcnr(jcnr); + studyMethodJcgj.setJcnrEn(jcnrEn); + studyMethodJcgj.setQmrId(qmr.getUserId()); + studyMethodJcgj.setQmrMc(qmr.getNickName()); + studyMethodJcgj.setQmrMcEn(qmr.getUserName()); + studyMethodJcgj.setCreateTime(date); + this.save(studyMethodJcgj); + + systemLogService.saveInfoWithData(studyMethod.getFfmc(), studyMethod.getFfmc(), studyMethodJcgj.getJcmc(), studyMethodJcgj.getJcmcEn(), + studyMethodJcgj.getJcnr(), studyMethodJcgj.getJcnrEn(), studyMethodJcgj.getQmrId(), studyMethodJcgj.getQmrMc(), studyMethodJcgj.getQmrMcEn(), studyMethodJcgj.getRemark(), date); + } + + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodReadServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodReadServiceImpl.java index 41e3b0c..4a47f7d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodReadServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodReadServiceImpl.java @@ -2,7 +2,9 @@ package com.hxhq.business.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.business.domain.Bacteria; import com.hxhq.business.domain.StudyMethod; import com.hxhq.business.domain.StudyMethodRead; import com.hxhq.business.form.study.StudyMethodForm; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java index 41c31a0..382a87e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java @@ -1,21 +1,29 @@ package com.hxhq.business.service.impl; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hxhq.business.domain.Bacteria; import com.hxhq.business.domain.Study; import com.hxhq.business.domain.StudyMethodRead; import com.hxhq.business.dto.select.DeptUserTreeDto; +import com.hxhq.business.enums.NormalEnum; import com.hxhq.business.enums.study.StudyMethodStatusEnum; import com.hxhq.business.enums.study.StudyTypeEnum; +import com.hxhq.business.enums.zykgl.JcgjlxEnum; +import com.hxhq.business.enums.zykgl.JcmcysEnum; import com.hxhq.business.form.study.StudyMethodForm; import com.hxhq.business.form.study.StudyMethodReadForm; import com.hxhq.business.form.study.StudyMethodSearchForm; import com.hxhq.business.service.*; +import com.hxhq.business.utils.JctUtil; import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.web.domain.AjaxResult; import com.hxhq.common.security.utils.SecurityUtils; @@ -51,6 +59,9 @@ public class StudyMethodServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + studyMethodJcgjService.saveJcgj(studyMethod, JcgjlxEnum.lc.getValue(), "上传方法", "Upload Method", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } @@ -166,8 +184,14 @@ public class StudyMethodServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + studyMethodJcgjService.saveJcgj(studyMethod, JcgjlxEnum.lc.getValue(), "阅读方法", "Read Method", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } @Override @@ -182,34 +206,52 @@ public class StudyMethodServiceImpl extends ServiceImplo.getId()).collect(Collectors.toList()).contains(String.valueOf(userId)) && !study.getLeader().equals(userId)){ //排除sd - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(StudyMethodRead::getQmrId, userId) - .eq(StudyMethodRead::getStudyId, studyId); + QueryWrapper queryWrapper = Wrappers.query(); + queryWrapper.eq("del_flag", 0) + .eq("status", NormalEnum.yes.getValue()) + .eq("study_id", studyId); if(studySubjectId != null) { - queryWrapper.eq(StudyMethodRead::getStudySubjectId, studySubjectId); + queryWrapper.eq("study_subject_id", studySubjectId); + queryWrapper.and(p -> p.apply("(id NOT IN (SELECT study_method_id FROM t_study_method_read WHERE del_flag = 0 AND qmr_id = {0} AND study_id = {1} AND study_subject_id = {2}))" + , SecurityUtils.getUserId(), studyId, studySubjectId)); + } else { + queryWrapper.and(p -> p.apply("(id NOT IN (SELECT study_method_id FROM t_study_method_read WHERE del_flag = 0 AND qmr_id = {0} AND study_id = {1}))" + , SecurityUtils.getUserId(), studyId)); } - long readCount = studyMethodReadService.count(queryWrapper); - LambdaQueryWrapper studyMethodLambdaQueryWrapper = new LambdaQueryWrapper<>(); - studyMethodLambdaQueryWrapper.eq(StudyMethod::getStudyId, studyId); - if(studySubjectId != null) { - studyMethodLambdaQueryWrapper.eq(StudyMethod::getStudySubjectId, studySubjectId); - } - List list = this.list(studyMethodLambdaQueryWrapper); - if(readCount != list.size()) { + List list = baseMapper.queryUnreadList(queryWrapper); + + if(list.size() > 0) { // 获取未读方法 - StudyMethodSearchForm form = new StudyMethodSearchForm(); - form.setStudyId(studyId); - form.setStudySubjectId(studySubjectId); - form.setZt(StudyMethodStatusEnum.wd.getValue()); - List studyMethodList = queryList(form); String toUrl=study.getType().equals(StudyTypeEnum.sy.getValue())?("/study/enter/"+study.getId()+"/syff"):study.getType().equals(StudyTypeEnum.fsy.getValue())?("/nonTrial/enter/"+study.getId()+"/syff"):study.getType().equals(StudyTypeEnum.mjy.getValue())?("/drug/enter/"+study.getId()+"/syff"):""; result.put("toUrl",toUrl); - result.put("ffmc","《" + studyMethodList.stream().map(StudyMethod::getFfmc).collect(Collectors.joining(",")) + "》方法还未阅读,请先阅读后再进行操作"); + result.put("ffmc","《" + list.stream().map(StudyMethod::getFfmc).collect(Collectors.joining(",")) + "》方法还未阅读,请先阅读后再进行操作"); } } return result; } + @Override + public void close(StudyMethodForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + + StudyMethod studyMethod = getById(form.getId()); + if(studyMethod == null || !studyMethod.getUserId().equals(form.getQmrId())) { + throw new ServiceException("对象不存在"); + } + studyMethod.setStatus(NormalEnum.no.getValue()); + updateById(studyMethod); + + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + studyMethodJcgjService.saveJcgj(studyMethod, JcgjlxEnum.lc.getValue(), "关闭方法", "Close Method", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); + } + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java index 44f6eb4..a8dc92a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -57,6 +58,8 @@ public class StudyRoomJcgjServiceImpl extends ServiceImpl implements queryWrapper.like("s.sn",form.getSn()); } if(StringUtils.isNoneBlank(form.getLeaderName())){ - queryWrapper.like("u.nick_name",form.getLeaderName()); + queryWrapper.like("s.`leader_name`",form.getLeaderName()); } if (StringUtils.isNoneBlank(form.getStartDate())) { queryWrapper.ge("s.create_time", form.getStartDate()); @@ -226,9 +226,10 @@ public class StudyServiceImpl extends ServiceImpl implements checkPermit(old); //获取修改的稽查轨迹 - List jcgjList = getChangeJcgj(old,study,sign); + Date now=new Date(); + List jcgjList = getChangeJcgj(old,study,sign,now); studyJcgjService.saveBatch(jcgjList); - systemLogService.saveStudyBatch(study, jcgjList); + systemLogService.saveStudyBatch(study, jcgjList,now); if(!old.getLeaderName().equals(study.getLeaderName())){ @@ -271,9 +272,10 @@ public class StudyServiceImpl extends ServiceImpl implements * @param old * @param study * @param sign + * @param time * @return */ - private List getChangeJcgj(Study old,Study study,SignForm sign){ + private List getChangeJcgj(Study old,Study study,SignForm sign,Date time){ List jcgjList = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, study); if (fieldChanges.size() > 0) { @@ -308,6 +310,7 @@ public class StudyServiceImpl extends ServiceImpl implements jcgj.setQmrMc(SecurityUtils.getNickName()); jcgj.setQmrMcEn(SecurityUtils.getUsername()); } + jcgj.setCreateTime(time); jcgjList.add(jcgj); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java index 3083d8f..8da990a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java @@ -1,6 +1,7 @@ package com.hxhq.business.service.impl; import java.util.ArrayList; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -58,7 +59,7 @@ public class SystemLogServiceImpl extends ServiceImpl jcgjList) { + public void saveStudyBatch(Study study,List jcgjList,Date time) { List logList = new ArrayList<>(); for(StudyJcgj jcgj : jcgjList){ SystemLog info = new SystemLog(); @@ -88,6 +90,7 @@ public class SystemLogServiceImpl extends ServiceImpl impleme @Override @Async public void saveJcgj(Yq yq, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn) { + Date date = new Date(); SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); YqJcgj jcgj = new YqJcgj(); jcgj.setYqId(yq.getId()); @@ -70,19 +72,24 @@ public class YqJcgjServiceImpl extends ServiceImpl impleme jcgj.setQmrId(sysUser.getUserId()); jcgj.setQmrMc(sysUser.getNickName()); jcgj.setQmrMcEn(sysUser.getUserName()); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override @Async public void saveBatchWithLog(Yq yq, List jcgjList) { + Date date = new Date(); + for (YqJcgj jcgj : jcgjList) { + jcgj.setCreateTime(date); + } this.saveBatch(jcgjList); for (YqJcgj jcgj : jcgjList) { - systemLogService.saveInfo(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java new file mode 100644 index 0000000..44f4325 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java @@ -0,0 +1,472 @@ +package com.hxhq.business.utils; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.hxhq.business.domain.*; +import com.hxhq.business.utils.lang.TemplateUtil; +import com.hxhq.business.utils.pdf.PdfBaseUtil; +import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.common.core.text.Convert; +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.model.LoginUser; +import com.itextpdf.text.*; +import com.itextpdf.text.pdf.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Paths; +import java.util.List; +import java.util.Random; +import java.util.StringJoiner; + +/** + * 试验方法pdf导出 + * + * @author HanLong + */ +@Component +public class StudyFormFillUtil { + + private static final Logger log = LoggerFactory.getLogger(StudyFormFillUtil.class); + public static String language = "zh"; + /** + * 资源映射路径 前缀 + */ + @Value("${file.prefix}") + public String localFilePrefix; + + /** + * 域名或本机访问地址 + */ + @Value("${file.domain}") + public String domain; + + /** + * 上传文件存储在本地的根路径 + */ + @Value("${file.path}") + private String localFilePath; + + /** + * 复制原有PDF的所有页面到新Document中 + */ + private static void copyOriginalPagesToDocument(Document doc, PdfWriter writer, PdfReader reader) throws DocumentException { + int pageCount = reader.getNumberOfPages(); + // 获取直接内容画布 + PdfContentByte canvas = writer.getDirectContent(); + + for (int i = 1; i <= pageCount; i++) { + doc.newPage(); // 新建一页(与原PDF页面一一对应) + // 5.5.11中通过PdfImportedPage导入原有页面 + PdfImportedPage importedPage = writer.getImportedPage(reader, i); + // 将原有页面绘制到新文档的当前页 + canvas.addTemplate(importedPage, 0, 0); + } + } + + /** + * 导出table + * + * @param headerText + * @param fileDir + * @return + */ + public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List jcgjList, List qmxxList,Boolean jcgj) { + language = lang; + Document document = null; + FileOutputStream fos = null; + String filePath = ""; + String fileName = ""; + try { + // 1. 生成文件名 + fileName = generateFileName(); + // 2. 确保目录存在 + File dir = new File(fileDir); + if (!dir.exists()) { + dir.mkdirs(); + } + // 3. 完整文件路径 + filePath = Paths.get(fileDir, fileName).toString(); + // 创建PDF文档 设置文档边距,避免内容遮挡页眉页脚 + // 1. 读取原有PDF,获取页面尺寸(保证新文档与原文档格式一致) + PdfReader srcReader = new PdfReader(srcPdf); + // 取第一页尺寸作为新文档尺寸 + Rectangle pageSize = srcReader.getPageSize(1); + // 2. 初始化Document(iText 5的核心高层类) + document = new Document(pageSize); + fos = new FileOutputStream(filePath); + // 3. 关联PdfWriter,绑定Document和输出流(5.5.11必须先创建Writer再open Document) + PdfWriter writer = PdfWriter.getInstance(document, fos); + // 设置页面事件,每页添加文字页眉 + String sign = "hxhq"; + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + sign = loginUser.getSysUser().getNickName() + " " + DateUtils.getTime(); + } + writer.setPageEvent(new TextHeaderEvent(sign+" "+version+" ", headerText, false)); + // 4. 设置PDF属性 + document.addTitle("华西海圻"); + document.addAuthor("华西海圻"); + document.addCreator("华西海圻"); + document.addCreationDate(); + document.open(); + // 5. 复制原有PDF的所有页面到新Document中 + copyOriginalPagesToDocument(document, writer, srcReader); + // 7. 表格设置到新的一页 + document.newPage(); + addQmxx(document, qmxxList, lang); + if(jcgj){ + addJcgj(document, jcgjList, lang); + } + } catch (Exception e) { + throw new RuntimeException("生成失败: " + e.getMessage()); + } finally { + if (document != null) { + document.close(); + } + if (fos != null) { + try { + fos.close(); + } catch (IOException e) { + log.error("关闭文件流失败", e); + } + } + } + return fileName; + } + + /** + * 签名信息 + * 申请表单 + * + * @param document + * @param studyFormFillQmxxList + * @throws IOException + * @throws DocumentException + */ + public static void addQmxx(Document document, List studyFormFillQmxxList, String lang) throws IOException, DocumentException { + language = lang; + PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true); + // 9. 表头 + BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); + Font headerFont = new Font(bfChinese, 10, Font.NORMAL); + Font contentFont = new Font(bfChinese, 10, Font.NORMAL); + + // 8. 创建表格 + PdfPTable table = new PdfPTable(4); + table.setWidthPercentage(100); + table.setSpacingBefore(10); + String[] headers = {getName("签名人"), getName("签名意义"), getName("签名时间"), getName("备注原因")}; + for (String header : headers) { + PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); + cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); + cell.setBorderWidth(1); + table.addCell(cell); + } + if (studyFormFillQmxxList.size() > 0) { + int rowNum = 0; + for (StudyFormFillQmxx studyFormFillQmxx : studyFormFillQmxxList) { + // 交替行颜色 + if (rowNum % 2 == 0) { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } else { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } + table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getQmrMc(), contentFont)); + table.addCell(PdfBaseUtil.createCell("en".equals(language) ? studyFormFillQmxx.getQmyyEn() : studyFormFillQmxx.getQmyy(), contentFont)); + table.addCell(PdfBaseUtil.createCell(PdfExportUtil.parseDateToStr(studyFormFillQmxx.getCreateTime()), contentFont)); + table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getRemark(), contentFont)); + rowNum++; + } + } + document.add(table); + } + + /** + * 稽查轨迹 + * 申请表单 + * + * @param document + * @param studyFormFillJcgjList + * @throws IOException + * @throws DocumentException + */ + public static void addJcgj(Document document, List studyFormFillJcgjList, String lang) throws IOException, DocumentException { + language = lang; + PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹"), 10, true); + for (StudyFormFillJcgj jcgj : studyFormFillJcgjList) { + StringJoiner result = new StringJoiner(", "); + if ("en".equals(lang)) { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmcEn(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnrEn())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnrEn()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value") != null ? node.get("value").asText() : ""; + result.add(name + ":" + value); + } + } + } + } else { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmc(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnr())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value") != null ? node.get("value").asText() : ""; + result.add(name + ":" + value); + } + } + } + } + + if (StringUtils.isNoneBlank(jcgj.getRemark())) { + result.add(getName("备注") + ":" + jcgj.getRemark()); + } + if (StringUtils.isNoneBlank(jcgj.getQmrMc())) { + result.add(getName("签名人") + ":" + jcgj.getQmrMc()); + } + PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); + } + } + + + /** + * 获取名称 + * + * @param name + * @return + */ + public static String getName(String name) { + return "en".equals(language) ? TemplateUtil.getEn(name) : name; + } + + + /** + * 创建表格 + */ + private static PdfPCell createCell(String content, Font font) { + PdfPCell cell = new PdfPCell(new Phrase(content, font)); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setVerticalAlignment(Element.ALIGN_MIDDLE); + cell.setPadding(6); + cell.setMinimumHeight(25); + return cell; + } + + + /** + * 生成文件名 + */ + private static String generateFileName() { + Random random = new Random(); + String timestamp = DateUtils.dateTimeNow("yyyyMMddHHmmss"); + return String.format("%s_%s.pdf", timestamp, random.nextInt(1000)); + } + + + /** + * 页面事件处理类 - 每页添加文字页眉 + */ + static class TextHeaderEvent extends PdfPageEventHelper { + private Font footerFont; + private String signText; + private String headerText; + private BaseFont baseFont; + private Boolean showHaderLine = true; + private int totalPages = 0; + private PdfTemplate total; + + public TextHeaderEvent(String signText, String headerText, Boolean showHaderLine) throws Exception { + try { + this.showHaderLine = showHaderLine; + this.signText = signText; + this.headerText = headerText; + // 创建字体(支持中文) + this.baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); + footerFont = new Font(baseFont, 10, Font.NORMAL, BaseColor.GRAY); + } catch (Exception e) { + footerFont = new Font(Font.FontFamily.HELVETICA, 10, Font.NORMAL, BaseColor.GRAY); + } + } + + @Override + public void onOpenDocument(PdfWriter writer, Document document) { + total = writer.getDirectContent().createTemplate(100, 16); + } + + @Override + public void onCloseDocument(PdfWriter writer, Document document) { + totalPages = writer.getPageNumber(); + String totalPagesStr = String.valueOf(totalPages); + + // 重新创建合适宽度的模板 + BaseFont baseFont = footerFont.getBaseFont(); + float actualWidth = baseFont.getWidthPoint(totalPagesStr, footerFont.getSize()); + + total.beginText(); + total.setFontAndSize(baseFont, footerFont.getSize()); + total.setTextMatrix(0, 0); + total.showText(totalPagesStr); + total.endText(); + } + + @Override + public void onEndPage(PdfWriter writer, Document document) { + try { + PdfContentByte cb = writer.getDirectContent(); + + // 获取页面尺寸 + Rectangle pageSize = document.getPageSize(); + float pageWidth = pageSize.getWidth(); + float pageHeight = pageSize.getHeight(); + + // 设置页眉参数 + float topMargin = 15; // 顶部边距 + float fontSize = 12; // 字体大小 + + // 计算文字宽度(用于居中) + float textWidth = baseFont.getWidthPoint(signText, fontSize); + + // 计算居中位置 + float textX = (pageSize.getLeft() + pageSize.getRight()) / 2; + float textY = pageHeight - topMargin; + + // 获取画布 + PdfContentByte canvas = writer.getDirectContent(); + + int currentPage = writer.getPageNumber(); + float y = document.bottom() - 20; + + // 在每一页都重新计算,确保位置准确 + String pageText = signText+ " 第 " + currentPage + " 页 / 共 "; + BaseFont baseFont = footerFont.getBaseFont(); + + // 计算页面文本宽度 + float pageTextWidth = baseFont.getWidthPoint(pageText, footerFont.getSize()); + + // 临时用估计的总页数计算位置(等文档关闭后会被替换) + String tempTotal = String.valueOf(writer.getPageNumber() + 5); // 估计值 + float totalWidth = baseFont.getWidthPoint(tempTotal, footerFont.getSize()); + + // 计算起始位置 + float totalTextWidth = pageTextWidth + totalWidth + + baseFont.getWidthPoint(" 页", footerFont.getSize()); + float startX = (document.getPageSize().getWidth() - totalTextWidth) / 2; + + // 写入当前页信息 + ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, + new Phrase(pageText, footerFont), startX, y, 0); + + // 添加总页数模板 + cb.addTemplate(total, startX + pageTextWidth, y); + + // 写入"页"字 + ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, + new Phrase(" 页", footerFont), startX + pageTextWidth + totalWidth, y, 0); + +// PdfContentByte content = writer.getDirectContentUnder(); // 在水印层添加 +// +// // 设置透明度 +// PdfGState gs = new PdfGState(); +// float opacity = Convert.toFloat("0.3"); +// gs.setFillOpacity(opacity); +// content.setGState(gs); +// +// // 设置字体和颜色 +// content.setColorFill(BaseColor.RED); +// content.setFontAndSize(baseFont, fontSize); +// +// float width = pageSize.getWidth(); +// float height = pageSize.getHeight(); +// +// // 重复铺满水印 +// addRepeatedWatermark(content, width, height, signText); + // 添加页眉文字 + if (StringUtils.isNoneBlank(headerText)) { + float pageTextWidth1 = baseFont.getWidthPoint(headerText, footerFont.getSize()); + float startX1 = (document.getPageSize().getWidth() - pageTextWidth1) / 2; + + PdfContentByte cb2 = writer.getDirectContent(); + ColumnText.showTextAligned(cb2, Element.ALIGN_LEFT, + new Phrase(headerText, footerFont), startX1, textY, 0); +// canvas.beginText(); +// canvas.setFontAndSize(baseFont, fontSize); +// canvas.setTextMatrix(textX, textY); +// canvas.showText(headerText); +// canvas.endText(); + if (showHaderLine) { + // 添加页眉分隔线(可选) + addHeaderLine(canvas, pageWidth, textY - 10); + } + } + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 添加水印 + * + * @param content + * @param width + * @param height + * @param signText + */ + private void addRepeatedWatermark(PdfContentByte content, float width, float height, String signText) { + // 计算文字尺寸 + float fontSize = Convert.toFloat("10"); + float textWidth = baseFont.getWidthPoint(signText, fontSize) + 50; + float textHeight = baseFont.getAscentPoint(signText, fontSize) - + baseFont.getDescentPoint(signText, fontSize); + + // 计算间距 + float stepX = textWidth + 70; + float stepY = textHeight + 100; + + // 添加重复水印 + Integer two = 2; + for (float x = textWidth / two; x < width; x += stepX) { + for (float y = textHeight / two; y < height; y += stepY) { + content.beginText(); + content.showTextAligned( + Element.ALIGN_CENTER, + signText, + x, + y, + fontSize + ); + content.endText(); + } + } + } + + /** + * 添加页眉线 + * + * @param canvas + * @param pageWidth + * @param yPos + */ + private void addHeaderLine(PdfContentByte canvas, float pageWidth, float yPos) { + canvas.setLineWidth(0.5f); + canvas.lineTo(pageWidth, yPos); + canvas.stroke(); + } + } +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java index f313ffa..e921ade 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java @@ -15,6 +15,9 @@ public class GspJcnrUtil { private static final Logger logger = LoggerFactory.getLogger(GspJcnrUtil.class.getName()); private static HashMap mapLang=new HashMap<>(); static { + + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("入库","In Storage"); mapLang.put("未入库","Not in Storage"); mapLang.put("已发放","In Use"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java index 69185ee..c7b45f4 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java @@ -88,6 +88,8 @@ public class GyzjJcnrUtil { mapLang.put("备注","Comment"); mapLang.put("签名人","Signed By"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("申请解档","Apply for De-archiving"); mapLang.put("申请借阅","Apply for Check-out"); mapLang.put("申请归档","Apply for Archiving"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java index 5b1eec2..04ed832 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java @@ -15,6 +15,9 @@ public class MjyJcnrUtil { private static final Logger logger = LoggerFactory.getLogger(MjyJcnrUtil.class.getName()); private static HashMap mapLang=new HashMap<>(); static { + + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("入库","In Storage"); mapLang.put("未入库","Not in Storage"); mapLang.put("已发放","In Use"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java new file mode 100644 index 0000000..f528556 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java @@ -0,0 +1,167 @@ +package com.hxhq.business.utils.lang; + +import com.hxhq.business.utils.JctUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author tanfei + */ +public class SjJcnrUtil { + private static final Logger logger = LoggerFactory.getLogger(SjJcnrUtil.class.getName()); + private static HashMap mapLang=new HashMap<>(); + static { + mapLang.put("入库","In Storage"); + mapLang.put("未入库","Not in Storage"); + mapLang.put("已发放","In Use"); + mapLang.put("已锁定","Locked"); + mapLang.put("待归档","Pending Archiving"); + mapLang.put("归档","Archived"); + mapLang.put("待解档","Pending De-archiving"); + mapLang.put("借阅开始时间","Checkout Start Date"); + mapLang.put("借阅结束时间","Checkout End Date"); + mapLang.put("处置","Dispose"); + mapLang.put("处置方式","Dispose Method"); + mapLang.put("处置原因","Reason"); + mapLang.put("处置量","Amount"); + mapLang.put("处置人","Operator"); + mapLang.put("使用","Usage"); + mapLang.put("配制完成","Configuration completed"); + mapLang.put("复核人","Reviewer"); + mapLang.put("监督人","Supervisor"); + mapLang.put("钥匙1领取人","Key 1 User"); + mapLang.put("钥匙2领取人","Key 2 User"); + mapLang.put("发放人","Issuer"); + mapLang.put("发放人2","Issuer 2"); + mapLang.put("出库量","Out Amount"); + mapLang.put("转移条件","Transfer Condition"); + mapLang.put("出库毛重","Check-out Gross Weight"); + mapLang.put("入库毛重","Check-in Gross Weight"); + mapLang.put("使用量","Usage Amount"); + mapLang.put("归还人1","Returner 1"); + mapLang.put("归还人2","Returner 2"); + mapLang.put("库管员1","Warehouse Keeper 1"); + mapLang.put("库管员2","Warehouse Keeper 2"); + mapLang.put("签名人1","Signed By 1"); + mapLang.put("签名人2","Signed By 2"); + mapLang.put("申请备注","Apply Comment"); + mapLang.put("审核备注","Approve Comment"); + mapLang.put("存储条件","Storage Condition"); + mapLang.put("存储位置","Storage Location"); + mapLang.put("有效周期","Validity Period"); + mapLang.put("使用人","User"); + mapLang.put("领取/归还人","Recipient/Returner"); + mapLang.put("发放/接收人","Issuer/Receiver"); + mapLang.put("操作类型","Action"); + mapLang.put("操作量","Amount"); + mapLang.put("备注/原因","Comment/Reason"); + mapLang.put("操作时间","Datetime"); + mapLang.put("名称","Name"); + mapLang.put("编号","ID"); + mapLang.put("浓度/含量/纯度","Concentration/Purity"); + mapLang.put("批号","Batch Num"); + mapLang.put("规格","Specification"); + mapLang.put("库存量","Amount"); + mapLang.put("来源","Source"); + mapLang.put("失效日期","Expiration"); + mapLang.put("配制日期","Formulation Date"); + mapLang.put("制剂状态","Status"); + mapLang.put("所属表单","In Record"); + mapLang.put("表单所属试验","From Study"); + mapLang.put("表单所属人","By User"); + mapLang.put("表单所属部门","Department"); + mapLang.put("基本信息","Information"); + mapLang.put("表单信息","Record Information"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("麻精药台账","Controlled Drug Table"); + mapLang.put("备注","Comment"); + mapLang.put("原因","Reason"); + mapLang.put("签名人","Signed By"); + + + + mapLang.put("申请解档","Apply for De-archiving"); + mapLang.put("申请借阅","Apply for Check-out"); + mapLang.put("申请归档","Apply for Archiving"); + mapLang.put("锁定麻精药","Lock Controlled Drug"); + mapLang.put("解锁麻精药","Unlock Controlled Drug"); + mapLang.put("处置药剂","Dispose Substance"); + mapLang.put("处置容器","Dispose Container"); + mapLang.put("钥匙发放","Issue Key"); + mapLang.put("申请编辑","Apply Edit"); + mapLang.put("同意编辑","Approve Edit"); + mapLang.put("拒绝编辑","Reject Edit"); + mapLang.put("修改库存申请","Apply Change Inventory"); + mapLang.put("同意修改库存","Approve Change Inventory"); + mapLang.put("拒绝修改库存","Reject Change Inventory"); + mapLang.put("归还","Return"); + mapLang.put("领取发放","Distribution"); + mapLang.put("存储","Storage"); + mapLang.put("取出","Take Out"); + mapLang.put("确认归还","Confirm Check-in"); + mapLang.put("到期自动归还","到期自动归还"); + + mapLang.put("表单名称","Preset Name"); + mapLang.put("锁定发放记录","Lock Record"); + mapLang.put("解锁发放记录","Unlock Record"); + mapLang.put("麻精药入库","Controlled Drug Check-in"); + mapLang.put("目的","Purpose"); + mapLang.put("麻精药详情","Controlled Drug Information"); + + mapLang.put("入库位置","Check-in Location"); + mapLang.put("入库条件","Check-in Condition"); + mapLang.put("同意归档","Approve Archiving"); + mapLang.put("拒绝归档","Reject Archiving"); + mapLang.put("同意解档","Approve De-archiving"); + mapLang.put("拒绝解档","Reject De-archiving"); + mapLang.put("同意借阅","Approve Check-out"); + mapLang.put("拒绝借阅","Reject Check-out"); + + } + + public static void main(String[] args) { + Map formData = new LinkedHashMap<>(); + formData.put("申请备注", "1111"); + formData.put("审核备注", "22"); + logger.info(getJcnrEn(formData)); + } + /** + * 获取英文 + * @param qmyy + * @return + */ + public static String getEn(String qmyy) { + return mapLang.get(qmyy); + } + + /** + * 获取稽查内容英文 + * @param map + * @return + */ + public static String getJcnrEn(Map map) { + Map result =new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + result.put(mapLang.get(entry.getKey()),entry.getValue()); + } + return JctUtil.formatStr(result); + } + + /** + * 获取稽查内容英文 + * @param map + * @return + */ + public static Map getMapEn(Map map) { + Map result =new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + result.put(mapLang.get(entry.getKey()),entry.getValue()); + } + return result; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java index a24a680..f4d7876 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java @@ -17,12 +17,15 @@ public class StudyFormUtil { static { + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("存储","Storage"); mapLang.put("存储条件","Storage Condition"); mapLang.put("存储位置","Storage Location"); mapLang.put("存储药剂","存储药剂"); + mapLang.put("字段名","Field Name"); mapLang.put("原值","Old Value"); mapLang.put("新值","New Value"); mapLang.put("原因","Reason"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java index 7fdac5a..27862a9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java @@ -22,6 +22,8 @@ public class TemplateUtil { mapLang.put("操作步骤","Operation Steps"); mapLang.put("备注","Remarks"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("试验名称","Study Name"); mapLang.put("试验编号","Study Number"); mapLang.put("方法编号","Method Code"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java index 3944cd7..c4b71df 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java @@ -26,6 +26,8 @@ public class ZcgJcnrUtil { mapLang.put("钥匙1领取人","Key 1 Recipient"); mapLang.put("钥匙2领取人","Key 2 Recipient"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); } public static void main(String[] args) { diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java index bcdbf9d..516569e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java @@ -234,11 +234,11 @@ public class PdfBaseUtil { private String signText; private String headerText; private BaseFont baseFont; - private Boolean showHaderLine=true; + private Boolean showHaderLine = true; private int totalPages = 0; private PdfTemplate total; - public TextHeaderEvent(String signText, String headerText,Boolean showHaderLine) throws Exception { + public TextHeaderEvent(String signText, String headerText, Boolean showHaderLine) throws Exception { try { this.showHaderLine = showHaderLine; this.signText = signText; @@ -283,14 +283,14 @@ public class PdfBaseUtil { float pageHeight = pageSize.getHeight(); // 设置页眉参数 - float topMargin = 30; // 顶部边距 + float topMargin = 15; // 顶部边距 float fontSize = 12; // 字体大小 // 计算文字宽度(用于居中) float textWidth = baseFont.getWidthPoint(signText, fontSize); // 计算居中位置 - float textX = (pageWidth - textWidth) / 2; + float textX = (pageSize.getLeft() + pageSize.getRight()) / 2; float textY = pageHeight - topMargin; // 获取画布 @@ -300,7 +300,7 @@ public class PdfBaseUtil { float y = document.bottom() - 20; // 在每一页都重新计算,确保位置准确 - String pageText = "第 " + currentPage + " 页 / 共 "; + String pageText = signText+ " 第 " + currentPage + " 页 / 共 "; BaseFont baseFont = footerFont.getBaseFont(); // 计算页面文本宽度 @@ -326,38 +326,43 @@ public class PdfBaseUtil { ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, new Phrase(" 页", footerFont), startX + pageTextWidth + totalWidth, y, 0); - PdfContentByte content = writer.getDirectContentUnder(); // 在水印层添加 - - // 设置透明度 - PdfGState gs = new PdfGState(); - float opacity = Convert.toFloat("0.3"); - gs.setFillOpacity(opacity); - content.setGState(gs); - - // 设置字体和颜色 - content.setColorFill(BaseColor.RED); - content.setFontAndSize(baseFont, fontSize); - - float width = pageSize.getWidth(); - float height = pageSize.getHeight(); - - // 重复铺满水印 - addRepeatedWatermark(content, width, height, signText); - +// PdfContentByte content = writer.getDirectContentUnder(); // 在水印层添加 +// +// // 设置透明度 +// PdfGState gs = new PdfGState(); +// float opacity = Convert.toFloat("0.3"); +// gs.setFillOpacity(opacity); +// content.setGState(gs); +// +// // 设置字体和颜色 +// content.setColorFill(BaseColor.RED); +// content.setFontAndSize(baseFont, fontSize); +// +// float width = pageSize.getWidth(); +// float height = pageSize.getHeight(); +// +// // 重复铺满水印 +// addRepeatedWatermark(content, width, height, signText); // 添加页眉文字 - if(StringUtils.isNoneBlank(headerText)) { - canvas.beginText(); - canvas.setFontAndSize(baseFont, fontSize); - canvas.setTextMatrix(textX, textY); - canvas.showText(headerText); - canvas.endText(); - - if(showHaderLine){ + if (StringUtils.isNoneBlank(headerText)) { + float pageTextWidth1 = baseFont.getWidthPoint(headerText, footerFont.getSize()); + float startX1 = (document.getPageSize().getWidth() - pageTextWidth1) / 2; + + PdfContentByte cb2 = writer.getDirectContent(); + ColumnText.showTextAligned(cb2, Element.ALIGN_LEFT, + new Phrase(headerText, footerFont), startX1, textY, 0); +// canvas.beginText(); +// canvas.setFontAndSize(baseFont, fontSize); +// canvas.setTextMatrix(textX, textY); +// canvas.showText(headerText); +// canvas.endText(); + if (showHaderLine) { // 添加页眉分隔线(可选) addHeaderLine(canvas, pageWidth, textY - 10); } } + } catch (Exception e) { e.printStackTrace(); } @@ -374,7 +379,7 @@ public class PdfBaseUtil { private void addRepeatedWatermark(PdfContentByte content, float width, float height, String signText) { // 计算文字尺寸 float fontSize = Convert.toFloat("10"); - float textWidth = baseFont.getWidthPoint(signText, fontSize)+50; + float textWidth = baseFont.getWidthPoint(signText, fontSize) + 50; float textHeight = baseFont.getAscentPoint(signText, fontSize) - baseFont.getDescentPoint(signText, fontSize); @@ -383,7 +388,7 @@ public class PdfBaseUtil { float stepY = textHeight + 100; // 添加重复水印 - Integer two=2; + Integer two = 2; for (float x = textWidth / two; x < width; x += stepX) { for (float y = textHeight / two; y < height; y += stepY) { content.beginText(); @@ -408,8 +413,7 @@ public class PdfBaseUtil { */ private void addHeaderLine(PdfContentByte canvas, float pageWidth, float yPos) { canvas.setLineWidth(0.5f); - canvas.moveTo(50, yPos); - canvas.lineTo(pageWidth - 50, yPos); + canvas.lineTo(pageWidth, yPos); canvas.stroke(); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java index e418427..bd2dc15 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java @@ -37,7 +37,7 @@ public class Dosage { * @param gyzj * @return */ - public String exportDetail(DetailDto gyzj, List gyzjTzList, List gyzjJcgjList, String lang, String localFilePath) { + public String exportDetail(DetailDto gyzj, List gyzjTzList, List gyzjJcgjList, String lang, String version,String localFilePath) { language=lang; Document document = null; FileOutputStream fos = null; @@ -46,9 +46,9 @@ public class Dosage { String sign = "hxhq"; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName(); + sign = loginUser.getSysUser().getNickName() +" "+ PdfExportUtil.parseDateToStr(new Date()); } - document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("给药制剂详情"),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +" "+version+" ", getName("给药制剂详情"),false); // 基本信息 PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); Map formData1 = new LinkedHashMap<>(); @@ -113,8 +113,9 @@ public class Dosage { String[] headers = {getName("使用人"),getName("领取/归还人/入库申请人"),getName("发放/接收人"),getName("操作类型"),getName("表单名称"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); cell.setBorderWidth(1); table.addCell(cell); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java index 39dac70..c80ae75 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java @@ -36,7 +36,7 @@ public class Drug { * @param mjy * @return */ - public String exportDetail(DetailDto mjy, List mjyTzList, List mjyJcgjList, String lang, String localFilePath) { + public String exportDetail(DetailDto mjy, List mjyTzList, List mjyJcgjList, String lang,String version, String localFilePath) { language=lang; Document document = null; FileOutputStream fos = null; @@ -45,9 +45,9 @@ public class Drug { String sign = "hxhq" ; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName(); + sign = loginUser.getSysUser().getNickName()+" "+ PdfExportUtil.parseDateToStr(new Date()); } - document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("麻精药详情"),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +" "+version+" ", getName("麻精药详情"),false); // 基本信息 PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); Map formData1 = new LinkedHashMap<>(); @@ -112,8 +112,9 @@ public class Drug { String[] headers = {getName("使用人"),getName("领取/归还人"),getName("发放/接收人"),getName("操作类型"),getName("表单名称"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); cell.setBorderWidth(1); table.addCell(cell); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java index 212b1b4..145ca05 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java @@ -38,7 +38,7 @@ public class GspPdf { * @param gsp * @return */ - public String exportDetail(GspDto gsp, List tzList, List jcgjList, String lang, String localFilePath) { + public String exportDetail(GspDto gsp, List tzList, List jcgjList, String lang,String version, String localFilePath) { language=lang; Document document = null; FileOutputStream fos = null; @@ -47,9 +47,9 @@ public class GspPdf { String sign = "hxhq"; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName(); + sign = loginUser.getSysUser().getNickName()+" "+ PdfExportUtil.parseDateToStr(new Date()); } - document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("给药制剂详情"),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +" "+version+" ", getName("给药制剂详情"),false); // 基本信息 PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); Map formData1 = new LinkedHashMap<>(); @@ -106,8 +106,9 @@ public class GspPdf { String[] headers = {getName("使用人"),getName("领取/归还人/入库申请人"),getName("发放/接收人"),getName("操作类型"),getName("表单名称"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); cell.setBorderWidth(1); table.addCell(cell); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java new file mode 100644 index 0000000..caefb1c --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java @@ -0,0 +1,204 @@ +package com.hxhq.business.utils.pdf.resource; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.hxhq.business.domain.*; +import com.hxhq.business.dto.gsp.GspDto; +import com.hxhq.business.dto.sj.SjListDto; +import com.hxhq.business.enums.zykgl.ZjztEnum; +import com.hxhq.business.utils.lang.GyzjJcnrUtil; +import com.hxhq.business.utils.lang.SjJcnrUtil; +import com.hxhq.business.utils.pdf.PdfBaseUtil; +import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.common.security.utils.SecurityUtils; +import com.hxhq.system.api.model.LoginUser; +import com.itextpdf.text.*; +import com.itextpdf.text.pdf.BaseFont; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import java.util.*; + +/** + * 试剂pdf导出详情 + * + * @author HanLong + */ +public class SjPdf { + private static final Logger logger = LoggerFactory.getLogger(SjPdf.class.getName()); + public String language="zh"; + /** + * 导出 + * + * @param sj + * @return + */ + public String exportDetail(SjListDto sj, List tzList, List jcgjList, String lang, String localFilePath) { + language=lang; + Document document = null; + FileOutputStream fos = null; + String filePath = PdfBaseUtil.getFilePath(localFilePath,"Sj"); + try { + String sign = "hxhq"; + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + sign = loginUser.getSysUser().getNickName(); + } + document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("给药制剂详情"),false); + // 基本信息 + PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); + Map formData1 = new LinkedHashMap<>(); + formData1.put(getName("名称"), sj.getMc()); + formData1.put(getName("编号"), sj.getBh()); + formData1.put(getName("批号"), sj.getPh()); + formData1.put(getName("规格"), sj.getGg()); + formData1.put(getName("浓度"), sj.getNd() + sj.getNddw()); + formData1.put(getName("库存量"), sj.getKc() + sj.getKcdw()); + formData1.put(getName("来源"), sj.getLy()); + formData1.put(getName("存储条件"), sj.getCctj()); + formData1.put(getName("存储位置"), sj.getCcwz()); + formData1.put(getName("有效周期"), sj.getYxzq() + sj.getYxzqdw()); + formData1.put(getName("失效日"), PdfExportUtil.parseDateToStr(sj.getSxr())); + formData1.put(getName("配制日期"), PdfExportUtil.parseDateToStr(sj.getPzrq())); + PdfBaseUtil.addFormTableColumns(document, formData1, 2); + // 表单信息 + PdfBaseUtil.addUnderlinedTitle(document, getName("表单信息"), 10, true); + Map formData3 = new LinkedHashMap<>(); + formData3.put(getName("所属表单"), sj.getFormName()); + formData3.put(getName("表单所属试验"), sj.getStudyName()); + formData3.put(getName("表单所属人"), sj.getFormUserName()); + formData3.put(getName("表单所属部门"), sj.getDeptName()); + PdfBaseUtil.addFormTableColumns(document, formData3, 2); + PdfBaseUtil.addUnderlinedTitle(document, getName("试剂台账") , 10, true); + // 台账 + addTz(document, tzList, lang); + PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹") , 10, true); + //稽查轨迹 + addJcgj(document, jcgjList, lang); + logger.info("生成成功:{}", filePath); + } catch (Exception e) { + logger.error("生成失败", e); + throw new RuntimeException("生成失败: " + e.getMessage()); + } finally { + if (document != null) { + document.close(); + } + if (fos != null) { + try { + fos.close(); + } catch (IOException e) { + logger.error("关闭文件流失败", e); + } + } + } + return filePath; + } + + /** + * 台账 + * + * @param document + * @param tzList + * @throws IOException + * @throws DocumentException + */ + public void addTz(Document document, List tzList, String lang) throws IOException, DocumentException { + + // 9. 表头 + BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); + Font headerFont = new Font(bfChinese, 8, Font.NORMAL); + Font contentFont = new Font(bfChinese, 8, Font.NORMAL); + // 8. 创建表格 + PdfPTable table = new PdfPTable(8); + table.setWidthPercentage(100); + String[] headers = {getName("签名人"),getName("操作类型"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; + for (String header : headers) { + PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setPadding(8); + cell.setBorderWidth(1); + table.addCell(cell); + } + int rowNum = 0; + for (SjTz sjTz : tzList) { + // 交替行颜色 + if (rowNum % 2 == 0) { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } else { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } + table.addCell(PdfBaseUtil.createCell(sjTz.getQmrMc(), contentFont)); + table.addCell(PdfBaseUtil.createCell(sjTz.getQmyy(), contentFont)); + table.addCell(PdfBaseUtil.createCell(sjTz.getCzl() + sjTz.getCzldw(), contentFont)); + table.addCell(PdfBaseUtil.createCell(sjTz.getRemark(), contentFont)); + table.addCell(PdfBaseUtil.createCell(PdfExportUtil.parseDateToStr(sjTz.getCreateTime()), contentFont)); + rowNum++; + } + document.add(table); + } + + /** + * 稽查轨迹 + * + * @param document + * @param jcgjList + * @throws IOException + * @throws DocumentException + */ + public void addJcgj(Document document, List jcgjList, String lang) throws IOException, DocumentException { + for (SjJcgj jcgj : jcgjList) { + StringJoiner result = new StringJoiner(", "); + if ("en".equals(lang)) { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime())+ " " + jcgj.getJcmcEn(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnrEn())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnrEn()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value")!=null? node.get("value").asText():""; + result.add(name + ":" + value); + } + } + } + } else { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime())+ " " + jcgj.getJcmc(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnr())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value =node.get("value")!=null? node.get("value").asText():""; + result.add(name + ":" + value); + } + } + } + } + if (StringUtils.isNoneBlank(jcgj.getRemark())) { + result.add(getName("备注")+":" + jcgj.getRemark()); + } + if (StringUtils.isNoneBlank(jcgj.getQmrMc())) { + result.add(getName("签名人")+":" + jcgj.getQmrMc()); + } + PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); + } + } + + /** + * 获取名称 + * @param name + * @return + */ + public String getName(String name){ + return "en".equals(language) ? SjJcnrUtil.getEn(name) : name; + } + + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java index c5b5910..38b9eb8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java @@ -5,11 +5,15 @@ import java.util.List; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; +import com.hxhq.business.domain.StorageLocation; import com.hxhq.business.domain.Yq; import com.hxhq.business.enums.NormalEnum; +import com.hxhq.business.form.yq.StorageLocationSearchForm; import com.hxhq.business.form.yq.YqSearchForm; +import com.hxhq.business.service.IStorageLocationService; import com.hxhq.business.service.IYqService; import com.hxhq.system.api.domain.SysDept; +import com.hxhq.system.form.DictDataSaveForm; import com.hxhq.system.service.ISysDeptService; import com.hxhq.system.service.ISysDictDataService; import com.hxhq.system.service.ISysDictTypeService; @@ -49,7 +53,7 @@ public class SysDictDataController extends BaseController private ISysDictTypeService dictTypeService; @Autowired - private IYqService yqService; + private IStorageLocationService storageLocationService; @Autowired private ISysDeptService sysDeptService; @@ -61,14 +65,15 @@ public class SysDictDataController extends BaseController @GetMapping("/list") public TableDataInfo list(SysDictData dictData) { - if(StringUtils.equals(dictData.getDictType(), "business_ccwz")) { - YqSearchForm form = new YqSearchForm(); + String ccwz = "business_ccwz"; + if(StringUtils.equals(dictData.getDictType(),ccwz)) { + StorageLocationSearchForm form = new StorageLocationSearchForm(); List superiorAndSubordinate = sysDeptService.getSuperiorAndSubordinate(SecurityUtils.getLoginUser().getSysUser().getDeptId()); List deptIdList = superiorAndSubordinate.stream().map(SysDept::getDeptId).collect(Collectors.toList()); form.setDeptIdList(deptIdList); - form.setCcwz(NormalEnum.yes.getValue()); + form.setStatus(NormalEnum.yes.getValue()); startPage(); - List list = yqService.queryList(form); + List list = storageLocationService.queryList(form); return getDataTable(list); } else { @@ -115,10 +120,11 @@ public class SysDictDataController extends BaseController */ @Log(title = "字典数据", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictData dict) + public AjaxResult add(@Validated @RequestBody DictDataSaveForm form) { + SysDictData dict = form.getDict(); dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictDataService.insertDictData(dict)); + return toAjax(dictDataService.insertDictData(form)); } /** @@ -126,20 +132,21 @@ public class SysDictDataController extends BaseController */ @Log(title = "字典数据", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictData dict) + public AjaxResult edit(@Validated @RequestBody DictDataSaveForm form) { + SysDictData dict = form.getDict(); dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictDataService.updateDictData(dict)); + return toAjax(dictDataService.updateDictData(form)); } /** * 删除字典类型 */ @Log(title = "字典类型", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictCodes}") - public AjaxResult remove(@PathVariable Long[] dictCodes) + @PostMapping("/delete") + public AjaxResult remove(@RequestBody DictDataSaveForm form) { - dictDataService.deleteDictDataByIds(dictCodes); + dictDataService.deleteDictDataByIds(form); return success(); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java index bfe110a..3a009e1 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java @@ -3,6 +3,7 @@ package com.hxhq.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.hxhq.system.form.DictSaveForm; import com.hxhq.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -70,14 +71,15 @@ public class SysDictTypeController extends BaseController @RequiresPermissions("system:dict:add") @Log(title = "字典类型", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) + public AjaxResult add(@Validated @RequestBody DictSaveForm form) { + SysDictType dict = form.getDict(); if (!dictTypeService.checkDictTypeUnique(dict)) { return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.insertDictType(dict)); + return toAjax(dictTypeService.insertDictType(form)); } /** @@ -86,14 +88,15 @@ public class SysDictTypeController extends BaseController @RequiresPermissions("system:dict:edit") @Log(title = "字典类型", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictType dict) + public AjaxResult edit(@Validated @RequestBody DictSaveForm form) { + SysDictType dict = form.getDict(); if (!dictTypeService.checkDictTypeUnique(dict)) { return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.updateDictType(dict)); + return toAjax(dictTypeService.updateDictType(form)); } /** @@ -101,17 +104,17 @@ public class SysDictTypeController extends BaseController */ @RequiresPermissions("system:dict:remove") @Log(title = "字典类型", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictIds}") - public AjaxResult remove(@PathVariable Long[] dictIds) + @PostMapping("/delete") + public AjaxResult remove(@RequestBody DictSaveForm form) { - dictTypeService.deleteDictTypeByIds(dictIds); + dictTypeService.deleteDictTypeByIds(form); return success(); } /** * 刷新字典缓存 */ - @RequiresPermissions("system:dict:remove") + @RequiresPermissions("system:dict:refresh") @Log(title = "字典类型", businessType = BusinessType.CLEAN) @DeleteMapping("/refreshCache") public AjaxResult refreshCache() diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java index 2404b61..0da649d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java @@ -70,9 +70,9 @@ public class SysLogininforController extends BaseController for(SysLogininfor l:list){ SystemLog systemLog = new SystemLog(); systemLog.setQmrMc(l.getNickName()); - systemLog.setCzlx(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"登录":"Login"); + systemLog.setCzlx("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"登录":"Login"); systemLog.setCzsj(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,l.getAccessTime())); - systemLog.setCzxq(l.getMsg()); + systemLog.setCzxq("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?l.getMsg():l.getMsgEn()); logList.add(systemLog); } ExcelUtil util = new ExcelUtil(SystemLog.class); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java index b7bb82e..b647b78 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java @@ -14,6 +14,7 @@ import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.ServletUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.system.domain.SysUserRole; +import com.hxhq.system.form.RoleSaveForm; import com.hxhq.system.form.RoleUserSaveForm; import com.hxhq.system.service.ISysDeptService; import com.hxhq.system.service.ISysRoleService; @@ -81,7 +82,7 @@ public class SysRoleController extends BaseController { List list = roleService.selectRoleList(role); for(SysRole l : list){ - l.setStatusText("0".endsWith(l.getStatus())?(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"启用":"Enabled"):(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"禁用":"Disabled")); + l.setStatusText("0".endsWith(l.getStatus())?("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"启用":"Enabled"):("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"禁用":"Disabled")); } ExcelUtil util = new ExcelUtil(SysRole.class); util.exportExcel(response, list, "角色数据"); @@ -103,8 +104,9 @@ public class SysRoleController extends BaseController @RequiresPermissions("system:role:add") @Log(title = "角色管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysRole role) + public AjaxResult add(@Validated @RequestBody RoleSaveForm form) { + SysRole role = form.getRole(); if (!roleService.checkRoleNameUnique(role)) { return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); @@ -114,7 +116,7 @@ public class SysRoleController extends BaseController return error("新增角色'" + role.getRoleName() + "'失败,角色编码已存在"); } role.setCreateBy(SecurityUtils.getUsername()); - return toAjax(roleService.insertRole(role)); + return toAjax(roleService.insertRole(form)); } @@ -124,8 +126,9 @@ public class SysRoleController extends BaseController @RequiresPermissions("system:role:edit") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysRole role) + public AjaxResult edit(@Validated @RequestBody RoleSaveForm form) { + SysRole role = form.getRole(); roleService.checkRoleAllowed(role); roleService.checkRoleDataScope(role.getRoleId()); if (!roleService.checkRoleNameUnique(role)) @@ -137,7 +140,7 @@ public class SysRoleController extends BaseController return error("修改角色'" + role.getRoleName() + "'失败,角色编码已存在"); } role.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(roleService.updateRole(role)); + return toAjax(roleService.updateRole(form)); } /** @@ -159,12 +162,13 @@ public class SysRoleController extends BaseController @RequiresPermissions("system:role:enable") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysRole role) + public AjaxResult changeStatus(@RequestBody RoleSaveForm form) { + SysRole role = form.getRole(); roleService.checkRoleAllowed(role); roleService.checkRoleDataScope(role.getRoleId()); role.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(roleService.updateRoleStatus(role)); + return toAjax(roleService.updateRoleStatus(form)); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java index a0ce4a9..b1bb646 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java @@ -12,7 +12,9 @@ import com.hxhq.business.domain.Study; import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.enums.dept.DeptTypeEnum; import com.hxhq.business.enums.study.StudyTypeEnum; +import com.hxhq.business.form.common.SignForm; import com.hxhq.business.service.IStudyService; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.ServletUtils; import com.hxhq.system.dto.UserExportDto; import com.hxhq.system.form.UserSaveForm; @@ -118,7 +120,7 @@ public class SysUserController extends BaseController exportDto.setDeptName(u.getDept()==null?"":u.getDept().getDeptName()); exportDto.setRoleName(getRoleName(u.getRoles())); - exportDto.setStatus("0".endsWith(u.getStatus())?(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"启用":"Enabled"):(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"禁用":"Disabled")); + exportDto.setStatus("0".endsWith(u.getStatus())?("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"启用":"Enabled"):("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"禁用":"Disabled")); userList.add(exportDto); } ExcelUtil util = new ExcelUtil(UserExportDto.class); @@ -283,6 +285,7 @@ public class SysUserController extends BaseController ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); } List roles = roleService.selectRoleAll(); + roles = roles.stream().filter(o->o.getStatus().equals("0")).collect(Collectors.toList()); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("posts", postService.selectPostAll()); return ajax; @@ -294,8 +297,9 @@ public class SysUserController extends BaseController @RequiresPermissions("system:user:add") @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysUser user) + public AjaxResult add(@Validated @RequestBody UserSaveForm form) { + SysUser user = form.getUser(); deptService.checkDeptDataScope(user.getDeptId()); roleService.checkRoleDataScope(user.getRoleIds()); if (!userService.checkUserNameUnique(user)) @@ -312,7 +316,7 @@ public class SysUserController extends BaseController } user.setCreateBy(SecurityUtils.getUsername()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); - return toAjax(userService.insertUser(user)); + return toAjax(userService.insertUser(form)); } /** @@ -380,12 +384,13 @@ public class SysUserController extends BaseController @RequiresPermissions("system:user:enable") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysUser user) + public AjaxResult changeStatus(@RequestBody UserSaveForm form) { + SysUser user = form.getUser(); userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); user.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(userService.updateUserStatus(user)); + return toAjax(userService.updateUserStatus(form)); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java new file mode 100644 index 0000000..f3c4591 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java @@ -0,0 +1,38 @@ +package com.hxhq.system.form; + +import com.hxhq.business.form.common.SignForm; +import com.hxhq.system.api.domain.SysDictData; +import com.hxhq.system.api.domain.SysDictType; + +/** + * @author memory + */ +public class DictDataSaveForm { + + /** + * 字典数据 + */ + private SysDictData dict; + + /** + * 签名信息 + */ + private SignForm sign; + + + public SignForm getSign() { + return sign; + } + + public void setSign(SignForm sign) { + this.sign = sign; + } + + public SysDictData getDict() { + return dict; + } + + public void setDict(SysDictData dict) { + this.dict = dict; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java new file mode 100644 index 0000000..99fa062 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java @@ -0,0 +1,38 @@ +package com.hxhq.system.form; + +import com.hxhq.business.form.common.SignForm; +import com.hxhq.system.api.domain.SysDictData; +import com.hxhq.system.api.domain.SysDictType; +import com.hxhq.system.api.domain.SysUser; + +/** + * @author memory + */ +public class DictSaveForm { + + /** + * 字典 + */ + private SysDictType dict; + + /** + * 签名信息 + */ + private SignForm sign; + + public SysDictType getDict() { + return dict; + } + + public void setDict(SysDictType dict) { + this.dict = dict; + } + + public SignForm getSign() { + return sign; + } + + public void setSign(SignForm sign) { + this.sign = sign; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java new file mode 100644 index 0000000..45fe5ee --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java @@ -0,0 +1,36 @@ +package com.hxhq.system.form; + +import com.hxhq.business.form.common.SignForm; +import com.hxhq.system.api.domain.SysRole; + +/** + * @author memory + */ +public class RoleSaveForm { + + /** + * 角色 + */ + private SysRole role; + + /** + * 签名信息 + */ + private SignForm sign; + + public SysRole getRole() { + return role; + } + + public void setRole(SysRole role) { + this.role = role; + } + + public SignForm getSign() { + return sign; + } + + public void setSign(SignForm sign) { + this.sign = sign; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java index 44d9b6f..71419f2 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java @@ -2,6 +2,7 @@ package com.hxhq.system.service; import java.util.List; import com.hxhq.system.api.domain.SysDictData; +import com.hxhq.system.form.DictDataSaveForm; /** * 字典 业务层 @@ -38,23 +39,23 @@ public interface ISysDictDataService /** * 批量删除字典数据信息 * - * @param dictCodes 需要删除的字典数据ID + * @param form 需要删除的字典数据ID */ - public void deleteDictDataByIds(Long[] dictCodes); + public void deleteDictDataByIds(DictDataSaveForm form); /** * 新增保存字典数据信息 * - * @param dictData 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ - public int insertDictData(SysDictData dictData); + public int insertDictData(DictDataSaveForm form); /** * 修改保存字典数据信息 * - * @param dictData 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ - public int updateDictData(SysDictData dictData); + public int updateDictData(DictDataSaveForm form); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java index 78d68d5..b880149 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java @@ -3,6 +3,7 @@ package com.hxhq.system.service; import java.util.List; import com.hxhq.system.api.domain.SysDictData; import com.hxhq.system.api.domain.SysDictType; +import com.hxhq.system.form.DictSaveForm; /** * 字典 业务层 @@ -53,9 +54,9 @@ public interface ISysDictTypeService /** * 批量删除字典信息 * - * @param dictIds 需要删除的字典ID + * @param form 需要删除的字典ID */ - public void deleteDictTypeByIds(Long[] dictIds); + public void deleteDictTypeByIds(DictSaveForm form); /** * 加载字典缓存数据 @@ -75,18 +76,18 @@ public interface ISysDictTypeService /** * 新增保存字典类型信息 * - * @param dictType 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ - public int insertDictType(SysDictType dictType); + public int insertDictType(DictSaveForm form); /** * 修改保存字典类型信息 * - * @param dictType 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ - public int updateDictType(SysDictType dictType); + public int updateDictType(DictSaveForm form); /** * 校验字典类型称是否唯一 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java index d380c66..3dedf5e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Set; import com.hxhq.system.api.domain.SysRole; import com.hxhq.system.domain.SysUserRole; +import com.hxhq.system.form.RoleSaveForm; /** * 角色业务层 @@ -108,26 +109,26 @@ public interface ISysRoleService /** * 新增保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ - public int insertRole(SysRole role); + public int insertRole(RoleSaveForm form); /** * 修改保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ - public int updateRole(SysRole role); + public int updateRole(RoleSaveForm form); /** * 修改角色状态 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ - public int updateRoleStatus(SysRole role); + public int updateRoleStatus(RoleSaveForm form); /** * 修改数据权限信息 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java index 48c5f92..4e2304f 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java @@ -112,10 +112,10 @@ public interface ISysUserService /** * 新增用户信息 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ - public int insertUser(SysUser user); + public int insertUser(UserSaveForm form); /** * 注册用户信息 @@ -144,10 +144,10 @@ public interface ISysUserService /** * 修改用户状态 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ - public int updateUserStatus(SysUser user); + public int updateUserStatus(UserSaveForm form); /** * 修改用户基本信息 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java index b13e264..a199319 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java @@ -4,11 +4,14 @@ import java.util.ArrayList; import java.util.List; import com.hxhq.business.domain.SystemLog; +import com.hxhq.business.form.common.SignForm; import com.hxhq.business.service.ISystemLogService; import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.system.api.domain.SysDictType; +import com.hxhq.system.form.DictDataSaveForm; import com.hxhq.system.mapper.SysDictDataMapper; +import com.hxhq.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hxhq.common.security.utils.DictUtils; @@ -28,6 +31,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService @Autowired private ISystemLogService systemLogService; + @Autowired + private ISysUserService userService; /** * 根据条件分页查询字典数据 @@ -81,50 +86,53 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 批量删除字典数据信息 * - * @param dictCodes 需要删除的字典数据ID + * @param form 需要删除的字典数据ID */ @Override - public void deleteDictDataByIds(Long[] dictCodes) + public void deleteDictDataByIds(DictDataSaveForm form) { - for (Long dictCode : dictCodes) - { - SysDictData data = selectDictDataById(dictCode); - dictDataMapper.deleteDictDataById(dictCode); - List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + Long dictCode = form.getDict().getDictCode(); + SysDictData data = selectDictDataById(dictCode); + dictDataMapper.deleteDictDataById(dictCode); + List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); + DictUtils.setDictCache(data.getDictType(), dictDatas); - systemLogService.saveInfo(data.getDictLabel(),null,"删除字典数据","Remove Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); - } + systemLogService.saveInfo(data.getDictLabel(),null,"删除字典数据","Remove Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); } /** * 新增保存字典数据信息 * - * @param data 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ @Override - public int insertDictData(SysDictData data) + public int insertDictData(DictDataSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictData data = form.getDict(); int row = dictDataMapper.insertDictData(data); if (row > 0) { List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); DictUtils.setDictCache(data.getDictType(), dictDatas); } - systemLogService.saveInfo(data.getDictLabel(),null,"新增字典数据","Create Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(data.getDictLabel(),null,"新增字典数据","Create Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } /** * 修改保存字典数据信息 * - * @param data 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ @Override - public int updateDictData(SysDictData data) + public int updateDictData(DictDataSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictData data = form.getDict(); SysDictData oldDict = dictDataMapper.selectDictDataById(data.getDictCode()); int row = dictDataMapper.updateDictData(data); if (row > 0) @@ -133,7 +141,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService DictUtils.setDictCache(data.getDictType(), dictDatas); } - List logList = getModifyLogList(data,oldDict); + List logList = getModifyLogList(data,oldDict,form.getSign()); if(logList.size()>0){ systemLogService.saveBatch(logList); } @@ -146,12 +154,12 @@ public class SysDictDataServiceImpl implements ISysDictDataService * @param old * @return */ - private List getModifyLogList(SysDictData info, SysDictData old){ + private List getModifyLogList(SysDictData info, SysDictData old, SignForm signForm){ List list = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,signForm); log.setJcnr(fieldChange.toString()); log.setJcnrEn(fieldChange.toEnString()); list.add(log); @@ -163,7 +171,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService * 获取日志基础信息 * @return */ - private SystemLog getLogInfo(SysDictData sysDictData){ + private SystemLog getLogInfo(SysDictData sysDictData, SignForm signForm){ SystemLog log = new SystemLog(); log.setName(sysDictData.getDictLabel()); log.setNameEn(sysDictData.getDictLabel()); @@ -172,6 +180,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService log.setQmrId(SecurityUtils.getUserId()); log.setQmrMc(SecurityUtils.getNickName()); log.setQmrMcEn(SecurityUtils.getUsername()); + log.setRemark(signForm.getRemark()); return log; } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java index e68115d..e9f673e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java @@ -8,13 +8,16 @@ import java.util.stream.Collectors; import javax.annotation.PostConstruct; import com.hxhq.business.domain.SystemLog; +import com.hxhq.business.form.common.SignForm; import com.hxhq.business.service.ISystemLogService; import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.system.api.domain.SysRole; import com.hxhq.system.domain.SysMenu; +import com.hxhq.system.form.DictSaveForm; import com.hxhq.system.mapper.SysDictDataMapper; import com.hxhq.system.mapper.SysDictTypeMapper; +import com.hxhq.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -42,6 +45,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService @Autowired private ISystemLogService systemLogService; + @Autowired + private ISysUserService userService; /** * 项目启动时,初始化字典到缓存 @@ -125,24 +130,21 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 批量删除字典类型信息 * - * @param dictIds 需要删除的字典ID + * @param form 需要删除的字典ID */ @Override - public void deleteDictTypeByIds(Long[] dictIds) + public void deleteDictTypeByIds(DictSaveForm form) { - for (Long dictId : dictIds) + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + Long dictId = form.getDict().getDictId(); + SysDictType dictType = selectDictTypeById(dictId); + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) { - SysDictType dictType = selectDictTypeById(dictId); - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) - { - throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); - } - dictTypeMapper.deleteDictTypeById(dictId); - DictUtils.removeDictCache(dictType.getDictType()); - - - systemLogService.saveInfo(dictType.getDictName(),null,"删除字典","Remove Term Book",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } + dictTypeMapper.deleteDictTypeById(dictId); + DictUtils.removeDictCache(dictType.getDictType()); + systemLogService.saveInfo(dictType.getDictName(),null,"删除字典","Remove Term Book",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); } /** @@ -182,31 +184,35 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 新增保存字典类型信息 * - * @param dict 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ @Override - public int insertDictType(SysDictType dict) + public int insertDictType(DictSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictType dict = form.getDict(); int row = dictTypeMapper.insertDictType(dict); if (row > 0) { DictUtils.setDictCache(dict.getDictType(), null); } - systemLogService.saveInfo(dict.getDictName(),null,"新增字典","Create Term Book",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(dict.getDictName(),null,"新增字典","Create Term Book",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } /** * 修改保存字典类型信息 * - * @param dict 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int updateDictType(SysDictType dict) + public int updateDictType(DictSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictType dict = form.getDict(); SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); int row = dictTypeMapper.updateDictType(dict); @@ -216,7 +222,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService DictUtils.setDictCache(dict.getDictType(), dictDatas); } - List logList = getModifyLogList(dict,oldDict); + List logList = getModifyLogList(dict,oldDict, form.getSign()); if(logList.size()>0){ systemLogService.saveBatch(logList); } @@ -247,12 +253,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * @param old * @return */ - private List getModifyLogList(SysDictType info, SysDictType old){ + private List getModifyLogList(SysDictType info, SysDictType old, SignForm sign){ List list = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr(fieldChange.toString()); log.setJcnrEn(fieldChange.toEnString()); list.add(log); @@ -264,7 +270,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * 获取日志基础信息 * @return */ - private SystemLog getLogInfo(SysDictType sysDictType){ + private SystemLog getLogInfo(SysDictType sysDictType,SignForm sign){ SystemLog log = new SystemLog(); log.setName(sysDictType.getDictName()); log.setNameEn(sysDictType.getDictName()); @@ -273,6 +279,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService log.setQmrId(SecurityUtils.getUserId()); log.setQmrMc(SecurityUtils.getNickName()); log.setQmrMcEn(SecurityUtils.getUsername()); + log.setRemark(sign.getRemark()); return log; } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java index 0851c13..7ca3cb4 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java @@ -635,7 +635,8 @@ public class SysMenuServiceImpl implements ISysMenuService if(menus!=null && menus.size()>0){ SysMenu firstMenu = menus.get(0); urlList.add(firstMenu.getPath()); - if(!firstMenu.getMenuType().equals("C")){ + String menu = "C"; + if(!menu.equals(firstMenu.getMenuType())){ urlList = getChildUrl(urlList,firstMenu.getChildren()); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java index 14b9bcc..5a10773 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java @@ -14,7 +14,9 @@ import com.hxhq.system.domain.SysMenu; import com.hxhq.system.domain.SysRoleDept; import com.hxhq.system.domain.SysRoleMenu; import com.hxhq.system.domain.SysUserRole; +import com.hxhq.system.form.RoleSaveForm; import com.hxhq.system.mapper.*; +import com.hxhq.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -53,6 +55,8 @@ public class SysRoleServiceImpl implements ISysRoleService @Autowired private ISystemLogService systemLogService; + @Autowired + private ISysUserService sysUserService; /** * 根据条件分页查询角色数据 @@ -241,30 +245,34 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 新增保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int insertRole(SysRole role) + public int insertRole(RoleSaveForm form) { + sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysRole role = form.getRole(); // 新增角色信息 roleMapper.insertRole(role); int row = insertRoleMenu(role); - systemLogService.saveInfo(role.getRoleName(),null,"新增角色","Create Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(role.getRoleName(),null,"新增角色","Create Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } /** * 修改保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int updateRole(SysRole role) + public int updateRole(RoleSaveForm form) { + sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysRole role = form.getRole(); SysRole old = selectRoleById(role.getRoleId()); List oldMenuList = menuMapper.selectMenuByRoleId(role.getRoleId()); @@ -276,6 +284,9 @@ public class SysRoleServiceImpl implements ISysRoleService List logList = getModifyLogList(role,old,oldMenuList); if(logList.size()>0){ + for(SystemLog systemLog : logList){ + systemLog.setRemark(form.getSign().getRemark()); + } systemLogService.saveBatch(logList); } @@ -285,15 +296,21 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 修改角色状态 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ @Override - public int updateRoleStatus(SysRole role) + public int updateRoleStatus(RoleSaveForm form) { + sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysRole role = form.getRole(); + String disableStatus = "1"; + if(disableStatus.equals(role.getStatus()) && countUserRoleByRoleId(role.getRoleId()) > 0){ + throw new ServiceException("角色已分配,不能禁用"); + } SysRole info = selectRoleById(role.getRoleId()); int row = roleMapper.updateRole(role); - systemLogService.saveInfo(info.getRoleName(),null,"0".equals(role.getStatus())?"启用角色":"禁用角色","0".equals(role.getStatus())?"Enable Role":"Disable Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(info.getRoleName(),null,"0".equals(role.getStatus())?"启用角色":"禁用角色","0".equals(role.getStatus())?"Enable Role":"Disable Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java index ba75016..e2c7931 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java @@ -271,13 +271,15 @@ public class SysUserServiceImpl implements ISysUserService /** * 新增保存用户信息 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int insertUser(SysUser user) + public int insertUser(UserSaveForm form) { + checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysUser user = form.getUser(); // 新增用户信息 int rows = userMapper.insertUser(user); // 新增用户岗位关联 @@ -285,7 +287,7 @@ public class SysUserServiceImpl implements ISysUserService // 新增用户与角色管理 insertUserRole(user); - systemLogService.saveInfo(user.getUserName(),null,"新增用户","Create User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(user.getNickName(),null,"新增用户","Create User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return rows; } @@ -313,6 +315,7 @@ public class SysUserServiceImpl implements ISysUserService { SysUser user = form.getUser(); SignForm sign = form.getSign(); + checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); List logList = getModifyLogList(user, sign); if(logList.size()>0){ @@ -349,16 +352,18 @@ public class SysUserServiceImpl implements ISysUserService /** * 修改用户状态 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ @Override - public int updateUserStatus(SysUser user) + public int updateUserStatus(UserSaveForm form) { + checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysUser user = form.getUser(); SysUser info = selectUserById(user.getUserId()); int row = userMapper.updateUserStatus(user.getUserId(), user.getStatus()); - systemLogService.saveInfo(info.getUserName(),null,"0".equals(user.getStatus())?"启用用户":"禁用用户","0".equals(user.getStatus())?"Enable User":"Disable User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(info.getNickName(),null,"0".equals(user.getStatus())?"启用用户":"禁用用户","0".equals(user.getStatus())?"Enable User":"Disable User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } @@ -496,7 +501,7 @@ public class SysUserServiceImpl implements ISysUserService // 删除用户与岗位表 userPostMapper.deleteUserPostByUserId(userId); int row = userMapper.deleteUserById(userId); - systemLogService.saveInfo(sysUser.getUserName(),null,"删除用户","Remove User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(sysUser.getNickName(),null,"删除用户","Remove User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); return row; } @@ -647,18 +652,16 @@ public class SysUserServiceImpl implements ISysUserService private List getModifyLogList(SysUser info, SignForm sign){ SysUser old = selectUserById(info.getUserId()); List oldRoleIdList = roleMapper.selectRoleListByUserId(info.getUserId()); - List list = new ArrayList<>(); - List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr(fieldChange.toString()); log.setJcnrEn(fieldChange.toEnString()); list.add(log); } if(!info.getStatus().equals(old.getStatus())){ - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr("[{\"name\":\"字段名\",\"value\":\"状态\"},{\"name\":\"原值\",\"value\":\""+("0".equals(old.getStatus())?"启用":"禁用")+"\"},{\"name\":\"新值\",\"value\":\""+("0".equals(info.getStatus())?"启用":"禁用")+"\"}]"); log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Status\"},{\"name\":\"Old Value\",\"value\":\""+("0".equals(old.getStatus())?"Enabled":"Disabled")+"\"},{\"name\":\"New Value\",\"value\":\""+("0".equals(info.getStatus())?"Enabled":"Disabled")+"\"}]"); list.add(log); @@ -667,12 +670,11 @@ public class SysUserServiceImpl implements ISysUserService SysDept oldDept = deptService.selectDeptById(old.getDeptId()); SysDept newDept = deptService.selectDeptById(info.getDeptId()); - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr("[{\"name\":\"字段名\",\"value\":\"所属部门/学科\"},{\"name\":\"原值\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"新值\",\"value\":\""+newDept.getDeptName()+"\"}]"); log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Department\"},{\"name\":\"Old Value\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"New Value\",\"value\":\""+newDept.getDeptName()+"\"}]"); list.add(log); } - //判断菜单修改 Boolean updateRole = false; if(info.getRoleIds().length!=oldRoleIdList.size()){ @@ -686,10 +688,7 @@ public class SysUserServiceImpl implements ISysUserService } } if(updateRole){ - checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); - List allRoleList = roleMapper.selectRoleList(new SysRole()); - List oldRoleList = new ArrayList<>(); List newRoleList = new ArrayList<>(); if(info.getRoleIds()!=null && info.getRoleIds().length>0){ @@ -702,10 +701,8 @@ public class SysUserServiceImpl implements ISysUserService oldRoleList.add(allRoleList.stream().filter(o->o.getRoleId().equals(oldRoleId)).collect(Collectors.toList()).get(0)); } } - List oldRoleNameList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); List bghList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); - List addNameList = new ArrayList<>(); List deleteNameList = new ArrayList<>(); for(SysRole newRole : newRoleList){ @@ -714,7 +711,6 @@ public class SysUserServiceImpl implements ISysUserService bghList.add(newRole.getRoleName()); } } - List newMenuIdList = Arrays.asList(info.getRoleIds()); for(SysRole oldRole : oldRoleList){ if(!newMenuIdList.contains(oldRole.getRoleId())){ @@ -722,16 +718,14 @@ public class SysUserServiceImpl implements ISysUserService bghList.remove(oldRole.getRoleName()); } } - if(addNameList.size()>0 || deleteNameList.size()>0){ - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr((addNameList.size()>0?("新增角色:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";删除角色:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";备注:"+sign.getRemark())); log.setJcnrEn((addNameList.size()>0?("Add Role:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";Remove Role:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";Comment:"+sign.getRemark())); list.add(log); } roleChangeService.saveInfo(info.getUserId(),String.join(",",oldRoleNameList),String.join(",",bghList),sign.getRemark()); } - return list; } @@ -739,7 +733,7 @@ public class SysUserServiceImpl implements ISysUserService * 获取日志基础信息 * @return */ - private SystemLog getLogInfo(SysUser sysUser){ + private SystemLog getLogInfo(SysUser sysUser,SignForm signForm){ SystemLog log = new SystemLog(); log.setName(sysUser.getNickName()); log.setNameEn(sysUser.getNickName()); @@ -748,6 +742,7 @@ public class SysUserServiceImpl implements ISysUserService log.setQmrId(SecurityUtils.getUserId()); log.setQmrMc(SecurityUtils.getNickName()); log.setQmrMcEn(SecurityUtils.getUsername()); + log.setRemark(signForm.getRemark()); return log; } } diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml new file mode 100644 index 0000000..5bee43c --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml new file mode 100644 index 0000000..7f054ca --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml index c46f24e..682377c 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml @@ -42,5 +42,16 @@ update t_study_form_fill set zdgxjl=#{zdgxjl} where id=#{id}; + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMethodMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMethodMapper.xml index 56b5a26..4c1248f 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMethodMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMethodMapper.xml @@ -12,4 +12,12 @@ + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml index 43bc1f4..2bcecd2 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -11,16 +11,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - insert into sys_logininfor (user_name,nick_name, status, ipaddr, msg, access_time) - values (#{userName},#{nickName}, #{status}, #{ipaddr}, #{msg}, sysdate()) + insert into sys_logininfor (user_name,nick_name, status, ipaddr, msg, msg_en, access_time) + values (#{userName},#{nickName}, #{status}, #{ipaddr}, #{msg}, #{msgEn}, sysdate())