This commit is contained in:
parent
5a24c1baf0
commit
5c481ee8b4
|
|
@ -189,4 +189,11 @@ public interface ScrapApplyDetailsMapper {
|
|||
* @return
|
||||
*/
|
||||
List<Type> selectMaTypeList(Long typeId);
|
||||
|
||||
/**
|
||||
* 添加库存
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
int updateStorageNumAdd(ScrapApplyDetails details);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -745,7 +745,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
result += scrapApplyDetailsMapper.delete(scrapApplyDetails);
|
||||
// 恢复设备库存及设备状态
|
||||
for (ScrapApplyDetails details : list) {
|
||||
result += scrapApplyDetailsMapper.updateStorageNum(details);
|
||||
result += scrapApplyDetailsMapper.updateStorageNumAdd(details);
|
||||
if (StringUtils.isNotBlank(details.getMaIds())) {
|
||||
String[] maIds = details.getMaIds().split(",");
|
||||
// 转换为long类型
|
||||
|
|
@ -769,6 +769,10 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
}
|
||||
// 根据编辑提交的数据去和编辑前数据作对比,修改maId的状态
|
||||
extracted(scrapApplyDetails);
|
||||
TmTask tmTask = new TmTask();
|
||||
tmTask.setTaskId(scrapApplyDetails.getTaskId());
|
||||
tmTask.setTaskStatus(ScrapTaskStatusEnum.SCRAP_TASK_NO_FINISHED.getStatus());
|
||||
result = taskMapper.updateTmTask(tmTask);
|
||||
result = getScrapResult(scrapApplyDetails, result, scrapApplyDetails.getTaskId());
|
||||
result = getFileResult(scrapApplyDetails, result, scrapApplyDetails.getTaskId());
|
||||
if (result > 0) {
|
||||
|
|
@ -829,7 +833,14 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
// 根据前端传的status来判断审核通过还是驳回(1 通过 ,2 驳回)
|
||||
for (Long taskId : scrapApplyDetails.getTaskIdList()) {
|
||||
scrapApplyDetails.setTaskId(taskId);
|
||||
scrapApplyDetails.setAuditBy(SecurityUtils.getUserId());
|
||||
scrapApplyDetails.setAuditTime(DateUtils.getNowDate());
|
||||
result += scrapApplyDetailsMapper.updateTaskStatus(scrapApplyDetails);
|
||||
// 修改任务状态
|
||||
TmTask tmTask = new TmTask();
|
||||
tmTask.setTaskId(taskId);
|
||||
tmTask.setTaskStatus(Integer.valueOf(scrapApplyDetails.getStatus()));
|
||||
result += taskMapper.updateTmTask(tmTask);
|
||||
}
|
||||
if (result > 0) {
|
||||
return AjaxResult.success("审核成功");
|
||||
|
|
|
|||
|
|
@ -301,10 +301,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<update id="updateTaskStatus">
|
||||
update scrap_apply_details
|
||||
set status = #{status}
|
||||
set status = #{status},
|
||||
audit_by = #{auditBy},
|
||||
audit_time = #{auditTime}
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<update id="updateStorageNumAdd">
|
||||
update ma_type
|
||||
set storage_num = storage_num + IFNULL(#{scrapNum}, 0)
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScrapApplyDetailsById" parameterType="Long">
|
||||
delete from scrap_apply_details where id = #{id}
|
||||
</delete>
|
||||
|
|
|
|||
Loading…
Reference in New Issue