| @@ -65,7 +65,7 @@ public class WxPropertyContractController extends BaseController { | |||
| if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate()); | |||
| } | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName(), EnumFromType.OTHER.getCode()); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName()); | |||
| } | |||
| @PostMapping("updateRentStartTime") | |||
| @@ -83,7 +83,7 @@ public class WxPropertyContractController extends BaseController { | |||
| propertyContract.setTenantId(user.getTenantId()); | |||
| propertyContract.setAdjustPeriodHandle(); | |||
| propertyContract.setRentStartType(wxPropertyContract.getRentStartType()); | |||
| return wxPropertyContractService.saveOrUpdate(propertyContract, user.getId(), user.getName(),EnumFromType.SWITCH.getCode()); | |||
| return wxPropertyContractService.saveOrUpdate(propertyContract, user.getId(), user.getName()); | |||
| } | |||
| @@ -94,7 +94,8 @@ public class WxPropertyContractController extends BaseController { | |||
| MallUserInfo user = getUser(); | |||
| wxPropertyContract.setTenantId(user.getTenantId()); | |||
| wxPropertyContract.setAdjustPeriodHandle(); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName(),EnumFromType.OTHER.getCode()); | |||
| //第三步提交 SWITCH | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName()); | |||
| } | |||
| @GetMapping("/del") | |||
| @@ -36,7 +36,7 @@ public interface WxPropertyContractService { | |||
| * @param userId | |||
| * @return | |||
| */ | |||
| ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName,int from); | |||
| ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -492,9 +492,14 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| //设置当前节点代办人信息 | |||
| String[] assigneeArray = assignee.get("assignee").split(","); | |||
| String userName = ""; | |||
| for (String userid:assigneeArray) { | |||
| for (int j = 0; j < assigneeArray.length; j++) { | |||
| String userid = assigneeArray[j]; | |||
| MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); | |||
| userName += mallUserInfo.getName()+" "; | |||
| if(j != assigneeArray.length-1){ | |||
| userName += mallUserInfo.getName()+","; | |||
| }else{ | |||
| userName += mallUserInfo.getName()+""; | |||
| } | |||
| } | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setUserName(userName.trim()); | |||
| @@ -527,9 +532,10 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| }else{ | |||
| List<Task> taskList = taskService.createTaskQuery().processInstanceId(pi.getId()).list(); | |||
| //Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| WxFlowModel flowModelDb = getModelByType(flowType,tenantId); | |||
| WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue(flowModelDb.getFlow(),WxFlowModel.class); | |||
| Map<String,Object> mapInfo = taskService.getVariables(taskList.get(0).getId()); | |||
| //WxFlowModel flowModelDb = getModelByType(flowType,tenantId); | |||
| String flowJson = (String)mapInfo.get("taskAssignee"); | |||
| WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue(flowJson,WxFlowModel.class); | |||
| List<UserTaskVo> taskAssigneeList = flowModel.getLists(); | |||
| for (int i = 0; i < taskAssigneeList.size(); i++) { | |||
| UserTaskVo assignee = taskAssigneeList.get(i); | |||
| @@ -555,7 +561,14 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| for (FlowUserVo userVo:assignee.getUserList()) { | |||
| userName += userVo.getName()+" "; | |||
| } | |||
| for (int j = 0; j < assignee.getUserList().size(); j++) { | |||
| FlowUserVo userVo = assignee.getUserList().get(j); | |||
| if(j != assignee.getUserList().size() - 1){ | |||
| userName += userVo.getName()+","; | |||
| }else{ | |||
| userName += userVo.getName()+""; | |||
| } | |||
| } | |||
| wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setUserName(userName.trim()); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); | |||
| @@ -200,7 +200,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| @Override | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName,int from) { | |||
| public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { | |||
| // 保存调整金额(预账单调整) | |||
| boolean haspreview = false; | |||
| if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ | |||
| @@ -285,27 +285,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| message = "保存物业合同信息成功"; | |||
| } else {//更新物业合同信息 | |||
| WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(record.getId()); | |||
| if (wxPropertyContract == null) { | |||
| return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| if(from != 1){ | |||
| record.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||
| } | |||
| record.setRentalEndDate(wxRentContract.getRentalEndDate()); | |||
| record.setStartDate(wxRentContract.getStartDate()); | |||
| record.setEndDate(wxRentContract.getEndDate()); | |||
| record.setPrice(record.getPrice() != null ? record.getPrice() : 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit() : 0); | |||
| record.setUpdatetime(new Date()); | |||
| record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||
| try { | |||
| wxPropertyContractMapper.updateByPrimaryKeySelective(record); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业合同信息失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| //查询预账单用于展示 | |||
| WxBillProperty wxBillRent = new WxBillProperty(); | |||
| wxBillRent.setPropertyContractId(record.getId()); | |||
| @@ -320,15 +299,30 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| //删除预账单,重新生成 | |||
| wxBillPropertyMapper.deletePreviewBill(record); | |||
| //重新生成 | |||
| wxPropertyContract.setPrice(record.getPrice()); | |||
| wxPropertyContract.setDeposit(record.getDeposit()); | |||
| wxPropertyContract.setReceivePeriod(record.getReceivePeriod()); | |||
| wxPropertyContract.setPayAccount(record.getPayAccount()); | |||
| billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode()); | |||
| record.setPreviewBillRentList(billList); | |||
| } | |||
| } | |||
| WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(record.getId()); | |||
| if (wxPropertyContract == null) { | |||
| return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| record.setRentalStartDate(wxPropertyContract.getRentalStartDate()); | |||
| record.setRentalEndDate(wxRentContract.getRentalEndDate()); | |||
| record.setStartDate(wxRentContract.getStartDate()); | |||
| record.setEndDate(wxRentContract.getEndDate()); | |||
| record.setPrice(record.getPrice() != null ? record.getPrice() : 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit() : 0); | |||
| record.setUpdatetime(new Date()); | |||
| record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||
| try { | |||
| wxPropertyContractMapper.updateByPrimaryKeySelective(record); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业合同信息失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| message = "更新物业合同信息成功"; | |||
| } | |||
| @@ -433,7 +433,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| } | |||
| // 保存调整金额(预账单调整) | |||
| if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ | |||
| wxBillRentMapper.updateBills(record.getPreviewBillRentList()); | |||