Jelajahi Sumber

fix:审核合同,解除合同会调用停止工单加上逻辑,一部分判断假删委托防止生产管理看见

ly 11 bulan lalu
induk
melakukan
7dd219eb64

+ 4 - 0
src/main/java/cn/ezhizao/project/business/order/mapper/BizArchiveInputMapper.java

@@ -1,10 +1,12 @@
 package cn.ezhizao.project.business.order.mapper;
 
+import java.util.Date;
 import java.util.List;
 
 import cn.ezhizao.project.business.order.domain.BizArchiveInput;
 import cn.ezhizao.project.business.order.domain.vo.InputVo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 档案入库Mapper接口
@@ -32,4 +34,6 @@ public interface BizArchiveInputMapper extends BaseMapper<BizArchiveInput>
     int removeByIds(List<Long> ids);
 
     List<BizArchiveInput> getListByInput(InputVo bizArchiveInput);
+
+    int deleteByDate(@Param("workOrderId")Long workOrderId, @Param("endDate")Date endDate, @Param("taskTypeId")Long taskTypeId);
 }

+ 4 - 0
src/main/java/cn/ezhizao/project/business/order/service/impl/BizArchiveInputServiceImpl.java

@@ -609,6 +609,10 @@ public class BizArchiveInputServiceImpl extends ServiceImpl<BizArchiveInputMappe
                             // 不停止工单 只修改工单完成时间
                             l.setMonthNum(months);
                             l.setEndMonth(endDate);
+                            l.setIsContinue(0);
+
+                            // 当前这个工单所对应的委托根据endDate去查询,查询条件是大于endDate的,更新字段deleted为1
+                            bizArchiveInputMapper.deleteByDate(l.getId(),endDate,l.getTaskTypeId());
                             // 旧任务明细 停止
                             details.stream().filter(v -> v.getWorkOrderId().equals(l.getId())).forEach(v -> v.setIsStop(1));
                         }

+ 6 - 1
src/main/resources/mybatis/business/BizArchiveInputMapper.xml

@@ -196,7 +196,12 @@
             #{id}
         </foreach>
     </update>
-
+    <update id="deleteByDate">
+        update biz_entrust entrust set entrust.deleted = 1
+        where work_order_id = #{workOrderId}
+        and task_type_id = #{taskTypeId}
+        <![CDATA[and current_month > #{endDate} ]]>
+    </update>
     <delete id="physicalDelete">
         DELETE FROM biz_archive_input
         <where>