diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ArchiveLogController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ArchiveLogController.java new file mode 100644 index 0000000..6c6c1d5 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ArchiveLogController.java @@ -0,0 +1,64 @@ +package com.hxhq.business.controller; + +import java.util.Arrays; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.hxhq.business.domain.ArchiveLog; +import com.hxhq.business.service.IArchiveLogService; +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-01-23 + */ +@RestController +@RequestMapping("/business/archiveLog") +public class ArchiveLogController extends BaseController +{ + @Autowired + private IArchiveLogService archiveLogService; + + /** + * 查询档案记录列表 + */ + @GetMapping("/list") + public TableDataInfo list(ArchiveLog archiveLog) + { + startPage(); + List list = archiveLogService.queryList(archiveLog); + return getDataTable(list); + } + + /** + * 获取档案记录详细信息 + */ + @GetMapping(value = "/info") + public AjaxResult getInfo(Long id) + { + return AjaxResult.success(archiveLogService.getById(id)); + } + + /** + * 新增档案记录信息 + */ + @PostMapping("/save") + public AjaxResult save(@RequestBody ArchiveLog archiveLog) + { + return toAjax(archiveLogService.saveOrUpdate(archiveLog)); + } + + /** + * 删除档案记录信息 + */ + @PostMapping("/delete") + public AjaxResult delete(@RequestBody Long[] ids) + { + return toAjax(archiveLogService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/ArchiveLog.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/ArchiveLog.java new file mode 100644 index 0000000..cd64286 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/ArchiveLog.java @@ -0,0 +1,149 @@ +package com.hxhq.business.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 档案记录对象 t_archive_log + * + * @author hxhq + * @date 2026-01-23 + */ +@TableName("t_archive_log") +public class ArchiveLog extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 类型1试验非试验,3供试品,5供试品领取发放,7给药制剂,9给药制剂领取发放,11麻精药,13麻精药领取发放,15试剂 */ + private Integer type; + + /** 类型1试验,5非试验表单,10麻精药表单 */ + private Integer studyType; + + /** 对应id */ + private Long targetId; + + /** 名称 */ + private String name; + + /** 编号/批号 */ + private String sn; + + /** 试验负责人/规格/目的/浓度 */ + private String leader; + + /** 操作类型 */ + private String operateType; + + /** 操作类型_英文 */ + private String operateTypeEn; + + /** 操作人 */ + private String operateUser; + + /** 操作人_英文 */ + private String operateUserEn; + + + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + + public void setStudyType(Integer studyType) + { + this.studyType = studyType; + } + + public Integer getStudyType() + { + return studyType; + } + + public void setTargetId(Long targetId) + { + this.targetId = targetId; + } + + public Long getTargetId() + { + return targetId; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setSn(String sn) + { + this.sn = sn; + } + + public String getSn() + { + return sn; + } + + public void setLeader(String leader) + { + this.leader = leader; + } + + public String getLeader() + { + return leader; + } + + public void setOperateType(String operateType) + { + this.operateType = operateType; + } + + public String getOperateType() + { + return operateType; + } + + public void setOperateTypeEn(String operateTypeEn) + { + this.operateTypeEn = operateTypeEn; + } + + public String getOperateTypeEn() + { + return operateTypeEn; + } + + public void setOperateUser(String operateUser) + { + this.operateUser = operateUser; + } + + public String getOperateUser() + { + return operateUser; + } + + public void setOperateUserEn(String operateUserEn) + { + this.operateUserEn = operateUserEn; + } + + public String getOperateUserEn() + { + return operateUserEn; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/archive/ArchiveLogTypeEnum.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/archive/ArchiveLogTypeEnum.java new file mode 100644 index 0000000..d4d0b67 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/archive/ArchiveLogTypeEnum.java @@ -0,0 +1,81 @@ +package com.hxhq.business.enums.archive; + +/** + * 档案类型 + * @author tanfei + */ +public enum ArchiveLogTypeEnum { + + /** + * 1试验非试验 + */ + sy(1, "试验非试验"), + + /** + * 3供试品 + */ + gsp(3, "供试品"), + + /** + * 5供试品领取发放 + */ + gsplqff(5, "供试品领取发放"), + + /** + * 7给药制剂 + */ + gyzj(7, "给药制剂"), + + /** + * 9给药制剂领取发放 + */ + gyzjlqff(9, "给药制剂领取发放"), + + /** + * 11麻精药 + */ + mjy(11, "麻精药"), + + /** + * 13麻精药领取发放 + */ + mjylqff(13, "麻精药领取发放"), + + /** + * 15试剂 + */ + sj(15, "试剂"); + + private int value; + private String text; + + ArchiveLogTypeEnum(int value, String text) { + this.value = value; + this.text = text; + } + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public static ArchiveLogTypeEnum getEnumByValue(int type) { + for (ArchiveLogTypeEnum bt : values()) { + if (bt.value == type) { + return bt; + } + } + return null; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/ArchiveLogMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/ArchiveLogMapper.java new file mode 100644 index 0000000..27b17e5 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/ArchiveLogMapper.java @@ -0,0 +1,14 @@ +package com.hxhq.business.mapper; + +import com.hxhq.business.domain.ArchiveLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +/** + * 档案记录Mapper接口 + * + * @author hxhq + * @date 2026-01-23 + */ +public interface ArchiveLogMapper extends BaseMapper +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IArchiveLogService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IArchiveLogService.java new file mode 100644 index 0000000..e208425 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IArchiveLogService.java @@ -0,0 +1,48 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.ArchiveLog; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.business.enums.archive.ArchiveLogTypeEnum; +import com.hxhq.business.enums.study.StudyTypeEnum; + +/** + * 档案记录Service接口 + * + * @author hxhq + * @date 2026-01-23 + */ +public interface IArchiveLogService extends IService +{ + /** + * 查询档案记录列表 + * + * @param archiveLog 档案记录 + * @return 档案记录集合 + */ + public List queryList(ArchiveLog archiveLog); + + /** + * 保存日志 + * @param type + * @param targetId + * @param name + * @param sn + * @param leader + * @param operateType + */ + void saveInfo(ArchiveLogTypeEnum type,Long targetId,String name,String sn,String leader,String operateType); + + /** + * 保存试验日志 + * @param type + * @param studyType + * @param targetId + * @param name + * @param sn + * @param leader + * @param operateType + */ + void saveInfo(ArchiveLogTypeEnum type, StudyTypeEnum studyType, Long targetId, String name, String sn, String leader, String operateType); + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ArchiveLogServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ArchiveLogServiceImpl.java new file mode 100644 index 0000000..e7bd9af --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ArchiveLogServiceImpl.java @@ -0,0 +1,86 @@ +package com.hxhq.business.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hxhq.business.enums.archive.ArchiveLogTypeEnum; +import com.hxhq.business.enums.study.StudyTypeEnum; +import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.common.security.utils.SecurityUtils; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.ArchiveLogMapper; +import com.hxhq.business.domain.ArchiveLog; +import com.hxhq.business.service.IArchiveLogService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 档案记录Service业务层处理 + * + * @author hxhq + * @date 2026-01-23 + */ +@Service +public class ArchiveLogServiceImpl extends ServiceImpl implements IArchiveLogService +{ + /** + * 查询档案记录列表 + * + * @param archiveLog 档案记录 + * @return 档案记录 + */ + @Override + public List queryList(ArchiveLog archiveLog) + { + QueryWrapper queryWrapper = Wrappers.query(); + if(StringUtils.isNoneBlank(archiveLog.getOperateType())){ + queryWrapper.and(q->q.eq("operate_type",archiveLog.getOperateType()) + .or().eq("operate_type_en",archiveLog.getOperateType())); + } + if(StringUtils.isNoneBlank(archiveLog.getSn())){ + queryWrapper.like("sn",archiveLog.getSn()); + } + if(StringUtils.isNoneBlank(archiveLog.getName())){ + queryWrapper.like("name",archiveLog.getName()); + } + queryWrapper.orderByDesc("id"); + return this.list(queryWrapper); + } + + @Override + public void saveInfo(ArchiveLogTypeEnum type, Long targetId, String name, String sn, String leader, String operateType) { + saveInfo(type,null,targetId,name,sn,leader,operateType); + } + + @Override + public void saveInfo(ArchiveLogTypeEnum type, StudyTypeEnum studyType, Long targetId, String name, String sn, String leader, String operateType) { + ArchiveLog archiveLog = new ArchiveLog(); + archiveLog.setType(type.getValue()); + archiveLog.setStudyType(studyType==null?null:studyType.getValue()); + archiveLog.setName(name); + archiveLog.setSn(sn); + archiveLog.setLeader(leader); + archiveLog.setOperateType(operateType); + archiveLog.setOperateTypeEn(getOperateTypeEn(operateType)); + archiveLog.setOperateUser(SecurityUtils.getNickName()); + archiveLog.setOperateUserEn(SecurityUtils.getUsername()); + save(archiveLog); + } + + private String getOperateTypeEn(String operateType){ + return operateType.equals("申请归档")?"Apply for Archiving" + :operateType.equals("同意归档")?"Approve Archiving" + :operateType.equals("拒绝归档")?"Reject Archiving" + + :operateType.equals("申请解档")?"Apply for De-archiving" + :operateType.equals("同意解档")?"Approve De-archiving" + :operateType.equals("拒绝解档")?"Reject De-archiving" + + :operateType.equals("申请借阅")?"Apply for Check-out" + :operateType.equals("同意借阅")?"Approve Check-out" + :operateType.equals("拒绝借阅")?"Reject Check-out" + + :operateType.equals("确认归还")?"Check-out End Confirmation" + :operateType.equals("到期自动归还")?"Check-out End on Time":""; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/ArchiveLogMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/ArchiveLogMapper.xml new file mode 100644 index 0000000..14c749f --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/ArchiveLogMapper.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file