diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java index 11474f045..793afbaa7 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java @@ -98,7 +98,7 @@ public class WxAppinfoController extends BaseController { @Override public void run() { String param = couponChannel.getWeappScene(); - ResultData resultData = exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); + ResultData resultData = exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); Map map = (Map)resultData.data; String url = map.get("url"); couponChannel.setQrCode(url); diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java index 11516e8b2..352db27ce 100755 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java @@ -75,11 +75,11 @@ public class WxCUserController extends BaseController { if (StringUtils.isEmpty(wxCUserFromBDto.getAppId())) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "C端appId不能为空"); } - if (wxCUserFromBDto.getBUserId() == null) { + if (wxCUserFromBDto.getUserId() == null) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "bUserId不能为空"); } //根据bUserId查询B端用户是否存在 - WxMerchantBUser bUser = wxMerchantBUserService.getById(wxCUserFromBDto.getBUserId()); + WxMerchantBUser bUser = wxMerchantBUserService.getById(wxCUserFromBDto.getUserId()); if (bUser == null) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "B端用户不存在"); } @@ -121,7 +121,7 @@ public class WxCUserController extends BaseController { wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); //新增来自B端的会员关联数据 wxCUserFromB = new WxCUserFromB(); - wxCUserFromB.setBUserId(wxCUserFromBDto.getBUserId()); + wxCUserFromB.setBUserId(wxCUserFromBDto.getUserId()); wxCUserFromB.setCUserId(wxCUserBasicInfo.getId()); wxCUserFromB.setOpenid(wxCUserFromBDto.getOpenid()); wxCUserFromB.setMerchantId(bUser.getMerchantId()); @@ -151,7 +151,7 @@ public class WxCUserController extends BaseController { wxCUserBasicInfoService.save(wxCUserBasicInfo); //新增来自B端的会员关联数据 wxCUserFromB = new WxCUserFromB(); - wxCUserFromB.setBUserId(wxCUserFromBDto.getBUserId()); + wxCUserFromB.setBUserId(wxCUserFromBDto.getUserId()); wxCUserFromB.setCUserId(cUserId); wxCUserFromB.setOpenid(wxCUserFromBDto.getOpenid()); wxCUserFromB.setMerchantId(bUser.getMerchantId()); @@ -217,8 +217,8 @@ public class WxCUserController extends BaseController { if (StringUtils.isEmpty(wxCUserFromBDto.getAppId())) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "C端appid不能为空"); } - if (wxCUserFromBDto.getBUserId() == null) { - return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "bUserId不能为空"); + if (wxCUserFromBDto.getUserId() == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "B端userId不能为空"); } WxCUserFromB wxCUserFromB = wxCUserFromBService.getByOpenidAndAppId(wxCUserFromBDto); if(wxCUserFromB!=null){ diff --git a/mallinkCallback/src/main/java/com/iformall/config/MyExecutorConfig.java b/mallinkCallback/src/main/java/com/iformall/config/MyExecutorConfig.java index c60425e84..bc9dbb75c 100644 --- a/mallinkCallback/src/main/java/com/iformall/config/MyExecutorConfig.java +++ b/mallinkCallback/src/main/java/com/iformall/config/MyExecutorConfig.java @@ -18,7 +18,7 @@ public class MyExecutorConfig { public AsyncTaskExecutor taskExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setThreadNamePrefix("Anno-Executor"); - executor.setMaxPoolSize(100); + executor.setMaxPoolSize(200); executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor; } diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index e1d41db9a..9b1f50afb 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -361,7 +361,7 @@ public enum ErrorCode{ SHOP_NOT_SELECTED(22002, "未选择商铺"), SHOP_BAN_DELETED(22003, "已出租的商铺无法删除"), SHOP_DELETED_BY_ADMIN(22004, "仅系统管理员能删除该商铺"), - + SHOP_CONTRACT_HAS_CONNECT(22005, "有合同签约此商铺,请先解除相应的合同再删除"), /** * 迈外迪 diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/WxCUserFromBDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/WxCUserFromBDto.java index df47816c5..df492f694 100644 --- a/mallinkService/src/main/java/com/iformall/domain/dto/WxCUserFromBDto.java +++ b/mallinkService/src/main/java/com/iformall/domain/dto/WxCUserFromBDto.java @@ -10,8 +10,6 @@ import java.util.Date; public class WxCUserFromBDto implements Serializable { private static final long serialVersionUID = 1L; - @io.swagger.annotations.ApiModelProperty(value="B端登录者ID",name="bUserId") - private Long bUserId; @io.swagger.annotations.ApiModelProperty(value="C端openid",name="openid") private String openid; @io.swagger.annotations.ApiModelProperty(value="C端appid",name="appId") @@ -28,4 +26,7 @@ public class WxCUserFromBDto implements Serializable { private String phone; @io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "merchantId") private Long merchantId; + @io.swagger.annotations.ApiModelProperty(value = "B端登录者ID", name = "userId") + private Long userId; + } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java index be7ccb3fa..5bba77043 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java @@ -157,7 +157,7 @@ public class WxMerchant extends BaseEntity { private Integer isAdmin; @io.swagger.annotations.ApiModelProperty(value = "待缴提醒", name = "billSetting") - @Excel(name="待缴提醒(提前X天)",width = 20,orderNum = "12") + @Excel(name = "待缴提醒", width = 20, orderNum = "12") private Integer billSetting; @io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromBServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromBServiceImpl.java index 6083f9ce5..8047f8d0a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromBServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromBServiceImpl.java @@ -3,7 +3,6 @@ package com.iformall.service.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.iformall.common.IdWorker; -import com.iformall.common.ResultData; import com.iformall.domain.dto.WxCUserFromBDto; import com.iformall.domain.po.WxCUserFromB; import com.iformall.domain.po.WxMerchantBUser; @@ -14,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; -import java.util.UUID; /** * @author gongbiao @@ -60,7 +58,7 @@ public class WxCUserFromBServiceImpl implements WxCUserFromBService { @Override public WxCUserFromB getByOpenidAndAppId(WxCUserFromBDto wxCUserFromBDto) { - WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(wxCUserFromBDto.getBUserId()); + WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(wxCUserFromBDto.getUserId()); if (wxMerchantBUser == null) { return null; } @@ -71,7 +69,7 @@ public class WxCUserFromBServiceImpl implements WxCUserFromBService { @Override public PageInfo listCUser(WxCUserFromBDto wxCUserFromBDto, Integer pageIndex, Integer pageSize) { WxCUserFromB record = new WxCUserFromB(); - record.setBUserId(wxCUserFromBDto.getBUserId()); + record.setBUserId(wxCUserFromBDto.getUserId()); return PageHelper.startPage(pageIndex, pageSize) .doSelectPageInfo(() -> wxCUserFromBMapper.findList(record)); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index 06151ab76..2c3a4f662 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -7,11 +7,13 @@ import com.iformall.common.IdWorker; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.WxMerchantShop; +import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.WxShop; import com.iformall.domain.vo.WxNotRentShopVo; import com.iformall.domain.vo.WxShopVo; import com.iformall.enums.*; import com.iformall.mapper.WxMerchantShopMapper; +import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxShopMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxShopService; @@ -20,6 +22,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.*; @@ -37,6 +40,9 @@ public class WxShopServiceImpl implements WxShopService { @Autowired ExcelService excelService; + @Autowired + WxRentContractMapper wxRentContractMapper; + @Override public PageInfo listAsPage(WxShop record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopMapper.findList(record)); @@ -99,6 +105,28 @@ public class WxShopServiceImpl implements WxShopService { WxMerchantShop wxMerchantShop = new WxMerchantShop(); wxMerchantShop.setShopId(wxShop.getId()); List wxMerchantShops = wxMerchantShopMapper.select(wxMerchantShop); + + if (isAdmin.equals(EnumUserAdmin.ADMIN.getCode())) { + //3、合同 两种 都要查一下 存在时不能删除 + WxRentContract wxRentContract = new WxRentContract(); + wxRentContract.setShopId(wxShop.getId()); + wxRentContract.setTenantId(wxShop.getTenantId()); + long count = 0; + if (wxShop.getType().equals(EnumRentShopType.SHOP.getCode())) { + count = wxRentContractMapper.selectRentContractByShopId(wxRentContract).parallelStream() + .filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) && + !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) && + !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); + } else { + count = wxRentContractMapper.select(wxRentContract).parallelStream() + .filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) && + !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) && + !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); + } + if (count > 0) { + return new ResultData(ErrorCode.SHOP_CONTRACT_HAS_CONNECT); + } + } //有关联过商户必须是管理员才能删除 int count = wxMerchantShops.size(); if (count > 0) { diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index 3bb1d2f92..341752d80 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -16,10 +16,11 @@ + - cc.`id`,cc.`tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`,cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`begin_time`,cc.`end_time`,cc.`status`,cc.`create_date`,cc.`update_date`,cc.`sub_target_id` + cc.`id`,cc.`tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`,cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`begin_time`,cc.`end_time`,cc.`status`,cc.`create_date`,cc.`update_date`,cc.`sub_target_id`,cc.qr_code @@ -201,7 +202,8 @@ c.tenant_id,c.type,c.cover_img,c.cover_picture,c.detail_picture,c.title,c.sub_title,c.sale_price,c.use_price, c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date, c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status, - c.create_date,c.update_date,c.business,c.sub_business,c.support_transfer,c.press_limit_num, c.auto_refund,c.credit_price + c.create_date,c.update_date,c.business,c.sub_business,c.support_transfer,c.press_limit_num, c.auto_refund,c.credit_price, + cc.qr_code @@ -241,6 +243,7 @@ + - @@ -91,7 +90,7 @@ `id`,`tenant_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_type`, `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, - `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,qr_code + `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund` diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 1a6792bd5..43768aba7 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -243,7 +243,9 @@