Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

hym vor 4 Jahren
Ursprung
Commit
b947a69a85

+ 3 - 3
.idea/libraries/Maven__org_springframework_amqp_spring_amqp_2_1_7_RELEASE.xml

@@ -1,13 +1,13 @@
 <component name="libraryTable">
   <library name="Maven: org.springframework.amqp:spring-amqp:2.1.7.RELEASE">
     <CLASSES>
-      <root url="jar://$PROJECT_DIR$/../../../Program Files/repository/org/springframework/amqp/spring-amqp/2.1.7.RELEASE/spring-amqp-2.1.7.RELEASE.jar!/" />
+      <root url="jar://$USER_HOME$/.m2/repository/org/springframework/amqp/spring-amqp/2.1.7.RELEASE/spring-amqp-2.1.7.RELEASE.jar!/" />
     </CLASSES>
     <JAVADOC>
-      <root url="jar://$PROJECT_DIR$/../../../Program Files/repository/org/springframework/amqp/spring-amqp/2.1.7.RELEASE/spring-amqp-2.1.7.RELEASE-javadoc.jar!/" />
+      <root url="jar://$USER_HOME$/.m2/repository/org/springframework/amqp/spring-amqp/2.1.7.RELEASE/spring-amqp-2.1.7.RELEASE-javadoc.jar!/" />
     </JAVADOC>
     <SOURCES>
-      <root url="jar://$PROJECT_DIR$/../../../Program Files/repository/org/springframework/amqp/spring-amqp/2.1.7.RELEASE/spring-amqp-2.1.7.RELEASE-sources.jar!/" />
+      <root url="jar://$USER_HOME$/.m2/repository/org/springframework/amqp/spring-amqp/2.1.7.RELEASE/spring-amqp-2.1.7.RELEASE-sources.jar!/" />
     </SOURCES>
   </library>
 </component>

+ 3 - 3
.idea/libraries/Maven__org_springframework_amqp_spring_rabbit_2_1_7_RELEASE.xml

@@ -1,13 +1,13 @@
 <component name="libraryTable">
   <library name="Maven: org.springframework.amqp:spring-rabbit:2.1.7.RELEASE">
     <CLASSES>
-      <root url="jar://$PROJECT_DIR$/../../../Program Files/repository/org/springframework/amqp/spring-rabbit/2.1.7.RELEASE/spring-rabbit-2.1.7.RELEASE.jar!/" />
+      <root url="jar://$USER_HOME$/.m2/repository/org/springframework/amqp/spring-rabbit/2.1.7.RELEASE/spring-rabbit-2.1.7.RELEASE.jar!/" />
     </CLASSES>
     <JAVADOC>
-      <root url="jar://$PROJECT_DIR$/../../../Program Files/repository/org/springframework/amqp/spring-rabbit/2.1.7.RELEASE/spring-rabbit-2.1.7.RELEASE-javadoc.jar!/" />
+      <root url="jar://$USER_HOME$/.m2/repository/org/springframework/amqp/spring-rabbit/2.1.7.RELEASE/spring-rabbit-2.1.7.RELEASE-javadoc.jar!/" />
     </JAVADOC>
     <SOURCES>
-      <root url="jar://$PROJECT_DIR$/../../../Program Files/repository/org/springframework/amqp/spring-rabbit/2.1.7.RELEASE/spring-rabbit-2.1.7.RELEASE-sources.jar!/" />
+      <root url="jar://$USER_HOME$/.m2/repository/org/springframework/amqp/spring-rabbit/2.1.7.RELEASE/spring-rabbit-2.1.7.RELEASE-sources.jar!/" />
     </SOURCES>
   </library>
 </component>

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

@@ -6,6 +6,8 @@ import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
 import com.huaxu.model.Pagination;
 import com.huaxu.model.ResultStatus;
+import com.huaxu.process.entity.ProcessDefinition;
+import com.huaxu.process.service.WorkFlowService;
 import com.huaxu.task.dto.PlanManageDto;
 import com.huaxu.task.entity.PlanManage;
 import com.huaxu.task.service.PlanManageService;
@@ -14,9 +16,14 @@ import com.huaxu.util.UserUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
 @RestController
 @RequestMapping("/workflow/task/")
@@ -26,6 +33,10 @@ public class PlanManageController {
     @Autowired
     PlanManageService planManageService;
 
+    @Autowired
+    WorkFlowService workFlowService;
+
+
     /**
      * 新增巡检计划
      * @param planName 任务名称
@@ -84,18 +95,14 @@ public class PlanManageController {
             @ApiParam(value = "计划单号或计划名称", required = true) @RequestParam(required = false) String key,
             @ApiParam(value = "计划安排起始日期", required = true) @RequestParam(required = false) String startDate,
             @ApiParam(value = "计划安排截至日期", required = true) @RequestParam(required = false) String endDate){
-
         PlanManageDto planManageDto = new PlanManageDto();
         //根据用户编号,获取用户的权限
         LoginUser loginUser = UserUtil.getCurrentUser();
-//        Map<String,Object> map =new HashMap<String,Object>();
-//        map.put("tenantId",loginUser.getTenantId());
-//        map.put("key",key);
-//        map.put("startDate",startDate);
-//        map.put("endDate",endDate);
-//        map.put("permissonType",loginUser.getPermissonType());
-//        map.put("programItem",loginUser.getProgramItemList());
-//        IPage<PlanManage> iPage = new Page<>(pageNum, pageSize);
+        planManageDto.setKey(key);
+        if(!StringUtils.isEmpty(startDate)&& !StringUtils.isEmpty(endDate)) {
+            planManageDto.setStartDate(startDate);
+            planManageDto.setEndDate(endDate);
+        }
         planManageDto.setTenantId(loginUser.getTenantId());
         planManageDto.setProgramItems(loginUser.getProgramItemList());
         planManageDto.setUserType(loginUser.getType());
@@ -104,15 +111,52 @@ public class PlanManageController {
         IPage<PlanManageDto> iPage = new Page<>(pageNum, pageSize);
         iPage = planManageService.selectPage(iPage, planManageDto);
         Pagination<PlanManageDto> pages = new Pagination<>(iPage);
-        for(PlanManageDto plan : pages.getList()){
+        for(PlanManage plan : pages.getList()){
             //plan.setCompanyOrgName(orgInfoUtil.getOrgName(plan.getCompanyOrgId()));
             //plan.setDeptOrgName(orgInfoUtil.getOrgName(plan.getDeptOrgId()));
         }
         return new AjaxMessage<>(ResultStatus.OK, pages);
-
     }
 
 
-
-
+    @PostMapping("/plan/submit")
+    @ApiOperation(value = "提交巡检计划")
+    public AjaxMessage submitPlan(
+            @ApiParam(value = "计划单号", required = true) @RequestParam(required = false) Integer id){
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        PlanManage planManage = planManageService.selectByPrimaryKey(id);
+        //测试数据 test1 1 1
+//        ProcessDefinition processDefinition = workFlowService.findProcessDefinition(
+//                loginUser.getTenantId(),
+//                loginUser.getCompanyId(),
+//                planManage.getTaskType());
+        ProcessDefinition processDefinition = workFlowService.findProcessDefinition(
+                "test1",
+                1,
+                1);
+        Map<String,Object> vars = new HashMap<>();
+        vars.put("assineeFormUserId",planManage.getUserId());
+        //巡检发送系统消息所需参数
+        vars.put("任务类型",planManage.getTaskType());
+        vars.put("任务编号",planManage.getPlanId());
+        vars.put("templateId",4);
+        vars.put("msgType",4);
+        String startProcess = workFlowService.startProcess(processDefinition,vars);
+        Task task = workFlowService.getProcessRuntimeTask(startProcess).get(0);
+        Set<String> taskParticipator = workFlowService.getTaskParticipator(task.getId(),false,null);
+        //更新计划表的流程相关字段值。
+        planManage.setPlanStatus(1);//已执行
+        planManage.setUpdateBy(loginUser.getId().toString());
+        planManage.setDateUpdate(new Date());
+        planManage.setProcessInstanceId("");
+        planManage.setProcessDefId("");
+        planManage.setCurrentTaskId("");
+        planManage.setCurrentUsers("");
+        planManage.setCurrentTaskName("");
+        int rows = planManageService.updateByPrimaryKeySelective(planManage);
+        if(rows > 0) {
+            return new AjaxMessage<>(ResultStatus.OK);
+        }
+        return new AjaxMessage<>(ResultStatus.ERROR);
+    }
 }

+ 2 - 0
operation_manager/src/main/java/com/huaxu/task/dao/PlanManageMapper.java

@@ -16,6 +16,8 @@ public interface PlanManageMapper {
 
     PlanManage selectByPrimaryKey(Integer id);
 
+    PlanManage selectByPlanId(String planId);
+
     int updateByPrimaryKeySelective(PlanManage record);
 
     Page<PlanManageDto> findPage(IPage<PlanManageDto> page, @Param("plan") PlanManageDto planManageDto);

+ 14 - 0
operation_manager/src/main/java/com/huaxu/task/dto/PlanManageDto.java

@@ -1,5 +1,6 @@
 package com.huaxu.task.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.huaxu.model.ProgramItem;
 import com.huaxu.task.entity.PlanManage;
@@ -7,6 +8,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
 import java.util.List;
 
 @Data
@@ -34,6 +36,18 @@ public class PlanManageDto extends PlanManage {
     @ApiModelProperty(value="用户权限类型",hidden = true)
     @JsonIgnore
     private Integer permissonType;
+    /**
+     *
+     */
+    @ApiModelProperty(value = "关键字")
+    private String key;
+
+    @ApiModelProperty(value="起始日期")
+    private String startDate;
+
+    @ApiModelProperty(value="截至日期")
+    private String endDate;
+
     /**
      * 用户类型
      */

+ 12 - 0
operation_manager/src/main/java/com/huaxu/task/entity/PlanManage.java

@@ -24,9 +24,15 @@ public class PlanManage implements Serializable {
     @ApiModelProperty(value = "计划安排人")
     private String planUserId;
 
+    @ApiModelProperty(value = "计划安排人姓名")
+    private String planUserName;
+
     @ApiModelProperty(value = "计划巡检人员")
     private String userId;
 
+    @ApiModelProperty(value = "计划巡检人员姓名")
+    private String userName;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "计划安排时间")
     private Date planDate;
@@ -75,6 +81,9 @@ public class PlanManage implements Serializable {
     @ApiModelProperty(value = "创建者")
     private String createBy;
 
+    @ApiModelProperty(value = "创建者姓名")
+    private String createByName;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间")
     private Date dateCreate;
@@ -82,6 +91,9 @@ public class PlanManage implements Serializable {
     @ApiModelProperty(value = "更新人")
     private String updateBy;
 
+    @ApiModelProperty(value = "更新人姓名")
+    private String updateByName;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间")
     private Date dateUpdate;

+ 10 - 0
operation_manager/src/main/java/com/huaxu/task/service/PlanManageService.java

@@ -20,4 +20,14 @@ public interface PlanManageService {
      */
     IPage<PlanManageDto> selectPage(IPage<PlanManageDto> page, PlanManageDto planManageDto);
 
+
+    /**
+     * 按单号查询
+     */
+    PlanManage selectByPlanId(String planId);
+
+    /**
+     * 按主键查询
+     */
+    PlanManage selectByPrimaryKey(Integer id);
 }

+ 9 - 0
operation_manager/src/main/java/com/huaxu/task/service/impl/PlanManageServiceImpl.java

@@ -29,4 +29,13 @@ public class PlanManageServiceImpl implements PlanManageService {
         return planManageMapper.findPage(page,planManageDto);
     }
 
+    @Override
+    public PlanManage selectByPlanId(String planId) {
+        return planManageMapper.selectByPlanId(planId);
+    }
+
+    @Override
+    public PlanManage selectByPrimaryKey(Integer id) {
+        return planManageMapper.selectByPrimaryKey(id);
+    }
 }

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

@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.huaxu.task.dao.PlanManageMapper" >
+  <resultMap id="BaseResultMap" type="com.huaxu.task.entity.PlanManage" >
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="plan_id" property="planId" jdbcType="VARCHAR" />
+    <result column="plan_name" property="planName" jdbcType="VARCHAR" />
+    <result column="plan_user_id" property="planUserId" jdbcType="VARCHAR" />
+    <result column="user_id" property="userId" jdbcType="VARCHAR" />
+    <result column="plan_date" property="planDate" jdbcType="TIMESTAMP" />
+    <result column="plan_start_date" property="planStartDate" jdbcType="TIMESTAMP" />
+    <result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
+    <result column="task_content" property="taskContent" jdbcType="VARCHAR" />
+    <result column="task_area_shape" property="taskAreaShape" jdbcType="VARCHAR" />
+    <result column="task_area_name" property="taskAreaName" jdbcType="VARCHAR" />
+    <result column="task_type" property="taskType" jdbcType="INTEGER" />
+    <result column="plan_status" property="planStatus" jdbcType="INTEGER" />
+    <result column="tenant_id" property="tenantId" jdbcType="VARCHAR" />
+    <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
+    <result column="process_def_id" property="processDefId" jdbcType="VARCHAR" />
+    <result column="current_task_id" property="currentTaskId" jdbcType="VARCHAR" />
+    <result column="current_users" property="currentUsers" jdbcType="VARCHAR" />
+    <result column="current_task_name" property="currentTaskName" jdbcType="VARCHAR" />
+    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
+    <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="department_org_id" property="departmentOrgId" jdbcType="VARCHAR" />
+  </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, 
+    process_instance_id, process_def_id, current_task_id, current_users, current_task_name, 
+    create_by, date_create, update_by, date_update, company_org_id, department_org_id
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from sc_plan_manage
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <select id="selectByPlanId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select
+    <include refid="Base_Column_List" />
+    from sc_plan_manage
+    where plan_id = #{planId,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from sc_plan_manage
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insertSelective" parameterType="com.huaxu.task.entity.PlanManage" >
+    insert into sc_plan_manage
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="planId != null" >
+        plan_id,
+      </if>
+      <if test="planName != null" >
+        plan_name,
+      </if>
+      <if test="planUserId != null" >
+        plan_user_id,
+      </if>
+      <if test="userId != null" >
+        user_id,
+      </if>
+      <if test="planDate != null" >
+        plan_date,
+      </if>
+      <if test="planStartDate != null" >
+        plan_start_date,
+      </if>
+      <if test="planEndDate != null" >
+        plan_end_date,
+      </if>
+      <if test="taskContent != null" >
+        task_content,
+      </if>
+      <if test="taskAreaShape != null" >
+        task_area_shape,
+      </if>
+      <if test="taskAreaName != null" >
+        task_area_name,
+      </if>
+      <if test="taskType != null" >
+        task_type,
+      </if>
+      <if test="planStatus != null" >
+        plan_status,
+      </if>
+      <if test="tenantId != null" >
+        tenant_id,
+      </if>
+      <if test="processInstanceId != null" >
+        process_instance_id,
+      </if>
+      <if test="processDefId != null" >
+        process_def_id,
+      </if>
+      <if test="currentTaskId != null" >
+        current_task_id,
+      </if>
+      <if test="currentUsers != null" >
+        current_users,
+      </if>
+      <if test="currentTaskName != null" >
+        current_task_name,
+      </if>
+      <if test="createBy != null" >
+        create_by,
+      </if>
+      <if test="dateCreate != null" >
+        date_create,
+      </if>
+      <if test="updateBy != null" >
+        update_by,
+      </if>
+      <if test="dateUpdate != null" >
+        date_update,
+      </if>
+      <if test="companyOrgId != null" >
+        company_org_id,
+      </if>
+      <if test="departmentOrgId != null" >
+        department_org_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="planId != null" >
+        #{planId,jdbcType=VARCHAR},
+      </if>
+      <if test="planName != null" >
+        #{planName,jdbcType=VARCHAR},
+      </if>
+      <if test="planUserId != null" >
+        #{planUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null" >
+        #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="planDate != null" >
+        #{planDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="planStartDate != null" >
+        #{planStartDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="planEndDate != null" >
+        #{planEndDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="taskContent != null" >
+        #{taskContent,jdbcType=VARCHAR},
+      </if>
+      <if test="taskAreaShape != null" >
+        #{taskAreaShape,jdbcType=VARCHAR},
+      </if>
+      <if test="taskAreaName != null" >
+        #{taskAreaName,jdbcType=VARCHAR},
+      </if>
+      <if test="taskType != null" >
+        #{taskType,jdbcType=INTEGER},
+      </if>
+      <if test="planStatus != null" >
+        #{planStatus,jdbcType=INTEGER},
+      </if>
+      <if test="tenantId != null" >
+        #{tenantId,jdbcType=VARCHAR},
+      </if>
+      <if test="processInstanceId != null" >
+        #{processInstanceId,jdbcType=VARCHAR},
+      </if>
+      <if test="processDefId != null" >
+        #{processDefId,jdbcType=VARCHAR},
+      </if>
+      <if test="currentTaskId != null" >
+        #{currentTaskId,jdbcType=VARCHAR},
+      </if>
+      <if test="currentUsers != null" >
+        #{currentUsers,jdbcType=VARCHAR},
+      </if>
+      <if test="currentTaskName != null" >
+        #{currentTaskName,jdbcType=VARCHAR},
+      </if>
+      <if test="createBy != null" >
+        #{createBy,jdbcType=VARCHAR},
+      </if>
+      <if test="dateCreate != null" >
+        #{dateCreate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateBy != null" >
+        #{updateBy,jdbcType=VARCHAR},
+      </if>
+      <if test="dateUpdate != null" >
+        #{dateUpdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyOrgId != null" >
+        #{companyOrgId,jdbcType=VARCHAR},
+      </if>
+      <if test="departmentOrgId != null" >
+        #{departmentOrgId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.task.entity.PlanManage" >
+    update sc_plan_manage
+    <set >
+      <if test="planId != null" >
+        plan_id = #{planId,jdbcType=VARCHAR},
+      </if>
+      <if test="planName != null" >
+        plan_name = #{planName,jdbcType=VARCHAR},
+      </if>
+      <if test="planUserId != null" >
+        plan_user_id = #{planUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null" >
+        user_id = #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="planDate != null" >
+        plan_date = #{planDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="planStartDate != null" >
+        plan_start_date = #{planStartDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="planEndDate != null" >
+        plan_end_date = #{planEndDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="taskContent != null" >
+        task_content = #{taskContent,jdbcType=VARCHAR},
+      </if>
+      <if test="taskAreaShape != null" >
+        task_area_shape = #{taskAreaShape,jdbcType=VARCHAR},
+      </if>
+      <if test="taskAreaName != null" >
+        task_area_name = #{taskAreaName,jdbcType=VARCHAR},
+      </if>
+      <if test="taskType != null" >
+        task_type = #{taskType,jdbcType=INTEGER},
+      </if>
+      <if test="planStatus != null" >
+        plan_status = #{planStatus,jdbcType=INTEGER},
+      </if>
+      <if test="tenantId != null" >
+        tenant_id = #{tenantId,jdbcType=VARCHAR},
+      </if>
+      <if test="processInstanceId != null" >
+        process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
+      </if>
+      <if test="processDefId != null" >
+        process_def_id = #{processDefId,jdbcType=VARCHAR},
+      </if>
+      <if test="currentTaskId != null" >
+        current_task_id = #{currentTaskId,jdbcType=VARCHAR},
+      </if>
+      <if test="currentUsers != null" >
+        current_users = #{currentUsers,jdbcType=VARCHAR},
+      </if>
+      <if test="currentTaskName != null" >
+        current_task_name = #{currentTaskName,jdbcType=VARCHAR},
+      </if>
+      <if test="createBy != null" >
+        create_by = #{createBy,jdbcType=VARCHAR},
+      </if>
+      <if test="dateCreate != null" >
+        date_create = #{dateCreate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateBy != null" >
+        update_by = #{updateBy,jdbcType=VARCHAR},
+      </if>
+      <if test="dateUpdate != null" >
+        date_update = #{dateUpdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyOrgId != null" >
+        company_org_id = #{companyOrgId,jdbcType=VARCHAR},
+      </if>
+      <if test="departmentOrgId != null" >
+        department_org_id = #{departmentOrgId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="findPage" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List"/>
+    from sc_plan_manage t1
+    <where>
+      <if test="plan.tenantId != null and plan.tenantId != ''">
+        and t1.tenant_id = #{plan.tenantId}
+      </if>
+      <if test="plan.key != null and plan.key != ''">
+        and (t1.plan_id like CONCAT('%',#{plan.key},'%') or t1.plan_name like CONCAT('%',#{plan.key},'%'))
+      </if>
+      <if test="plan.userType!=null and plan.userType!=-999 and plan.userType!=-9999 and  plan.programItems != null and plan.programItems.size() > 0">
+        <if test="plan.permissonType == 5 or alarm.plan == 2">
+          and ( t1.DEPT_ORG_ID in
+          <foreach collection="plan.programItems" item="item" open="(" close=")" separator=",">
+            #{item.orgId}
+          </foreach>
+          or
+          t1.COMPANY_ORG_ID in
+          <foreach collection="plan.programItems" item="item" open="(" close=")" separator=",">
+            #{item.orgId}
+          </foreach>
+          )
+        </if>
+        <if test="plan.permissonType == 4 or plan.permissonType == 3">
+          and t2.DEPT_ORG_ID in
+          <foreach collection="plan.programItems" item="item" open="(" close=")" separator=",">
+            #{item.orgId}
+          </foreach>
+        </if>
+        <if test="plan.permissonType == 1">
+          and t1.COMPANY_ORG_ID in
+          <foreach collection="plan.programItems" item="item" open="(" close=")" separator=",">
+            #{item.orgId}
+          </foreach>
+          and (t1.DEPT_ORG_ID is null or t1.DEPT_ORG_ID =0)
+        </if>
+      </if>
+      <if test="plan.planStatus != null">
+        and t1.plan_status =  #{plan.planStatus,jdbcType=INTEGER}
+      </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)
+      </if>
+    </where>
+    order by t1.date_create
+  </select>
+</mapper>

+ 0 - 1
sms_water/src/main/java/com/huaxu/service/SceneService.java

@@ -92,7 +92,6 @@ public class SceneService extends ServiceImpl<SceneMapper, SceneEntity> {
                     temList.add(temMeanu);
                     leve--;
                 }
-
             }
         }
         if (temList.size() > 0) {