| @@ -33,6 +33,9 @@ public class WxOrderQueryVo extends BaseEntity { | |||
| @Transient | |||
| private Integer orderStatus; | |||
| @Transient | |||
| private Date createDate; | |||
| @Override | |||
| public String getSortColumns() { | |||
| super.setSortColumns(this.sortColumns); | |||
| @@ -470,22 +470,28 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| } | |||
| msgReplaceMap.put("taskList", taskListHtml); | |||
| MailMsg mailMsg = new MailMsg(); | |||
| mailMsg.setSubject("待办通知"); | |||
| mailMsg.setHtml(true); | |||
| mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode()); | |||
| mailMsg.setModelType(EnumMailMsgModel.MAIL_ASSIGNEE_NODIFY.getCode()); | |||
| mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); | |||
| mailMsg.setTo(new String[]{email}); | |||
| mailMsg.setTenantId(tenantId); | |||
| if(1 == flowType.intValue() || 3 == flowType.intValue()){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(2 == flowType.intValue()){ | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| if(StringUtils.isBlank(email)){ | |||
| logger.info("phone:{},userName:{}邮件地址为空,不发送代办邮件",phone,userName); | |||
| }else{ | |||
| MailMsg mailMsg = new MailMsg(); | |||
| mailMsg.setSubject("待办通知"); | |||
| mailMsg.setHtml(true); | |||
| mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode()); | |||
| mailMsg.setModelType(EnumMailMsgModel.MAIL_ASSIGNEE_NODIFY.getCode()); | |||
| mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); | |||
| mailMsg.setTo(new String[]{email}); | |||
| mailMsg.setTenantId(tenantId); | |||
| if(1 == flowType.intValue() || 3 == flowType.intValue()){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(2 == flowType.intValue()){ | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| public String variablesToJson(List<Map<String,Object>> variables){ | |||
| @@ -765,6 +771,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| }else{ | |||
| logger.info("邮件地址为空,不发送审批通知邮件"); | |||
| } | |||
| return false; | |||
| }else{ | |||
| @@ -811,6 +819,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| }else{ | |||
| logger.info("邮件地址为空,不发送通过邮件"); | |||
| } | |||
| return true; | |||
| } | |||
| @@ -931,6 +941,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| }else{ | |||
| logger.info("邮件地址为空,不发送驳回邮件"); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @@ -95,10 +95,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| //init dateDiff | |||
| if(wxPropertyContract.getRentalStartDate() != null && wxPropertyContract.getRentalEndDate() != null){ | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxPropertyContract.getRentalEndDate()); | |||
| instance.add(Calendar.DATE, 1); | |||
| int[] array = DateUtils.getDiff(wxPropertyContract.getRentalStartDate(),instance.getTime()); | |||
| int[] array = DateUtils.getDiff(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate()); | |||
| result.put("totalPeriodMonth",array[0]); | |||
| result.put("totalPeriodDay",array[1]); | |||
| } | |||
| @@ -118,10 +118,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //init dateDiff | |||
| if(wxRentContract.getRentalStartDate() != null && wxRentContract.getRentalEndDate() != null){ | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxRentContract.getRentalEndDate()); | |||
| instance.add(Calendar.DATE, 1); | |||
| int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),instance.getTime()); | |||
| int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate()); | |||
| result.put("totalPeriodMonth",array[0]); | |||
| result.put("totalPeriodDay",array[1]); | |||
| } | |||
| @@ -381,8 +378,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| if(CollectionUtils.isEmpty(record.getPreviewBillRentList())) { | |||
| if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null | |||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) { | |||
| if (record.getReceivePeriod() != null && record.getLease() != null | |||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { | |||
| //删除预账单,重新生成 | |||
| wxBillRentMapper.deletePreviewBill(record); | |||
| resultList = buildRent(new WxMerchant(), null, record, EnumIsPreview.YES.getCode()); | |||
| @@ -659,6 +656,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| Long id = record.getId(); | |||
| //审核流程中止 | |||
| try { | |||
| // 修改合同审核状态 | |||
| WxRentContract rentContract = record; | |||
| rentContract.setId(id); | |||
| rentContract.setApplyStatus(EnumRentContractAppStatus.CANCLE.getCode()); | |||
| updateApplyStatus(rentContract); | |||
| logger.info("合同id:{},开始停止...", id); | |||
| //结束审批流 by luozukai | |||
| List<Task> tasks = taskService.createTaskQuery().processDefinitionKey(WxFlowServiceImpl.getFlowKeyByType(1)) | |||
| @@ -668,12 +671,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| logger.info("合同id:{},taskid:{}", id, task.getId()); | |||
| runtimeService.deleteProcessInstance(task.getProcessInstanceId(), "合同作废"); | |||
| // 修改合同审核状态 | |||
| WxRentContract rentContract = record; | |||
| rentContract.setId(id); | |||
| rentContract.setApplyStatus(EnumRentContractAppStatus.CANCLE.getCode()); | |||
| updateApplyStatus(rentContract); | |||
| // 保存审批历史入 | |||
| MallUserInfo mallUserInfo = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| WxFlowRecord updateRecord = new WxFlowRecord(); | |||
| @@ -316,7 +316,7 @@ | |||
| <select id="getWaitPayBill" resultType="hashmap"> | |||
| select bill.tenant_id tenantId,bill.merchant_id merchantId,bill.receive_date receiveDate, | |||
| select bill.tenant_id tenantId,bill.merchant_id merchantId,m.name merchantName,bill.receive_date receiveDate, | |||
| bill.need_pay needPay,m.link_phone linkPhone,app.appname,m.email,bill.bill_type billType from ( | |||
| select bill.bill_type,bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay from ( | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| @@ -579,7 +579,7 @@ | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,(need_pay-pay),DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| @@ -79,7 +79,9 @@ | |||
| </select> | |||
| <select id="queryBillPropertyList" parameterType="com.iformall.domain.po.WxBillProperty" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| select br.`id`,br.`receive_pay` receivePay, | |||
| case when br.status=1 then br.`pay` else 0 end pay | |||
| ,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay, | |||
| case when br.status=1 then br.owe else 0 end owe | |||
| ,br.`status`, | |||