Просмотр исходного кода

[合同][修改][修改租赁记租开始日期]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
03e2615331
3 измененных файлов: 93 добавлений и 0 удалений
  1. +21
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  2. +34
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  3. +38
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumRentStartType.java

+ 21
- 0
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java Просмотреть файл

@@ -8,6 +8,9 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract;
import com.iformall.enums.EnumRentStartType;
import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.service.WxBillPropertyService;
import com.iformall.service.WxPropertyContractService;
import io.swagger.annotations.ApiImplicitParam;
@@ -32,6 +35,8 @@ public class WxPropertyContractController extends BaseController {
private WxPropertyContractService wxPropertyContractService;
@Autowired
private WxBillPropertyService wxBillPropertyService;
@Autowired
private WxPropertyContractMapper wxPropertyContractMapper;

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

@@ -58,6 +63,22 @@ public class WxPropertyContractController extends BaseController {
return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName());
}

@PostMapping("updateRentStartTime")
@SystemControllerLog(description = "物业合同-更新租赁开始日期")
public ResultData updateRentStartTime(@RequestBody WxPropertyContract wxPropertyContract) {
logger.debug("[" + getIpAddr() + "] WxPropertyContractController::updateRentStartTime");
Integer rentStartType = wxPropertyContract.getRentStartType();
wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId());
if(rentStartType.equals(EnumRentStartType.STARTTIME.getCode())){
wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate());
}
MallUserInfo user = getUser();
wxPropertyContract.setTenantId(user.getTenantId());
wxPropertyContract.setAdjustPeriodHandle();
return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName());
}


@PostMapping("update")
public ResultData update(@RequestBody WxPropertyContract wxPropertyContract) {
logger.debug("[" + getIpAddr() + "] WxPropertyContractController::update");


+ 34
- 0
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Просмотреть файл

@@ -12,6 +12,8 @@ import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxShop;
import com.iformall.enums.EnumRentContractAdjustPeriod;
import com.iformall.enums.EnumRentShopType;
import com.iformall.enums.EnumRentStartType;
import com.iformall.mapper.WxRentContractMapper;
import com.iformall.service.WxBillRentService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.WxRentContractService;
@@ -46,6 +48,8 @@ public class WxRentContractController extends BaseController {
private WxPayAccountBillService payAccountBillService;
@Autowired
private WxShopService wxShopService;
@Autowired
private WxRentContractMapper wxRentContractMapper;

@GetMapping("getDateDiff")
@ApiImplicitParams({
@@ -85,9 +89,28 @@ public class WxRentContractController extends BaseController {
wxRentContract.setTenantId(user.getTenantId());

wxRentContract.setAdjustPeriodHandle();
if(wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxRentContract.setRentalStartDate(wxRentContract.getStartDate());
}
return wxRentContractService.save(wxRentContract, user.getId(),user.getName());
}

@PostMapping("updateRentStartTime")
@SystemControllerLog(description = "租赁合同-更新租赁开始日期")
public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentStartTime");
Integer rentStartType = wxRentContract.getRentStartType();
wxRentContract = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId());
if(rentStartType.equals(EnumRentStartType.STARTTIME.getCode())){
wxRentContract.setRentalStartDate(wxRentContract.getStartDate());
}
MallUserInfo user = getUser();
wxRentContract.setTenantId(user.getTenantId());
wxRentContract.setAdjustPeriodHandle();
wxRentContract.setRentPriceHandle();
return wxRentContractService.update(wxRentContract, user.getId(),user.getName());
}

@PostMapping("update")
@SystemControllerLog(description = "租赁合同-更新")
public ResultData update(@RequestBody WxRentContract wxRentContract) {
@@ -96,6 +119,9 @@ public class WxRentContractController extends BaseController {
wxRentContract.setTenantId(user.getTenantId());
wxRentContract.setAdjustPeriodHandle();
wxRentContract.setRentPriceHandle();
if(wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxRentContract.setRentalStartDate(wxRentContract.getStartDate());
}
return wxRentContractService.update(wxRentContract, user.getId(),user.getName());
}

@@ -112,6 +138,10 @@ public class WxRentContractController extends BaseController {
wxRentContract.setTenantId(user.getTenantId());
wxRentContract.setAdjustPeriodHandle();
wxRentContract.setRentPriceHandle();

if(wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxRentContract.setRentalStartDate(wxRentContract.getStartDate());
}
return wxRentContractService.update(wxRentContract, user.getId(),user.getName());
}

@@ -123,6 +153,9 @@ public class WxRentContractController extends BaseController {
wxRentContract.setTenantId(user.getTenantId());
wxRentContract.setAdjustPeriodHandle();
wxRentContract.setRentPriceHandle();
if(wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxRentContract.setRentalStartDate(wxRentContract.getStartDate());
}
return wxRentContractService.updateFile(wxRentContract, user.getId(),user.getName());
}

@@ -262,3 +295,4 @@ public class WxRentContractController extends BaseController {

}



+ 38
- 0
mallinkService/src/main/java/com/iformall/enums/EnumRentStartType.java Просмотреть файл

@@ -0,0 +1,38 @@
package com.iformall.enums;

/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumRentStartType {


STARTTIME(2, "记租开始日期"),
RENTTIME(1, "租赁开始日期"),
;

public static EnumRentStartType getEnum(Integer code) {
for (EnumRentStartType value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumRentStartType(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}


Загрузка…
Отмена
Сохранить