diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java index cfc6ce4d..a03188b2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java @@ -504,8 +504,6 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic /** * 提交结算清单 - * @param sltInfoVo - * @return */ @Override @Transactional(rollbackFor = Exception.class) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index 58fb1dc7..4636540e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -29,6 +29,11 @@ public interface SltAgreementInfoMapper { */ int updateSltInfoByAgreementIdType(SltAgreementInfo sltAgreementInfo); + /** + * 根据协议ID+结算类型去修改设备状态为丢失 + */ + int updateMaStatusLoseByAgreementIdType(SltAgreementInfo sltAgreementInfo); + /** * 查询结算信息 * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index 9077b080..3b6844bc 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -1022,12 +1022,23 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { int countThree = sltAgreementInfoMapper.updateSltInfoByAgreementIdType( new SltAgreementInfo() .setAgreementId(sltAgreementApply.getAgreementId()) - .setSettlementType(Integer.valueOf(sltAgreementApplyFromDb.getSettlementType())) + .setSettlementType(sltAgreementApplyFromDb.getSettlementType()) ); if (countThree == 0) { throw new ServiceException("slt_agreement_info修改失败"); } + // 修改未退还设备状态为丢失 + int countFour = sltAgreementInfoMapper.updateMaStatusLoseByAgreementIdType( + new SltAgreementInfo() + .setAgreementId(sltAgreementApply.getAgreementId()) + .setSettlementType(sltAgreementApplyFromDb.getSettlementType()) + ); + if (countFour == 0) { + log.warn("协议ID:" + sltAgreementApply.getAgreementId() + "," + + "结算类型:" + sltAgreementApplyFromDb.getSettlementType() + ",无未归还设备,无需更新为丢失状态"); + } + if (examNum == GlobalConstants.INT_0) { return AjaxResult.error("结算审批失败"); } else { diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index e4c224e3..84f8744a 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -1434,4 +1434,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE sai.agreement_id = #{agreementId} AND mt.jiju_type = #{settlementType} + + + update + ma_machine mi + INNER JOIN slt_agreement_info sai ON mi.ma_id = sai.ma_id AND sai.end_time is null AND sai.status = '0' + INNER JOIN ma_type mt ON sai.type_id = mt.type_id AND mt.`level` = '4' + set + mi.status = '18', mi.update_time = NOW() + where + sai.agreement_id = #{agreementId} AND mt.jiju_type = #{settlementType} +