| @@ -11,6 +11,7 @@ import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.WxBrand; | import com.iformall.domain.po.WxBrand; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.enums.EnumDelFlag; | import com.iformall.enums.EnumDelFlag; | ||||
| import com.iformall.enums.EnumMerchantAdmin; | |||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| import com.iformall.service.WxBrandService; | import com.iformall.service.WxBrandService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| @@ -81,7 +82,7 @@ public class WxBrandController extends BaseController { | |||||
| // wxMerchant.updateTenantInfo(wxBrand); | // wxMerchant.updateTenantInfo(wxBrand); | ||||
| wxMerchant.setIsDel(EnumYesOrNo.NO.getCode()); | wxMerchant.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| wxMerchant.setBrand(wxBrand.getId()); | wxMerchant.setBrand(wxBrand.getId()); | ||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | ||||
| if(CollectionUtils.isNotEmpty(merchantList)){ | if(CollectionUtils.isNotEmpty(merchantList)){ | ||||
| return new ResultData(Result.ERROR, "请先删除已绑定该品牌的商户。"); | return new ResultData(Result.ERROR, "请先删除已绑定该品牌的商户。"); | ||||
| @@ -213,6 +213,7 @@ public class WxMerchantController extends BaseController { | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| wxMerchant.setType(type); | wxMerchant.setType(type); | ||||
| wxMerchant.setCarVendorType(0); | wxMerchant.setCarVendorType(0); | ||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); | return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); | ||||
| } | } | ||||
| @@ -9,10 +9,7 @@ import com.iformall.domain.po.WxBusiness; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.vo.WxBusinessDataVo; | import com.iformall.domain.vo.WxBusinessDataVo; | ||||
| import com.iformall.enums.EnumCouponContentType; | |||||
| import com.iformall.enums.EnumCouponSourceType; | |||||
| import com.iformall.enums.EnumRentContractAppStatus; | |||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBusinessService; | import com.iformall.service.WxBusinessService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| @@ -116,6 +113,7 @@ public class WxBusinessController extends BaseController { | |||||
| WxMerchant merchantQ = new WxMerchant(); | WxMerchant merchantQ = new WxMerchant(); | ||||
| merchantQ.updateTenantInfo(tenantEntity); | merchantQ.updateTenantInfo(tenantEntity); | ||||
| merchantQ.setBusinessId(b.getId()); | merchantQ.setBusinessId(b.getId()); | ||||
| merchantQ.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> merchantList = wxMerchantService.findList(merchantQ); | List<WxMerchant> merchantList = wxMerchantService.findList(merchantQ); | ||||
| if (null != merchantList && merchantList.size() > 0 ) { | if (null != merchantList && merchantList.size() > 0 ) { | ||||
| return new ResultData(Result.ERROR,"存在已关联的商户,不能删除"); | return new ResultData(Result.ERROR,"存在已关联的商户,不能删除"); | ||||
| @@ -124,6 +122,7 @@ public class WxBusinessController extends BaseController { | |||||
| WxMerchant merchantsubQ = new WxMerchant(); | WxMerchant merchantsubQ = new WxMerchant(); | ||||
| merchantsubQ.updateTenantInfo(tenantEntity); | merchantsubQ.updateTenantInfo(tenantEntity); | ||||
| merchantsubQ.setSubBusinessId(b.getId()); | merchantsubQ.setSubBusinessId(b.getId()); | ||||
| merchantsubQ.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> merchantSubList = wxMerchantService.findList(merchantsubQ); | List<WxMerchant> merchantSubList = wxMerchantService.findList(merchantsubQ); | ||||
| if (null != merchantSubList && merchantSubList.size() > 0 ) { | if (null != merchantSubList && merchantSubList.size() > 0 ) { | ||||
| return new ResultData(Result.ERROR,"存在已关联的商户,不能删除"); | return new ResultData(Result.ERROR,"存在已关联的商户,不能删除"); | ||||
| @@ -4,6 +4,7 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxMerchantProductVo; | import com.iformall.domain.vo.WxMerchantProductVo; | ||||
| import com.iformall.enums.EnumDateAmtType; | import com.iformall.enums.EnumDateAmtType; | ||||
| import com.iformall.enums.EnumMerchantAdmin; | |||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxDateAmountRecordService; | import com.iformall.service.WxDateAmountRecordService; | ||||
| @@ -151,6 +152,7 @@ public class DaliyAmountSchedule { | |||||
| WxMerchant merchantQ = new WxMerchant(); | WxMerchant merchantQ = new WxMerchant(); | ||||
| merchantQ.updateTenantInfo(mall.getTenantInfo()); | merchantQ.updateTenantInfo(mall.getTenantInfo()); | ||||
| merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); | merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| merchantQ.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | ||||
| if (merchantList.size()==0) { | if (merchantList.size()==0) { | ||||
| @@ -285,6 +285,9 @@ public class WxMerchant extends TenantEntity { | |||||
| private String coverPicture; | private String coverPicture; | ||||
| @io.swagger.annotations.ApiModelProperty(value="EnumMerchantAdmin",name="isAdmin") | @io.swagger.annotations.ApiModelProperty(value="EnumMerchantAdmin",name="isAdmin") | ||||
| private Integer isAdmin; | private Integer isAdmin; | ||||
| @TableField(exist = false) | |||||
| private List<Integer> adminTypes; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime") | @io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime") | ||||
| private Date topTime; | private Date topTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="微信二维码地址",name="qrCode") | @io.swagger.annotations.ApiModelProperty(value="微信二维码地址",name="qrCode") | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.enums; | package com.iformall.enums; | ||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| /** | /** | ||||
| * Created by Stormeye on 2018/08/09. | * Created by Stormeye on 2018/08/09. | ||||
| */ | */ | ||||
| @@ -36,4 +39,11 @@ public enum EnumMerchantAdmin { | |||||
| public String getMessage() { | public String getMessage() { | ||||
| return message; | return message; | ||||
| } | } | ||||
| public static List<Integer> getOrdinaryTypes(){ | |||||
| List<Integer> adminTypes = new ArrayList(); | |||||
| adminTypes.add(PUBLIC_COMMON.code); | |||||
| adminTypes.add(PUBLIC_ADMIN.code); | |||||
| return adminTypes; | |||||
| } | |||||
| } | } | ||||
| @@ -170,6 +170,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.updateTenantInfo(tenantEntity); | wxMerchant.updateTenantInfo(tenantEntity); | ||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | ||||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | ||||
| @@ -2716,6 +2716,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.updateTenantInfo(tenantEntity); | wxMerchant.updateTenantInfo(tenantEntity); | ||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | ||||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | ||||
| wxMerchantTradeDaily.updateTenantInfo(tenantEntity); | wxMerchantTradeDaily.updateTenantInfo(tenantEntity); | ||||
| @@ -52,8 +52,10 @@ public class WxCouponOrderReservationServiceImpl implements WxCouponOrderReserva | |||||
| if(EnumMerchantAdmin.REGIONAL.getCode().equals(merchant.getIsAdmin())){ | if(EnumMerchantAdmin.REGIONAL.getCode().equals(merchant.getIsAdmin())){ | ||||
| //通过区域商户id查询所有子商户 | //通过区域商户id查询所有子商户 | ||||
| List<Long> collect = wxMerchantRelationService.getRelationByRegionId(merchant.getId()); | List<Long> collect = wxMerchantRelationService.getRelationByRegionId(merchant.getId()); | ||||
| if (!CollectionUtils.isEmpty(collect)){ | |||||
| if (collect != null && collect.size() > 0){ | |||||
| record.setReservationMerchantIdList(collect); | record.setReservationMerchantIdList(collect); | ||||
| }else{ | |||||
| record.setId(-999L); | |||||
| } | } | ||||
| record.setReservationMerchantId(null); | record.setReservationMerchantId(null); | ||||
| } | } | ||||
| @@ -162,6 +162,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | ||||
| if(record.getIsAdmin() == null){ | |||||
| record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| } | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findList(record)); | ||||
| } | } | ||||
| @@ -288,6 +291,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public List<Long> findIdList(WxMerchant record) { | public List<Long> findIdList(WxMerchant record) { | ||||
| if(record == null){ | |||||
| record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| } | |||||
| return wxMerchantMapper.findIdList(record); | return wxMerchantMapper.findIdList(record); | ||||
| } | } | ||||
| @@ -307,6 +313,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchant.updateTenantInfo(tenantEntity); | wxMerchant.updateTenantInfo(tenantEntity); | ||||
| wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); | wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); | ||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> wxMerchantList = wxMerchantMapper.findList(wxMerchant); | List<WxMerchant> wxMerchantList = wxMerchantMapper.findList(wxMerchant); | ||||
| List<WxMerchantSimpleVo> collect = wxMerchantList.stream().map(x -> { | List<WxMerchantSimpleVo> collect = wxMerchantList.stream().map(x -> { | ||||
| WxMerchantSimpleVo wxMerchantSimpleVo = new WxMerchantSimpleVo(); | WxMerchantSimpleVo wxMerchantSimpleVo = new WxMerchantSimpleVo(); | ||||
| @@ -1013,6 +1020,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public void exportData(WxMerchant wxMerchant, HttpServletRequest request, HttpServletResponse response) { | public void exportData(WxMerchant wxMerchant, HttpServletRequest request, HttpServletResponse response) { | ||||
| if(wxMerchant.getIsAdmin() == null){ | |||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| } | |||||
| List<WxMerchant> list = wxMerchantMapper.findList(wxMerchant); | List<WxMerchant> list = wxMerchantMapper.findList(wxMerchant); | ||||
| WxBusiness bq = new WxBusiness(); | WxBusiness bq = new WxBusiness(); | ||||
| @@ -1145,6 +1156,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| private void initQueryParam(WxMerchant record,boolean hasRentContractInfo,Map<Long,WxRentContract> merchantRentMap) { | private void initQueryParam(WxMerchant record,boolean hasRentContractInfo,Map<Long,WxRentContract> merchantRentMap) { | ||||
| if(record.getIsAdmin() == null){ | |||||
| record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| } | |||||
| if (hasRentContractInfo) { | if (hasRentContractInfo) { | ||||
| WxRentContract wxRentContractQ = new WxRentContract(); | WxRentContract wxRentContractQ = new WxRentContract(); | ||||
| wxRentContractQ.updateTenantInfo(record); | wxRentContractQ.updateTenantInfo(record); | ||||
| @@ -2030,6 +2045,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchant.setTenantId(tenantEntity.getFinalTenantId()); | wxMerchant.setTenantId(tenantEntity.getFinalTenantId()); | ||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| wxMerchant.setBrand(brand); | wxMerchant.setBrand(brand); | ||||
| wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); | |||||
| List<WxMerchant> list = findList(wxMerchant); | List<WxMerchant> list = findList(wxMerchant); | ||||
| if(list.size() > 0){ | if(list.size() > 0){ | ||||
| return list.get(0); | return list.get(0); | ||||
| @@ -168,6 +168,12 @@ | |||||
| <if test=" null != creditLocked "> | <if test=" null != creditLocked "> | ||||
| and m.`credit_locked` = #{creditLocked} | and m.`credit_locked` = #{creditLocked} | ||||
| </if> | </if> | ||||
| <if test=" null != adminTypes and adminTypes.size > 0"> | |||||
| and m.`is_admin` in | |||||
| <foreach collection="adminTypes" index="index" item="typeItem" open="(" separator="," close=")"> | |||||
| #{typeItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and m.id in | and m.id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||