| @@ -20,7 +20,6 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.servlet.http.HttpServletResponse; | |||||
| import java.util.*; | import java.util.*; | ||||
| @RestController | @RestController | ||||
| @@ -31,8 +30,6 @@ public class WxFlowAbleController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxFlowService wxFlowService; | private WxFlowService wxFlowService; | ||||
| // @Autowired | |||||
| // RuntimeService runtimeService; | |||||
| @ApiOperation(value = "启动流程",notes = "{\"businessId\":\"221178539888607232\",\"businessType\":1,\"remark\":\"意见意见。\",\"taskAssignee\":[{\"taskKey\":\"firstTaskUser\",\"assignee\":\"243650055783841792\"},{\"taskKey\":\"secondTaskUser\",\"assignee\":\"\"}],\"variables\":[{\"key\":\"contractType\",\"value\":\"1\"},{\"key\":\"contractNumber\",\"value\":\"1111\"}]}") | @ApiOperation(value = "启动流程",notes = "{\"businessId\":\"221178539888607232\",\"businessType\":1,\"remark\":\"意见意见。\",\"taskAssignee\":[{\"taskKey\":\"firstTaskUser\",\"assignee\":\"243650055783841792\"},{\"taskKey\":\"secondTaskUser\",\"assignee\":\"\"}],\"variables\":[{\"key\":\"contractType\",\"value\":\"1\"},{\"key\":\"contractNumber\",\"value\":\"1111\"}]}") | ||||
| @PostMapping("/start") | @PostMapping("/start") | ||||
| @@ -43,19 +40,6 @@ public class WxFlowAbleController extends BaseController { | |||||
| return wxFlowService.start(params, user.getId(),user.getName(),user.getTenantId()); | return wxFlowService.start(params, user.getId(),user.getName(),user.getTenantId()); | ||||
| } | } | ||||
| /** | |||||
| * 删除流程 | |||||
| */ | |||||
| // @GetMapping(value = "/del") | |||||
| // public ResultData del(String id,String x) { | |||||
| // if("xll1dxx1314".equals(x)) { | |||||
| // runtimeService.deleteProcessInstance(id, "驳回"); | |||||
| // return new ResultData(); | |||||
| // }else{ | |||||
| // return new ResultData("fail"); | |||||
| // } | |||||
| // } | |||||
| /** | /** | ||||
| * 用户代办列表 | * 用户代办列表 | ||||
| */ | */ | ||||
| @@ -225,7 +225,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| map.put(userTaskVo.getKey()+"_signAssignee",assigneeList); | map.put(userTaskVo.getKey()+"_signAssignee",assigneeList); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -619,7 +618,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| // 设置最后一个发起节点 | |||||
| // 只展示最后一次发起,设置最后一个发起节点 | |||||
| if(CollectionUtils.isNotEmpty(resultList)){ | if(CollectionUtils.isNotEmpty(resultList)){ | ||||
| for (int i = 0; i < resultList.size() ; i++) { | for (int i = 0; i < resultList.size() ; i++) { | ||||
| if(resultList.get(i).getStatus() == 1){ | if(resultList.get(i).getStatus() == 1){ | ||||
| @@ -630,12 +629,11 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| } | } | ||||
| } | } | ||||
| // 合并会签节点展 | |||||
| // 合并会签节点展示 | |||||
| Map<String,WxFlowRecord> map = new LinkedHashMap<>(); | Map<String,WxFlowRecord> map = new LinkedHashMap<>(); | ||||
| for (WxFlowRecord r:resultList) { | for (WxFlowRecord r:resultList) { | ||||
| if(r.getTaskKey() == null){ | |||||
| if(r.getTaskKey() == null) | |||||
| r.setTaskKey(r.getTaskName()); | r.setTaskKey(r.getTaskName()); | ||||
| } | |||||
| WxFlowRecord mapR = map.get(r.getTaskKey()); | WxFlowRecord mapR = map.get(r.getTaskKey()); | ||||
| if(mapR != null) | if(mapR != null) | ||||
| mapR.setUserName(mapR.getUserName()+","+r.getUserName()); | mapR.setUserName(mapR.getUserName()+","+r.getUserName()); | ||||
| @@ -1956,6 +1956,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| diff = DateUtils.getDiff(start,currEnd); | diff = DateUtils.getDiff(start,currEnd); | ||||
| total = (diff[1]+1) * price; | total = (diff[1]+1) * price; | ||||
| int warnCount = 0; | |||||
| while (true){ | while (true){ | ||||
| Date monthStartDate = DateUtils.getDaySet(currEnd,Calendar.DATE,1); | Date monthStartDate = DateUtils.getDaySet(currEnd,Calendar.DATE,1); | ||||
| dayCount = DateUtils.getMonthDayCount(monthStartDate); | dayCount = DateUtils.getMonthDayCount(monthStartDate); | ||||
| @@ -1975,6 +1976,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| diff = DateUtils.getDiff(monthStartDate,currEnd); | diff = DateUtils.getDiff(monthStartDate,currEnd); | ||||
| total += price * (diff[1] +1); | total += price * (diff[1] +1); | ||||
| } | } | ||||
| //预警 | |||||
| if(warnCount >= 1000){ | |||||
| Logger logger = LoggerFactory.getLogger(WxRentContractServiceImpl.class); | |||||
| logger.error("getNeedPay() warnCount max error !!!"); | |||||
| break; | |||||
| } | |||||
| warnCount ++; | |||||
| } | } | ||||
| return total; | return total; | ||||
| } | } | ||||
| @@ -1982,6 +1991,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| public static List<BillTimeVo> initBillTimeList(Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){ | public static List<BillTimeVo> initBillTimeList(Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){ | ||||
| List<BillTimeVo> list = new ArrayList<>(); | List<BillTimeVo> list = new ArrayList<>(); | ||||
| int warnCount = 0; | |||||
| int count = 0; | int count = 0; | ||||
| while (true){ | while (true){ | ||||
| BillTimeVo timeVo = new BillTimeVo(); | BillTimeVo timeVo = new BillTimeVo(); | ||||
| @@ -2034,6 +2044,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| break; | break; | ||||
| } | } | ||||
| count ++; | count ++; | ||||
| //预警 | |||||
| if(warnCount >= 1000){ | |||||
| Logger logger = LoggerFactory.getLogger(WxRentContractServiceImpl.class); | |||||
| logger.error("initBillTimeList() warnCount max error !!!"); | |||||
| break; | |||||
| } | |||||
| warnCount ++; | |||||
| } | } | ||||
| return list; | return list; | ||||
| } | } | ||||