Browse Source

[合同][修改][添加合同类型]

release_toaliyun_real
gongbiao 6 years ago
parent
commit
dce4c7ff45
8 changed files with 82 additions and 9 deletions
  1. +6
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  2. +8
    -4
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  3. +14
    -0
      mallinkAdmin/src/main/resources/db/migration/V201910231605__ALTER_CONTRACT.sql
  4. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  5. +2
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  6. +3
    -3
      mallinkService/src/main/java/com/iformall/enums/EnumContract.java
  7. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxRentPropertyContractService.java
  8. +43
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java

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

@@ -9,12 +9,14 @@ import com.iformall.domain.po.MallUserInfo;
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.EnumIsPreview;
import com.iformall.enums.EnumRentStartType;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.service.WxBillPropertyService;
import com.iformall.service.WxPropertyContractService;
import com.iformall.service.WxRentPropertyContractService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.slf4j.Logger;
@@ -39,6 +41,8 @@ public class WxPropertyContractController extends BaseController {
private WxBillPropertyService wxBillPropertyService;
@Autowired
private WxPropertyContractMapper wxPropertyContractMapper;
@Autowired
private WxRentPropertyContractService wxRentPropertyContractService;

private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class);

@@ -65,7 +69,8 @@ public class WxPropertyContractController extends BaseController {
MallUserInfo user = getUser();
wxPropertyContract.setTenantId(user.getTenantId());
wxPropertyContract.setAdjustPeriodHandle();

Integer contractType = wxRentPropertyContractService.getContractType(wxPropertyContract.getRentShopType(), wxPropertyContract.getOperationType(), EnumContractType.PROPERTY.getCode());
wxPropertyContract.setContractType(contractType);
if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate());
}


+ 8
- 4
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java View File

@@ -7,6 +7,7 @@ import com.iformall.common.Result;
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.EnumFromType;
import com.iformall.enums.EnumIsPreview;
import com.iformall.enums.EnumRentStartType;
@@ -14,10 +15,7 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillPropertyMapper;
import com.iformall.mapper.WxBillRentMapper;
import com.iformall.mapper.WxRentContractMapper;
import com.iformall.service.WxBillRentService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.WxRentContractService;
import com.iformall.service.*;
import com.iformall.utils.DateUtils;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -59,6 +57,10 @@ public class WxRentContractController extends BaseController {
WxBillRentMapper wxBillRentMapper;
@Autowired
WxBillPropertyMapper wxBillPropertyMapper;

@Autowired
private WxRentPropertyContractService wxRentPropertyContractService;

@GetMapping("autolatePay")
@SystemControllerLog(description = "autolatePay")
public ResultData autolatePay(String startDate, String endDate) throws Exception{
@@ -130,6 +132,8 @@ public class WxRentContractController extends BaseController {
@SystemControllerLog(description = "租赁合同-添加")
public ResultData add(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::add");
Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode());
wxRentContract.setContractType(contractType);
if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){
wxRentContract.setBusDiscountTime(new Integer(0));
}


+ 14
- 0
mallinkAdmin/src/main/resources/db/migration/V201910231605__ALTER_CONTRACT.sql View File

@@ -0,0 +1,14 @@
alter table wx_rent_contract
add column contract_type smallint(2) not null default 0 comment '合同类型1店铺租金合同5店铺租金物业合同3多经租金合同6多经租金物业合同';
alter table wx_property_contract
add column contract_type smallint(2) not null default 0 comment '合同类型2店铺物业合同4多经物业合同5店铺租金物业合同6多经租金物业合同';

update wx_rent_contract set contract_type=1 where rent_shop_type=1 and operation_type=1;
update wx_rent_contract set contract_type=3 where rent_shop_type=2 and operation_type=1;
update wx_rent_contract set contract_type=5 where rent_shop_type=1 and operation_type=2;
update wx_rent_contract set contract_type=6 where rent_shop_type=2 and operation_type=2;

update wx_property_contract set contract_type=2 where rent_shop_type=1 and operation_type=1;
update wx_property_contract set contract_type=4 where rent_shop_type=2 and operation_type=1;
update wx_property_contract set contract_type=5 where rent_shop_type=1 and operation_type=2;
update wx_property_contract set contract_type=6 where rent_shop_type=2 and operation_type=2;

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

@@ -198,4 +198,8 @@ public class WxPropertyContract extends BaseEntity {
this.adjustPeriod = EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode();
}
}

@io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType")
private Integer contractType;

}

+ 2
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java View File

@@ -250,7 +250,8 @@ public class WxRentContract extends BaseEntity {
}



@io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType")
private Integer contractType;

}


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

@@ -9,10 +9,10 @@ public enum EnumContract {

SHOP_RENT(1, "店铺租赁合同"),
SHOP_PROPERTY(3, "店铺物业合同"),
SHOP_PROPERTY_RENT(5, "店铺租赁物业合同"),
SHOP_RENT_PROPERTY(5, "店铺租赁物业合同"),
POINT_RENT(2, "多经租赁合同"),
POIN_PROPERTY(4, "多经物业合同"),
SHOP_RENT_PROPERTY(6, "多经租赁物业合同"),;
POINT_PROPERTY(4, "多经物业合同"),
POINT_RENT_PROPERTY(6, "多经租赁物业合同"),;

public static EnumContract getEnum(Integer code) {
for (EnumContract value : values()) {


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

@@ -18,4 +18,6 @@ public interface WxRentPropertyContractService {

ResultData insertRentForCreate(WxRentContract wxRentContract);

Integer getContractType(Integer rentShopType, Integer operationType, Integer contract);

}

+ 43
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java View File

@@ -8,6 +8,10 @@ import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.vo.WxRentPropertyContractVo;
import com.iformall.enums.EnumContract;
import com.iformall.enums.EnumContractOperationType;
import com.iformall.enums.EnumContractType;
import com.iformall.enums.EnumRentShopType;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.mapper.WxRentContractMapper;
@@ -88,6 +92,45 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract
public ResultData insertRentForCreate(WxRentContract wxRentContract) {
return null;
}

@Override
public Integer getContractType(Integer rentShopType, Integer operationType, Integer contract) {
//店铺租赁合同
if (contract.equals(EnumContractType.RENT.getCode())
&& rentShopType.equals(EnumRentShopType.SHOP.getCode())
&& operationType.equals(EnumContractOperationType.PART.getCode())) {
return EnumContract.SHOP_RENT.getCode();
}
//多经租赁合同
if (contract.equals(EnumContractType.RENT.getCode())
&& rentShopType.equals(EnumRentShopType.POINT.getCode())
&& operationType.equals(EnumContractOperationType.PART.getCode())) {
return EnumContract.POINT_RENT.getCode();
}
//店铺物业合同
if (contract.equals(EnumContractType.PROPERTY.getCode())
&& rentShopType.equals(EnumRentShopType.SHOP.getCode())
&& operationType.equals(EnumContractOperationType.PART.getCode())) {
return EnumContract.SHOP_PROPERTY.getCode();
}
//多经物业合同
if (contract.equals(EnumContractType.PROPERTY.getCode())
&& rentShopType.equals(EnumRentShopType.POINT.getCode())
&& operationType.equals(EnumContractOperationType.PART.getCode())) {
return EnumContract.POINT_PROPERTY.getCode();
}
//店铺租赁物业合同
if (rentShopType.equals(EnumRentShopType.SHOP.getCode())
&& operationType.equals(EnumContractOperationType.WHOLE.getCode())) {
return EnumContract.SHOP_RENT_PROPERTY.getCode();
}
//多经租赁物业合同
if (rentShopType.equals(EnumRentShopType.POINT.getCode())
&& operationType.equals(EnumContractOperationType.WHOLE.getCode())) {
return EnumContract.POINT_RENT_PROPERTY.getCode();
}
return 0;
}
}




Loading…
Cancel
Save