| @@ -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<String,String> map = (Map)resultData.data; | |||
| String url = map.get("url"); | |||
| couponChannel.setQrCode(url); | |||
| @@ -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){ | |||
| @@ -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; | |||
| } | |||
| @@ -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, "有合同签约此商铺,请先解除相应的合同再删除"), | |||
| /** | |||
| * 迈外迪 | |||
| @@ -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; | |||
| } | |||
| @@ -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") | |||
| @@ -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<WxCUserFromB> 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)); | |||
| } | |||
| @@ -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<WxShop> 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<WxMerchantShop> 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) { | |||
| @@ -16,10 +16,11 @@ | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="sub_target_id" jdbcType="BIGINT" property="subTargetId" /> | |||
| <result column="qr_code" property="qrCode"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| 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 | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -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 | |||
| </sql> | |||
| <resultMap id="WxCouponCVoMap" type="com.iformall.domain.vo.WxCouponCVo"> | |||
| @@ -241,6 +243,7 @@ | |||
| <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | |||
| <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/> | |||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | |||
| <result column="qr_code" property="qrCode"/> | |||
| <collection column="{productId=coupon_id}" property="merchantVoList" | |||
| ofType="com.iformall.domain.vo.WxMerchantVo" | |||
| @@ -37,7 +37,6 @@ | |||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | |||
| <result column="credit_price" jdbcType="INTEGER" property="creditPrice"/> | |||
| <result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/> | |||
| <result column="qr_code" property="qrCode"/> | |||
| </resultMap> | |||
| <resultMap id="statisMap" type="com.iformall.domain.vo.WxCouponStatisVo"> | |||
| @@ -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` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -243,7 +243,9 @@ | |||
| <select id="selectRentContractByShopId" parameterType="com.iformall.domain.po.WxRentContract" | |||
| resultType="com.iformall.domain.po.WxRentContract"> | |||
| select * from wx_rent_contract where tenant_id=#{tenantId} and json_contains(json_extract(rent_info,'$[*].shopId'),concat('"',${shopId},'"')) and status=#{status} and rent_shop_type =1 | |||
| select * from wx_rent_contract where tenant_id=#{tenantId} and | |||
| json_contains(json_extract(rent_info,'$[*].shopId'),concat('"',${shopId},'"')) and rent_shop_type =1 | |||
| <if test=" null != status ">and status=#{status}</if> | |||
| </select> | |||
| <update id="updateInvalidContract" parameterType="com.iformall.domain.po.WxRentContract"> | |||