| @@ -2,7 +2,9 @@ package com.iformall.controller; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxBillProperty; | |||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.service.WxBillPropertyService; | |||||
| import com.iformall.service.WxPropertyContractService; | import com.iformall.service.WxPropertyContractService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -20,10 +22,11 @@ import java.util.Map; | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxPropertyContract") | @RequestMapping("wxPropertyContract") | ||||
| public class WxPropertyContractController extends BaseController | |||||
| { | |||||
| public class WxPropertyContractController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxPropertyContractService wxPropertyContractService; | private WxPropertyContractService wxPropertyContractService; | ||||
| @Autowired | |||||
| private WxBillPropertyService wxBillPropertyService; | |||||
| private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | ||||
| @@ -67,6 +70,9 @@ public class WxPropertyContractController extends BaseController | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::findById"); | logger.debug("[" + getIpAddr() + "] WxPropertyContractController::findById"); | ||||
| WxBillProperty wxBillProperty = new WxBillProperty(); | |||||
| wxBillProperty.setTenantId(super.getTenantId()); | |||||
| wxBillPropertyService.updateBillStatus(wxBillProperty); | |||||
| return wxPropertyContractService.getById(id); | return wxPropertyContractService.getById(id); | ||||
| } | } | ||||
| @@ -2,7 +2,9 @@ package com.iformall.controller; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.service.WxBillRentService; | |||||
| import com.iformall.service.WxRentContractService; | import com.iformall.service.WxRentContractService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -25,6 +27,8 @@ public class WxRentContractController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxRentContractService wxRentContractService; | private WxRentContractService wxRentContractService; | ||||
| @Autowired | |||||
| private WxBillRentService wxBillRentService; | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -79,6 +83,10 @@ public class WxRentContractController extends BaseController { | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); | ||||
| // 同步欠缴状态 | |||||
| WxBillRent wxBillRent = new WxBillRent(); | |||||
| wxBillRent.setTenantId(super.getTenantId()); | |||||
| wxBillRentService.updateBillStatus(wxBillRent); | |||||
| return wxRentContractService.getById(id); | return wxRentContractService.getById(id); | ||||
| } | } | ||||
| @@ -3,7 +3,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -22,7 +22,7 @@ public interface WxBillDepositMapper extends CommonMapper<WxBillDeposit, Long> { | |||||
| void updateWaitPayStatus(Map<String,Object> params); | void updateWaitPayStatus(Map<String,Object> params); | ||||
| long queryOweCount(WxRentContract wxRentContract); | |||||
| } | } | ||||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -21,7 +22,7 @@ public interface WxBillPropertyDepositMapper extends CommonMapper<WxBillProperty | |||||
| void updateWaitPayStatus(Map<String,Object> params); | void updateWaitPayStatus(Map<String,Object> params); | ||||
| long queryOweCount(WxPropertyContract wxPropertyContract); | |||||
| } | } | ||||
| @@ -39,4 +39,6 @@ public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContrac | |||||
| void updateApplyStatus(WxPropertyContract wxPropertyContract); | void updateApplyStatus(WxPropertyContract wxPropertyContract); | ||||
| void updateStatus(WxPropertyContract wxPropertyContract); | void updateStatus(WxPropertyContract wxPropertyContract); | ||||
| long queryOweCount(WxPropertyContract wxPropertyContract); | |||||
| } | } | ||||
| @@ -42,4 +42,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Strin | |||||
| List<WxRentContract> getRentInvalidList(WxRentContract wxRentContract); | List<WxRentContract> getRentInvalidList(WxRentContract wxRentContract); | ||||
| void updateStatus(WxRentContract wxRentContract); | void updateStatus(WxRentContract wxRentContract); | ||||
| long queryOweCount(WxRentContract wxRentContract); | |||||
| } | } | ||||
| @@ -89,8 +89,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void updateBusinessStatus(Map<String, Object> mapInfo,Integer applyStatus){ | public void updateBusinessStatus(Map<String, Object> mapInfo,Integer applyStatus){ | ||||
| Long businessId = (Long)mapInfo.get("businessId"); | |||||
| Integer flowType = (Integer)mapInfo.get("businessType"); | |||||
| Long businessId = Long.parseLong((String)mapInfo.get("businessId")); | |||||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||||
| List<Map<String,String>> variables = (List)mapInfo.get("variables"); | List<Map<String,String>> variables = (List)mapInfo.get("variables"); | ||||
| Boolean supplement = (Boolean)mapInfo.get("supplement"); | Boolean supplement = (Boolean)mapInfo.get("supplement"); | ||||
| Integer contractType = 0; | Integer contractType = 0; | ||||
| @@ -137,7 +137,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| //终止租赁合同,同时终止物业合同 | //终止租赁合同,同时终止物业合同 | ||||
| String endProperty = getVariableByKey(variables,"endProperty"); | String endProperty = getVariableByKey(variables,"endProperty"); | ||||
| if("1".equals(endProperty)){ | |||||
| if("2".equals(endProperty)){ | |||||
| } | } | ||||
| // todo 账单失效 | // todo 账单失效 | ||||
| @@ -179,7 +179,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| MallUserInfo starterInfo = this.mallUserInfoService.getById(userId); | MallUserInfo starterInfo = this.mallUserInfoService.getById(userId); | ||||
| map.put("starter", starterInfo); | map.put("starter", starterInfo); | ||||
| map.put("startTime",new Date().getTime()); | map.put("startTime",new Date().getTime()); | ||||
| map.put("businessId",businessId); | |||||
| map.put("businessId",businessId+""); | |||||
| map.put("flowType",flowType); | map.put("flowType",flowType); | ||||
| map.put("taskAssignee",taskAssignee); | map.put("taskAssignee",taskAssignee); | ||||
| map.put("variables",variables); | map.put("variables",variables); | ||||
| @@ -188,6 +188,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); | ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); | ||||
| logger.debug("流程启动,流程id:{}",processInstance.getId()); | logger.debug("流程启动,流程id:{}",processInstance.getId()); | ||||
| params.put("flowType",flowType); | |||||
| updateBusinessStatus(params,EnumRentContractAppStatus.APPLYING.getCode()); | updateBusinessStatus(params,EnumRentContractAppStatus.APPLYING.getCode()); | ||||
| // 保存wx_flow_record表审批记录 | // 保存wx_flow_record表审批记录 | ||||
| @@ -369,7 +370,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| taskName = task.getName(); | taskName = task.getName(); | ||||
| taskKey = task.getTaskDefinitionKey(); | taskKey = task.getTaskDefinitionKey(); | ||||
| Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | ||||
| Long businessId = (Long)mapInfo.get("businessId"); | |||||
| Long businessId = Long.parseLong((String)mapInfo.get("businessId")); | |||||
| Integer flowType = (Integer)mapInfo.get("flowType"); | Integer flowType = (Integer)mapInfo.get("flowType"); | ||||
| taskService.complete(taskId); | taskService.complete(taskId); | ||||
| @@ -412,7 +413,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| wxMsgValidationcode.setTenantId(tenantId); | wxMsgValidationcode.setTenantId(tenantId); | ||||
| MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); | MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); | ||||
| List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); | List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); | ||||
| Long businessId = (Long)mapInfo.get("businessId"); | |||||
| Long businessId = Long.parseLong((String)mapInfo.get("businessId")); | |||||
| // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 | // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 | ||||
| if(!isEnded(processInstanceId)){ | if(!isEnded(processInstanceId)){ | ||||
| @@ -510,7 +511,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| // 修改合同审核状态为驳回 | // 修改合同审核状态为驳回 | ||||
| params.putAll(mapInfo); | params.putAll(mapInfo); | ||||
| params.put("businessType",flowType); | |||||
| updateBusinessStatus(params,EnumRentContractAppStatus.REJECT.getCode()); | updateBusinessStatus(params,EnumRentContractAppStatus.REJECT.getCode()); | ||||
| //保存wx_flow_record表审批记录 | //保存wx_flow_record表审批记录 | ||||
| @@ -568,7 +568,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| // 修改合同审核状态为撤回 | // 修改合同审核状态为撤回 | ||||
| params.putAll(mapInfo); | params.putAll(mapInfo); | ||||
| params.put("businessType",flowType); | |||||
| updateBusinessStatus(params,EnumRentContractAppStatus.SETBACK.getCode()); | updateBusinessStatus(params,EnumRentContractAppStatus.SETBACK.getCode()); | ||||
| //保存wx_flow_record表审批记录 | //保存wx_flow_record表审批记录 | ||||
| @@ -95,8 +95,18 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| } else { | } else { | ||||
| result.put("wxShops", Collections.EMPTY_LIST); | result.put("wxShops", Collections.EMPTY_LIST); | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "查询成功", result); | |||||
| //租赁费用欠缴 | |||||
| WxRentContract wxRentContract = new WxRentContract(); | |||||
| wxRentContract.setId(wxPropertyContract.getRentContractId()); | |||||
| result.put("rentOweCount",wxRentContractMapper.queryOweCount(wxRentContract)); | |||||
| //物业费用欠缴 | |||||
| WxPropertyContract propertyContract = new WxPropertyContract(); | |||||
| propertyContract.setId(id); | |||||
| result.put("propertyOweCount",wxPropertyContractMapper.queryOweCount(propertyContract)); | |||||
| //押金欠缴 | |||||
| result.put("depositOweCount",wxBillPropertyDepositMapper.queryOweCount(propertyContract)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", result); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -12,10 +12,7 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxFlowRecordService; | |||||
| import com.iformall.service.WxFlowService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.service.*; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.io.FileUtils; | import org.apache.commons.io.FileUtils; | ||||
| @@ -131,6 +128,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| //设置审批流程状态 | //设置审批流程状态 | ||||
| result.put("applyStatus", wxRentContract.getApplyStatus()); | result.put("applyStatus", wxRentContract.getApplyStatus()); | ||||
| //租赁费用欠缴 | |||||
| result.put("rentOweCount",wxRentContractMapper.queryOweCount(wxRentContract)); | |||||
| //物业费用欠缴 | |||||
| WxPropertyContract propertyContract = new WxPropertyContract(); | |||||
| propertyContract.setRentContractId(id); | |||||
| result.put("propertyOweCount",wxPropertyContractMapper.queryOweCount(propertyContract)); | |||||
| //押金欠缴 | |||||
| result.put("depositOweCount",wxBillDepositMapper.queryOweCount(wxRentContract)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", result); | return new ResultData(Result.SUCCESS, "查询成功", result); | ||||
| } | } | ||||
| @@ -105,7 +105,10 @@ | |||||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | ||||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | ||||
| </update> | </update> | ||||
| <select id="queryOweCount" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long"> | |||||
| select count(*) c from wx_rent_contract r,wx_bill_rent_deposit b | |||||
| where b.rent_contract_id = r.id and b.status = 1 and r.id = #{id} | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -103,8 +103,13 @@ | |||||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | ||||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | ||||
| </update> | </update> | ||||
| <select id="queryOweCount" parameterType="com.iformall.domain.po.WxPropertyContract" resultType="Long"> | |||||
| select count(*) from wx_property_contract r,wx_bill_property_deposit b | |||||
| where b.property_contract_id = r.id and b.status = 1 | |||||
| <if test=" null != id ">and r.id = #{id}</if> | |||||
| <if test=" null != rentContractId ">and r.rent_contract_id = #{rentContractId}</if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -187,4 +187,11 @@ | |||||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| update wx_property_contract set status=#{status} where id=#{id} | update wx_property_contract set status=#{status} where id=#{id} | ||||
| </update> | </update> | ||||
| <select id="queryOweCount" parameterType="com.iformall.domain.po.WxPropertyContract" resultType="Long"> | |||||
| select count(*) from wx_property_contract r,wx_bill_property b | |||||
| where b.property_contract_id = r.id and b.status = 1 | |||||
| <if test=" null != id ">and r.id = #{id}</if> | |||||
| <if test=" null != rentContractId ">and r.rent_contract_id = #{rentContractId}</if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -199,5 +199,9 @@ | |||||
| )s) and status=1 and status!=7 and tenant_id=#{tenantId} | )s) and status=1 and status!=7 and tenant_id=#{tenantId} | ||||
| </select> | </select> | ||||
| <select id="queryOweCount" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long"> | |||||
| select count(*) from wx_rent_contract r,wx_bill_rent b | |||||
| where b.rent_contract_id = r.id and b.status = 1 and r.id = #{id} | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||