装备编辑可修改装备租金

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<SysDept> getDemandUnit(DevInfoVo devInfoVo);
int updateTypeLeasePrice(DevInfo devInfo);
}

View File

@ -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<DevTemplateVo> 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
*/

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
where is_active = '1' and ma_status = '3'
</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