装备编辑可修改装备租金

This commit is contained in:
liang.chao 2025-07-04 09:33:49 +08:00
parent e46bca6cdb
commit 4085364894
3 changed files with 25 additions and 5 deletions

View File

@ -274,5 +274,7 @@ public interface DevInfoMapper {
List<DevInfoVo> getMaTypeLeasingDetail(DevInfoVo devInfoVo); List<DevInfoVo> getMaTypeLeasingDetail(DevInfoVo devInfoVo);
List<SysDept> getDemandUnit(DevInfoVo devInfoVo); List<SysDept> getDemandUnit(DevInfoVo devInfoVo);
int updateTypeLeasePrice(DevInfo devInfo);
} }

View File

@ -210,6 +210,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 根据文件名截取文件名 * 根据文件名截取文件名
*
* @param fileName * @param fileName
*/ */
private String extracted(String fileName) { private String extracted(String fileName) {
@ -410,9 +411,11 @@ public class DevInfoServiceImpl implements DevInfoService {
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
devInfo.setDeviceCount(devInfo.getDeviceCount()); devInfo.setDeviceCount(devInfo.getDeviceCount());
devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode()); devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode());
if (devInfoMapper.insertDevInfo(devInfo) == 0) { int num = devInfoMapper.insertDevInfo(devInfo);
if (num == 0) {
return AjaxResult.error("设备信息SQL保存失败请修改后重试"); return AjaxResult.error("设备信息SQL保存失败请修改后重试");
} }
devInfoMapper.updateTypeLeasePrice(devInfo);
code = ""; code = "";
//保存自定义属性值 //保存自定义属性值
if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) { if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) {
@ -594,6 +597,7 @@ public class DevInfoServiceImpl implements DevInfoService {
String identifyCode = tableList.get(0).getIdentifyCode(); String identifyCode = tableList.get(0).getIdentifyCode();
devInfo.setIdentifyCode(identifyCode); devInfo.setIdentifyCode(identifyCode);
int i = devInfoMapper.updateDevInfo(devInfo); int i = devInfoMapper.updateDevInfo(devInfo);
devInfoMapper.updateTypeLeasePrice(devInfo);
Integer id = tableList.get(0).getId(); Integer id = tableList.get(0).getId();
if (id != null) { if (id != null) {
@ -871,6 +875,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 在租装备信息查询 * 在租装备信息查询
*
* @param devInfo * @param devInfo
* @return * @return
*/ */
@ -881,6 +886,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 设备批量导入模版下载 * 设备批量导入模版下载
*
* @param response * @param response
*/ */
@Override @Override
@ -888,7 +894,7 @@ public class DevInfoServiceImpl implements DevInfoService {
//模板名称 //模板名称
String templateName = "MaDevTemplate.xlsx"; String templateName = "MaDevTemplate.xlsx";
OutputStream out = null; OutputStream out = null;
InputStream input =null; InputStream input = null;
try { try {
input = this.getClass().getClassLoader().getResourceAsStream("template/MaDevTemplate.xlsx"); input = this.getClass().getClassLoader().getResourceAsStream("template/MaDevTemplate.xlsx");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
@ -914,6 +920,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 设备信息导入 * 设备信息导入
*
* @param file * @param file
* @return * @return
*/ */
@ -987,7 +994,7 @@ public class DevInfoServiceImpl implements DevInfoService {
List<DevTemplateVo> devTemplateVos = entry.getValue(); List<DevTemplateVo> devTemplateVos = entry.getValue();
for (DevTemplateVo templateVo : devTemplateVos) { for (DevTemplateVo templateVo : devTemplateVos) {
if (StringUtils.isBlank(templateVo.getIdentifyCode()) && StringUtils.isBlank(templateVo.getCheckMan()) if (StringUtils.isBlank(templateVo.getIdentifyCode()) && StringUtils.isBlank(templateVo.getCheckMan())
&& templateVo.getNextCheckDate() == null && templateVo.getCheckDate() == null) { && templateVo.getNextCheckDate() == null && templateVo.getCheckDate() == null) {
continue; continue;
} }
DevTemplateVo dto = new DevTemplateVo(); DevTemplateVo dto = new DevTemplateVo();
@ -1015,6 +1022,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 读取Excel表格数据做非空判断 * 读取Excel表格数据做非空判断
*
* @param sheet * @param sheet
* @param totalRows * @param totalRows
* @param totalCells * @param totalCells
@ -1062,8 +1070,8 @@ public class DevInfoServiceImpl implements DevInfoService {
case 10: case 10:
checkDate(cellValue, r, c); checkDate(cellValue, r, c);
break; break;
default: default:
break; break;
} }
} }
} }
@ -1071,6 +1079,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 检查数字格式是否为整数 * 检查数字格式是否为整数
*
* @param cellValue * @param cellValue
* @param r * @param r
* @param c * @param c
@ -1088,6 +1097,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 检查日期格式 * 检查日期格式
*
* @param cellValue * @param cellValue
* @param rowIndex * @param rowIndex
* @param colIndex * @param colIndex
@ -1104,6 +1114,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 判断日期格式是否正确 * 判断日期格式是否正确
*
* @param dateStr * @param dateStr
* @return * @return
*/ */
@ -1150,6 +1161,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 检查数据是否为空 * 检查数据是否为空
*
* @param cellValue * @param cellValue
* @param rowIndex * @param rowIndex
* @param colIndex * @param colIndex
@ -1163,6 +1175,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 检查电话号码格式 * 检查电话号码格式
*
* @param cellValue * @param cellValue
* @param rowIndex * @param rowIndex
* @param colIndex * @param colIndex
@ -1178,6 +1191,7 @@ public class DevInfoServiceImpl implements DevInfoService {
/** /**
* 读取Excel表格数据做非空及格式判断 * 读取Excel表格数据做非空及格式判断
*
* @param headerRow * @param headerRow
* @param totalCells * @param totalCells
*/ */

View File

@ -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 update ma_dev_info set total_lease_day = IFNULL(total_lease_day, 0) + 1
where is_active = '1' and ma_status = '3' where is_active = '1' and ma_status = '3'
</update> </update>
<update id="updateTypeLeasePrice">
update ma_type set lease_price = #{dayLeasePrice}
where type_id = #{typeId}
</update>
<select id="getIdleDevRatio" resultType="com.bonus.material.device.domain.DevInfo"> <select id="getIdleDevRatio" resultType="com.bonus.material.device.domain.DevInfo">
SELECT SELECT