Jelajahi Sumber

删除巡检计划

wangbo 4 tahun lalu
induk
melakukan
4b294a303c

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

@@ -6,7 +6,6 @@ import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
 import com.huaxu.model.Pagination;
 import com.huaxu.model.ResultStatus;
-import com.huaxu.order.dto.WorkOrderManageDto;
 import com.huaxu.process.entity.ProcessDefinition;
 import com.huaxu.process.service.WorkFlowService;
 import com.huaxu.task.dto.PlanManageDto;
@@ -210,44 +209,9 @@ public class PlanManageController {
         return new AjaxMessage(ResultStatus.ERROR);
     }
 
-
     @RequestMapping(value="batchDelete" , method = RequestMethod.DELETE)
     @ApiOperation(value = "批量删除")
     public AjaxMessage<Integer> batchDelete( @ApiParam(value = "巡检计划ids") @RequestParam List<Integer> ids){
         return new AjaxMessage<>(ResultStatus.OK, planManageService.batchDelete(ids));
     }
-
-
-//    @GetMapping("/plan/selecttask")
-//    @ApiOperation(value = "查询巡检任务")
-//    public AjaxMessage<Pagination<PlanManageDto>> selecttask(
-//            @ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
-//            @ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
-//            @ApiParam(value = "状态", required = false) @RequestParam(required = false) Integer planStatus,
-//            @ApiParam(value = "计划单号或计划名称", required = false) @RequestParam(required = false) String key,
-//            @ApiParam(value = "计划安排起始日期", required = false) @RequestParam(required = false) String startDate,
-//            @ApiParam(value = "计划安排截至日期", required = false) @RequestParam(required = false) String endDate){
-//        PlanManageDto planManageDto = new PlanManageDto();
-//        //根据用户编号,获取用户的权限
-//        LoginUser loginUser = UserUtil.getCurrentUser();
-//        planManageDto.setKey(key);
-//        if(!StringUtils.isEmpty(startDate)&& !StringUtils.isEmpty(endDate)) {
-//            planManageDto.setStartDate(startDate);
-//            planManageDto.setEndDate(endDate);
-//        }
-//        planManageDto.setPlanStatus(planStatus);
-//        planManageDto.setTenantId(loginUser.getTenantId());
-//        planManageDto.setProgramItems(loginUser.getProgramItemList());
-//        planManageDto.setUserType(loginUser.getType());
-//        //1是公司,2是公司及以下,3部门,4部门及以下,5自定义
-//        planManageDto.setPermissonType(loginUser.getPermissonType());
-//        IPage<PlanManageDto> iPage = new Page<>(pageNum, pageSize);
-//        iPage = planManageService.selectPage(iPage, planManageDto);
-//        Pagination<PlanManageDto> pages = new Pagination<>(iPage);
-//        for(PlanManage plan : pages.getList()){
-//            //plan.setCompanyOrgName(orgInfoUtil.getOrgName(plan.getCompanyOrgId()));
-//            //plan.setDeptOrgName(orgInfoUtil.getOrgName(plan.getDeptOrgId()));
-//        }
-//        return new AjaxMessage<>(ResultStatus.OK, pages);
-//    }
 }

+ 7 - 1
operation_manager/src/main/java/com/huaxu/task/dto/PlanManageDto.java

@@ -37,14 +37,20 @@ public class PlanManageDto extends PlanManage {
     @JsonIgnore
     private Integer permissonType;
     /**
-     *
+     *关键字查询
      */
     @ApiModelProperty(value = "关键字")
     private String key;
 
+    /**
+     * 查询起始日期
+     */
     @ApiModelProperty(value="起始日期")
     private String startDate;
 
+    /**
+     * 查询截至日期
+     */
     @ApiModelProperty(value="截至日期")
     private String endDate;
 

+ 21 - 0
operation_manager/src/main/java/com/huaxu/task/entity/TaskManage.java

@@ -0,0 +1,21 @@
+package com.huaxu.task.entity;
+
+import com.huaxu.order.entity.WorkFlowDetail;
+import com.huaxu.order.entity.WorkFlowLog;
+import com.huaxu.task.dto.PlanManageDto;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel
+public class TaskManage extends PlanManageDto implements Serializable {
+
+    @ApiModelProperty(value = "工作流日志")
+    WorkFlowLog workFlowLog;
+
+    @ApiModelProperty(value = "工作流详情")
+    WorkFlowDetail workFlowDetail;
+}

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

@@ -25,12 +25,39 @@
     <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP" />
     <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
     <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
-    <result column="company_org_id" property="companyOrgId" jdbcType="VARCHAR" />
+    <result column="company_org_id" property="compa=nyOrgId" jdbcType="VARCHAR" />
     <result column="department_org_id" property="departmentOrgId" jdbcType="VARCHAR" />
     <result column="task_checked" property="taskChecked" jdbcType="VARCHAR" />
     <result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
   </resultMap>
 
+  <resultMap id="TaskResultMap" type="com.huaxu.task.entity.TaskManage" extends="BaseResultMap">
+    <association property="workFlowLog" javaType="com.huaxu.order.entity.WorkFlowLog">
+      <id column="id" property="id" jdbcType="INTEGER" />
+      <result column="flow_id" property="flowId" jdbcType="INTEGER" />
+      <result column="log_process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
+      <result column="task_id" property="taskId" jdbcType="VARCHAR" />
+      <result column="handle_user_id" property="handleUserId" jdbcType="VARCHAR" />
+      <result column="handle_user_name" property="handleUserName" jdbcType="VARCHAR" />
+      <result column="flow_type" property="flowType" jdbcType="INTEGER" />
+      <result column="flow_result" property="flowResult" jdbcType="VARCHAR" />
+      <result column="log_create_by" property="createBy" jdbcType="VARCHAR" />
+      <result column="log_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
+      <result column="log_update_by" property="updateBy" jdbcType="VARCHAR" />
+      <result column="log_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
+    </association>
+    <association property="workFlowDetail" javaType="com.huaxu.order.entity.WorkFlowDetail">
+      <id column="id" property="id" jdbcType="INTEGER" />
+      <result column="flow_id" property="flowId" jdbcType="INTEGER" />
+      <result column="flow_type" property="flowType" jdbcType="INTEGER" />
+      <result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
+      <result column="detail_create_by" property="createBy" jdbcType="VARCHAR" />
+      <result column="detail_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
+      <result column="detail_update_by" property="updateBy" jdbcType="VARCHAR" />
+      <result column="detail_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
+    </association>
+  </resultMap>
+
   <sql id="Base_Column_List" >
     id, plan_id, plan_name, plan_user_id, user_id, plan_date, plan_start_date, plan_end_date, 
     task_content, task_area_shape, task_area_name, task_type, plan_status, tenant_id, 
@@ -334,10 +361,19 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
 
-  <select id="findPage" resultMap="BaseResultMap">
+  <select id="findPage" resultMap="TaskResultMap">
     select
-    <include refid="Base_Column_List"/>
-    from sc_plan_manage t1
+    t1.id, t1.plan_id, plan_name, plan_user_id, user_id, plan_date, plan_start_date, plan_end_date,
+    task_content, task_area_shape, task_area_name, task_type, plan_status, tenant_id,
+    t1.process_instance_id, process_def_id, current_task_id, current_users, current_task_name,
+    t1.create_by, t1.date_create, t1.update_by, t1.date_update, company_org_id, department_org_id,task_checked,
+    t2.flow_detail,t2.create_by detail_create_by,t2.date_create detail_date_create,t2.update_by detail_update_by,t2.date_update detail_date_update,
+    t3.process_instance_id log_process_instance_id,t3.task_id,t3.handle_user_id,t3.handle_user_name,t3.flow_result,t3.create_by log_create_by,
+    t3.date_create log_date_create,t3.update_by log_update_by,t3.date_update log_date_update
+    from sc_plan_manage t1 left  join sc_work_flow_detail t2
+    on t1.id = t2.flow_id and t2.flow_type=1
+    left join sc_work_flow_log t3
+    on t3.flow_id = t1.id and t3.flow_type=1
     <where>
       <if test="plan.tenantId != null and plan.tenantId != ''">
         and t1.tenant_id = #{plan.tenantId}
@@ -375,6 +411,9 @@
       <if test="plan.planStatus != null">
         and t1.plan_status =  #{plan.planStatus,jdbcType=INTEGER}
       </if>
+      <if test="plan.planStatus == null">
+        and t1.plan_status != 0
+      </if>
       <if test="plan.startDate != null and plan.endDate != null">
         and t1.date_create &gt;= date_format(#{plan.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
         and t1.date_create &lt;= DATE_ADD(date_format(#{plan.endDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 DAY)