diff --git a/src/main/java/cn/com/tenlion/systemtask/controller/api/receiveruser/ReceiverUserController.java b/src/main/java/cn/com/tenlion/systemtask/controller/api/receiveruser/ReceiverUserController.java index 1de87f9..d48fd8f 100644 --- a/src/main/java/cn/com/tenlion/systemtask/controller/api/receiveruser/ReceiverUserController.java +++ b/src/main/java/cn/com/tenlion/systemtask/controller/api/receiveruser/ReceiverUserController.java @@ -163,6 +163,7 @@ public class ReceiverUserController extends DefaultBaseController { public SuccessResult back(@PathVariable("receiverUserIds") String receiverUserIds) { Map params = requestParams(); params.put("receiverUserIds", Arrays.asList(receiverUserIds.split("_"))); + params.put("receiverIds", receiverUserIds); receiverUserService.back(params); return new SuccessResult(); } diff --git a/src/main/java/cn/com/tenlion/systemtask/controller/route/distribute/DistributeRouteController.java b/src/main/java/cn/com/tenlion/systemtask/controller/route/distribute/DistributeRouteController.java index 9f1ce48..eb12570 100644 --- a/src/main/java/cn/com/tenlion/systemtask/controller/route/distribute/DistributeRouteController.java +++ b/src/main/java/cn/com/tenlion/systemtask/controller/route/distribute/DistributeRouteController.java @@ -67,4 +67,9 @@ public class DistributeRouteController extends DefaultBaseController { public ModelAndView listEveryday() { return new ModelAndView("distribute/list-everyday"); } + + @GetMapping("list-already-business") + public ModelAndView listAlreadyBusiness() { + return new ModelAndView("distribute/list-already-business"); + } } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemtask/service/receiveruser/impl/ReceiverUserServiceImpl.java b/src/main/java/cn/com/tenlion/systemtask/service/receiveruser/impl/ReceiverUserServiceImpl.java index 92c896f..f28d99c 100644 --- a/src/main/java/cn/com/tenlion/systemtask/service/receiveruser/impl/ReceiverUserServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemtask/service/receiveruser/impl/ReceiverUserServiceImpl.java @@ -303,6 +303,21 @@ public class ReceiverUserServiceImpl extends DefaultBaseService implements IRece setAppUpdateInfo(token, params); } receiverUserDao.cancel(params); + if(!StringHandler.isNull(params.get("isSupervision"))) { + String[] receiverUserIds = params.get("receiverIds").toString().split("_"); + for(int i=0;i params = new HashMap<>(2); params.put("isReceive", 1); params.put("distributeStatus", "已下派"); - params.put("taskType", "正常"); + params.put("NotTaskType", "正常"); params.put("executeStatusNoOver", "完成"); List receiverUserDTOList = list(params); if(null != receiverUserDTOList && receiverUserDTOList.size() > 0) { diff --git a/src/main/resources/mybatis/mapper/receiveruser/receiver-user-mapper.xml b/src/main/resources/mybatis/mapper/receiveruser/receiver-user-mapper.xml index 5dc1132..59d7180 100644 --- a/src/main/resources/mybatis/mapper/receiveruser/receiver-user-mapper.xml +++ b/src/main/resources/mybatis/mapper/receiveruser/receiver-user-mapper.xml @@ -436,6 +436,10 @@ AND t1.task_type = #{taskType} + + AND + t1.task_type ]]> #{NotTaskType} + AND t1.check_status = #{checkStatus} diff --git a/src/main/resources/templates/distribute/list-already-business.html b/src/main/resources/templates/distribute/list-already-business.html new file mode 100644 index 0000000..bd3a815 --- /dev/null +++ b/src/main/resources/templates/distribute/list-already-business.html @@ -0,0 +1,811 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+
+ + + + + + +
+
+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ + +
+
+
+ + + + + + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/templates/receiveruser/list.html b/src/main/resources/templates/receiveruser/list.html index edfef6c..d7fa3a2 100644 --- a/src/main/resources/templates/receiveruser/list.html +++ b/src/main/resources/templates/receiveruser/list.html @@ -365,6 +365,15 @@ return rowData; } }, + {field: 'distributeTaskType', width: 180, title: '任务类型', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, {field: 'distributeTime', width: 180, title: '下派时间', align:'center', templet: function(row) { var rowData = row[this.field]; @@ -479,7 +488,7 @@ return rowData; } }, - {field: '', fixed: 'right', width: 300, title: '操作', align:'center', + {field: '', fixed: 'right', width: 340, title: '操作', align:'center', templet: function(row) { var rowData = '
\n' + ' 转派\n' + @@ -828,102 +837,185 @@ // 退回 function check(receiverUserIds) { - layer.confirm('审核状态', { - btn: ['通过', '回退'] - }, function(index, layero){ - layer.close(index); - var layIndex; - top.restAjax.delete(top.restAjax.path('api/receiveruser/back/{receiverUserIds}?checkStatus={checkStatus}', [receiverUserIds, '已通过']), {}, null, function (code, data) { - top.dialog.msg('审核成功', {time: 1000}); - reloadTable(); - }, function (code, data) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); - }); - }, function(index){ - back(receiverUserIds); + var layIndex; + top.restAjax.get(top.restAjax.path('api/receiveruser/get/{receiverUserId}', [receiverUserIds]), {}, null, function (code, getData) { + if('未完成' == getData.executeStatus) { + top.dialog.msg('当前任务未完成'); + return false; + }else { + if('已通过' == getData.checkStatus || '已回退' == getData.checkStatus) { + top.dialog.msg('当前任务审核:' + getData.checkStatus); + return false; + }else { + layer.confirm('审核状态', { + btn: ['通过', '回退'] + }, function(index, layero){ + layer.close(index); + var layIndex; + top.restAjax.delete(top.restAjax.path('api/receiveruser/back/{receiverUserIds}?checkStatus={checkStatus}', [receiverUserIds, '已通过']), {}, null, function (code, data) { + top.dialog.msg('审核成功', {time: 1000}); + reloadTable(); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + }, function(index){ + back(receiverUserIds); + }); + } + } + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); }); } // 修改任务状态 function taskStatus(receiverUserId) { - layer.confirm('任务状态', { - btn: ['完成', '进行中', '任务接收'] - ,btn3: function(index, layero){ - top.dialog.close(index); - var layIndex; - top.restAjax.put(top.restAjax.path('api/receiveruser/update/{receiverUserId}', [receiverUserId]), { - isReceive: 1 - }, null, function (code, data) { - top.dialog.msg('任务接收成功', {time: 1000}); - reloadTable(); - }, function (code, data) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg(top.dataMessage.updating, {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); + var layIndex; + top.restAjax.get(top.restAjax.path('api/receiveruser/get/{receiverUserId}', [receiverUserId]), {}, null, function (getCode, getData) { + if ('正常' != getData.taskType) { + top.dialog.msg('当前任务' + getData.taskType); + return false; + }else { + layer.confirm('审核状态', { + btn: ['任务接收', '任务完成'] + }, function(index1, layero){ + if ('1' == getData.isReceive) { + top.dialog.msg('当前任务已接收'); + return false; + } else { + layer.close(index1); + receiveTask(receiverUserId); + } + }, function(index2){ + if ('0' == getData.isReceive) { + top.dialog.msg('您需要先接收任务'); + return false; + }else { + top.restAjax.get(top.restAjax.path('api/receiveruserpatrol/list/?receiverUserId={receiverUserId}', [receiverUserId]), {}, null, function (patrolCode, patrolData) { + console.log(patrolData) + if ('' == patrolData) { + top.dialog.msg('您须先填写任务结果', { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function (index) { + top.dialog.open({ + url: top.restAjax.path('route/receiveruserpatrol/list?receiverUserId={receiverUserId}', [receiverUserId]), + title: '任务结果', + width: '1040px', + height: '98%', + onClose: function (data) { + var layIndex; + top.restAjax.get(top.restAjax.path('api/receiveruserpatrol/list?receiverUserId={receiverUserId}', [receiverUserId]), {}, null, function (code, backData) { + if (backData.length > 0) { + layer.close(index); + overTask(receiverUserId) + } + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.deleting, { + icon: 16, + time: 0, + shade: 0.3 + }); + }, function () { + top.dialog.close(layIndex); + }); + } + }); + } + }); + } else { + if ('完成' == getData.executeStatus) { + top.dialog.msg('当前任务已完成'); + return false; + } else { + layer.close(index2); + overTask(receiverUserId); + } + } + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + } }); } - }, function(outerIndex, layero){ - top.dialog.msg('您须先填写任务结果', { + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + } + + // 接受任务 + function receiveTask(receiverUserId) { + var layIndex; + top.restAjax.put(top.restAjax.path('api/receiveruser/update/{receiverUserId}', [receiverUserId]), { + isReceive: 1, + executeStatus: '进行中' + }, null, function (code, data) { + top.dialog.msg('任务接收成功', {time: 1000}); + reloadTable(); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.updating, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + } + + //任务进行中 + function ingTask(receiverUserId) { + var layIndex; + top.restAjax.put(top.restAjax.path('api/receiveruser/update/{receiverUserId}', [receiverUserId]), { + executeStatus: '进行中' + }, null, function (code, data) { + top.dialog.msg('提交成功', {time: 1000}); + reloadTable(); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.updating, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(layIndex); + }); + } + + // 任务完成 + function overTask(receiverUserId) { + var layIndex; + top.restAjax.put(top.restAjax.path('api/receiveruser/update/{receiverUserId}', [receiverUserId]), { + executeStatus: '完成', + isReceive: 1 + }, null, function (code, data) { + top.dialog.msg('提交成功', {time: 1000}); + reloadTable(); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + layIndex = top.dialog.msg(top.dataMessage.updating, { + icon: 16, time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function (index) { - top.dialog.open({ - url: top.restAjax.path('route/receiveruserpatrol/list?receiverUserId={receiverUserId}', [receiverUserId]), - title: '任务结果', - width: '1040px', - height: '98%', - onClose: function(data) { - var layIndex; - top.restAjax.get(top.restAjax.path('api/receiveruserpatrol/list?receiverUserId={receiverUserId}', [receiverUserId]), {}, null, function (code, backData) { - console.log(backData); - if(backData.length > 0) { - layer.close(outerIndex); - top.restAjax.put(top.restAjax.path('api/receiveruser/update/{receiverUserId}', [receiverUserId]), { - executeStatus: '完成' - }, null, function (code, data) { - top.dialog.msg('提交成功', {time: 1000}); - reloadTable(); - }, function (code, data) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg(top.dataMessage.updating, {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); - }); - } - }, function (code, data) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); - }); - } - }); - } - }); - }, function(index){ - top.dialog.close(index); - var layIndex; - top.restAjax.put(top.restAjax.path('api/receiveruser/update/{receiverUserId}', [receiverUserId]), { - executeStatus: '进行中' - }, null, function (code, data) { - top.dialog.msg('提交成功', {time: 1000}); - reloadTable(); - }, function (code, data) { - top.dialog.msg(data.msg); - }, function () { - layIndex = top.dialog.msg(top.dataMessage.updating, {icon: 16, time: 0, shade: 0.3}); - }, function () { - top.dialog.close(layIndex); + shade: 0.3 }); + }, function () { + top.dialog.close(layIndex); }); }