工单撤回
This commit is contained in:
parent
1b309739e4
commit
37199ffff4
|
|
@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
||||||
import com.chushang.common.core.web.AjaxResult;
|
import com.chushang.common.core.web.AjaxResult;
|
||||||
import com.chushang.common.log.annotation.SysLog;
|
import com.chushang.common.log.annotation.SysLog;
|
||||||
import com.chushang.common.log.enums.BusinessType;
|
import com.chushang.common.log.enums.BusinessType;
|
||||||
|
import com.chushang.inspection.project.dto.Delete;
|
||||||
import com.chushang.inspection.utils.TaskConfigUtils;
|
import com.chushang.inspection.utils.TaskConfigUtils;
|
||||||
import com.chushang.inspection.work.dto.WrkInfoDTO;
|
import com.chushang.inspection.work.dto.WrkInfoDTO;
|
||||||
import com.chushang.inspection.work.query.DispatchQuery;
|
import com.chushang.inspection.work.query.DispatchQuery;
|
||||||
|
|
@ -234,4 +235,17 @@ public class WrkInfoController {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回
|
||||||
|
*/
|
||||||
|
@PostMapping("/withdraw")
|
||||||
|
@RequiresPermissions("wrk:withdraw")
|
||||||
|
@SysLog(value = "工单撤回", businessType = BusinessType.DELETE)
|
||||||
|
public AjaxResult withdraw(@RequestBody @Validated Delete delete) {
|
||||||
|
wrkInfoService.withdraw(delete.getIds());
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,5 +34,7 @@ public interface WrkInfoService extends IService<WrkInfo> {
|
||||||
|
|
||||||
void submit(WrkInfoDTO info);
|
void submit(WrkInfoDTO info);
|
||||||
|
|
||||||
|
void withdraw(List<Long> ids);
|
||||||
|
|
||||||
void audit(AuditDTO audit);
|
void audit(AuditDTO audit);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
|
@ -28,6 +29,7 @@ import com.chushang.common.mybatis.utils.PageResult;
|
||||||
import com.chushang.common.mybatis.utils.WrapperUtils;
|
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||||
import com.chushang.inspection.ins.GeneratedInsFactory;
|
import com.chushang.inspection.ins.GeneratedInsFactory;
|
||||||
import com.chushang.inspection.project.dto.AuditDTO;
|
import com.chushang.inspection.project.dto.AuditDTO;
|
||||||
|
import com.chushang.inspection.project.po.InspectionData;
|
||||||
import com.chushang.inspection.project.service.InspectionDataService;
|
import com.chushang.inspection.project.service.InspectionDataService;
|
||||||
import com.chushang.inspection.terminal.po.FiveStore;
|
import com.chushang.inspection.terminal.po.FiveStore;
|
||||||
import com.chushang.inspection.terminal.po.Store;
|
import com.chushang.inspection.terminal.po.Store;
|
||||||
|
|
@ -341,6 +343,22 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void withdraw(List<Long> ids) {
|
||||||
|
List<Integer> status = ListUtil.toList(1, 2, 5, 6, 7);
|
||||||
|
LambdaQueryWrapper<WrkInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(WrkInfo::getWrkId, ids);
|
||||||
|
queryWrapper.in(WrkInfo::getWrkStatus, status);
|
||||||
|
List<WrkInfo> list = list(queryWrapper);
|
||||||
|
Assert.notEmpty(list, "请确认此工单是否存在或已经审核成功了");
|
||||||
|
List<Long> wrkIds = list.stream().map(WrkInfo::getWrkId).collect(Collectors.toList());
|
||||||
|
removeBatchByIds(wrkIds);
|
||||||
|
wrkImgService.remove(new LambdaQueryWrapper<WrkImg>().in(WrkImg::getWrkId, wrkIds));
|
||||||
|
inspectionDataService.remove(new LambdaQueryWrapper<InspectionData>().in(InspectionData::getInsId, wrkIds));
|
||||||
|
// todo 终端占用状态和江西内蒙古
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单审核
|
* 工单审核
|
||||||
*
|
*
|
||||||
|
|
@ -561,7 +579,7 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
||||||
if (result.isSuccess()) {
|
if (result.isSuccess()) {
|
||||||
Map<String, Long> userIds = result.getData();
|
Map<String, Long> userIds = result.getData();
|
||||||
for (DispatchDTO dispatchDTO : dispatch) {
|
for (DispatchDTO dispatchDTO : dispatch) {
|
||||||
Long userId = 1L;// 先固定 userIds.get(dispatchDTO.getAccountManager());
|
Long userId = userIds.get(dispatchDTO.getAccountManager());
|
||||||
Assert.notNull(userId, "【{}】未设置商户", dispatchDTO.getAccountManager());
|
Assert.notNull(userId, "【{}】未设置商户", dispatchDTO.getAccountManager());
|
||||||
// 组装wrkinfo实体
|
// 组装wrkinfo实体
|
||||||
WrkInfo wrkInfo = makeWrkInfoEntity(dispatchDTO, query, userId, dispatchDTO.getAccountManager(), 0);
|
WrkInfo wrkInfo = makeWrkInfoEntity(dispatchDTO, query, userId, dispatchDTO.getAccountManager(), 0);
|
||||||
|
|
|
||||||
|
|
@ -210,10 +210,25 @@
|
||||||
from st_terminal t1
|
from st_terminal t1
|
||||||
left join st_store t2 on t1.store_id = t2.store_id
|
left join st_store t2 on t1.store_id = t2.store_id
|
||||||
left join st_terminal_ins t3 on t3.terminal_id = t1.terminal_id
|
left join st_terminal_ins t3 on t3.terminal_id = t1.terminal_id
|
||||||
where t1.del_state = 0
|
<where>
|
||||||
|
t1.del_state = 0
|
||||||
<if test="query.taskId != null">
|
<if test="query.taskId != null">
|
||||||
AND t1.task_id = #{query.taskId}
|
AND t1.task_id = #{query.taskId}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY t1.create_time DESC limit 10
|
|
||||||
|
<if test="query.nos != null and query.nos.size > 0">
|
||||||
|
AND t1.terminal_no in
|
||||||
|
<foreach collection="query.nos" item="no" open="(" separator="," close=")">
|
||||||
|
#{no}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.terminalIds != null and query.terminalIds.size > 0">
|
||||||
|
AND t1.terminal_id in
|
||||||
|
<foreach collection="query.terminalIds" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue