|
|
@@ -324,19 +324,17 @@ public class IsMaterialsLoanServiceImpl extends ServiceImpl<IsMaterialsLoanMappe
|
|
|
// 1.物资信息
|
|
|
IsMaterials materials = isMaterialsService.getById(isMaterialsLoan.getMaterialsId());
|
|
|
MaterialsTypePageVO materialsTypePageVO = new MaterialsTypePageVO();
|
|
|
- // 1.1如果是从错误柜子中拿出这个物资,默认是为了更正
|
|
|
- if ("0".equals(materials.getLoanState()) && "3".equals(materials.getStatus())) {
|
|
|
- // 1.1.1纠正归还异常
|
|
|
- isMaterialsLoanExceptionService.update(Wrappers.<IsMaterialsLoanException>lambdaUpdate()
|
|
|
- .eq(IsMaterialsLoanException::getMaterialsId, isMaterialsLoan.getMaterialsId())
|
|
|
- .set(IsMaterialsLoanException::getStatus, "1")
|
|
|
- .set(IsMaterialsLoanException::getHandleTime, nowDate));
|
|
|
- // 1.1.2纠正物资状态
|
|
|
- isMaterialsService.update(Wrappers.<IsMaterials>lambdaUpdate()
|
|
|
- .eq(IsMaterials::getMaterialsId, dto.getMaterialsId())
|
|
|
- .set(IsMaterials::getStatus, "0"));
|
|
|
- return 1;
|
|
|
- }
|
|
|
+ // 1.1处理更新错放异常
|
|
|
+ isMaterialsLoanExceptionService.update(Wrappers.<IsMaterialsLoanException>lambdaUpdate()
|
|
|
+ .eq(IsMaterialsLoanException::getMaterialsRfid, dto.getMaterialsRfid())
|
|
|
+ .set(IsMaterialsLoanException::getStatus, "1")
|
|
|
+ .set(IsMaterialsLoanException::getHandleTime, nowDate));
|
|
|
+ // 1.1.1同时处理物资的借出状态
|
|
|
+ isMaterialsService.update(Wrappers.<IsMaterials>lambdaUpdate()
|
|
|
+ .eq(IsMaterials::getMaterialsId, dto.getMaterialsId())
|
|
|
+ .eq(IsMaterials::getStatus, "3")
|
|
|
+ .set(IsMaterials::getStatus, "0"));
|
|
|
+
|
|
|
// 1.2借用到期规则
|
|
|
IsMailNotifyConfig reminderConf = isMailNotifyConfigService.getOne(Wrappers.<IsMailNotifyConfig>lambdaQuery()
|
|
|
.eq(IsMailNotifyConfig::getTemplateCode, isSystemAttributeService.getIsSystemAttributeByKey("sys.template.material_expiration_reminder").getSysAttrValue()));
|
|
|
@@ -396,7 +394,7 @@ public class IsMaterialsLoanServiceImpl extends ServiceImpl<IsMaterialsLoanMappe
|
|
|
map.put("[借用时间]", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, nowDate));
|
|
|
map.put("[到期时间]", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, re));
|
|
|
map.put("[告警时间]", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, al));
|
|
|
- map.put("[归还地址]", cabinet.getCabinetName());
|
|
|
+ map.put("[归还地址]", cabinet != null ? cabinet.getCabinetName() : "");
|
|
|
map.put("[发件人]", isSystemAttributeService.getIsSystemAttributeByKey("info.mail.name").getSysAttrValue());
|
|
|
map.put("[公司名称]", isSystemAttributeService.getIsSystemAttributeByKey("info.mail.company").getSysAttrValue());
|
|
|
// 2.3处理归还提醒
|