|
@@ -3,6 +3,7 @@ package cn.ezhizao.project.business.workOrder.controller;
|
|
|
import cn.ezhizao.common.utils.StringUtils;
|
|
|
import cn.ezhizao.common.utils.poi.ExcelUtil;
|
|
|
import cn.ezhizao.framework.aspectj.lang.annotation.Log;
|
|
|
+import cn.ezhizao.framework.aspectj.lang.annotation.distributedLock;
|
|
|
import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
|
|
|
import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
@@ -140,6 +141,7 @@ public class WorkOrderServiceController extends BaseController {
|
|
|
@Log(title = "循环工单", businessType = BusinessType.EXPORT)
|
|
|
@PreAuthorize("@ss.hasPermi('business:customer:service:loop:exportLoop')")
|
|
|
@PostMapping("/exportLoop")
|
|
|
+ @distributedLock(prefix = "crmServiceExport",key = "@tenantId")
|
|
|
public void exportLoop(HttpServletResponse response, BizWorkOrder bizWorkOrder) throws NoSuchFieldException, IllegalAccessException {
|
|
|
setTenantId(bizWorkOrder);
|
|
|
bizWorkOrder.setType(1);
|
|
@@ -161,18 +163,21 @@ public class WorkOrderServiceController extends BaseController {
|
|
|
&& e.getFromId().equals(0L) &&
|
|
|
e.getYear().equals(bizWorkOrder.getYear())).findFirst().orElse(null));
|
|
|
// v.setEntrust(entrusts.stream().filter(e -> e.getWorkOrderId().equals(v.getId())).findFirst().orElse(null));
|
|
|
- for (BizEntrust entrust : collect.get(v.getCompanyId())) {
|
|
|
- String year = entrust.getWorkMonth().toLocalDate().getYear()+"";
|
|
|
- int month = entrust.getWorkMonth().toLocalDate().getMonthValue();
|
|
|
- String format = String.format("%02d", month);
|
|
|
- if (bizWorkOrder.getYear().equals(year) && bizWorkOrder.getMonth().equals(format)){
|
|
|
- v.setEntrust(entrust);
|
|
|
- break;
|
|
|
- }else {
|
|
|
- v.setEntrust(null);
|
|
|
+ if(null != collect.get(v.getCompanyId())){
|
|
|
+ for (BizEntrust entrust : collect.get(v.getCompanyId())) {
|
|
|
+ String year = entrust.getWorkMonth().toLocalDate().getYear()+"";
|
|
|
+ int month = entrust.getWorkMonth().toLocalDate().getMonthValue();
|
|
|
+ String format = String.format("%02d", month);
|
|
|
+ if (bizWorkOrder.getYear().equals(year) && bizWorkOrder.getMonth().equals(format)){
|
|
|
+ v.setEntrust(entrust);
|
|
|
+ break;
|
|
|
+ }else {
|
|
|
+ v.setEntrust(null);
|
|
|
+ }
|
|
|
}
|
|
|
+ }else{
|
|
|
+ v.setEntrust(null);
|
|
|
}
|
|
|
-
|
|
|
BizWorkOrderLoop loop = new BizWorkOrderLoop();
|
|
|
loop.setCompanyName(v.getCompanyName());
|
|
|
loop.setTaxType(v.getTaxType());
|