后台代码提交

This commit is contained in:
liuchuan 2023-12-24 15:11:02 +08:00
parent a5a0642cdf
commit fbd6c6dcb5
3 changed files with 8 additions and 7 deletions

View File

@ -63,7 +63,7 @@ public class RepairServiceImpl implements RepairService {
int repairNum = details.getRepairedNum() + bean.getRepairNum();
int num = repairNum + details.getScrapNum();
if (num > details.getRepairNum()) {
return AjaxResult.error("维修数量大于维修总量");
throw new ServiceException("维修数量大于维修总量");
}
mapper.updateRepairedNum(bean.getId(), repairNum,bean.getRepairer(),loginUser.getUserid());
break;
@ -72,7 +72,7 @@ public class RepairServiceImpl implements RepairService {
int repairNum = details.getRepairedNum() + bean.getRepairNum();
int num = repairNum + details.getScrapNum();
if (num > details.getRepairNum()) {
return AjaxResult.error("维修数量大于维修总量");
throw new ServiceException("维修数量大于维修总量");
}
mapper.updateRepairedNumTwo(bean.getId(), repairNum,loginUser.getUserid());
break;
@ -81,7 +81,7 @@ public class RepairServiceImpl implements RepairService {
int scrapNum = details.getScrapNum() + bean.getScrapNum();
int num = scrapNum + details.getRepairedNum();
if (num > details.getRepairNum()) {
return AjaxResult.error("维修数量大于维修总量");
throw new ServiceException("维修数量大于维修总量");
//添加维修记录
}
mapper.updateScrapNum(bean.getId(), scrapNum,loginUser.getUserid());
@ -130,7 +130,7 @@ public class RepairServiceImpl implements RepairService {
for (RepairTaskDetails bean : list){
int repairedNum = bean.getRepairNum() - bean.getRepairedNum() - bean.getScrapNum();
if (repairedNum <= 0){
return AjaxResult.error("选中的数据中包含待维修数量为0的机具请重新选择");
throw new ServiceException("选中的数据中包含待维修数量为0的机具请重新选择");
}
}
for (RepairTaskDetails bean : list){
@ -157,7 +157,7 @@ public class RepairServiceImpl implements RepairService {
for (RepairTask task : taskList){
int i = mapper.getUnFinish(task);
if (i > 0){
return AjaxResult.error("选中的数据中包含维修未完成的,请完成维修再进行提交审核");
throw new ServiceException("选中的数据中包含维修未完成的,请完成维修再进行提交审核");
}
}
int i = mapper.updateTaskStatus(taskList,loginUser.getUserid());

View File

@ -150,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="backCode != null">
and tk.code = #{backCode}
</if>
order by tk.create_time desc
</select>
<select id="selectRepairAuditDetailsByTaskId" resultMap="RepairAuditDetailsResult">

View File

@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="agreementId != null">agreement_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
create_time,
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="agreementId != null">#{agreementId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
now(),
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>