| @@ -83,5 +83,16 @@ public class WxShopController extends BaseController { | |||||
| return wxShopService.getMerchantShopByShopId(getTenantId(), shopId); | return wxShopService.getMerchantShopByShopId(getTenantId(), shopId); | ||||
| } | } | ||||
| @ApiOperation("查询商铺号是否存在") | |||||
| @GetMapping("hasShopNumber") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "shopNumber", value = "shopNumber", dataType = "String", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query")}) | |||||
| public ResultData hasShopNumber(String shopNumber,Long id) { | |||||
| return wxShopService.hasShopNumber(getTenantId(), shopNumber,id); | |||||
| } | |||||
| } | } | ||||
| @@ -46,4 +46,6 @@ public interface WxShopService { | |||||
| ResultData getMerchantShopByShopId(String tenantId, String shopId); | ResultData getMerchantShopByShopId(String tenantId, String shopId); | ||||
| ResultData hasShopNumber(String tenantId, String shopNumber, Long id); | |||||
| } | } | ||||
| @@ -334,6 +334,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| if(paycount==1){//12 | if(paycount==1){//12 | ||||
| WxBillRent wxBillRent = new WxBillRent(); | WxBillRent wxBillRent = new WxBillRent(); | ||||
| wxBillRent.setId(idWorker.nextId()); | wxBillRent.setId(idWorker.nextId()); | ||||
| wxBillRent.setShopId(wxshop.getId()); | |||||
| wxBillRent.setPayStatus(0); | wxBillRent.setPayStatus(0); | ||||
| wxBillRent.setPay(new BigDecimal(0)); | wxBillRent.setPay(new BigDecimal(0)); | ||||
| wxBillRent.setTenantId(wxshop.getTenantId()); | wxBillRent.setTenantId(wxshop.getTenantId()); | ||||
| @@ -365,6 +366,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| WxBillRent wxBillRent = new WxBillRent(); | WxBillRent wxBillRent = new WxBillRent(); | ||||
| wxBillRent.setId(idWorker.nextId()); | wxBillRent.setId(idWorker.nextId()); | ||||
| wxBillRent.setShopId(wxshop.getId()); | |||||
| wxBillRent.setPayStatus(0); | wxBillRent.setPayStatus(0); | ||||
| wxBillRent.setPay(new BigDecimal(0)); | wxBillRent.setPay(new BigDecimal(0)); | ||||
| wxBillRent.setTenantId(wxshop.getTenantId()); | wxBillRent.setTenantId(wxshop.getTenantId()); | ||||
| @@ -397,6 +399,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| WxBillRent wxBillRent = new WxBillRent(); | WxBillRent wxBillRent = new WxBillRent(); | ||||
| wxBillRent.setId(idWorker.nextId()); | wxBillRent.setId(idWorker.nextId()); | ||||
| wxBillRent.setShopId(wxshop.getId()); | |||||
| wxBillRent.setPayStatus(0); | wxBillRent.setPayStatus(0); | ||||
| wxBillRent.setPay(new BigDecimal(0)); | wxBillRent.setPay(new BigDecimal(0)); | ||||
| wxBillRent.setTenantId(wxshop.getTenantId()); | wxBillRent.setTenantId(wxshop.getTenantId()); | ||||
| @@ -428,6 +431,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| WxBillRent wxBillRent = new WxBillRent(); | WxBillRent wxBillRent = new WxBillRent(); | ||||
| wxBillRent.setId(idWorker.nextId()); | wxBillRent.setId(idWorker.nextId()); | ||||
| wxBillRent.setShopId(wxshop.getId()); | |||||
| wxBillRent.setPayStatus(0); | wxBillRent.setPayStatus(0); | ||||
| wxBillRent.setPay(new BigDecimal(0)); | wxBillRent.setPay(new BigDecimal(0)); | ||||
| wxBillRent.setTenantId(wxshop.getTenantId()); | wxBillRent.setTenantId(wxshop.getTenantId()); | ||||
| @@ -1,6 +1,8 @@ | |||||
| package com.simple.service.impl; | package com.simple.service.impl; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| @@ -41,7 +43,6 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| public void saveOrUpdate(WxShop record) { | public void saveOrUpdate(WxShop record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(0); | record.setStatus(0); | ||||
| @@ -78,5 +79,19 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| return new ResultData(ResultData.SUCCESS,"",map); | return new ResultData(ResultData.SUCCESS,"",map); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData hasShopNumber(String tenantId, String shopNumber, Long id) { | |||||
| WxShop wxShop = new WxShop(); | |||||
| wxShop.setTenantId(tenantId); | |||||
| wxShop.setShopNumber(shopNumber); | |||||
| List<WxShop> list = wxShopMapper.findList(wxShop); | |||||
| if(id!=null){ | |||||
| List<WxShop> collect = list.stream().filter(s -> !s.getId().equals(id)?true:false).collect(Collectors.toList()); | |||||
| return new ResultData(ResultData.SUCCESS,"查询成功",collect.size()>0?true:false); | |||||
| } | |||||
| return new ResultData(ResultData.SUCCESS,"查询成功",list.size()>0?true:false); | |||||
| } | |||||
| } | } | ||||