diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java index f96c712f7..dcd84a800 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java @@ -29,10 +29,12 @@ public class WxContractBaseController extends BaseController{ Map map = new HashMap(); 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 variablesList = new ArrayList(); Map contractTypeMap = new HashMap(); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java index 4750509ce..d51e6a338 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java @@ -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("合同审批详情") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/workflow/WxFlowAbleController.java b/mallinkAdmin/src/main/java/com/iformall/controller/workflow/WxFlowAbleController.java index 3627eabd5..1e22a2cad 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/workflow/WxFlowAbleController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/workflow/WxFlowAbleController.java @@ -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()); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java b/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java index 5bf899716..b2a497dbe 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java @@ -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; diff --git a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java index 65cb433e6..ee30d3a33 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java @@ -32,7 +32,7 @@ public interface WxFlowService { */ void updateBusinessStatus(Map 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); /** * 审批 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index 164c1d522..39e3bf87e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -462,7 +462,7 @@ public class WxFlowServiceImpl implements WxFlowService { @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class}) public ResultData start(Map 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> 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> variables) { + public void sendAssigneeMsgAndEmail(TenantEntity tenantEntity, String phone, String email, String userName, String businessId, Integer flowType, List> variables) { Map 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 result; WxCoupon query = new WxCoupon(); query.updateTenantInfo(tenantEntity); - query.setId(businessId); + try { + query.setId(Long.parseLong(businessId)); + }catch(Exception e) { + query.setId(0L); + } List 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 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 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> 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 userMap = (Map)mapInfo.get("starter"); - Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); + String businessId = mapInfo.get("businessId").toString(); String email = (String)userMap.get("email"); List> 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 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 userMap = (Map)mapInfo.get("starter"); String email = (String) userMap.get("email"); @@ -1343,7 +1347,7 @@ public class WxFlowServiceImpl implements WxFlowService { List task = taskService.createTaskQuery().processInstanceId(processInstanceId).list(); Map 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> variables = (List)mapInfo.get("variables"); Date startDate = (Date)mapInfo.get("startDate"); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index d46c0ac54..edbdd9721 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -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 flowRecordList = wxFlowRecordService.findList(wxFlowRecord); if(!CollectionUtils.isEmpty(flowRecordList)){ diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index e091925f6..d40014b89 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -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 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 {