ezhizao_zx há 1 ano atrás
pai
commit
700ab85590

+ 1 - 0
src/main/java/cn/ezhizao/project/business/standardCpmpany/controller/BizStandardCompanyController.java

@@ -179,6 +179,7 @@ public class BizStandardCompanyController extends BaseController {
                 //查询是否存在该期间工单
                 List<BizWorkOrder> workOrders = bizWorkOrderService.selectStarMonthList(workOrder);
                 if (workOrders.size() > 0) {
+
                     throw new RuntimeException("已有该期间工单");
                 }
                 workOrder.setStartMonth(null);

+ 4 - 0
src/main/java/cn/ezhizao/project/business/workOrder/domain/BizWorkOrder.java

@@ -75,6 +75,10 @@ public class BizWorkOrder extends BaseEntity
     @TableField(exist = false)
     private String taskTypeName;
 
+    @Excel(name = "是否延续")
+    @ApiModelProperty(value = "是否延续")
+    private Integer isContinue;
+
     /** 任务类型 任务表外键 任务明细表 */
     @ApiModelProperty(value = "任务明细外键")
     private Long taskTypeDetailId;

+ 31 - 19
src/main/resources/mybatis/business/BizWorkOrderMapper.xml

@@ -20,19 +20,19 @@
         left join sys_user t5 on t5.user_id = t1.service_id
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
-            <if test="id != null "> AND t1.id = #{id}</if>
+            <if test="id != null ">AND t1.id = #{id}</if>
             <if test="ids != null and ids.size() > 0">
                 AND t1.id IN
                 <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
                     #{item,jdbcType=BIGINT}
                 </foreach>
             </if>
-            <if test="companyName != null and companyName!=''"> AND t2.name like concat('%', #{companyName}, '%')</if>
+            <if test="companyName != null and companyName!=''">AND t2.name like concat('%', #{companyName}, '%')</if>
             <if test="tenantId != null ">
                 <!--                AND exists (select 1 from biz_entrust t1.tenant_id = tenant_id where )-->
                 AND t1.tenant_id = #{tenantId}
             </if>
-            <if test="companyId != null "> AND t1.company_id = #{companyId}</if>
+            <if test="companyId != null ">AND t1.company_id = #{companyId}</if>
             <if test="type != null ">AND t1.type = #{type}</if>
             <if test="noContract != null ">AND t1.no_contract = #{noContract}</if>
             <if test="workOrderNo != null  and workOrderNo != ''">AND t1.work_order_no = #{workOrderNo}</if>
@@ -41,12 +41,18 @@
             <if test="startMonth != null ">AND t1.end_month &gt;= #{startMonth}</if>
             <if test="monthNum != null ">AND t1.month_num = #{monthNum}</if>
             <if test="isStop != null ">AND t1.is_stop = #{isStop}</if>
-            <if test="currentMonth != null"> AND t1.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &gt;= (case when t1.task_type_id = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &lt;= (case when t1.end_month = 0 then DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') when t1.task_type_id = 1 then DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)</if>
+            <if test="currentMonth != null">AND t1.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &gt;= (case when t1.task_type_id
+                = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &lt;=
+                (case when t1.end_month = 0 then DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') when t1.task_type_id = 1 then
+                DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)
+            </if>
             <if test="toTenantId != null and currentMonth != null">
-                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and t6.work_month = #{currentMonth} and t1.id = t6.work_order_id )
+                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and
+                t6.work_month = #{currentMonth} and t1.id = t6.work_order_id )
             </if>
             <if test="toTenantId != null">
-                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and t1.id = t6.work_order_id )
+                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and
+                t1.id = t6.work_order_id )
             </if>
         </trim>
     </select>
@@ -62,19 +68,19 @@
         left join sys_user t5 on t5.user_id = t1.service_id
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
-            <if test="id != null "> AND t1.id = #{id}</if>
+            <if test="id != null ">AND t1.id = #{id}</if>
             <if test="ids != null and ids.size() > 0">
                 AND t1.id IN
                 <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
                     #{item,jdbcType=BIGINT}
                 </foreach>
             </if>
-            <if test="companyName != null and companyName!=''"> AND t2.name like concat('%', #{companyName}, '%')</if>
+            <if test="companyName != null and companyName!=''">AND t2.name like concat('%', #{companyName}, '%')</if>
             <if test="tenantId != null ">
-<!--                AND exists (select 1 from biz_entrust t1.tenant_id = tenant_id where )-->
+                <!--                AND exists (select 1 from biz_entrust t1.tenant_id = tenant_id where )-->
                 AND t1.tenant_id = #{tenantId}
             </if>
-            <if test="companyId != null "> AND t1.company_id = #{companyId}</if>
+            <if test="companyId != null ">AND t1.company_id = #{companyId}</if>
             <if test="type != null ">AND t1.type = #{type}</if>
             <if test="noContract != null ">AND t1.no_contract = #{noContract}</if>
             <if test="workOrderNo != null  and workOrderNo != ''">AND t1.work_order_no = #{workOrderNo}</if>
@@ -84,12 +90,18 @@
             <if test="endMonth != null ">AND t1.end_month = #{endMonth}</if>
             <if test="monthNum != null ">AND t1.month_num = #{monthNum}</if>
             <if test="isStop != null ">AND t1.is_stop = #{isStop}</if>
-            <if test="currentMonth != null"> AND t1.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &gt;= (case when t1.task_type_id = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &lt;= (case when t1.end_month = 0 then DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') when t1.task_type_id = 1 then DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)</if>
+            <if test="currentMonth != null">AND t1.start_month != 0 AND DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &gt;= (case when t1.task_type_id
+                = 1 then DATE_ADD(t1.start_month,interval 1 month) else t1.start_month end) and DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') &lt;=
+                (case when t1.is_continue=1 then #{currentMonth} when  t1.end_month = 0 then DATE_FORMAT(#{currentMonth}, '%Y-%m-%d') when t1.task_type_id = 1 then
+                DATE_ADD(t1.end_month,interval 1 month) else t1.end_month end)
+            </if>
             <if test="toTenantId != null and currentMonth != null">
-                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and t6.work_month = #{currentMonth} and t1.id = t6.work_order_id )
+                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and
+                t6.work_month = #{currentMonth} and t1.id = t6.work_order_id )
             </if>
             <if test="toTenantId != null">
-                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and t1.id = t6.work_order_id )
+                AND exists (select 1 from biz_entrust t6 where t6.deleted = 0 and t6.to_tenant_id = #{toTenantId} and
+                t1.id = t6.work_order_id )
             </if>
         </trim>
         ORDER BY t1.create_time DESC
@@ -107,12 +119,12 @@
     <insert id="insertTasks">
         <foreach collection="tableValues" item="item" index="index" separator=";">
             insert into ${item.tableName} (
-                id,
-                company_id,
-                work_order_id,
-                tenant_id,
-                create_time,
-                creator_id
+            id,
+            company_id,
+            work_order_id,
+            tenant_id,
+            create_time,
+            creator_id
             )values (
             #{item.id,jdbcType=BIGINT},
             #{item.companyId,jdbcType=BIGINT},