|
|
|
@@ -16,6 +16,7 @@ import com.iformall.enums.EnumFromType; |
|
|
|
import com.iformall.enums.EnumIsPreview; |
|
|
|
import com.iformall.enums.EnumRentContractAppStatus; |
|
|
|
import com.iformall.enums.EnumRentContractStatus; |
|
|
|
import com.iformall.enums.EnumRentShopType; |
|
|
|
import com.iformall.enums.EnumRentStartType; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.WxBillPropertyMapper; |
|
|
|
@@ -71,14 +72,12 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxShopService wxShopService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@UserDataRuleAnnotation("rent_contract_list") |
|
|
|
@GetMapping("/list") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) |
|
|
|
@SystemControllerLog(description = "租赁合同-列表") |
|
|
|
public ResultData list(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::list"); |
|
|
|
if (null == wxRentContract) { |
|
|
|
@@ -169,7 +168,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
|
|
|
|
@GetMapping("/findById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
@SystemControllerLog(description = "租赁合同-查找") |
|
|
|
public ResultData findById(Long id) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); |
|
|
|
// 同步欠缴状态 |
|
|
|
@@ -232,7 +230,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "contractId", value = "contractId", dataType = "Long", paramType = "query", required = true)}) |
|
|
|
@SystemControllerLog(description = "租赁合同-终结合同") |
|
|
|
public ResultData merchantShops(Long merchantId,Long contractId) { |
|
|
|
|
|
|
|
List<Long> shopList = wxMerchantService.getMerchantShopIds(merchantId); |
|
|
|
@@ -297,7 +294,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
*/ |
|
|
|
@GetMapping("getXuQianRentContract") |
|
|
|
@ApiImplicitParams({}) |
|
|
|
@SystemControllerLog(description = "查询续签合同") |
|
|
|
public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); |
|
|
|
wxRentContract.updateTenantInfo(getTenantInfo()); |
|
|
|
@@ -386,12 +382,56 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("effective") |
|
|
|
@ApiImplicitParams({}) |
|
|
|
@SystemControllerLog(description = "合同生效") |
|
|
|
public ResultData effective(@ModelAttribute WxRentContract wxRentContract) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); |
|
|
|
WxRentContract contract = wxRentContractService.getSimpleDeatil(wxRentContract.getId()); |
|
|
|
if (null == contract) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同不存在"); |
|
|
|
} |
|
|
|
//查询是否有审批流程 |
|
|
|
if(rentContractHasWorkFlow(contract)) { |
|
|
|
return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"租赁合同存在工作流,不允许直接生效。"); |
|
|
|
} |
|
|
|
|
|
|
|
if (contract.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同状态为草稿才能进行此操作"); |
|
|
|
} |
|
|
|
//店铺是否存在其他有效合同里面 |
|
|
|
boolean result = wxRentContractService.hasOtherValidContractShop(contract); |
|
|
|
if (result) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"店铺已经在其他计租中或者已签约未到期的合同里面了。"); |
|
|
|
} |
|
|
|
wxRentContractService.updateRentContractStatus(wxRentContract.getId()); |
|
|
|
return new ResultData(Result.SUCCESS,"合同生效成功!"); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("apply") |
|
|
|
@SystemControllerLog(description = "租赁合同-提交审批") |
|
|
|
public ResultData apply(@ModelAttribute WxRentContract wxRentContract) { |
|
|
|
MallUserInfo user = getUser(); |
|
|
|
|
|
|
|
WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); |
|
|
|
if (null == rentContract) { |
|
|
|
return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]未找到租金合同"); |
|
|
|
} |
|
|
|
|
|
|
|
//查询是否有审批流程 |
|
|
|
if(rentContractHasWorkFlow(rentContract)) { |
|
|
|
return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"租赁合同存在工作流,不允许直接生效。"); |
|
|
|
} |
|
|
|
|
|
|
|
rentContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT, wxRentContract.getRemark(), wxRentContract.getId())); |
|
|
|
return wxRentContractService.apply(rentContract,user); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("getRentContractList") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) |
|
|
|
@SystemControllerLog(description = "租赁合同-列表") |
|
|
|
public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract, Integer validStatus, Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); |
|
|
|
if (null == wxRentContract) wxRentContract = new WxRentContract(); |
|
|
|
@@ -425,7 +465,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/hasRentStatus") |
|
|
|
@SystemControllerLog(description = "查询店铺租赁状态") |
|
|
|
public ResultData hasRentStatus(@ModelAttribute WxRentContract wxRentContract) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::hasRentStatus"); |
|
|
|
wxRentContract.updateTenantInfo(getTenantInfo()); |
|
|
|
@@ -433,7 +472,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/hasContractNumber") |
|
|
|
@SystemControllerLog(description = "租赁合同-检查合同编号是否存在") |
|
|
|
public ResultData hasContractNumber(@ModelAttribute WxRentContract wxRentContract) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::hasContractNumber"); |
|
|
|
wxRentContract.updateTenantInfo(getTenantInfo()); |
|
|
|
@@ -441,7 +479,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("getMerchantList") |
|
|
|
@SystemControllerLog(description = "获取商户列表") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) |
|
|
|
public ResultData getMerchantList(Integer shopType) throws Exception{ |
|
|
|
@@ -475,7 +512,6 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("buildBillPriceList") |
|
|
|
@SystemControllerLog(description = "租赁合同-生成账单列表金额") |
|
|
|
public ResultData buildBillPriceList(@RequestBody WxRentContract wxRentContract) throws Exception{ |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); |
|
|
|
WxRentContract dbRent = wxRentContractMapper.selectById(wxRentContract.getId()); |
|
|
|
@@ -598,13 +634,7 @@ public class WxRentContractController extends WxContractBaseController { |
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|