|
|
@ -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())){ |
|
|
|