diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspFfjlArchiveController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspFfjlArchiveController.java index 58ad38f..d2d4149 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspFfjlArchiveController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspFfjlArchiveController.java @@ -34,9 +34,6 @@ public class GspFfjlArchiveController extends BaseController @Autowired private IGspFfjlService gspFfjlService; - @Autowired - private IGspFfjlJcgjService gspFfjlJcgjService; - /** * 查询供试品发放记录列表 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlArchiveController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlArchiveController.java index e6e03ce..4280996 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlArchiveController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlArchiveController.java @@ -45,6 +45,30 @@ public class GspRkjlArchiveController extends BaseController } /** + * 同意归档 + */ + @PostMapping("/gd/agree") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult agreeGd(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + gspRkjlService.agreeGd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 拒绝归档 + */ + @PostMapping("/gd/refuse") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult refuseGd(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + gspRkjlService.refuseGd(form); + return AjaxResult.success("操作成功"); + } + + /** * 同意解档 */ @PostMapping("/jd/agree") diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java index cf6328b..daabb34 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java @@ -62,9 +62,11 @@ public class Gsp extends MpBaseEntity private String ggdw; /** 库存数量 */ + @Compare(name = "库存数量", nameEn = "Inventory") private String kc; /** 库存单位 */ + @Compare(name = "库存单位", nameEn = "Inventory Unit") private String kcdw; /** 有效期 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java index 5325042..c0b8418 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java @@ -685,6 +685,9 @@ public class GspRkjlServiceImpl extends ServiceImpl impl queryWrapper.in("jlzt", JlztEnum.dgd.getValue(), JlztEnum.gd.getValue(), JlztEnum.djd.getValue()); } Map map = baseMapper.getRklUnit(queryWrapper); + if(map == null) { + return null; + } return map.get("rkdw"); } @@ -726,6 +729,9 @@ public class GspRkjlServiceImpl extends ServiceImpl impl // 单位转换 rkl = UnitTools.convert(rkl, rkdw); + if(rkl == null) { + return null; + } return rkl.toString() + rkdw; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java index 9b173c9..525bac5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java @@ -358,7 +358,6 @@ public class GspServiceImpl extends ServiceImpl implements IGspS } else if (!gspOld.getBjzt().equals(BjEnum.wbj.getValue())) { throw new ServiceException("供试品【" + gspOld.getMc() + "】已经提交编辑申请,请等待审核"); } - List fieldChanges = ObjectCompareUtil.compareObjects(gspOld, form); if (fieldChanges.size() == 0) { throw new ServiceException("你没有修改任何内容"); @@ -466,6 +465,7 @@ public class GspServiceImpl extends ServiceImpl implements IGspS gspOld.setJsrqbj(null); gspOld.setCctjbj(null); gspOld.setZysxbj(null); + gspOld.setBjbz(null); gspOld.setBjzt(BjEnum.wbj.getValue()); this.updateById(gspOld); //endregion @@ -750,7 +750,7 @@ public class GspServiceImpl extends ServiceImpl implements IGspS if (form.getId() == null || form.getId().longValue() < 0) { throw new ServiceException("参数id不正确"); } - Gsp gspOld = this.getById(form.getId()); + Gsp gspOld = this.queryInfo(form.getId()); if (gspOld == null) { throw new ServiceException("供试品不存在或已删除"); } @@ -760,7 +760,13 @@ public class GspServiceImpl extends ServiceImpl implements IGspS if (!(gspOld.getZjzt().equals(ZjztEnum.rk.getValue()) || gspOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { throw new ServiceException("供试品【" + gspOld.getMc() + "】不是入库状态,不能修改库存"); } - List fieldChanges = ObjectCompareUtil.compareObjects(gspOld, form); + if(StringUtils.equals(form.getKc(), gspOld.getKc()) && StringUtils.equals(form.getKcdw(), gspOld.getKcdw())) { + throw new ServiceException("库存未进行任何修改"); + } + Gsp gspCompare = new Gsp(); + gspCompare.setKc(gspOld.getKc()); + gspCompare.setKcdw(gspOld.getKcdw()); + List fieldChanges = ObjectCompareUtil.compareObjects(gspCompare, form); if (fieldChanges.size() == 0) { throw new ServiceException("你没有修改任何内容"); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java index 6fc006f..25af86d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java @@ -164,6 +164,9 @@ public class UnitTools { * @return */ public static BigDecimal convert(BigDecimal value, String toUnit) { + if(value == null) { + return BigDecimal.ZERO; + } // 验证单位是否支持 if (!UNIT_TO_LITER.containsKey(toUnit) ) { return value; diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml index 8031f2b..f36ffaf 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml @@ -4,8 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">