| @@ -9,12 +9,14 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillProperty; | import com.iformall.domain.po.WxBillProperty; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.enums.EnumContractType; | |||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxPropertyContractMapper; | import com.iformall.mapper.WxPropertyContractMapper; | ||||
| import com.iformall.service.WxBillPropertyService; | import com.iformall.service.WxBillPropertyService; | ||||
| import com.iformall.service.WxPropertyContractService; | import com.iformall.service.WxPropertyContractService; | ||||
| import com.iformall.service.WxRentPropertyContractService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -39,6 +41,8 @@ public class WxPropertyContractController extends BaseController { | |||||
| private WxBillPropertyService wxBillPropertyService; | private WxBillPropertyService wxBillPropertyService; | ||||
| @Autowired | @Autowired | ||||
| private WxPropertyContractMapper wxPropertyContractMapper; | private WxPropertyContractMapper wxPropertyContractMapper; | ||||
| @Autowired | |||||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||||
| private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | ||||
| @@ -65,7 +69,8 @@ public class WxPropertyContractController extends BaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxPropertyContract.setTenantId(user.getTenantId()); | wxPropertyContract.setTenantId(user.getTenantId()); | ||||
| wxPropertyContract.setAdjustPeriodHandle(); | 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())){ | if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | ||||
| wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate()); | wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate()); | ||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumContractType; | |||||
| import com.iformall.enums.EnumFromType; | import com.iformall.enums.EnumFromType; | ||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| @@ -14,10 +15,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillPropertyMapper; | import com.iformall.mapper.WxBillPropertyMapper; | ||||
| import com.iformall.mapper.WxBillRentMapper; | import com.iformall.mapper.WxBillRentMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | 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 com.iformall.utils.DateUtils; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -59,6 +57,10 @@ public class WxRentContractController extends BaseController { | |||||
| WxBillRentMapper wxBillRentMapper; | WxBillRentMapper wxBillRentMapper; | ||||
| @Autowired | @Autowired | ||||
| WxBillPropertyMapper wxBillPropertyMapper; | WxBillPropertyMapper wxBillPropertyMapper; | ||||
| @Autowired | |||||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||||
| @GetMapping("autolatePay") | @GetMapping("autolatePay") | ||||
| @SystemControllerLog(description = "autolatePay") | @SystemControllerLog(description = "autolatePay") | ||||
| public ResultData autolatePay(String startDate, String endDate) throws Exception{ | public ResultData autolatePay(String startDate, String endDate) throws Exception{ | ||||
| @@ -130,6 +132,8 @@ public class WxRentContractController extends BaseController { | |||||
| @SystemControllerLog(description = "租赁合同-添加") | @SystemControllerLog(description = "租赁合同-添加") | ||||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | public ResultData add(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | ||||
| Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode()); | |||||
| wxRentContract.setContractType(contractType); | |||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | ||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | wxRentContract.setBusDiscountTime(new Integer(0)); | ||||
| } | } | ||||
| @@ -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; | |||||
| @@ -198,4 +198,8 @@ public class WxPropertyContract extends BaseEntity { | |||||
| this.adjustPeriod = EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode(); | this.adjustPeriod = EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode(); | ||||
| } | } | ||||
| } | } | ||||
| @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | |||||
| private Integer contractType; | |||||
| } | } | ||||
| @@ -250,7 +250,8 @@ public class WxRentContract extends BaseEntity { | |||||
| } | } | ||||
| @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | |||||
| private Integer contractType; | |||||
| } | } | ||||
| @@ -9,10 +9,10 @@ public enum EnumContract { | |||||
| SHOP_RENT(1, "店铺租赁合同"), | SHOP_RENT(1, "店铺租赁合同"), | ||||
| SHOP_PROPERTY(3, "店铺物业合同"), | SHOP_PROPERTY(3, "店铺物业合同"), | ||||
| SHOP_PROPERTY_RENT(5, "店铺租赁物业合同"), | |||||
| SHOP_RENT_PROPERTY(5, "店铺租赁物业合同"), | |||||
| POINT_RENT(2, "多经租赁合同"), | POINT_RENT(2, "多经租赁合同"), | ||||
| POIN_PROPERTY(4, "多经物业合同"), | |||||
| SHOP_RENT_PROPERTY(6, "多经租赁物业合同"),; | |||||
| POINT_PROPERTY(4, "多经物业合同"), | |||||
| POINT_RENT_PROPERTY(6, "多经租赁物业合同"),; | |||||
| public static EnumContract getEnum(Integer code) { | public static EnumContract getEnum(Integer code) { | ||||
| for (EnumContract value : values()) { | for (EnumContract value : values()) { | ||||
| @@ -18,4 +18,6 @@ public interface WxRentPropertyContractService { | |||||
| ResultData insertRentForCreate(WxRentContract wxRentContract); | ResultData insertRentForCreate(WxRentContract wxRentContract); | ||||
| Integer getContractType(Integer rentShopType, Integer operationType, Integer contract); | |||||
| } | } | ||||
| @@ -8,6 +8,10 @@ import com.iformall.domain.po.WxBillProperty; | |||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | 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.exception.MallinkException; | ||||
| import com.iformall.mapper.WxPropertyContractMapper; | import com.iformall.mapper.WxPropertyContractMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| @@ -88,6 +92,45 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||||
| public ResultData insertRentForCreate(WxRentContract wxRentContract) { | public ResultData insertRentForCreate(WxRentContract wxRentContract) { | ||||
| return null; | 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; | |||||
| } | |||||
| } | } | ||||