diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java similarity index 84% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java index cebba5b..0d3fad9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java @@ -4,38 +4,34 @@ import java.util.List; import com.hxhq.business.domain.*; import com.hxhq.business.form.mjy.GdForm; -import com.hxhq.business.form.mjy.JdForm; -import com.hxhq.business.form.mjy.JyForm; -import com.hxhq.business.form.mjy.SdForm; import com.hxhq.business.form.sj.*; +import com.hxhq.business.service.ISjService; import com.hxhq.business.service.ISjTzService; -import com.hxhq.business.service.ISjkcJcgjService; -import com.hxhq.common.security.annotation.RequiresPermissions; +import com.hxhq.business.service.ISjJcgjService; import com.hxhq.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import com.hxhq.business.service.ISjkcService; 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 + * 试剂Controller * * @author HanLong * @date 2025-12-22 */ @RestController -@RequestMapping("/business/sjkc") -public class SjkcController extends BaseController +@RequestMapping("/business/sj") +public class SjController extends BaseController { @Autowired - private ISjkcService sjkcService; + private ISjService sjkcService; @Autowired - private ISjkcJcgjService sjkcJcgjService; + private ISjJcgjService sjkcJcgjService; @Autowired private ISjTzService sjTzService; @@ -44,10 +40,10 @@ public class SjkcController extends BaseController * 稽查轨迹列表 */ @GetMapping("/jcgjList") - public TableDataInfo jcgjList(SjkcJcgj form) + public TableDataInfo jcgjList(SjJcgj form) { startPage(); - List list = sjkcJcgjService.queryList(form); + List list = sjkcJcgjService.queryList(form); return getDataTable(list); } @@ -66,10 +62,10 @@ public class SjkcController extends BaseController * 查询试剂库存列表 */ @GetMapping("/list") - public TableDataInfo list(Sjkc sjkc) + public TableDataInfo list(Sj sj) { startPage(); - List list = sjkcService.queryList(sjkc); + List list = sjkcService.queryList(sj); return getDataTable(list); } @@ -86,9 +82,9 @@ public class SjkcController extends BaseController * 新增试剂库存信息 */ @PostMapping("/save") - public AjaxResult save(@RequestBody Sjkc sjkc) + public AjaxResult save(@RequestBody Sj sj) { - return toAjax(sjkcService.saveOrUpdate(sjkc)); + return toAjax(sjkcService.saveOrUpdate(sj)); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java similarity index 98% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java index 1195a04..a99422b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java @@ -13,8 +13,8 @@ import com.hxhq.common.core.domain.MpBaseEntity; * @author HanLong * @date 2025-12-22 */ -@TableName("t_sjkc") -public class Sjkc extends MpBaseEntity +@TableName("t_sj") +public class Sj extends MpBaseEntity { private static final long serialVersionUID = 1L; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java similarity index 87% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java index ab49a15..d227e61 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java @@ -10,13 +10,13 @@ import com.hxhq.common.core.domain.MpBaseEntity; * @author HanLong * @date 2025-12-22 */ -@TableName("t_sjkc_jcgj") -public class SjkcJcgj extends MpBaseEntity +@TableName("t_sj_jcgj") +public class SjJcgj extends MpBaseEntity { private static final long serialVersionUID = 1L; - /** 试剂库存id */ - private Long sjkcId; + /** 试剂id */ + private Long sjId; /** 稽查轨迹类型 */ private Integer jcgjlx; @@ -40,14 +40,14 @@ public class SjkcJcgj extends MpBaseEntity private String qmrMc; - public void setSjkcId(Long sjkcId) + public void setSjId(Long sjId) { - this.sjkcId = sjkcId; + this.sjId = sjId; } - public Long getSjkcId() + public Long getSjId() { - return sjkcId; + return sjId; } public void setJcgjlx(Integer jcgjlx) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java similarity index 55% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java index c9c078f..eee2de6 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java @@ -1,14 +1,14 @@ package com.hxhq.business.mapper; -import com.hxhq.business.domain.Sjkc; +import com.hxhq.business.domain.Sj; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** - * 试剂库存Mapper接口 + * 试剂Mapper接口 * * @author HanLong * @date 2025-12-22 */ -public interface SjkcMapper extends BaseMapper +public interface SjMapper extends BaseMapper { } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java index 36d5305..374e881 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java @@ -1,6 +1,6 @@ package com.hxhq.business.mapper; -import com.hxhq.business.domain.SjkcJcgj; +import com.hxhq.business.domain.SjJcgj; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * 试剂库存-稽查轨迹Mapper接口 @@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author HanLong * @date 2025-12-22 */ -public interface SjkcJcgjMapper extends BaseMapper +public interface SjkcJcgjMapper extends BaseMapper { } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java similarity index 77% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java index 27c2036..6e9a1b5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java @@ -1,7 +1,7 @@ package com.hxhq.business.service; import java.util.List; -import com.hxhq.business.domain.SjkcJcgj; +import com.hxhq.business.domain.SjJcgj; import com.baomidou.mybatisplus.extension.service.IService; /** @@ -10,15 +10,15 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author HanLong * @date 2025-12-22 */ -public interface ISjkcJcgjService extends IService +public interface ISjJcgjService extends IService { /** * 查询试剂库存-稽查轨迹列表 * - * @param sjkcJcgj 试剂库存-稽查轨迹 + * @param sjJcgj 试剂库存-稽查轨迹 * @return 试剂库存-稽查轨迹集合 */ - public List queryList(SjkcJcgj sjkcJcgj); + public List queryList(SjJcgj sjJcgj); /** * 新增稽查轨迹 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java similarity index 78% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java index bd51f6b..c995e47 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java @@ -1,27 +1,26 @@ package com.hxhq.business.service; import java.util.List; -import com.hxhq.business.domain.Sjkc; +import com.hxhq.business.domain.Sj; import com.baomidou.mybatisplus.extension.service.IService; import com.hxhq.business.form.mjy.GdForm; -import com.hxhq.business.form.mjy.JyForm; import com.hxhq.business.form.sj.*; /** - * 试剂库存Service接口 + * 试剂Service接口 * * @author HanLong * @date 2025-12-22 */ -public interface ISjkcService extends IService +public interface ISjService extends IService { /** * 查询试剂库存列表 * - * @param sjkc 试剂库存 + * @param sj 试剂库存 * @return 试剂库存集合 */ - public List queryList(Sjkc sjkc); + public List queryList(Sj sj); /** 修改库存 */ void xgkc(SjXgkcForm form); 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 new file mode 100644 index 0000000..9862273 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java @@ -0,0 +1,64 @@ +package com.hxhq.business.service.impl; + +import java.util.List; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hxhq.common.core.domain.MpBaseEntity; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.common.security.utils.SecurityUtils; +import com.hxhq.system.api.domain.SysUser; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.SjkcJcgjMapper; +import com.hxhq.business.domain.SjJcgj; +import com.hxhq.business.service.ISjJcgjService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 试剂库存-稽查轨迹Service业务层处理 + * + * @author HanLong + * @date 2025-12-22 + */ +@Service +public class SjJcgjServiceImpl extends ServiceImpl implements ISjJcgjService { + /** + * 查询试剂库存-稽查轨迹列表 + * + * @param sjJcgj 试剂库存-稽查轨迹 + * @return 试剂库存-稽查轨迹 + */ + @Override + public List queryList(SjJcgj sjJcgj) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (sjJcgj.getSjId() == null || sjJcgj.getSjId().longValue() < 0) { + throw new SecurityException("试剂id不能为空"); + } + queryWrapper.eq(SjJcgj::getSjId, sjJcgj.getSjId()); + if (sjJcgj.getJcgjlx() != null && sjJcgj.getJcgjlx().intValue() > 0) { + queryWrapper.eq(SjJcgj::getJcgjlx, sjJcgj.getJcgjlx()); + } + if (StringUtils.isNoneBlank(sjJcgj.getJcmc())) { + queryWrapper.and(p -> p.like(SjJcgj::getJcmc, sjJcgj.getJcmc()) + .or().like(SjJcgj::getJcgjlx, sjJcgj.getJcmc())); + } + queryWrapper.orderByDesc(MpBaseEntity::getId); + return this.list(queryWrapper); + } + + @Override + @Async + public void saveJcgj(Long sjId, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr) { + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(sjId); + sjJcgj.setJcgjlx(jcgjlx); + sjJcgj.setJcmc(jcmc); + sjJcgj.setJcmcys(jcmcys); + sjJcgj.setJcnr(jcnr); + sjJcgj.setQmrId(sysUser.getUserId()); + sjJcgj.setQmrMc(sysUser.getNickName()); + this.save(sjJcgj); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java similarity index 73% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java index f1a413e..461055d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java @@ -5,31 +5,28 @@ import java.util.*; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hxhq.business.domain.Mjy; +import com.hxhq.business.domain.Sj; import com.hxhq.business.domain.SjTz; -import com.hxhq.business.domain.SjkcJcgj; +import com.hxhq.business.domain.SjJcgj; import com.hxhq.business.enums.zykgl.JcgjlxEnum; import com.hxhq.business.enums.zykgl.JcmcysEnum; import com.hxhq.business.enums.zykgl.JyztEnum; import com.hxhq.business.enums.zykgl.ZjztEnum; import com.hxhq.business.form.mjy.GdForm; -import com.hxhq.business.form.mjy.JyForm; import com.hxhq.business.form.sj.*; import com.hxhq.business.service.ISjTzService; -import com.hxhq.business.service.ISjkcJcgjService; +import com.hxhq.business.service.ISjJcgjService; import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.DateUtils; -import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.service.ISysUserService; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.hxhq.business.mapper.SjkcMapper; -import com.hxhq.business.domain.Sjkc; -import com.hxhq.business.service.ISjkcService; +import com.hxhq.business.mapper.SjMapper; +import com.hxhq.business.service.ISjService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.transaction.annotation.Transactional; @@ -40,13 +37,13 @@ import org.springframework.transaction.annotation.Transactional; * @date 2025-12-22 */ @Service -public class SjkcServiceImpl extends ServiceImpl implements ISjkcService +public class SjServiceImpl extends ServiceImpl implements ISjService { @Autowired private ISysUserService sysUserService; @Autowired - private ISjkcJcgjService sjkcJcgjService; + private ISjJcgjService sjkcJcgjService; @Autowired private ISjTzService sjTzService; @@ -54,13 +51,13 @@ public class SjkcServiceImpl extends ServiceImpl implements IS /** * 查询试剂库存列表 * - * @param sjkc 试剂库存 + * @param sj 试剂库存 * @return 试剂库存 */ @Override - public List queryList(Sjkc sjkc) + public List queryList(Sj sj) { - QueryWrapper queryWrapper = Wrappers.query(); + QueryWrapper queryWrapper = Wrappers.query(); return this.list(queryWrapper); } @@ -71,26 +68,26 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId().longValue() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjkcOld = this.getById(form.getId()); - if (sjkcOld == null) { + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } - if (!sjkcOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkcOld.getMc() + "】不是入库状态,不能修改库存"); + if (!sjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是入库状态,不能修改库存"); } - List fieldChanges = ObjectCompareUtil.compareObjects(sjkcOld, form); + List fieldChanges = ObjectCompareUtil.compareObjects(sjOld, form); if (fieldChanges.size() == 0) { throw new SecurityException("你没有修改任何内容"); } - sjkcOld.setKcdw(form.getKcdw()); - sjkcOld.setKc(form.getKc()); - this.updateById(sjkcOld); + sjOld.setKcdw(form.getKcdw()); + sjOld.setKc(form.getKc()); + this.updateById(sjOld); - List sjkcJcgjList = new ArrayList<>(); + List sjJcgjList = new ArrayList<>(); //region 稽查轨迹 for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SjkcJcgj mjyJcgj = new SjkcJcgj(); - mjyJcgj.setSjkcId(sjkcOld.getId()); + SjJcgj mjyJcgj = new SjJcgj(); + mjyJcgj.setSjId(sjOld.getId()); mjyJcgj.setJcgjlx(JcgjlxEnum.lc.getValue()); mjyJcgj.setJcmc("修改库存"); mjyJcgj.setJcmcys(JcmcysEnum.green.getValue()); @@ -98,13 +95,13 @@ public class SjkcServiceImpl extends ServiceImpl implements IS mjyJcgj.setQmyy("修改库存"); mjyJcgj.setQmrId(qmr.getUserId()); mjyJcgj.setQmrMc(qmr.getNickName()); - sjkcJcgjList.add(mjyJcgj); + sjJcgjList.add(mjyJcgj); } - sjkcJcgjService.saveBatch(sjkcJcgjList); + sjkcJcgjService.saveBatch(sjJcgjList); //endregion // 台账 - sjTzService.saveTz(sjkcOld.getId(), qmr.getUserId(), qmr.getNickName(), "修改库存", form.getKc(), form.getKcdw(), null); + sjTzService.saveTz(sjOld.getId(), qmr.getUserId(), qmr.getNickName(), "修改库存", form.getKc(), form.getKcdw(), null); } @Override @@ -115,7 +112,7 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjOld = this.getById(form.getId()); + Sj sjOld = this.getById(form.getId()); if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } @@ -138,16 +135,16 @@ public class SjkcServiceImpl extends ServiceImpl implements IS jcnrMap.put("处置方式", form.getCzfs()); jcnrMap.put("处置量", form.getCzl()); jcnrMap.put("原因", form.getRemark()); - SjkcJcgj sjkcJcgj = new SjkcJcgj(); - sjkcJcgj.setSjkcId(sjOld.getId()); - sjkcJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); - sjkcJcgj.setJcmc("处置"); - sjkcJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); - sjkcJcgj.setJcmcys(JcmcysEnum.green.getValue()); - sjkcJcgj.setQmyy("处置"); - sjkcJcgj.setQmrId(qmr.getUserId()); - sjkcJcgj.setQmrMc(qmr.getNickName()); - sjkcJcgjService.save(sjkcJcgj); + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(sjOld.getId()); + sjJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); + sjJcgj.setJcmc("处置"); + sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); + sjJcgj.setJcmcys(JcmcysEnum.green.getValue()); + sjJcgj.setQmyy("处置"); + sjJcgj.setQmrId(qmr.getUserId()); + sjJcgj.setQmrMc(qmr.getNickName()); + sjkcJcgjService.save(sjJcgj); // 台账 sjTzService.saveTz(sjOld.getId(), qmr.getUserId(), qmr.getNickName(), "处置", form.getCzl(), sjOld.getKcdw(), form.getRemark()); @@ -160,54 +157,54 @@ public class SjkcServiceImpl extends ServiceImpl implements IS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo - List sjkcList = new ArrayList<>(); - Map map = new HashMap<>(); + List sjList = new ArrayList<>(); + Map map = new HashMap<>(); for (PlczSjItemForm itemForm : form.getList()) { if (itemForm.getId() == null || itemForm.getId() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjkc = this.getById(itemForm.getId()); - if (sjkc == null) { + Sj sj = this.getById(itemForm.getId()); + if (sj == null) { throw new SecurityException("试剂不存在或已删除"); } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能处置"); + if (!sj.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是入库状态,不能处置"); } if(!NumberUtils.isParsable(itemForm.getCzl())) { throw new ServiceException("请输入正确的处置量"); } BigDecimal czl = new BigDecimal(itemForm.getCzl()); - BigDecimal kc = new BigDecimal(sjkc.getKc()); + BigDecimal kc = new BigDecimal(sj.getKc()); if(czl.compareTo(kc) > 0) { throw new ServiceException("处置量不应大于库存量"); } kc = kc.subtract(czl); - sjkc.setKc(kc.toString()); - sjkcList.add(sjkc); + sj.setKc(kc.toString()); + sjList.add(sj); - map.put(sjkc.getId(), sjkc); + map.put(sj.getId(), sj); } - updateBatchById(sjkcList); + updateBatchById(sjList); - List sjkcJcgjList = new ArrayList<>(); + List sjJcgjList = new ArrayList<>(); List sjTzList = new ArrayList<>(); for (PlczSjItemForm itemForm : form.getList()) { - Sjkc sjkc = map.get(itemForm.getId()); + Sj sj = map.get(itemForm.getId()); LinkedHashMap jcnrMap = new LinkedHashMap<>(); jcnrMap.put("处置方式", itemForm.getCzfs()); jcnrMap.put("处置量", itemForm.getCzl()); jcnrMap.put("原因", itemForm.getRemark()); - SjkcJcgj sjkcJcgj = new SjkcJcgj(); - sjkcJcgj.setSjkcId(itemForm.getId()); - sjkcJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); - sjkcJcgj.setJcmc("处置"); - sjkcJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); - sjkcJcgj.setJcmcys(JcmcysEnum.green.getValue()); - sjkcJcgj.setQmyy("处置"); - sjkcJcgj.setQmrId(qmr.getUserId()); - sjkcJcgj.setQmrMc(qmr.getNickName()); - sjkcJcgjList.add(sjkcJcgj); + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(itemForm.getId()); + sjJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); + sjJcgj.setJcmc("处置"); + sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); + sjJcgj.setJcmcys(JcmcysEnum.green.getValue()); + sjJcgj.setQmyy("处置"); + sjJcgj.setQmrId(qmr.getUserId()); + sjJcgj.setQmrMc(qmr.getNickName()); + sjJcgjList.add(sjJcgj); // 台账 SjTz sjTz = new SjTz(); @@ -215,11 +212,11 @@ public class SjkcServiceImpl extends ServiceImpl implements IS sjTz.setQmrMc(qmr.getNickName()); sjTz.setQmyy("处置"); sjTz.setCzl(itemForm.getCzl()); - sjTz.setCzldw(sjkc.getKcdw()); + sjTz.setCzldw(sj.getKcdw()); sjTz.setRemark(itemForm.getRemark()); sjTzList.add(sjTz); } - sjkcJcgjService.saveBatch(sjkcJcgjList); + sjkcJcgjService.saveBatch(sjJcgjList); sjTzService.saveBatch(sjTzList); } @@ -232,21 +229,21 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId().longValue() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjkc = this.getById(form.getId()); - if (sjkc == null) { + Sj sj = this.getById(form.getId()); + if (sj == null) { throw new SecurityException("试剂不存在或已删除"); } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能锁定"); + if (!sj.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是入库状态,不能锁定"); } - sjkc.setZjzt(ZjztEnum.ysd.getValue()); - this.updateById(sjkc); + sj.setZjzt(ZjztEnum.ysd.getValue()); + this.updateById(sj); //稽查轨迹 Map formData = new LinkedHashMap<>(); formData.put("备注", form.getRemark()); formData.put("签名意义", "锁定试剂"); formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjkc.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + sjkcJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); } @Override @@ -255,29 +252,29 @@ public class SjkcServiceImpl extends ServiceImpl implements IS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo - List sjkcList = new ArrayList<>(); + List sjList = new ArrayList<>(); for (Long id : form.getIds()) { if (id == null || id < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjkc = this.getById(id); - if (sjkc == null) { + Sj sj = this.getById(id); + if (sj == null) { throw new SecurityException("试剂不存在或已删除"); } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能锁定"); + if (!sj.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是入库状态,不能锁定"); } - sjkc.setZjzt(ZjztEnum.ysd.getValue()); - sjkcList.add(sjkc); + sj.setZjzt(ZjztEnum.ysd.getValue()); + sjList.add(sj); } - this.updateBatchById(sjkcList); + this.updateBatchById(sjList); //稽查轨迹 - for (Sjkc sjkc : sjkcList) { + for (Sj sj : sjList) { Map formData = new LinkedHashMap<>(); formData.put("备注", form.getRemark()); formData.put("签名意义", "锁定试剂"); formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjkc.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + sjkcJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); } } @@ -289,7 +286,7 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId().longValue() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjOld = this.getById(form.getId()); + Sj sjOld = this.getById(form.getId()); if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } @@ -314,7 +311,7 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId().longValue() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjOld = this.getById(form.getId()); + Sj sjOld = this.getById(form.getId()); if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } @@ -346,7 +343,7 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId().longValue() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjOld = this.getById(form.getId()); + Sj sjOld = this.getById(form.getId()); if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } @@ -371,7 +368,7 @@ public class SjkcServiceImpl extends ServiceImpl implements IS if (form.getId() == null || form.getId().longValue() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjOld = this.getById(form.getId()); + Sj sjOld = this.getById(form.getId()); if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } @@ -394,12 +391,12 @@ public class SjkcServiceImpl extends ServiceImpl implements IS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo - List sjkcList = new ArrayList<>(); + List sjList = new ArrayList<>(); for (Long id : form.getIds()) { if (id == null || id < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjOld = this.getById(id); + Sj sjOld = this.getById(id); if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } @@ -408,17 +405,17 @@ public class SjkcServiceImpl extends ServiceImpl implements IS } //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; sjOld.setZjzt(ZjztEnum.dgd.getValue()); - sjkcList.add(sjOld); + sjList.add(sjOld); } - this.updateBatchById(sjkcList); + this.updateBatchById(sjList); //稽查轨迹 - for (Sjkc sjkc : sjkcList) { + for (Sj sj : sjList) { Map formData = new LinkedHashMap<>(); formData.put("备注", form.getRemark()); formData.put("签名意义", "申请归档"); formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjkc.getId(), JcgjlxEnum.lc.getValue(), "申请归档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + sjkcJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "申请归档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java deleted file mode 100644 index cb59841..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.hxhq.business.service.impl; - -import java.util.List; - -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.MjyJcgj; -import com.hxhq.business.domain.YqJcgj; -import com.hxhq.common.core.domain.MpBaseEntity; -import com.hxhq.common.core.utils.StringUtils; -import com.hxhq.common.security.utils.SecurityUtils; -import com.hxhq.system.api.domain.SysUser; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import com.hxhq.business.mapper.SjkcJcgjMapper; -import com.hxhq.business.domain.SjkcJcgj; -import com.hxhq.business.service.ISjkcJcgjService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * 试剂库存-稽查轨迹Service业务层处理 - * - * @author HanLong - * @date 2025-12-22 - */ -@Service -public class SjkcJcgjServiceImpl extends ServiceImpl implements ISjkcJcgjService { - /** - * 查询试剂库存-稽查轨迹列表 - * - * @param sjkcJcgj 试剂库存-稽查轨迹 - * @return 试剂库存-稽查轨迹 - */ - @Override - public List queryList(SjkcJcgj sjkcJcgj) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (sjkcJcgj.getSjkcId() == null || sjkcJcgj.getSjkcId().longValue() < 0) { - throw new SecurityException("试剂id不能为空"); - } - queryWrapper.eq(SjkcJcgj::getSjkcId, sjkcJcgj.getSjkcId()); - if (sjkcJcgj.getJcgjlx() != null && sjkcJcgj.getJcgjlx().intValue() > 0) { - queryWrapper.eq(SjkcJcgj::getJcgjlx, sjkcJcgj.getJcgjlx()); - } - if (StringUtils.isNoneBlank(sjkcJcgj.getJcmc())) { - queryWrapper.and(p -> p.like(SjkcJcgj::getJcmc, sjkcJcgj.getJcmc()) - .or().like(SjkcJcgj::getJcgjlx, sjkcJcgj.getJcmc())); - } - queryWrapper.orderByDesc(MpBaseEntity::getId); - return this.list(queryWrapper); - } - - @Override - @Async - public void saveJcgj(Long sjId, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr) { - SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); - SjkcJcgj sjkcJcgj = new SjkcJcgj(); - sjkcJcgj.setSjkcId(sjId); - sjkcJcgj.setJcgjlx(jcgjlx); - sjkcJcgj.setJcmc(jcmc); - sjkcJcgj.setJcmcys(jcmcys); - sjkcJcgj.setJcnr(jcnr); - sjkcJcgj.setQmrId(sysUser.getUserId()); - sjkcJcgj.setQmrMc(sysUser.getNickName()); - this.save(sjkcJcgj); - } - -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java index 14f909a..1e0c6ca 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java @@ -3,10 +3,6 @@ package com.hxhq.business.service.impl; import java.util.List; 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.MjyJcgj; -import com.hxhq.business.domain.SjkcJcgj; import com.hxhq.common.core.domain.MpBaseEntity; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcJcgjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjJcgjMapper.xml similarity index 100% rename from hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcJcgjMapper.xml rename to hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjJcgjMapper.xml diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml similarity index 71% rename from hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml rename to hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml index 599ae7a..52b5666 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml @@ -2,5 +2,5 @@ - + \ No newline at end of file