| @@ -0,0 +1,59 @@ | |||||
| package com.iformall.controller.contractv2; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.enums.EnumContractType; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxRentPropertyContractService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| /** | |||||
| * @author: furunxin | |||||
| * @Date: 2020/8/5 10:13 | |||||
| * @Description: | |||||
| */ | |||||
| @Slf4j | |||||
| @RestController | |||||
| @RequestMapping("wxRentContract_V2") | |||||
| @Api(description = "租赁合同V2版本") | |||||
| public class WxRentContractv2Controller extends BaseController { | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||||
| @GetMapping("getMerchantList") | |||||
| @SystemControllerLog(description = "获取商户列表") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) | |||||
| public ResultData getMerchantList(Integer shopType) throws Exception{ | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| wxMerchant.setRentShopType(shopType); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.getMerchantList(wxMerchant)); | |||||
| } | |||||
| @PostMapping("add") | |||||
| @SystemControllerLog(description = "租赁合同-添加") | |||||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | |||||
| log.debug("[" + getIpAddr() + "] WxRentContractv2Controller::add"); | |||||
| //查询合同类型 | |||||
| Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode()); | |||||
| wxRentContract.setContractType(contractType); | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -75,7 +75,9 @@ public class WxCarController extends BaseController { | |||||
| private WxPark getCurrentPark(TenantEntity tenantEntity) { | private WxPark getCurrentPark(TenantEntity tenantEntity) { | ||||
| WxPark parkQ = new WxPark(); | WxPark parkQ = new WxPark(); | ||||
| parkQ.updateTenantInfo(tenantEntity); | |||||
| //parkQ.updateTenantInfo(tenantEntity); | |||||
| parkQ.setTenantId("789"); | |||||
| parkQ.setParentTenantId("788"); | |||||
| WxPark wxPark = wxParkService.getByObj(parkQ); | WxPark wxPark = wxParkService.getByObj(parkQ); | ||||
| // 1, get mall's park | // 1, get mall's park | ||||
| // future use redis to optimize | // future use redis to optimize | ||||
| @@ -36,4 +36,6 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| WxMerchant findByTrade(HashMap<String, String> params); | WxMerchant findByTrade(HashMap<String, String> params); | ||||
| List<WxMerchant> findListVo2(WxMerchant record); | List<WxMerchant> findListVo2(WxMerchant record); | ||||
| List<WxMerchant> getMerchantList(WxMerchant wxMerchant); | |||||
| } | } | ||||
| @@ -147,4 +147,6 @@ public interface WxMerchantService { | |||||
| PageInfo<WxMerchant> listVoAsPage2(WxMerchant wxMerchant, Integer pageNum, Integer pageSize); | PageInfo<WxMerchant> listVoAsPage2(WxMerchant wxMerchant, Integer pageNum, Integer pageSize); | ||||
| List<WxMerchant> getMerchantList(WxMerchant wxMerchant); | |||||
| } | } | ||||
| @@ -721,8 +721,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| List<WxMerchant> merchantList = wxMerchantMapper.selectList(new QueryWrapper(wxMerchant)); | List<WxMerchant> merchantList = wxMerchantMapper.selectList(new QueryWrapper(wxMerchant)); | ||||
| if (merchantList.size() == 1) | |||||
| if (merchantList.size() == 1){ | |||||
| return Optional.of(merchantList.get(0)); | return Optional.of(merchantList.get(0)); | ||||
| } | |||||
| return Optional.empty(); | return Optional.empty(); | ||||
| } | } | ||||
| @@ -803,4 +804,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @Override | |||||
| public List<WxMerchant> getMerchantList(WxMerchant wxMerchant) { | |||||
| return wxMerchantMapper.getMerchantList(wxMerchant); | |||||
| } | |||||
| } | } | ||||