Bläddra i källkod

Merge remote-tracking branch 'origin/master'

wangyangyang 4 år sedan
förälder
incheckning
bcfcf18eef

+ 7 - 6
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java

@@ -349,6 +349,7 @@ public class WorkOrderManageController {
             workOrderManageDto.setEndDate(endDate);
         }
         workOrderManageDto.setOrderStatus(orderStatus);
+        workOrderManageDto.setOrderStatus(orderStatus);
         workOrderManageDto.setEventType(eventType);
         workOrderManageDto.setTenantId(loginUser.getTenantId());
         workOrderManageDto.setOrderTypeId(orderTypeId);
@@ -465,8 +466,8 @@ public class WorkOrderManageController {
     @GetMapping("/submit")
     @ApiOperation(value = "派单")
     public AjaxMessage submitOrder(
-            @ApiParam(value = "工单ID", required = true) @RequestParam(required = false) Integer id,
-            @ApiParam(value = "工单类型编号", required = true) @RequestParam(required = false) Integer orderTypeId,
+            @ApiParam(value = "工单ID", required = true) @RequestParam(required = true) Integer id,
+            @ApiParam(value = "工单类型编号", required = true) @RequestParam(required = true) Integer orderTypeId,
             @ApiParam(value = "工单类型名称", required = true) @RequestParam(required = true) String orderType,
             @ApiParam(value = "紧急程度", required = true) @RequestParam(required = true) String urgency,
             @ApiParam(value = "时限", required = true) @RequestParam(required = true) String dateLimit,
@@ -489,8 +490,9 @@ public class WorkOrderManageController {
         Map<String,Object> vars = new HashMap<>();
         vars.put("assineeFormUserId",orderUserId);
         //巡检发送系统消息所需参数
-        vars.put("任务类型",orderType);
-        vars.put("任务编号",workOrderManage.getId());
+        vars.put("工单类型",orderType);
+        vars.put("工单编号",workOrderManage.getTaskNo());
+        vars.put("url",workOrderManage.getId());
         vars.put("templateId",7);
         vars.put("msgType",7);
         String startProcess = workFlowService.startProcess(processDefinition,vars);
@@ -500,14 +502,13 @@ public class WorkOrderManageController {
         for (String str : taskParticipator) {
             currentUsers += String.format("%s,",str);
         }
-        //currentUsers+="235,209,";
         //更新计划表的流程相关字段值。
         workOrderManage.setOrderStatus(1);//已执行
         workOrderManage.setOrderTypeId(orderTypeId);//工单类型ID
         workOrderManage.setUrgency(urgency);//紧急程度
         workOrderManage.setOrderUserId(orderUserId);//接单人ID
         workOrderManage.setDateLimit(dateLimit);
-        if(workOrderManage.getOrderPid() != null) {
+        if(orderPid != null) {
             workOrderManage.setOrderPid(Integer.parseInt(orderPid));
         }
         if(loginUser.getId() != null) {

+ 1 - 0
operation_manager/src/main/java/com/huaxu/process/activiti/Service/ProgressSevice.java

@@ -41,6 +41,7 @@ public class ProgressSevice  implements JavaDelegate{
         message.setMessageContent(JSONObject.toJSONString(variables));
         message.setMessageId(UUID.randomUUID().toString());
         message.setMessageType((Integer) variables.get("msgType"));
+        message.setUrl((String) variables.get("url"));
         message.setMessageTemplateId((Integer) variables.get("templateId"));
         String value = (String) expression.getValue(delegateExecution);
         TaskUserDTO taskUserDTO = JSONObject.parseObject(value, TaskUserDTO.class);

+ 3 - 2
operation_manager/src/main/java/com/huaxu/process/controller/WorkFlowController.java

@@ -176,15 +176,16 @@ public class WorkFlowController {
     @PostMapping ("/testHandleTask")
     @ApiOperation(value = "流程流转")
     public AjaxMessage testHandleTask( String taskId,Integer actionId) {
-
+        Map<String,Object>args=new HashMap<>();
         Action action=null;
         if(actionId==1){
             action=Action.ACTION_AUDIT;
         }
         else if(actionId==3){
             action=Action.ACTION_REJECT;
+            args.put("assineeFormUserId","1891");
         }
-        Map<String,Object>args=new HashMap<>();
+
         List<TaskPorcessResult> results = workFlowService.handleTask(action, taskId, args, "haowan");
         return new AjaxMessage(ResultStatus.OK,results);
     }

+ 4 - 2
operation_manager/src/main/java/com/huaxu/process/entity/ProcessDefinition.java

@@ -1,5 +1,6 @@
 package com.huaxu.process.entity;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -46,7 +47,7 @@ public class ProcessDefinition implements Serializable {
     /**
      * 任务类型
      */
-    @ApiModelProperty(value = "任务类型")
+    @ApiModelProperty(value = "任务类型,1表务工单,2停通水工单,3抢修工单,4漏点定位工单,5测漏工单,6违章跑水工单,7巡检任务,8测漏任务,9养护任务")
     private Integer taskType;
     /**
      * 公司id
@@ -56,7 +57,7 @@ public class ProcessDefinition implements Serializable {
     /**
      * 业务类型
      */
-    @ApiModelProperty(value = "业务类型")
+    @ApiModelProperty(value = "业务类型,1工单,2任务")
     private Integer businessType;
     /**
      * 关联activiti
@@ -118,6 +119,7 @@ public class ProcessDefinition implements Serializable {
     /**
      * 创建时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间",hidden = true)
     private Date dateCreate;
     /**

+ 10 - 7
operation_manager/src/main/java/com/huaxu/process/service/impl/WorkFlowServiceImpl.java

@@ -148,7 +148,8 @@ public class WorkFlowServiceImpl implements WorkFlowService {
     @Override
     public IPage<ProcessDefinitionDTO> selectPage(ProcessDefinition processDefinition, IPage<ProcessDefinitionDTO> iPage) {
         LoginUser loginUser = UserUtil.getCurrentUser();
-
+        processDefinition.setTenantId(loginUser.getTenantId());
+        processDefinition.setCompanyOrgId(loginUser.getCompanyId());
         IPage<ProcessDefinitionDTO> processDefinitionDTOIPage = processDefinitionMapper.selectPage(iPage, processDefinition);
         return processDefinitionDTOIPage;
     }
@@ -156,14 +157,16 @@ public class WorkFlowServiceImpl implements WorkFlowService {
     @Override
     public void saveProcessDefinition(ProcessDefinition processDefinition) {
         log.info("begin add ProcessDefinition processDefinition:" + JSON.toJSONString(processDefinition));
-        String tenantId = UserUtil.getCurrentUser().getTenantId();
-        int uniqueCount = processDefinitionMapper.checkProcessUnique(null, tenantId,
-                processDefinition.getCompanyOrgId(),processDefinition.getTaskType());
-        if (uniqueCount > 0) {
-            throw new ServiceException(ResultStatus.PROCESS_ALREADY_EXISTS);
-        }
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        String tenantId =currentUser.getTenantId();
+
         List<Integer> companyIds = processDefinition.getCompanyIds();
         companyIds.forEach(id->{
+            int uniqueCount = processDefinitionMapper.checkProcessUnique(null, tenantId,
+                    id,processDefinition.getTaskType());
+            if (uniqueCount > 0) {
+                throw new ServiceException(ResultStatus.PROCESS_ALREADY_EXISTS);
+            }
             processDefinition.setVersion(1);
             processDefinition.setRunningVersion(0);
             processDefinition.setTenantId(tenantId);

+ 3 - 3
operation_manager/src/main/java/com/huaxu/task/controller/PlanManageController.java

@@ -185,7 +185,7 @@ public class PlanManageController {
     @GetMapping("/plan/submit")
     @ApiOperation(value = "提交巡检计划")
     public AjaxMessage submitPlan(
-            @ApiParam(value = "任务ID", required = true) @RequestParam(required = false) Integer id,
+            @ApiParam(value = "任务ID", required = true) @RequestParam(required = true) Integer id,
             @ApiParam(value = "任务类型", required = true) @RequestParam(required = true) String taskType){
         LoginUser loginUser = UserUtil.getCurrentUser();
         PlanManage planManage = planManageService.selectByPrimaryKey(id);
@@ -205,7 +205,8 @@ public class PlanManageController {
         vars.put("assineeFormUserId",planManage.getUserId());
         //巡检发送系统消息所需参数
         vars.put("任务类型",taskType);
-        vars.put("任务编号",planManage.getId());
+        vars.put("任务编号",planManage.getPlanId());
+        vars.put("url",planManage.getId());
         vars.put("templateId",4);
         vars.put("msgType",4);
         String startProcess = workFlowService.startProcess(processDefinition,vars);
@@ -215,7 +216,6 @@ public class PlanManageController {
         for (String str : taskParticipator) {
             currentUsers += String.format("%s,",str);
         }
-        //currentUsers+="235,209,";
         //更新计划表的流程相关字段值。
         planManage.setPlanStatus(1);//已执行
         if(loginUser.getId() != null) {

+ 1 - 1
operation_manager/src/main/resources/mapper/ProcessDefinitionMapper.xml

@@ -241,7 +241,7 @@
         <include refid="Base_Column_List"/>
         from sc_process_definition
         <where>
-            status =1
+            status =1 and
             <if test="processDefinition.id != null">
                 and id = #{processDefinition.id}
             </if>

+ 11 - 3
operation_manager/src/main/resources/mapper/order/WorkOrderManageMapper.xml

@@ -604,12 +604,20 @@
       <if test="order.currentUsers != null">
         and FIND_IN_SET(#{order.currentUsers,jdbcType=VARCHAR},t1.current_users)
       </if>
+
       <if test="order.startDate != null and order.endDate != null">
-        and t1.date_create &gt;= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
-        and t1.date_create &lt;= DATE_ADD(date_format(#{order.endDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 DAY)
+        <if test="order.orderStatus == 0">
+          and t1.date_create &gt;= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
+          and t1.date_create &lt;= DATE_ADD(date_format(#{order.endDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 DAY)
+          order by t1.date_create desc
+        </if>
+        <if test="order.orderStatus != 0">
+          and t1.send_time &gt;= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
+          and t1.send_time &lt;= DATE_ADD(date_format(#{order.endDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 DAY)
+          order by t1.send_time desc
+        </if>
       </if>
     </where>
-    order by t1.date_create
   </select>
   <!--删除-->
   <delete id="batchDelete">

+ 1 - 1
operation_manager/src/main/resources/mapper/task/PlanManageMapper.xml

@@ -445,7 +445,7 @@
         and t1.date_create &lt;= DATE_ADD(date_format(#{plan.endDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 DAY)
       </if>
     </where>
-    order by t1.date_create
+    order by t1.date_create desc
   </select>
 
   <!--待处理权限-->