diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java index 82e3acd96..a1dec55b3 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java @@ -2,7 +2,9 @@ package com.iformall.controller; import com.iformall.common.Result; import com.iformall.common.ResultData; +import com.iformall.domain.po.WxBillProperty; import com.iformall.domain.po.WxPropertyContract; +import com.iformall.service.WxBillPropertyService; import com.iformall.service.WxPropertyContractService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -20,10 +22,11 @@ import java.util.Map; */ @RestController @RequestMapping("wxPropertyContract") -public class WxPropertyContractController extends BaseController -{ +public class WxPropertyContractController extends BaseController { @Autowired private WxPropertyContractService wxPropertyContractService; + @Autowired + private WxBillPropertyService wxBillPropertyService; 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) public ResultData findById(Long id) { logger.debug("[" + getIpAddr() + "] WxPropertyContractController::findById"); + WxBillProperty wxBillProperty = new WxBillProperty(); + wxBillProperty.setTenantId(super.getTenantId()); + wxBillPropertyService.updateBillStatus(wxBillProperty); return wxPropertyContractService.getById(id); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxRentContractController.java index eb080c6bd..f5cb2e7ad 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxRentContractController.java @@ -2,7 +2,9 @@ package com.iformall.controller; import com.iformall.common.Result; import com.iformall.common.ResultData; +import com.iformall.domain.po.WxBillRent; import com.iformall.domain.po.WxRentContract; +import com.iformall.service.WxBillRentService; import com.iformall.service.WxRentContractService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -25,6 +27,8 @@ public class WxRentContractController extends BaseController { @Autowired private WxRentContractService wxRentContractService; + @Autowired + private WxBillRentService wxBillRentService; @GetMapping("list") @ApiImplicitParams({ @@ -79,6 +83,10 @@ public class WxRentContractController extends BaseController { @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData findById(Long id) { logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); + // 同步欠缴状态 + WxBillRent wxBillRent = new WxBillRent(); + wxBillRent.setTenantId(super.getTenantId()); + wxBillRentService.updateBillStatus(wxBillRent); return wxRentContractService.getById(id); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java index 53a706a99..a9280dbf0 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java @@ -3,7 +3,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxBillDeposit; - +import com.iformall.domain.po.WxRentContract; import java.util.List; import java.util.Map; @@ -22,7 +22,7 @@ public interface WxBillDepositMapper extends CommonMapper { void updateWaitPayStatus(Map params); - + long queryOweCount(WxRentContract wxRentContract); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java index 6caf665e1..37442397e 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java @@ -2,6 +2,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxBillPropertyDeposit; +import com.iformall.domain.po.WxPropertyContract; import java.util.List; import java.util.Map; @@ -21,7 +22,7 @@ public interface WxBillPropertyDepositMapper extends CommonMapper params); - + long queryOweCount(WxPropertyContract wxPropertyContract); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java index cc0efd48a..3be0985d3 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java @@ -39,4 +39,6 @@ public interface WxPropertyContractMapper extends CommonMapper getRentInvalidList(WxRentContract wxRentContract); void updateStatus(WxRentContract wxRentContract); + + long queryOweCount(WxRentContract wxRentContract); } 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 15f463187..6ce7e1a8f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -89,8 +89,8 @@ public class WxFlowServiceImpl implements WxFlowService { */ @Override public void updateBusinessStatus(Map 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> variables = (List)mapInfo.get("variables"); Boolean supplement = (Boolean)mapInfo.get("supplement"); Integer contractType = 0; @@ -137,7 +137,7 @@ public class WxFlowServiceImpl implements WxFlowService { //终止租赁合同,同时终止物业合同 String endProperty = getVariableByKey(variables,"endProperty"); - if("1".equals(endProperty)){ + if("2".equals(endProperty)){ } // todo 账单失效 @@ -179,7 +179,7 @@ public class WxFlowServiceImpl implements WxFlowService { MallUserInfo starterInfo = this.mallUserInfoService.getById(userId); map.put("starter", starterInfo); map.put("startTime",new Date().getTime()); - map.put("businessId",businessId); + map.put("businessId",businessId+""); map.put("flowType",flowType); map.put("taskAssignee",taskAssignee); map.put("variables",variables); @@ -188,6 +188,7 @@ public class WxFlowServiceImpl implements WxFlowService { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); logger.debug("流程启动,流程id:{}",processInstance.getId()); + params.put("flowType",flowType); updateBusinessStatus(params,EnumRentContractAppStatus.APPLYING.getCode()); // 保存wx_flow_record表审批记录 @@ -369,7 +370,7 @@ public class WxFlowServiceImpl implements WxFlowService { taskName = task.getName(); taskKey = task.getTaskDefinitionKey(); Map 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"); taskService.complete(taskId); @@ -412,7 +413,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgValidationcode.setTenantId(tenantId); MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); - Long businessId = (Long)mapInfo.get("businessId"); + Long businessId = Long.parseLong((String)mapInfo.get("businessId")); // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 if(!isEnded(processInstanceId)){ @@ -510,7 +511,6 @@ public class WxFlowServiceImpl implements WxFlowService { // 修改合同审核状态为驳回 params.putAll(mapInfo); - params.put("businessType",flowType); updateBusinessStatus(params,EnumRentContractAppStatus.REJECT.getCode()); //保存wx_flow_record表审批记录 @@ -568,7 +568,6 @@ public class WxFlowServiceImpl implements WxFlowService { // 修改合同审核状态为撤回 params.putAll(mapInfo); - params.put("businessType",flowType); updateBusinessStatus(params,EnumRentContractAppStatus.SETBACK.getCode()); //保存wx_flow_record表审批记录 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 5d34f2632..ab022be92 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -95,8 +95,18 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } else { 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 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 517c742a5..d0e0634f3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -12,10 +12,7 @@ import com.iformall.domain.po.*; import com.iformall.enums.*; import com.iformall.exception.MallinkException; 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.DateUtils; import org.apache.commons.io.FileUtils; @@ -131,6 +128,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { } //设置审批流程状态 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); } diff --git a/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml b/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml index 1b6ecda36..93d064566 100644 --- a/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml @@ -105,7 +105,10 @@ 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) - - + + diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml index 2feba0bb6..c5d2c4408 100644 --- a/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml @@ -103,8 +103,13 @@ 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) - - - + + + diff --git a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml index 2f3886ddc..928418840 100644 --- a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml @@ -187,4 +187,11 @@ update wx_property_contract set status=#{status} where id=#{id} + + diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index e275785ee..f446f4661 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -199,5 +199,9 @@ )s) and status=1 and status!=7 and tenant_id=#{tenantId} +