Browse Source

fix:[资源库管理][供试品]

master
HanLong 3 weeks ago
parent
commit
7c7a6d6963
7 changed files with 46 additions and 10 deletions
  1. +0
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspFfjlArchiveController.java
  2. +24
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlArchiveController.java
  3. +2
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java
  4. +6
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java
  5. +9
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java
  6. +3
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java
  7. +2
    -4
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml

+ 0
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspFfjlArchiveController.java View File

@ -34,9 +34,6 @@ public class GspFfjlArchiveController extends BaseController
@Autowired
private IGspFfjlService gspFfjlService;
@Autowired
private IGspFfjlJcgjService gspFfjlJcgjService;
/**
* 查询供试品发放记录列表
*/

+ 24
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlArchiveController.java View File

@ -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")

+ 2
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java View File

@ -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;
/** 有效期 */

+ 6
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java View File

@ -685,6 +685,9 @@ public class GspRkjlServiceImpl extends ServiceImpl impl
queryWrapper.in("jlzt", JlztEnum.dgd.getValue(), JlztEnum.gd.getValue(), JlztEnum.djd.getValue());
}
Map<String, String> 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;
}

+ 9
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java View File

@ -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<ObjectCompareUtil.FieldChange> 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<ObjectCompareUtil.FieldChange> 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<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(gspCompare, form);
if (fieldChanges.size() == 0) {
throw new ServiceException("你没有修改任何内容");
}

+ 3
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java View File

@ -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;

+ 2
- 4
hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml View File

@ -4,8 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.GspFfjlMapper">
<select id="queryList" resultType="com.hxhq.business.dto.gsp.GspFfjlListDto">
select t.id,t.mc,t.bh,t.ffzytj,t.ffrq,t.ghrq,t.ckl,t.ckldw,t.rkl,t.rkldw,t.lqr1_mc,t.lqr2_mc,t.ffr1_mc,t.ffr2_mc,t.jsr1_mc,t.jsr2_mc
,t.syl,t.syldw,t.jlzt,t.jyzt,t.md_other,t.jyksrq,t.jyjsrq, z.mc as zcgMc,
select t.*, z.mc as zcgMc,
(select GROUP_CONCAT(s.name) from t_study s where find_in_set(s.id, t.`md_ids`)) as mdMcs
FROM `t_gsp_ffjl` t
left join `t_zcg` z on z.id=t.zcg_id
@ -16,8 +15,7 @@
</if>
</select>
<select id="queryInfo" resultType="com.hxhq.business.dto.gsp.GspFfjlListDto">
select t.id,t.mc,t.bh,t.ffzytj,t.ffrq,t.ghrq,t.ckl,t.ckldw,t.rkl,t.rkldw,t.lqr1_mc,t.lqr2_mc,t.ffr1_mc,t.ffr2_mc,t.jsr1_mc,t.jsr2_mc
,t.syl,t.syldw,t.jlzt,t.jyzt,t.md_other,t.jyksrq,t.jyjsrq,
select t.*,
(select GROUP_CONCAT(s.name) from t_study s where find_in_set(s.id, t.`md_ids`)) as mdMcs
FROM `t_gsp_ffjl` t WHERE id = #{id}
</select>

Loading…
Cancel
Save