| @@ -12,6 +12,7 @@ import com.iformall.domain.po.WxProfitSharingReceiver; | |||||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | import com.iformall.domain.vo.WxMerchantTradeDetailVo; | ||||
| import com.iformall.domain.vo.WxMerchantTradeVo; | import com.iformall.domain.vo.WxMerchantTradeVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.EnumMerchantStatus; | |||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.service.QrCodeService; | import com.iformall.service.QrCodeService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| @@ -91,6 +92,20 @@ public class WxMerchantController extends BaseController { | |||||
| final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("获取商户ID,名称接口") | |||||
| @GetMapping("IdAndNamelist") | |||||
| @ApiImplicitParams({ | |||||
| }) | |||||
| @SystemControllerLog(description = "商户-列表") | |||||
| public ResultData IdAndNamelist(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); | |||||
| } | |||||
| @ApiOperation("ETCP商户列表") | @ApiOperation("ETCP商户列表") | ||||
| @@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -64,6 +65,9 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxRentPropertyContractService wxRentPropertyContractService; | private WxRentPropertyContractService wxRentPropertyContractService; | ||||
| @Autowired | |||||
| private WxShopService wxShopService; | |||||
| @UserDataRuleAnnotation("rent_contract_list") | @UserDataRuleAnnotation("rent_contract_list") | ||||
| @@ -79,11 +83,7 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| } | } | ||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | ||||
| Map<String, Object> result = new HashMap<>(); | |||||
| //result.put("rentContractStatusInfo", ); | |||||
| result.put("pageInfo", wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||||
| return new ResultData(); | |||||
| return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -247,7 +247,55 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return wxRentContractService.endRentContract(id,status); | return wxRentContractService.endRentContract(id,status); | ||||
| } | } | ||||
| @GetMapping("/merchantShops") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "租赁合同-终结合同") | |||||
| public ResultData merchantShops(Long merchantId) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endRentContract"); | |||||
| return new ResultData(wxMerchantService.getMerchantShopList(merchantId)); | |||||
| } | |||||
| @GetMapping("/merchantShopsRenewable") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "contractId", value = "contractId", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "租赁合同-终结合同") | |||||
| public ResultData merchantShopsRenewable(Long merchantId,Long contractId) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endRentContract"); | |||||
| List<WxShop> allist = new ArrayList<WxShop>(); | |||||
| List<WxShop> shopList = wxMerchantService.getMerchantShopList(merchantId); | |||||
| if (null == shopList) { | |||||
| return new ResultData(Result.ERROR,"商户未绑定店铺!"); | |||||
| } | |||||
| WxRentContract rentContract = wxRentContractService.getSimpleDeatil(contractId); | |||||
| if (null == rentContract) { | |||||
| return new ResultData(Result.ERROR,"租金合同不存在!"); | |||||
| } | |||||
| if (rentContract.getStatus().intValue() != EnumRentContractStatus.PAING.getCode() | |||||
| && rentContract.getStatus().intValue() != EnumRentContractStatus.OUT_DATE.getCode()) { | |||||
| return new ResultData(Result.ERROR,"租金合同状态为计租中或者正常到期才能续签。"); | |||||
| } | |||||
| List<Long> shopIds = rentContract.shopIdsByRentInfo(); | |||||
| if (null != shopIds) { | |||||
| List<WxShop> contractShops = wxShopService.getByIds(shopIds); | |||||
| //如果合同状态是计租中,则商铺不显示 | |||||
| if (rentContract.getStatus().intValue() != EnumRentContractStatus.PAING.getCode()) { | |||||
| if (null != contractShops) { | |||||
| for (WxShop s:contractShops) { | |||||
| if (shopList.contains(s)) { | |||||
| shopList.remove(s); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| return new ResultData(shopList); | |||||
| } | |||||
| @@ -14,6 +14,9 @@ import java.util.Map; | |||||
| public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | ||||
| List<WxMerchant> findList(WxMerchant wxMerchant); | List<WxMerchant> findList(WxMerchant wxMerchant); | ||||
| List<WxMerchant> findIdNameList(WxMerchant wxMerchant); | |||||
| List<WxMerchantVo> findListCVo(WxMerchantDto wxMerchantDto); | List<WxMerchantVo> findListCVo(WxMerchantDto wxMerchantDto); | ||||
| WxMerchantVo getMerchantByCode(HashMap<String, String> params); | WxMerchantVo getMerchantByCode(HashMap<String, String> params); | ||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | import com.iformall.domain.po.WxProfitSharingReceiver; | ||||
| import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | import com.iformall.domain.vo.WxMerchantSimpleVo; | ||||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | import com.iformall.domain.vo.WxMerchantTradeDetailVo; | ||||
| import com.iformall.domain.vo.WxMerchantTradeVo; | import com.iformall.domain.vo.WxMerchantTradeVo; | ||||
| @@ -63,6 +64,9 @@ public interface WxMerchantService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize); | PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize); | ||||
| List<WxMerchant> queryIdAndNames(WxMerchant record); | |||||
| PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize); | PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize); | ||||
| /** | /** | ||||
| * 根据code查询 | * 根据code查询 | ||||
| @@ -150,4 +154,6 @@ public interface WxMerchantService { | |||||
| List<WxMerchant> getMerchantList(WxMerchant wxMerchant); | List<WxMerchant> getMerchantList(WxMerchant wxMerchant); | ||||
| void disableMerchat(Long id); | void disableMerchat(Long id); | ||||
| List<WxShop> getMerchantShopList(Long merchantId); | |||||
| } | } | ||||
| @@ -27,6 +27,8 @@ public interface WxRentContractService { | |||||
| */ | */ | ||||
| //Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize); | //Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize); | ||||
| List<WxRentContract> findList(WxRentContract record); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| * | * | ||||
| @@ -109,6 +109,12 @@ 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> queryIdAndNames (WxMerchant record) { | |||||
| return wxMerchantMapper.findIdNameList(record); | |||||
| } | |||||
| @Override | @Override | ||||
| @@ -855,4 +861,23 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public List<WxShop> getMerchantShopList(Long merchantId) { | |||||
| WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||||
| wxMerchantShop.setMerchantId(merchantId); | |||||
| wxMerchantShop.setIsDel(0); | |||||
| List<WxMerchantShop> shopList = wxMerchantShopMapper.findList(wxMerchantShop); | |||||
| if (null != shopList) { | |||||
| List<Long> shopIds = new ArrayList<Long>(); | |||||
| for (WxMerchantShop ws: shopList) { | |||||
| shopIds.add(ws.getShopId()); | |||||
| } | |||||
| WxShop shop = new WxShop(); | |||||
| shop.setIds(shopIds); | |||||
| return wxShopMapper.findList(shop); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | } | ||||
| @@ -127,6 +127,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| // return result; | // return result; | ||||
| // } | // } | ||||
| @Override | |||||
| public List<WxRentContract> findList(WxRentContract record){ | |||||
| return wxRentContractMapper.findList(record); | |||||
| } | |||||
| @Override | @Override | ||||
| public Map<String, Object> getById(Long id) { | public Map<String, Object> getById(Long id) { | ||||
| Map<String, Object> result = new HashMap<>(); | Map<String, Object> result = new HashMap<>(); | ||||
| @@ -170,6 +170,12 @@ | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| <select id="findIdNameList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap"> | |||||
| select id,name | |||||
| from wx_merchant m | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||