| @@ -29,10 +29,12 @@ public class WxContractBaseController extends BaseController{ | |||
| Map<String,Object> map = new HashMap<String,Object>(); | |||
| map.put("businessType", flowType.getCode()); | |||
| map.put("remark", remark); | |||
| map.put("businessId", String.valueOf(contractId)); | |||
| //租金+物业合同时用到 | |||
| if (null != wholeProperyId) { | |||
| map.put("businessId", String.valueOf(contractId)+"&"+String.valueOf(wholeProperyId)); | |||
| map.put("wholeProperyId", String.valueOf(wholeProperyId)); | |||
| }else { | |||
| map.put("businessId", String.valueOf(contractId)); | |||
| } | |||
| List<Map> variablesList = new ArrayList<Map>(); | |||
| Map contractTypeMap = new HashMap<String,Object>(); | |||
| @@ -142,11 +142,23 @@ public class WxRentPropertyContractController extends WxContractBaseController { | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "rentId", value = "租金合同编号", dataType = "Long", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "propertyId", value = "物业合同编号", dataType = "Long", paramType = "query", required = true)}) | |||
| public ResultData findById(Long rentId,Long propertyId) { | |||
| @ApiImplicitParam(name = "rentId", value = "租金合同编号", dataType = "Long", paramType = "query", required = false), | |||
| @ApiImplicitParam(name = "propertyId", value = "物业合同编号", dataType = "Long", paramType = "query", required = false), | |||
| @ApiImplicitParam(name = "id", value = "租金合同编号(工作流用)", dataType = "String", paramType = "query", required = false)}) | |||
| public ResultData findById(Long rentId,Long propertyId,String id) { | |||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::findById"); | |||
| return wxRentPropertyContractService.getContractInfo(rentId,propertyId); | |||
| if (null != rentId && null != propertyId) { | |||
| return wxRentPropertyContractService.getContractInfo(rentId,propertyId); | |||
| }else if (StringUtils.isBlank(id)) { | |||
| //租金+物业工作流查询会传此id | |||
| String[] ids = id.split("&"); | |||
| if (ids.length == 2 ) { | |||
| Long rId = Long.parseLong(ids[0]); | |||
| Long pId = Long.parseLong(ids[1]); | |||
| return wxRentPropertyContractService.getContractInfo(rId,pId); | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("合同审批详情") | |||
| @@ -119,10 +119,10 @@ public class WxFlowAbleController extends BaseController { | |||
| @ApiOperation("审批历史") | |||
| @GetMapping(value = "/applyHistory") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "long", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "String", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "工作流-审批历史") | |||
| public ResultData applyHistory(Long businessId) { | |||
| public ResultData applyHistory(String businessId) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::applyHistory"); | |||
| return wxFlowService.applyHistory(businessId,getTenantInfo()); | |||
| } | |||
| @@ -133,10 +133,10 @@ public class WxFlowAbleController extends BaseController { | |||
| @ApiOperation("审批历史和代办") | |||
| @GetMapping(value = "/applyHistoryAndAssignee") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "long", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "String", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "工作流-审批历史和代办") | |||
| public ResultData applyHistoryAndAssignee(Long businessId) { | |||
| public ResultData applyHistoryAndAssignee(String businessId) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::applyHistoryAndAssignee"); | |||
| return wxFlowService.getTaskStatusList(businessId,getTenantInfo()); | |||
| } | |||
| @@ -17,7 +17,7 @@ public class WxFlowRecord extends TenantEntity { | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="业务id",name="businessId") | |||
| private Long businessId; | |||
| private String businessId; | |||
| @io.swagger.annotations.ApiModelProperty(value="业务类型1合同审批2账单审批3合同终止",name="businessType") | |||
| private Integer businessType; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户id",name="userId") | |||
| @@ -67,7 +67,7 @@ public class WxFlowRecord extends TenantEntity { | |||
| private Integer approvalType; | |||
| public WxFlowRecord(){} | |||
| public WxFlowRecord(Long businessId){ | |||
| public WxFlowRecord(String businessId){ | |||
| this.businessId = businessId; | |||
| } | |||
| public WxFlowRecord(String processInstanceId,Integer currStatus){ | |||
| @@ -75,23 +75,23 @@ public class WxFlowRecord extends TenantEntity { | |||
| this.currStatus = currStatus; | |||
| } | |||
| @Deprecated | |||
| public WxFlowRecord(Long businessId,String tenantId){ | |||
| public WxFlowRecord(String businessId,String tenantId){ | |||
| this.businessId = businessId; | |||
| setTenantId(tenantId); | |||
| } | |||
| @Deprecated | |||
| public WxFlowRecord(Long businessId,String tenantId,Integer approvalType){ | |||
| public WxFlowRecord(String businessId,String tenantId,Integer approvalType){ | |||
| this.businessId = businessId; | |||
| setTenantId(tenantId); | |||
| this.approvalType = approvalType; | |||
| } | |||
| public WxFlowRecord(TenantEntity tenantEntity, Long businessId){ | |||
| public WxFlowRecord(TenantEntity tenantEntity, String businessId){ | |||
| updateTenantInfo(tenantEntity); | |||
| this.businessId = businessId; | |||
| } | |||
| public WxFlowRecord(TenantEntity tenantEntity, Long businessId,Integer approvalType){ | |||
| public WxFlowRecord(TenantEntity tenantEntity, String businessId,Integer approvalType){ | |||
| updateTenantInfo(tenantEntity); | |||
| this.businessId = businessId; | |||
| this.approvalType = approvalType; | |||
| @@ -32,7 +32,7 @@ public interface WxFlowService { | |||
| */ | |||
| void updateBusinessStatus(Map<String, Object> mapInfo,Integer applyStatus); | |||
| ResultData getTaskStatusList(Long businessId,TenantEntity tenantEntity); | |||
| ResultData getTaskStatusList(String businessId,TenantEntity tenantEntity); | |||
| /** | |||
| * 启动流程 | |||
| @@ -55,7 +55,7 @@ public interface WxFlowService { | |||
| * @param businessId | |||
| * @return | |||
| */ | |||
| ResultData applyHistory(Long businessId,TenantEntity tenantEntity); | |||
| ResultData applyHistory(String businessId,TenantEntity tenantEntity); | |||
| /** | |||
| * 审批 | |||
| @@ -462,7 +462,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class}) | |||
| public ResultData start(Map<String, Object> params,Long userId,String userName,TenantEntity tenantEntity) { | |||
| String remark = (String)params.get("remark"); | |||
| Long businessId = Long.parseLong(params.get("businessId").toString()); | |||
| String businessId = params.get("businessId").toString(); | |||
| Integer flowType = getIngeter(params.get("businessType")); | |||
| List<Map<String,Object>> variables = (List)params.get("variables"); | |||
| @@ -519,7 +519,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| return new ResultData(); | |||
| } | |||
| public void sendAssigneeMsgAndEmail(TenantEntity tenantEntity, String phone, String email, String userName, Long businessId, Integer flowType, List<Map<String, Object>> variables) { | |||
| public void sendAssigneeMsgAndEmail(TenantEntity tenantEntity, String phone, String email, String userName, String businessId, Integer flowType, List<Map<String, Object>> variables) { | |||
| Map<String,String> dynamicContentMap = new HashMap<>(); | |||
| dynamicContentMap.put("userName",userName); | |||
| dynamicContentMap.put("page", Constant.adminPage); | |||
| @@ -740,11 +740,15 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| @Override | |||
| public ResultData applyHistory(Long businessId,TenantEntity tenantEntity) { | |||
| public ResultData applyHistory(String businessId,TenantEntity tenantEntity) { | |||
| List<WxFlowRecord> result; | |||
| WxCoupon query = new WxCoupon(); | |||
| query.updateTenantInfo(tenantEntity); | |||
| query.setId(businessId); | |||
| try { | |||
| query.setId(Long.parseLong(businessId)); | |||
| }catch(Exception e) { | |||
| query.setId(0L); | |||
| } | |||
| List<WxCoupon> couponList = wxCouponMapper.findList(query); | |||
| if(CollectionUtils.isNotEmpty(couponList)) { | |||
| WxCoupon coupon = couponList.get(0); | |||
| @@ -774,7 +778,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| @Override | |||
| public ResultData getTaskStatusList(Long businessId, TenantEntity tenantEntity) { | |||
| public ResultData getTaskStatusList(String businessId, TenantEntity tenantEntity) { | |||
| List<WxFlowRecord> resultList = wxFlowRecordService.findList(new WxFlowRecord(tenantEntity, businessId)); | |||
| if(CollectionUtils.isEmpty(resultList)){ | |||
| return new ResultData(); | |||
| @@ -972,7 +976,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| taskName = task.getName(); | |||
| taskKey = task.getTaskDefinitionKey(); | |||
| Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | |||
| String businessId = mapInfo.get("businessId").toString(); | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| List<Map<String,Object>> variables = (List)mapInfo.get("variables"); | |||
| Date startDate = (Date)mapInfo.get("startDate"); | |||
| @@ -1018,7 +1022,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.updateTenantInfo(tenantEntity); | |||
| Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter"); | |||
| Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | |||
| String businessId = mapInfo.get("businessId").toString(); | |||
| String email = (String)userMap.get("email"); | |||
| List<Map<String,Object>> variables = (List)mapInfo.get("variables"); | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| @@ -1230,7 +1234,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| return new ResultData(ErrorCode.FLOW_INST_NOT_EXIST.getCode(), "任务不存在"); | |||
| } | |||
| Map<String,Object> mapInfo = taskService.getVariables(taskList.get(0).getId()); | |||
| Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | |||
| String businessId = mapInfo.get("businessId").toString(); | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter"); | |||
| String email = (String) userMap.get("email"); | |||
| @@ -1343,7 +1347,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| List<Task> task = taskService.createTaskQuery().processInstanceId(processInstanceId).list(); | |||
| Map<String,Object> mapInfo = taskService.getVariables(task.get(0).getId()); | |||
| Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | |||
| String businessId = mapInfo.get("businessId").toString(); | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| List<Map<String,Object>> variables = (List)mapInfo.get("variables"); | |||
| Date startDate = (Date)mapInfo.get("startDate"); | |||
| @@ -198,7 +198,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| //发起人备注 | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setBusinessId(id); | |||
| wxFlowRecord.setBusinessId(String.valueOf(id)); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.NEW.getCode()); | |||
| List<WxFlowRecord> flowRecordList = wxFlowRecordService.findList(wxFlowRecord); | |||
| if(!CollectionUtils.isEmpty(flowRecordList)){ | |||
| @@ -246,7 +246,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| //发起人备注 | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setBusinessId(id); | |||
| wxFlowRecord.setBusinessId(String.valueOf(id)); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.NEW.getCode()); | |||
| List<WxFlowRecord> flowRecordList = wxFlowRecordService.findList(wxFlowRecord); | |||
| if(!CollectionUtils.isEmpty(flowRecordList)){ | |||
| @@ -898,7 +898,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //修改flowRecord | |||
| WxFlowRecord fr = new WxFlowRecord(); | |||
| fr.setBusinessId(id); | |||
| fr.setBusinessId(String.valueOf(id)); | |||
| fr.setCurrStatus(EnumRentContractAppStatus.CANCLE.getCode()); | |||
| wxFlowRecordMapper.updateCurrStatus(fr); | |||
| @@ -944,7 +944,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| // 保存审批历史入 | |||
| MallUserInfo mallUserInfo = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| WxFlowRecord updateRecord = new WxFlowRecord(); | |||
| updateRecord.setBusinessId(id); | |||
| updateRecord.setBusinessId(String.valueOf(id)); | |||
| updateRecord.setStatus(EnumFlowRecordStatus.CANCLE.getCode()); | |||
| updateRecord.setBusinessType(1); | |||
| updateRecord.setUserId(mallUserInfo.getId()); | |||
| @@ -2491,7 +2491,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| if (null == flowModle) { | |||
| return new ResultData(Result.ERROR, "编号["+rentContract.getId()+"]租金合同配置的流程["+String.valueOf(bussinessType)+"]未找到流程模板."); | |||
| } | |||
| rentContract.getFlowParams().put("businessId", rentContract.getId().toString()); | |||
| //rentContract.getFlowParams().put("businessId", rentContract.getId().toString()); | |||
| wxFlowService.start(rentContract.getFlowParams(), user.getId(), user.getName(), rentContract); | |||
| return new ResultData(Result.SUCCESS,"提交审批成功",rentContract); | |||
| }else { | |||