Browse Source

update

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
e5a580cdf9
22 changed files with 399 additions and 395 deletions
  1. +26
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java
  2. +11
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  3. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractExtensionController.java
  4. +12
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  5. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractExtensionController.java
  6. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java
  7. +3
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  8. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  9. +3
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumRentContractStatus.java
  10. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java
  11. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java
  12. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  13. +10
    -8
      mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java
  14. +16
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java
  15. +29
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  16. +13
    -9
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  17. +133
    -122
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  18. +96
    -205
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  19. +12
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  20. +9
    -7
      mallinkService/src/main/java/com/iformall/service/invest/event/InvestListener.java
  21. +5
    -5
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java
  22. +7
    -0
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml

+ 26
- 0
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java View File

@@ -0,0 +1,26 @@
package com.iformall.controller.contract;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.RestController;

import com.iformall.controller.base.BaseController;
import com.iformall.enums.EnumFlowContractType;
import com.iformall.enums.EnumFlowKey;

@RestController
public class WxContractBaseController extends BaseController{

protected Map<String,Object> generateFlowParams(EnumFlowKey flowType,EnumFlowContractType contractType,String remark,Long contractId) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("businessType", flowType.getCode());
map.put("remark", remark);
map.put("businessId", String.valueOf(contractId));
Map variables = new HashMap<String,Object>();
variables.put("contractType",contractType.getCode());
variables.put("contractNumber", String.valueOf(contractId));
map.put("variables", variables);
return map;
}
}

+ 11
- 1
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java View File

@@ -10,6 +10,8 @@ import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.enums.EnumContractType;
import com.iformall.enums.EnumFlowContractType;
import com.iformall.enums.EnumFlowKey;
import com.iformall.enums.EnumIsPreview;
import com.iformall.enums.EnumRentStartType;
import com.iformall.exception.MallinkException;
@@ -34,7 +36,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping("wxPropertyContract")
public class WxPropertyContractController extends BaseController {
public class WxPropertyContractController extends WxContractBaseController {
private Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
@@ -208,4 +210,12 @@ public class WxPropertyContractController extends BaseController {
List<WxBillProperty> result = wxPropertyContractService.buildProperty(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false);
return new ResultData(result);
}
@PostMapping("apply")
@SystemControllerLog(description = "物业合同-提交审批")
public ResultData apply(@RequestBody WxPropertyContract wxPropertyContract) {
MallUserInfo user = getUser();
wxPropertyContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_PRO_CONTRACT, EnumFlowContractType.PROPERTY, wxPropertyContract.getRemark(), wxPropertyContract.getId()));
return wxPropertyContractService.apply(wxPropertyContract, user);
}
}

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractExtensionController.java View File

@@ -31,7 +31,7 @@ import java.util.Map;
@RestController
@Api(description = "物业合同续签")
@RequestMapping("wxPropertyContractExtension")
public class WxPropertyContractExtensionController extends BaseController {
public class WxPropertyContractExtensionController extends WxContractBaseController {

@Autowired
private WxPropertyContractService wxPropertyContractService;


+ 12
- 2
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java View File

@@ -8,6 +8,8 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.*;
import com.iformall.enums.EnumContractType;
import com.iformall.enums.EnumFlowContractType;
import com.iformall.enums.EnumFlowKey;
import com.iformall.enums.EnumFromType;
import com.iformall.enums.EnumIsPreview;
import com.iformall.enums.EnumRentStartType;
@@ -38,7 +40,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping("wxRentContract")
public class WxRentContractController extends BaseController {
public class WxRentContractController extends WxContractBaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
@@ -138,7 +140,7 @@ public class WxRentContractController extends BaseController {
wxRentContract.setBusDiscountTime(new Integer(0));
}
WxMerchant wxMerchant = new WxMerchant();
wxMerchant.setName(wxRentContract.getMerchantName());
//wxMerchant.setName(wxRentContract.getMerchantName());
wxMerchant.setId(wxRentContract.getMerchantId());
if (wxMerchantService.hasMerchant(wxMerchant)) {
return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND);
@@ -400,6 +402,14 @@ public class WxRentContractController extends BaseController {
return wxRentContractService.getContractByContractNumber(wxRentContract);
}

@PostMapping("apply")
@SystemControllerLog(description = "租赁合同-提交审批")
public ResultData apply(@ModelAttribute WxRentContract wxRentContract) {
MallUserInfo user = getUser();
wxRentContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT, wxRentContract.getRemark(), wxRentContract.getId()));
return wxRentContractService.apply(wxRentContract,user);
}
}



+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractExtensionController.java View File

@@ -37,7 +37,7 @@ import java.util.Map;
@RestController
@Api(description = "租赁合同续签")
@RequestMapping("wxRentContractExtension")
public class WxRentContractExtensionController extends BaseController {
public class WxRentContractExtensionController extends WxContractBaseController {


@Autowired


+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java View File

@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
*/
@RestController
@RequestMapping("wxRentPropertyContract")
public class WxRentPropertyContractController extends BaseController {
public class WxRentPropertyContractController extends WxContractBaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired


+ 3
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java View File

@@ -180,7 +180,9 @@ public class WxPropertyContract extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "年租金调整方式1按比例2按金额", name = "adjust_ratio_way")
private Integer adjustRatioWay;


@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value = "审批备注", name = "remark")
private String remark;

// public Integer getAdjustPeriod() {


+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java View File

@@ -190,6 +190,10 @@ public class WxRentContract extends TenantEntity {
@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value = "物业合同预账单列表", name = "reviewBillPropertyPList")
private List<WxBillProperty> reviewBillPropertyPList;
@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value = "审批说明", name = "remark")
private String remark;

@io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo")
private String rentInfo;


+ 3
- 1
mallinkService/src/main/java/com/iformall/enums/EnumRentContractStatus.java View File

@@ -12,7 +12,9 @@ public enum EnumRentContractStatus {
READY_FOR_PAING(13,"已签约未计租"),
TERMINATE(14,"提前终止"),
OUT_DATE(15,"正常到期"),
INVALID(16,"作废")
INVALID(16,"作废"),
PERFORMANCE(17,"履约中(审批中)"),
// INTENTION(0, "意向"),


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java View File

@@ -41,6 +41,8 @@ public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContrac
List<WxRentContract> getRentContractListByPoint(Map<String, Object> params);

void updateApplyStatus(WxPropertyContract wxPropertyContract);
void updateApplyStatusByRentContractId(WxPropertyContract wxPropertyContract);

void updateStatus(WxPropertyContract wxPropertyContract);



+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java View File

@@ -1,6 +1,7 @@
package com.iformall.service;

import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxMerchant;
@@ -79,5 +80,7 @@ public interface WxPropertyContractService {
WxPropertyContract getByBill(WxBillProperty billRent);

Object getMerchantList(WxPropertyContract record);
ResultData apply(WxPropertyContract wxPropertyContract,MallUserInfo user);

}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java View File

@@ -112,4 +112,6 @@ public interface WxRentContractService {
ResultData extensionUpdate(WxRentContract record, Long userId,String userName,int from,Date oldRentStartDate);

ResultData extensionUpdateFile(WxRentContract wxRentContract, Long userId,String userName,Date oldRentStartDate);
ResultData apply(WxRentContract wxRentContract,MallUserInfo user);
}

+ 10
- 8
mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java View File

@@ -290,22 +290,24 @@ public class DataTowerServiceImpl implements DataTowerService {
wxRentContract.updateTenantInfo(tenantEntity);

//待签约
wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
int waitSignCount = wxRentContractMapper.queryRentContractWaitSignStatus(wxRentContract);
contractMap.put("waitSignCount", waitSignCount);
//wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
//int waitSignCount = wxRentContractMapper.queryRentContractWaitSignStatus(wxRentContract);
//contractMap.put("waitSignCount", waitSignCount);
contractMap.put("waitSignCount", 0);

//计租中
wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode());
wxRentContract.setStatus(EnumRentContractStatus.PAING.getCode());
int rendPaidCount = wxRentContractMapper.queryRentContractPaidStatus(wxRentContract);
contractMap.put("rendPaidCount", rendPaidCount);

//将到期
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
int endSoonCount = wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract);
contractMap.put("endSoonCount", endSoonCount);
//wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
//int endSoonCount = wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract);
//contractMap.put("endSoonCount", endSoonCount);
contractMap.put("endSoonCount", 0);

//到期
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode());
wxRentContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode());
int endCount = wxRentContractMapper.queryRentContractEndStatus(wxRentContract);
contractMap.put("endCount", endCount);



+ 16
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java View File

@@ -86,11 +86,14 @@ public class WxBusinessServiceImpl implements WxBusinessService {
query.updateTenantInfo(wxBusiness.getTenantInfo());
List<WxRentContract> rentContractList = wxRentContractMapper.selectList(new QueryWrapper<>(query));
for (WxRentContract dbRent : rentContractList) {
if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
// if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
if (dbRent.getStatus().equals(EnumRentContractStatus.OUT_DATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.TERMINATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
logger.warn("rent rentInfo is null-1: " + dbRent.getId());
continue;
}
@@ -109,11 +112,14 @@ public class WxBusinessServiceImpl implements WxBusinessService {
pquery.updateTenantInfo(wxBusiness.getTenantInfo());
List<WxPropertyContract> propertyContractList = wxPropertyContractMapper.selectList(new QueryWrapper<>(pquery));
for (WxPropertyContract dbRent : propertyContractList) {
if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
// if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
// dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
if (dbRent.getStatus().equals(EnumRentContractStatus.OUT_DATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.TERMINATE.getCode()) ||
dbRent.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
logger.warn("property rentInfo is null-2:" + dbRent.getId());
continue;
}


+ 29
- 15
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java View File

@@ -179,37 +179,51 @@ public class WxFlowServiceImpl implements WxFlowService {
EnumFlowContractType.RENT_POINT.getCode().equals(contractType) ||
EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType) ||
EnumFlowContractType.WHOLE_POINT.getCode().equals(contractType)) {
WxRentContract rent = new WxRentContract();
rent.setId(businessId);
rent.setApplyStatus(applyStatus);
rent.setBusinessType(flowType);
wxRentContractService.updateApplyStatus(rent);

WxRentContract record = wxRentContractMapper.selectById(businessId);
//合并的合同-审批时 物业合同的状态肯定不在 签约中 避免更新物业合同时提示店铺存在
if(record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())){
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.setRentContractId(record.getId());
wxPropertyContract.setStatus(EnumRentContractStatus.INTENTION.getCode());
wxPropertyContractMapper.updateStatusByRentContractId(wxPropertyContract);
//wxPropertyContract.setStatus(EnumRentContractStatus.INTENTION.getCode());
wxPropertyContract.setApplyStatus(applyStatus);
wxPropertyContract.setBusinessType(flowType);
//wxPropertyContractMapper.updateStatusByRentContractId(wxPropertyContract);
wxPropertyContractMapper.updateApplyStatusByRentContractId(wxPropertyContract);
}

//如果审批完成,而且是补录直接改为已签约状态(普通需要绑定商户才是已签约)
if(record != null && record.getMerchantId()!=null && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxRentContractService.updateRentContractStatus(businessId);
}
//如果是提交审批 , 审批驳回状态不变
if (EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) {
rent.setStatus(EnumRentContractStatus.PERFORMANCE.getCode());
//如果审批完成
}else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxRentContractService.updateRentContractStatus(businessId);
return;
}
wxRentContractService.updateApplyStatus(rent);

}else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.setId(businessId);
wxPropertyContract.setApplyStatus(applyStatus);
wxPropertyContract.setBusinessType(flowType);
wxPropertyContractMapper.updateApplyStatus(wxPropertyContract);

// 审批完成,物业合同的合同状态需要和租赁合同同步(一致)
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxPropertyContractService.updatePropertyContractStatus(businessId);
//如果是提交审批
if (EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) {
wxPropertyContract.setStatus(EnumRentContractStatus.PERFORMANCE.getCode());
// 审批完成
}else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxPropertyContractService.updatePropertyContractStatus(businessId);
return;
}
wxPropertyContractMapper.updateApplyStatus(wxPropertyContract);
}
}else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType)
|| EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)
@@ -230,7 +244,7 @@ public class WxFlowServiceImpl implements WxFlowService {
rent.setBusinessType(flowType);

if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
rent.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
rent.setStatus(EnumRentContractStatus.TERMINATE.getCode());

//终止租赁合同,同时终止物业合同
Integer endProperty = getIngeter(getVariableByKey(variables,"endProperty"));
@@ -245,7 +259,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxPropertyContract.setBusinessType(flowType);

if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());

//账单失效
wxPropertyContractService.endContract(wxPropertyContract);


+ 13
- 9
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java View File

@@ -258,16 +258,20 @@ public class WxMerchantServiceImpl implements WxMerchantService {
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setMerchantId(id);
long countRentContract = wxRentContractMapper.selectList(new QueryWrapper<>(wxRentContract)).parallelStream().
filter(c -> c.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
c.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// filter(c -> c.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
// c.getStatus().equals(EnumRentContractStatus.PAING.getCode()) ||
// c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
filter(c -> c.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
c.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
//是否有物业合同
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.setMerchantId(id);
long countPropertyContract = wxPropertyContractMapper.selectList(new QueryWrapper<>(wxPropertyContract)).parallelStream().
filter(c -> c.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
c.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// filter(c -> c.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
// c.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
// c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
filter(c -> c.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
c.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
//解绑商铺-没有租赁合同或物业合同才可以
if (countRentContract == 0 || countPropertyContract == 0) {
WxMerchantShop wxMerchantShopQuery = new WxMerchantShop();
@@ -384,15 +388,15 @@ public class WxMerchantServiceImpl implements WxMerchantService {
if (wxRentContract == null) {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND);
}
if (wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE)) {
if (wxRentContract.getStatus().equals(EnumRentContractStatus.TERMINATE)) {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED);
}
wxRentContract.setMerchantId(merchantId);
wxRentContract.setUpdatetime(new Date());
if (wxRentContract.getRentalStartDate().before(new Date())) {
wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode());
wxRentContract.setStatus(EnumRentContractStatus.PAING.getCode());
} else {
wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode());
wxRentContract.setStatus(EnumRentContractStatus.READY_FOR_PAING.getCode());
}
wxRentContractMapper.updateById(wxRentContract);



+ 133
- 122
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -270,8 +270,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

WxRentContract wxRentContract = wxRentContractMapper.selectById(record.getRentContractId());
if (wxRentContract != null) {
if (wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
if (wxRentContract.getStatus().equals(EnumRentContractStatus.OUT_DATE.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.TERMINATE.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED);
}
@@ -307,9 +307,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
propertyContract.updateTenantInfo(wxRentContract);
propertyContract.setRentContractId(record.getRentContractId());
long count = wxPropertyContractMapper.findList(propertyContract)
.stream().filter(p -> p.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
p.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
p.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// .stream().filter(p -> p.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
// p.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
// p.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
.stream().filter(p -> p.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
p.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
if (count > 1) {
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND);
}
@@ -335,11 +337,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
Date date = new Date();
record.setCreatetime(date);
record.setUpdatetime(date);
if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
record.setStatus(EnumRentContractStatus.INTENTION.getCode());
} else {
record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
}
record.setStatus(EnumRentContractStatus.DRAFT.getCode());
// if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
// record.setStatus(EnumRentContractStatus.INTENTION.getCode());
// } else {
// record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
// }
record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
try {
wxPropertyContractMapper.insert(record);
@@ -389,9 +392,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
record.setUpdatetime(new Date());

//如果是合并合同 物业合同的状态为 意向
if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
record.setStatus(EnumRentContractStatus.INTENTION.getCode());
}
record.setStatus(EnumRentContractStatus.DRAFT.getCode());
// if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
// record.setStatus(EnumRentContractStatus.INTENTION.getCode());
// }

if (CollectionUtils.isEmpty(record.getFlowParams())) {
hasFlow = false;
@@ -407,50 +411,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
message = "更新物业合同信息成功";
}

if (hasFlow) {
if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null) {
updatePropertyContractStatus(record.getId());
} else {
record.getFlowParams().put("businessId", record.getId().toString());
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxPropertyContract updateRentContract = new WxPropertyContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
wxPropertyContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功", record.getId().toString());
}
} else {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
wxRentContractService.updateRentContractStatus(record.getId());
} else {
record.getFlowParams().put("businessId", record.getRentContractId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getRentContractId());
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
if(wxRentContract.getStatus().equals(EnumRentContractStatus.SUPPLE.getCode())){
updateRentContract.setStatus(EnumRentContractStatus.SUPPLE.getCode());
}
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功,是否补录:{}", record.getRentContractId().toString(), record.getMerchantId() != null);
}
}
}else{
//审批状态重置
WxPropertyContract updateRentContract = new WxPropertyContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
wxPropertyContractMapper.updateById(updateRentContract);
}
111111111111111

return new ResultData(Result.SUCCESS, message, record);
}
@@ -471,9 +432,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

WxRentContract wxRentContract = wxRentContractMapper.selectById(record.getRentContractId());
if (wxRentContract != null) {
if (wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
// if (wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_END.getCode()) ||
// wxRentContract.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) ||
// wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
if (wxRentContract.getStatus().equals(EnumRentContractStatus.OUT_DATE.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.TERMINATE.getCode()) ||
wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED);
}
} else {
@@ -508,9 +472,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
propertyContract.updateTenantInfo(wxRentContract);
propertyContract.setRentContractId(record.getRentContractId());
long count = wxPropertyContractMapper.findList(propertyContract)
.stream().filter(p -> p.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
p.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
p.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// .stream().filter(p -> p.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
// p.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
// p.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
.stream().filter(p -> p.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
p.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
if (count > 1) {
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND);
}
@@ -604,47 +570,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
message = "更新物业合同信息成功";
}

if (hasFlow) {
if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null) {
updatePropertyContractStatus(record.getId());
} else {
record.getFlowParams().put("businessId", record.getId().toString());
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxPropertyContract updateRentContract = new WxPropertyContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.EXTENSION.getCode());
wxPropertyContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功", record.getId().toString());
}
} else {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
wxRentContractService.updateRentContractStatus(record.getId());
} else {
record.getFlowParams().put("businessId", record.getRentContractId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getRentContractId());
updateRentContract.setStatus(EnumRentContractStatus.EXTENSION.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功,是否补录:{}", record.getRentContractId().toString(), record.getMerchantId() != null);
}
}
}else{
//审批状态重置
WxPropertyContract updateRentContract = new WxPropertyContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
wxPropertyContractMapper.updateById(updateRentContract);
}
22222222222222222222222222222

return new ResultData(Result.SUCCESS, message, record);
}
@@ -659,9 +585,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.setId(id);
if (record.getRentalStartDate().before(new Date())) {
wxPropertyContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.PAING.getCode());
} else {
wxPropertyContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.READY_FOR_PAING.getCode());
}
wxPropertyContractMapper.updateById(wxPropertyContract);
//建立账单
@@ -1151,7 +1077,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
if (wxPropertyContract == null) {
return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND);
}
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
try {
wxPropertyContract.setUpdatetime(new Date());
wxPropertyContractMapper.updateById(wxPropertyContract);
@@ -1187,7 +1113,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
Map<String, Object> contractMap = contractData.get(0);
WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectById((Long) contractMap.get("id"));
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
try {
wxPropertyContractMapper.updateById(wxPropertyContract);
} catch (MallinkException e) {
@@ -1214,9 +1140,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
List<WxPropertyContract> select = wxPropertyContractMapper.selectList(new QueryWrapper(wxPropertyContract));
if (select.size() > 0) {
long count = select.stream().filter(propertyContract -> propertyContract.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
propertyContract.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
propertyContract.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// long count = select.stream().filter(propertyContract -> propertyContract.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) ||
// propertyContract.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) ||
// propertyContract.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
long count = select.stream().filter(propertyContract -> propertyContract.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) ||
propertyContract.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
if (count > 0) {
return new ResultData(true);
}
@@ -1240,25 +1169,25 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxPropertyContractMapper.updateRentInvalidStatus(wxPropertyContract);

//待签约
wxPropertyContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
wxPropertyContractMapper.updateRentWaitSignStatus(wxPropertyContract);
int waitSignCount = wxPropertyContractMapper.queryRentContractWaitSignStatus(wxPropertyContract);
resultData.put("waitSignCount", waitSignCount);
//wxPropertyContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
//wxPropertyContractMapper.updateRentWaitSignStatus(wxPropertyContract);
//int waitSignCount = wxPropertyContractMapper.queryRentContractWaitSignStatus(wxPropertyContract);
resultData.put("waitSignCount", 0);

//计租中
wxPropertyContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.PAING.getCode());
wxPropertyContractMapper.updateRentContractPaidStatus(wxPropertyContract);
int rendPaidCount = wxPropertyContractMapper.queryRentContractPaidStatus(wxPropertyContract);
resultData.put("rendPaidCount", rendPaidCount);

//将到期
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
wxPropertyContractMapper.updateRentContractEndSoonStatus(wxPropertyContract);
int endSoonCount = wxPropertyContractMapper.queryRentContractEndSoonStatus(wxPropertyContract);
resultData.put("endSoonCount", endSoonCount);
//wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
//wxPropertyContractMapper.updateRentContractEndSoonStatus(wxPropertyContract);
//int endSoonCount = wxPropertyContractMapper.queryRentContractEndSoonStatus(wxPropertyContract);
resultData.put("endSoonCount", 0);

//到期
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode());
int endCount = wxPropertyContractMapper.queryRentContractEndStatus(wxPropertyContract);
wxPropertyContractMapper.updateRentContractEndStatus(wxPropertyContract);
resultData.put("endCount", endCount);
@@ -1336,7 +1265,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

@Override
public void endContract(WxPropertyContract wxPropertyContract) {
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
wxPropertyContractMapper.updateStatus(wxPropertyContract);

WxBillProperty wxBillProperty = new WxBillProperty();
@@ -1353,6 +1282,88 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
public Object getMerchantList(WxPropertyContract record) {
return wxPropertyContractMapper.getMerchantList(record);
}

@Override
public ResultData apply(WxPropertyContract record, MallUserInfo user) {
WxPropertyContract rentContract = wxPropertyContractMapper.selectById(record.getId());
if (null == rentContract) {
return new ResultData(Result.ERROR, "编号["+record.getId()+"]未找到物业合同");
}
rentContract.setFlowParams(record.getFlowParams());
if (CollectionUtils.isEmpty(rentContract.getFlowParams())) {
return new ResultData(Result.ERROR, "编号["+record.getId()+"]租金合同没有审批流程.");
}
if (rentContract.getMerchantId() == null) {
return new ResultData(Result.ERROR, "编号["+record.getId()+"]租金合同没有绑定商户.");
}
if ((EnumRentContractStatus.DRAFT.getCode().intValue() == rentContract.getStatus().intValue()
&& EnumRentContractAppStatus.DEFAULT.getCode().intValue() == rentContract.getApplyStatus().intValue())
|| (EnumRentContractStatus.PERFORMANCE.getCode().intValue() == rentContract.getStatus().intValue()
&& EnumRentContractAppStatus.REJECT.getCode().intValue() == rentContract.getApplyStatus().intValue())
) {
Integer bussinessType = (Integer) rentContract.getFlowParams().get("businessType");
if (null == bussinessType) {
return new ResultData(Result.ERROR, "编号["+record.getId()+"]租金合同FlowParams错误,未找到businessType.");
}
WxFlowModel flowModle = wxFlowService.getModelByType(bussinessType, rentContract);
if (null == flowModle) {
return new ResultData(Result.ERROR, "编号["+record.getId()+"]租金合同配置的流程["+String.valueOf(bussinessType)+"]未找到流程模板.");
}
//
//
//
// if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) {
// if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null) {
// updatePropertyContractStatus(record.getId());
// } else {
// record.getFlowParams().put("businessId", record.getId().toString());
// wxFlowService.start(record.getFlowParams(), userId, userName, record);
//
// // 合同状态改成待签约
// WxPropertyContract updateRentContract = new WxPropertyContract();
// updateRentContract.setId(record.getId());
// updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
// wxPropertyContractMapper.updateStatus(updateRentContract);
// logger.info("id:{},启动审批流成功", record.getId().toString());
// }
// } else {
// if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
// && record.getMerchantId() != null) {
// wxRentContractService.updateRentContractStatus(record.getId());
// } else {
// record.getFlowParams().put("businessId", record.getRentContractId().toString());
// if (record.getMerchantId() != null) {
// record.getFlowParams().put("supplement", true); //设置补录
// }
// wxFlowService.start(record.getFlowParams(), userId, userName, record);
//
// // 合同状态改成待签约
// WxRentContract updateRentContract = new WxRentContract();
// updateRentContract.setId(record.getRentContractId());
// updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
// if(wxRentContract.getStatus().equals(EnumRentContractStatus.SUPPLE.getCode())){
// updateRentContract.setStatus(EnumRentContractStatus.SUPPLE.getCode());
// }
// wxRentContractMapper.updateStatus(updateRentContract);
// logger.info("id:{},启动审批流成功,是否补录:{}", record.getRentContractId().toString(), record.getMerchantId() != null);
// }
// }
rentContract.getFlowParams().put("businessId", rentContract.getId().toString());
wxFlowService.start(rentContract.getFlowParams(), user.getId(), user.getName(), rentContract);
return new ResultData(Result.SUCCESS,"提交审批成功",rentContract);
}else {
return new ResultData(Result.ERROR, "编号["+record.getId()+"]租金合同状态不能提交审批.允许提交的状态为 [草稿+未提交审批],[履约中+审批驳回]");
}
}
}




+ 96
- 205
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -478,10 +478,15 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.updateTenantInfo(record);
wxRentContract.setShopId(record.getShopId());
// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
// filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode())
// || rc.get("status").equals(EnumRentContractStatus.PAING.getCode())
// || rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
filter(rc -> rc.get("status").equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode())
|| rc.get("status").equals(EnumRentContractStatus.RENT_PAID.getCode())
|| rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode())
|| rc.get("status").equals(EnumRentContractStatus.PAING.getCode())).count();
if (count > 0) {
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND);
}
@@ -500,33 +505,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}

//有模板,启动审批流,没有,直接生产账单
if (!CollectionUtils.isEmpty(record.getFlowParams())){
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
updateRentContractStatus(record.getId());
}else{
record.getFlowParams().put("businessId", record.getId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功, 是否补录:{}", record.getId().toString(), record.getMerchantId() != null);
}
}else{
//审批状态重置
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
updateApplyStatus(updateRentContract);
}

//生成预览账单(补录第二步,第三步走编辑)
if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null
&& !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) {
@@ -537,6 +515,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}

EventUtil.publistRentEvent(this, record);
return new ResultData(Result.SUCCESS, "保存租赁合同信息成功", record);
}

@@ -589,34 +568,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
}

//有模板,启动审批流,没有,直接生产账单
if (!CollectionUtils.isEmpty(record.getFlowParams())) {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
updateRentContractStatus(record.getId());
}else{
//补录
record.getFlowParams().put("businessId", record.getId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

//合同状态改成补录状态
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.SUPPLE.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功 ,是否补录:{}", record.getId().toString(), record.getMerchantId() != null);
}
}else{
//审批状态重置
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
updateApplyStatus(updateRentContract);
}

//保存调整金额(预账单调整)
savePreviewBill(record);

@@ -759,10 +710,13 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxRentContract wxRentContractQuery = new WxRentContract();
wxRentContractQuery.updateTenantInfo(record);
wxRentContractQuery.setShopId(record.getShopId());
long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
filter(rc -> rc.get("status").equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode())
|| rc.get("status").equals(EnumRentContractStatus.RENT_PAID.getCode())
|| rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
// filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode())
// || rc.get("status").equals(EnumRentContractStatus.PAING.getCode())
// || rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode())
|| rc.get("status").equals(EnumRentContractStatus.PAING.getCode())).count();
if (count > 0) {
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND);
}
@@ -1532,7 +1486,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if (wxRentContract == null) {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND);
}
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxRentContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
try {
wxRentContract.setUpdatetime(new Date());
wxRentContractMapper.updateById(wxRentContract);
@@ -1549,7 +1503,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
Long propertyContractId = (Long) propertyContract.get("id");
if (propertyContract != null && propertyContractId != null) {
WxPropertyContract propertyContractUpdate = wxPropertyContractMapper.selectById(propertyContractId);
propertyContractUpdate.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
propertyContractUpdate.setStatus(EnumRentContractStatus.TERMINATE.getCode());
propertyContractUpdate.setUpdatetime(new Date());
wxPropertyContractMapper.updateById(propertyContractUpdate);
}
@@ -1596,24 +1550,26 @@ public class WxRentContractServiceImpl implements WxRentContractService {
resultData.put("allCount", allCount);

//待签约
wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
int waitSignCount = wxRentContractMapper.queryRentContractWaitSignStatus(wxRentContract);
resultData.put("waitSignCount", waitSignCount);
//wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
//int waitSignCount = wxRentContractMapper.queryRentContractWaitSignStatus(wxRentContract);
//resultData.put("waitSignCount", waitSignCount);
resultData.put("waitSignCount", 0);

//计租中
wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode());
wxRentContract.setStatus(EnumRentContractStatus.PAING.getCode());
wxRentContractMapper.updateRentContractPaidStatus(wxRentContract);
int rendPaidCount = wxRentContractMapper.queryRentContractPaidStatus(wxRentContract);
resultData.put("rendPaidCount", rendPaidCount);

//将到期
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
wxRentContractMapper.updateRentContractEndSoonStatus(wxRentContract);
int endSoonCount = wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract);
resultData.put("endSoonCount", endSoonCount);
//wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
//wxRentContractMapper.updateRentContractEndSoonStatus(wxRentContract);
//int endSoonCount = wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract);
//resultData.put("endSoonCount", endSoonCount);
resultData.put("endSoonCount", 0);

//到期
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode());
wxRentContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode());
wxRentContractMapper.updateRentContractEndStatus(wxRentContract);
int endCount = wxRentContractMapper.queryRentContractEndStatus(wxRentContract);
resultData.put("endCount", endCount);
@@ -1628,7 +1584,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
//查询状态为合同正常到期的数据
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setTenantId(tenantId);
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode());
wxRentContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode());
List<Map<String, Object>> rentContractData = wxRentContractMapper.queryRentContractData(wxRentContract);
for (int i = 0, size = rentContractData.size(); i < size; i++) {
Map<String, Object> contract = rentContractData.get(i);
@@ -1678,37 +1634,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
savePreviewBill(record);
}
ResultData resultData = getResultDataForUpdate(record, userId,0,oldRentStartDate);
if (resultData.code != Result.SUCCESS) {
return resultData;
}

//有模板,启动审批流,没有,直接生产账单
if (!CollectionUtils.isEmpty(record.getFlowParams())) {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
updateRentContractStatus(record.getId());
}else{
record.getFlowParams().put("businessId", record.getId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功,是否补录:{}", record.getId().toString(), record.getMerchantId() != null);
}
}else{
//审批状态重置
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
updateApplyStatus(updateRentContract);
}

// if (resultData.code != Result.SUCCESS) {
// return resultData;
// }
return resultData;
}

@@ -1725,9 +1653,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setId(id);
if (record.getRentalStartDate().before(new Date())) {
wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode());
wxRentContract.setStatus(EnumRentContractStatus.PAING.getCode());
} else {
wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode());
wxRentContract.setStatus(EnumRentContractStatus.READY_FOR_PAING.getCode());
}
wxRentContractMapper.updateById(wxRentContract);
EventUtil.publistRentEvent(this, wxRentContract);
@@ -1825,12 +1753,14 @@ public class WxRentContractServiceImpl implements WxRentContractService {
result.put("mallName", wxMall.getName());
result.put("province", wxMall.getProvince());
result.put("city", wxMall.getCity());
//商户信息
WxMerchant merchant = wxMerchantService.getById(wxRentContract.getMerchantId());
//经营业态
WxBusiness wxBusiness = wxBusinessMapper.selectById(wxRentContract.getBusinessId());
wxRentContract.getMerchantId();
WxBusiness wxBusiness = wxBusinessMapper.selectById(merchant.getBusinessId());
result.put("business", wxBusiness.getTitle());

//商户信息
WxMerchant merchant = wxMerchantService.getById(wxRentContract.getMerchantId());
if (merchant != null) {
result.put("merchantName", merchant.getName());
//法人信息
@@ -1887,7 +1817,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}

//品牌
Long brandId = wxRentContract.getBrand();
Long brandId = merchant.getBrand();
String brand = " ";
if (brandId != null) {
WxBrand wxBrand = WxBrandMapper.selectById(brandId);
@@ -1949,12 +1879,16 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxPropertyContract propertyContract = new WxPropertyContract();
propertyContract.updateTenantInfo(wxRentContract);
propertyContract.setRentContractId(wxRentContract.getId());
Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
.stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst();
// Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
// .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst();
Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
.stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.TERMINATE.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.OUT_DATE.getCode())).findFirst();
Map<String, Object> wxPropertyContract = null;
if (first.isPresent()) {
wxPropertyContract = first.get();
@@ -2469,14 +2403,14 @@ public class WxRentContractServiceImpl implements WxRentContractService {

@Override
public void endContract(WxRentContract wxRentContract) {
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxRentContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
wxRentContractMapper.updateStatus(wxRentContract);

//终止租赁合同,同时终止物业合同
if(EnumEndProperty.END_RENT_AND_PROPERTY.getCode().equals(wxRentContract.getEndProperty())){
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.setRentContractId(wxRentContract.getId());
wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
wxPropertyContractMapper.updateStatusByRentContractId(wxPropertyContract);

//物业账单失效
@@ -2646,33 +2580,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}

//有模板,启动审批流,没有,直接生产账单
if (!CollectionUtils.isEmpty(record.getFlowParams())){
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
updateRentContractStatus(record.getId());
}else{
record.getFlowParams().put("businessId", record.getId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成续签合同状态
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.EXTENSION.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功, 是否补录:{}", record.getId().toString(), record.getMerchantId() != null);
}
}else{
//审批状态重置
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
updateApplyStatus(updateRentContract);
}

//生成预览账单(补录第二步,第三步走编辑)
if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null
&& !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) {
@@ -2711,34 +2618,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
}

//有模板,启动审批流,没有,直接生产账单
if (!CollectionUtils.isEmpty(record.getFlowParams())) {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
updateRentContractStatus(record.getId());
}else{
//补录
record.getFlowParams().put("businessId", record.getId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

//合同状态改成补录状态
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.SUPPLE.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功 ,是否补录:{}", record.getId().toString(), record.getMerchantId() != null);
}
}else{
//审批状态重置
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
updateApplyStatus(updateRentContract);
}

//保存调整金额(预账单调整)
savePreviewBill(record);

@@ -2817,10 +2696,13 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxRentContract wxRentContractQuery = new WxRentContract();
wxRentContractQuery.updateTenantInfo(record);
wxRentContractQuery.setShopId(record.getShopId());
long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
filter(rc -> rc.get("status").equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode())
|| rc.get("status").equals(EnumRentContractStatus.RENT_PAID.getCode())
|| rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
// filter(rc -> rc.get("status").equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode())
// || rc.get("status").equals(EnumRentContractStatus.RENT_PAID.getCode())
// || rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream().
filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode())
|| rc.get("status").equals(EnumRentContractStatus.PAING.getCode())).count();
if (count > 0) {
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND);
}
@@ -2850,33 +2732,42 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return resultData;
}

//有模板,启动审批流,没有,直接生产账单
if (!CollectionUtils.isEmpty(record.getFlowParams())) {
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null
&& record.getMerchantId() != null) {
updateRentContractStatus(record.getId());
}else{
record.getFlowParams().put("businessId", record.getId().toString());
if (record.getMerchantId() != null) {
record.getFlowParams().put("supplement", true); //设置补录
}
wxFlowService.start(record.getFlowParams(), userId, userName, record);

// 合同状态改成待签约
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
wxRentContractMapper.updateStatus(updateRentContract);
logger.info("id:{},启动审批流成功,是否补录:{}", record.getId().toString(), record.getMerchantId() != null);
}
}else{
//审批状态重置
WxRentContract updateRentContract = new WxRentContract();
updateRentContract.setId(record.getId());
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
updateApplyStatus(updateRentContract);
}

return resultData;
}

@Override
public ResultData apply(WxRentContract wxRentContract,MallUserInfo user) {
WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId());
if (null == rentContract) {
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]未找到租金合同");
}
rentContract.setFlowParams(wxRentContract.getFlowParams());
if (CollectionUtils.isEmpty(rentContract.getFlowParams())) {
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]租金合同没有审批流程.");
}
if (rentContract.getMerchantId() == null) {
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]租金合同没有绑定商户.");
}
if ((EnumRentContractStatus.DRAFT.getCode().intValue() == rentContract.getStatus().intValue()
&& EnumRentContractAppStatus.DEFAULT.getCode().intValue() == rentContract.getApplyStatus().intValue())
|| (EnumRentContractStatus.PERFORMANCE.getCode().intValue() == rentContract.getStatus().intValue()
&& EnumRentContractAppStatus.REJECT.getCode().intValue() == rentContract.getApplyStatus().intValue())
) {
Integer bussinessType = (Integer) rentContract.getFlowParams().get("businessType");
if (null == bussinessType) {
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]租金合同FlowParams错误,未找到businessType.");
}
WxFlowModel flowModle = wxFlowService.getModelByType(bussinessType, rentContract);
if (null == flowModle) {
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]租金合同配置的流程["+String.valueOf(bussinessType)+"]未找到流程模板.");
}
rentContract.getFlowParams().put("businessId", rentContract.getId().toString());
wxFlowService.start(rentContract.getFlowParams(), user.getId(), user.getName(), rentContract);
return new ResultData(Result.SUCCESS,"提交审批成功",rentContract);
}else {
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]租金合同状态不能提交审批.允许提交的状态为 [草稿+未提交审批],[履约中+审批驳回]");
}
}
}

+ 12
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java View File

@@ -130,14 +130,20 @@ public class WxShopServiceImpl implements WxShopService {
long count = 0;
if (wxShop.getType().equals(EnumRentShopType.SHOP.getCode())) {
count = wxRentContractMapper.selectRentContractByShopId(wxRentContract).parallelStream()
.filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) &&
!r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) &&
!r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// .filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
.filter(r -> !r.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) &&
!r.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
} else {
List<WxRentContract> list = wxRentContractMapper.selectList(new QueryWrapper(wxRentContract));
count = list.stream().filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) &&
!r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) &&
!r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
// count = list.stream().filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
count = list.stream().filter(r -> !r.getStatus().equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) &&
!r.getStatus().equals(EnumRentContractStatus.PAING.getCode())).count();
}
if (count > 0) {
return new ResultData(ErrorCode.SHOP_CONTRACT_HAS_CONNECT);


+ 9
- 7
mallinkService/src/main/java/com/iformall/service/invest/event/InvestListener.java View File

@@ -44,15 +44,17 @@ public class InvestListener implements ApplicationListener<InvestEvent> {

EnumTaskStatus status = EnumTaskStatus.CREATED;
EnumRentContractStatus rentContractStatus = rentEventInfo.getType();
if (Objects.equals(EnumRentContractStatus.INTENTION, rentContractStatus)) {
status = EnumTaskStatus.INTENTION;
} else if (Objects.equals(EnumRentContractStatus.SIGNED_RENT_UNPAID, rentContractStatus)) {
//if (Objects.equals(EnumRentContractStatus.INTENTION, rentContractStatus)) {
// status = EnumTaskStatus.INTENTION;
//} else
if (Objects.equals(EnumRentContractStatus.READY_FOR_PAING, rentContractStatus)) {
status = EnumTaskStatus.FINISH;
} else if (Objects.equals(EnumRentContractStatus.RENT_PAID, rentContractStatus)) {
} else if (Objects.equals(EnumRentContractStatus.PAING, rentContractStatus)) {
status = EnumTaskStatus.FINISH;
} else if (Objects.equals(EnumRentContractStatus.CONTRACT_END_SOON, rentContractStatus)) {
status = EnumTaskStatus.FINISH;
}
}
//else if (Objects.equals(EnumRentContractStatus.CONTRACT_END_SOON, rentContractStatus)) {
// status = EnumTaskStatus.FINISH;
//}

//if (status != EnumTaskStatus.FINISH) {
for (InvestTaskEntity task : tasks) {


+ 5
- 5
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java View File

@@ -1132,12 +1132,12 @@ public class InvestBizServiceImpl implements InvestBizService {
WxRentContract contractQuery = new WxRentContract();
contractQuery.updateTenantInfo(InvestUserContext.getUser());
contractQuery.setShopId(investTaskEntity.getTargetId());
contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode());
//contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode());
//获取意向合同
int count = rentContractService.selectContractCountByShopId(contractQuery);
if (count > 0) {
investTaskEntity.setStatus(EnumTaskStatus.INTENTION);
}
//int count = rentContractService.selectContractCountByShopId(contractQuery);
//if (count > 0) {
// investTaskEntity.setStatus(EnumTaskStatus.INTENTION);
//}
}
}
}


+ 7
- 0
mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml View File

@@ -353,6 +353,13 @@
<if test=" null != status ">,status=#{status}</if>
where id=#{id}
</update>
<update id="updateApplyStatusByRentContractId" parameterType="com.iformall.domain.po.WxPropertyContract">
update wx_property_contract set apply_status=#{applyStatus}
<if test=" null != businessType ">,business_type=#{businessType}</if>
<if test=" null != status ">,status=#{status}</if>
where rent_contract_id=#{rentContractId}
</update>

<update id="updateStatus" parameterType="com.iformall.domain.po.WxPropertyContract">
update wx_property_contract set status=#{status} where id=#{id}


Loading…
Cancel
Save