diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java index 29703cd..75e1f97 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java @@ -274,5 +274,7 @@ public interface DevInfoMapper { List getMaTypeLeasingDetail(DevInfoVo devInfoVo); List getDemandUnit(DevInfoVo devInfoVo); + + int updateTypeLeasePrice(DevInfo devInfo); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index 9b9c8ee..0343581 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -210,6 +210,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 根据文件名截取文件名 + * * @param fileName */ private String extracted(String fileName) { @@ -410,9 +411,11 @@ public class DevInfoServiceImpl implements DevInfoService { devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); devInfo.setDeviceCount(devInfo.getDeviceCount()); devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode()); - if (devInfoMapper.insertDevInfo(devInfo) == 0) { + int num = devInfoMapper.insertDevInfo(devInfo); + if (num == 0) { return AjaxResult.error("设备信息SQL保存失败,请修改后重试"); } + devInfoMapper.updateTypeLeasePrice(devInfo); code = ""; //保存自定义属性值 if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) { @@ -594,6 +597,7 @@ public class DevInfoServiceImpl implements DevInfoService { String identifyCode = tableList.get(0).getIdentifyCode(); devInfo.setIdentifyCode(identifyCode); int i = devInfoMapper.updateDevInfo(devInfo); + devInfoMapper.updateTypeLeasePrice(devInfo); Integer id = tableList.get(0).getId(); if (id != null) { @@ -871,6 +875,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 在租装备信息查询 + * * @param devInfo * @return */ @@ -881,6 +886,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 设备批量导入模版下载 + * * @param response */ @Override @@ -888,7 +894,7 @@ public class DevInfoServiceImpl implements DevInfoService { //模板名称 String templateName = "MaDevTemplate.xlsx"; OutputStream out = null; - InputStream input =null; + InputStream input = null; try { input = this.getClass().getClassLoader().getResourceAsStream("template/MaDevTemplate.xlsx"); response.setCharacterEncoding("UTF-8"); @@ -914,6 +920,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 设备信息导入 + * * @param file * @return */ @@ -987,7 +994,7 @@ public class DevInfoServiceImpl implements DevInfoService { List devTemplateVos = entry.getValue(); for (DevTemplateVo templateVo : devTemplateVos) { if (StringUtils.isBlank(templateVo.getIdentifyCode()) && StringUtils.isBlank(templateVo.getCheckMan()) - && templateVo.getNextCheckDate() == null && templateVo.getCheckDate() == null) { + && templateVo.getNextCheckDate() == null && templateVo.getCheckDate() == null) { continue; } DevTemplateVo dto = new DevTemplateVo(); @@ -1015,6 +1022,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 读取Excel表格数据,做非空判断 + * * @param sheet * @param totalRows * @param totalCells @@ -1062,8 +1070,8 @@ public class DevInfoServiceImpl implements DevInfoService { case 10: checkDate(cellValue, r, c); break; - default: - break; + default: + break; } } } @@ -1071,6 +1079,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 检查数字格式是否为整数 + * * @param cellValue * @param r * @param c @@ -1088,6 +1097,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 检查日期格式 + * * @param cellValue * @param rowIndex * @param colIndex @@ -1104,6 +1114,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 判断日期格式是否正确 + * * @param dateStr * @return */ @@ -1150,6 +1161,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 检查数据是否为空 + * * @param cellValue * @param rowIndex * @param colIndex @@ -1163,6 +1175,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 检查电话号码格式 + * * @param cellValue * @param rowIndex * @param colIndex @@ -1178,6 +1191,7 @@ public class DevInfoServiceImpl implements DevInfoService { /** * 读取Excel表格数据,做非空及格式判断 + * * @param headerRow * @param totalCells */ diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index f50f466..31c4b2f 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -1008,6 +1008,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update ma_dev_info set total_lease_day = IFNULL(total_lease_day, 0) + 1 where is_active = '1' and ma_status = '3' + + update ma_type set lease_price = #{dayLeasePrice} + where type_id = #{typeId} +