ly hace 1 año
padre
commit
738302a202

+ 8 - 5
src/main/java/cn/ezhizao/project/business/workOrder/controller/WorkOrderCurrentController.java

@@ -480,11 +480,14 @@ public class WorkOrderCurrentController extends BaseController {
     @PostMapping("/delEntrust")
     public AjaxResult delEntrust(@RequestBody BizEntrust bizEntrust) {
         List<BizEntrust> entrustList = bizEntrustService.getList(bizEntrust);
-        DateTime currentMonth = DateTime.of(bizEntrust.getWorkMonth());
-        bizEntrust.setWorkMonth(currentMonth.offset(DateField.MONTH, 1).toSqlDate());
-        List<BizEntrust> nextEntrustList = bizEntrustService.getList(bizEntrust);
-
-        boolean status = (entrustList.isEmpty() || bizEntrustService.removeByIds(entrustList.stream().map(BizEntrust::getId).collect(Collectors.toList()))) && (nextEntrustList.isEmpty() || bizEntrustService.removeByIds(nextEntrustList.stream().map(BizEntrust::getId).collect(Collectors.toList())));
+//        DateTime currentMonth = DateTime.of(bizEntrust.getWorkMonth());
+//        bizEntrust.setWorkMonth(currentMonth.offset(DateField.MONTH, 1).toSqlDate());
+        bizEntrust.setCurrentMonth(bizEntrust.getCurrentMonth());
+//        List<BizEntrust> nextEntrustList = bizEntrustService.getList(bizEntrust);
+
+        boolean status = (entrustList.isEmpty() || bizEntrustService.removeByIds(entrustList.stream().map(BizEntrust::getId).collect(Collectors.toList())));
+//                && (nextEntrustList.isEmpty() ||
+//                bizEntrustService.removeByIds(nextEntrustList.stream().map(BizEntrust::getId).collect(Collectors.toList()))
         // 取消委托
         return toAjax(status);
     }

+ 1 - 0
src/main/java/cn/ezhizao/project/business/workOrder/controller/WorkOrderNextController.java

@@ -205,6 +205,7 @@ public class WorkOrderNextController extends BaseController {
     @PreAuthorize("@ss.hasPermi('business:entrust:workOrder:next:edit')")
     @PostMapping("/delEntrust")
     public AjaxResult delEntrust(@RequestBody BizEntrust bizEntrust) {
+        bizEntrust.setCurrentMonth(bizEntrust.getCurrentMonth());
         List<BizEntrust> entrustList = bizEntrustService.getList(bizEntrust);
         // 取消委托
         return toAjax(bizEntrustService.removeByIds(entrustList.stream().map(BizEntrust::getId).collect(Collectors.toList())));

+ 2 - 1
src/main/resources/mybatis/business/BizWorkOrderMapper.xml

@@ -141,7 +141,7 @@
         LEFT JOIN biz_work_order t5 on t5.id = t1.work_order_id
         LEFT JOIN biz_tenant t7 on t1.from_tenant_id =t7.id
         <where>
-            t1.deleted = 0
+            t1.deleted = 0 and t5.id is not null
             <if test="fromTenantId != null and fromTenantId != ''">
                 AND t1.from_tenant_id = #{fromTenantId}
             </if>
@@ -149,6 +149,7 @@
                 AND t1.to_tenant_id = #{toTenantId}
             </if>
             <if test="fromCompanyName != null and fromCompanyName != ''">
+
                 AND t7.account_name like concat('%', #{fromCompanyName}, '%')
             </if>