Browse Source

fix:[资源库管理][钥匙管理]钥匙发放,钥匙归还,完善

master
15881625488@163.com 3 weeks ago
parent
commit
c661653d29
5 changed files with 161 additions and 19 deletions
  1. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java
  2. +5
    -13
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Zcg.java
  3. +98
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java
  4. +8
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java
  5. +39
    -5
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java

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

@ -59,6 +59,17 @@ public class ZcgController extends BaseController
return AjaxResult.success("操作成功"); return AjaxResult.success("操作成功");
} }
/**
* 批量钥匙归还
*/
@PostMapping("/ysghBatch")
public AjaxResult ysghBatch(@RequestBody YsghForm form)
{
zcgService.ysghBatch(form);
return AjaxResult.success("操作成功");
}
/** /**
* 钥匙发放 * 钥匙发放
*/ */

+ 5
- 13
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Zcg.java View File

@ -1,5 +1,7 @@
package com.hxhq.business.domain; package com.hxhq.business.domain;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.hxhq.common.core.domain.MpBaseEntity; import com.hxhq.common.core.domain.MpBaseEntity;
@ -18,19 +20,19 @@ public class Zcg extends MpBaseEntity
/** 暂存柜名称 */ /** 暂存柜名称 */
private String mc; private String mc;
/** 钥匙编号 */
private String bh;
/** 钥匙1领取人ID */ /** 钥匙1领取人ID */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long lqr1Id; private Long lqr1Id;
/** 钥匙2领取人ID */ /** 钥匙2领取人ID */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long lqr2Id; private Long lqr2Id;
/** 状态:1:未借用;5:借用中 */ /** 状态:1:未借用;5:借用中 */
private Integer zt; private Integer zt;
/** 关联药剂 */ /** 关联药剂 */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String glyj; private String glyj;
public String getGlyj() { public String getGlyj() {
@ -51,16 +53,6 @@ public class Zcg extends MpBaseEntity
return mc; return mc;
} }
public void setBh(String bh)
{
this.bh = bh;
}
public String getBh()
{
return bh;
}
public Long getLqr1Id() { public Long getLqr1Id() {
return lqr1Id; return lqr1Id;
} }

+ 98
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java View File

@ -5,6 +5,103 @@ import com.hxhq.business.domain.Zcg;
/** /**
* @author 15881 * @author 15881
*/ */
public class YsghForm extends Zcg {
public class YsghForm {
/** 暂存柜id */
private Long id;
/** 暂存柜ids */
private String ids;
/** 签名意义 */
private String qmyy;
/** 钥匙1归还人ID */
private Long ghr1Id;
/** 钥匙2归还人ID */
private Long ghr2Id;
/** 钥匙1归还人密码 */
private String ghr1mm;
/** 钥匙2归还人密码 */
private String ghr2mm;
/** 接收人id */
private String jsrId;
/** 接收人密码 */
private String jsrmm;
public String getIds() {
return ids;
}
public void setIds(String ids) {
this.ids = ids;
}
public String getJsrId() {
return jsrId;
}
public void setJsrId(String jsrId) {
this.jsrId = jsrId;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getQmyy() {
return qmyy;
}
public void setQmyy(String qmyy) {
this.qmyy = qmyy;
}
public Long getGhr1Id() {
return ghr1Id;
}
public void setGhr1Id(Long ghr1Id) {
this.ghr1Id = ghr1Id;
}
public Long getGhr2Id() {
return ghr2Id;
}
public void setGhr2Id(Long ghr2Id) {
this.ghr2Id = ghr2Id;
}
public String getGhr1mm() {
return ghr1mm;
}
public void setGhr1mm(String ghr1mm) {
this.ghr1mm = ghr1mm;
}
public String getGhr2mm() {
return ghr2mm;
}
public void setGhr2mm(String ghr2mm) {
this.ghr2mm = ghr2mm;
}
public String getJsrmm() {
return jsrmm;
}
public void setJsrmm(String jsrmm) {
this.jsrmm = jsrmm;
}
} }

+ 8
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java View File

@ -41,6 +41,14 @@ public interface IZcgService extends IService
*/ */
public void ysgh(YsghForm form); public void ysgh(YsghForm form);
/**
* 批量钥匙归还
*
* @param form
*/
public void ysghBatch(YsghForm form);
/** /**
* 钥匙发放 * 钥匙发放
* *

+ 39
- 5
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java View File

@ -58,6 +58,9 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
*/ */
@Override @Override
public Zcg queryInfo(Long id){ public Zcg queryInfo(Long id){
if(id==null||id.longValue()<0){
throw new SecurityException("参数id不正确");
}
return baseMapper.queryInfo(id); return baseMapper.queryInfo(id);
} }
@ -73,7 +76,7 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
if(form.getId()==null||form.getId().longValue()<0){ if(form.getId()==null||form.getId().longValue()<0){
throw new SecurityException("参数id不正确"); throw new SecurityException("参数id不正确");
} }
Zcg zcgOld=this.getById(form.getId());
Zcg zcgOld=this.getById(form.getId());
if(zcgOld==null){ if(zcgOld==null){
throw new SecurityException("暂存柜不存在或已删除"); throw new SecurityException("暂存柜不存在或已删除");
} }
@ -81,14 +84,45 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
throw new SecurityException("暂存柜未借用"); throw new SecurityException("暂存柜未借用");
} }
//验证钥匙1领取人密码钥匙2领取人密码发放人密码 todo //验证钥匙1领取人密码钥匙2领取人密码发放人密码 todo
zcgOld.setLqr2Id(0L);
zcgOld.setLqr2Id(0L);
zcgOld.setGlyj("");
zcgOld.setLqr1Id(null);
zcgOld.setLqr2Id(null);
zcgOld.setGlyj(null);
zcgOld.setZt(zcgJyztEnum.wjy.getValue()); zcgOld.setZt(zcgJyztEnum.wjy.getValue());
this.updateById(zcgOld); this.updateById(zcgOld);
//存台账 //存台账
} }
/**
* 批量钥匙归还
*
* @param form
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void ysghBatch(YsghForm form){
if(StringUtils.isBlank(form.getIds())){
throw new SecurityException("参数ids不正确");
}
//验证钥匙1领取人密码钥匙2领取人密码发放人密码 todo
QueryWrapper<Zcg> queryWrapper = Wrappers.query();
queryWrapper.in("id",form.getIds());
List<Zcg> zcgList=this.list(queryWrapper);
for (Zcg zcg:zcgList){
if(!zcg.getZt().equals(zcgJyztEnum.jyz.getValue())){
throw new SecurityException("暂存柜"+zcg.getMc()+"未借用");
}
zcg.setLqr1Id(null);
zcg.setLqr2Id(null);
zcg.setGlyj(null);
zcg.setZt(zcgJyztEnum.wjy.getValue());
this.updateById(zcg);
//存台账
}
}
/** /**
* 钥匙发放 * 钥匙发放
* *
@ -100,6 +134,7 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
if(form.getId()==null||form.getId().longValue()<0){ if(form.getId()==null||form.getId().longValue()<0){
throw new SecurityException("参数id不正确"); throw new SecurityException("参数id不正确");
} }
//验证钥匙1领取人密码钥匙2领取人密码发放人密码 todo
Zcg zcgOld=this.getById(form.getId()); Zcg zcgOld=this.getById(form.getId());
if(zcgOld==null){ if(zcgOld==null){
throw new SecurityException("暂存柜不存在或已删除"); throw new SecurityException("暂存柜不存在或已删除");
@ -107,7 +142,6 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
if(!zcgOld.getZt().equals(zcgJyztEnum.wjy.getValue())){ if(!zcgOld.getZt().equals(zcgJyztEnum.wjy.getValue())){
throw new SecurityException("暂存柜已借用"); throw new SecurityException("暂存柜已借用");
} }
//验证钥匙1领取人密码钥匙2领取人密码发放人密码 todo
zcgOld.setLqr1Id(form.getLqr1Id()); zcgOld.setLqr1Id(form.getLqr1Id());
zcgOld.setLqr2Id(form.getLqr2Id()); zcgOld.setLqr2Id(form.getLqr2Id());
if(StringUtils.isBlank(zcgOld.getGlyj())){ if(StringUtils.isBlank(zcgOld.getGlyj())){

Loading…
Cancel
Save