处理
This commit is contained in:
parent
326a5834be
commit
22a08f5e51
@ -1,7 +1,12 @@
|
||||
package com.fuint.business.store.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -10,20 +15,16 @@ import java.io.Serializable;
|
||||
* @author makejava
|
||||
* @since 2023-10-11 13:17:02
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class ChainStoreInfo extends Model<ChainStoreInfo> {
|
||||
//主键
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
//连锁店名称
|
||||
private String storeName;
|
||||
//总店地址
|
||||
private String storeAddress;
|
||||
//总店联系方式
|
||||
private String storePhone;
|
||||
//总店经度
|
||||
private String storeLat;
|
||||
//总店纬度
|
||||
private String storeLng;
|
||||
private Long contractDeptId;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//创建人
|
||||
@ -33,95 +34,5 @@ public class ChainStoreInfo extends Model<ChainStoreInfo> {
|
||||
//更新人
|
||||
private String updateBy;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStoreName() {
|
||||
return storeName;
|
||||
}
|
||||
|
||||
public void setStoreName(String storeName) {
|
||||
this.storeName = storeName;
|
||||
}
|
||||
|
||||
public String getStoreAddress() {
|
||||
return storeAddress;
|
||||
}
|
||||
|
||||
public void setStoreAddress(String storeAddress) {
|
||||
this.storeAddress = storeAddress;
|
||||
}
|
||||
|
||||
public String getStorePhone() {
|
||||
return storePhone;
|
||||
}
|
||||
|
||||
public void setStorePhone(String storePhone) {
|
||||
this.storePhone = storePhone;
|
||||
}
|
||||
|
||||
public String getStoreLat() {
|
||||
return storeLat;
|
||||
}
|
||||
|
||||
public void setStoreLat(String storeLat) {
|
||||
this.storeLat = storeLat;
|
||||
}
|
||||
|
||||
public String getStoreLng() {
|
||||
return storeLng;
|
||||
}
|
||||
|
||||
public void setStoreLng(String storeLng) {
|
||||
this.storeLng = storeLng;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fuint.repository.model;
|
||||
package com.fuint.business.store.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
@ -21,44 +23,27 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@TableName("mt_store")
|
||||
@ApiModel(value = "MtStore对象", description = "店铺表")
|
||||
public class MtStore implements Serializable {
|
||||
public class MtStore extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("所属商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty("连锁店主键")
|
||||
private Integer chainStoreId;
|
||||
@ApiModelProperty("关联机构主键")
|
||||
private Long contractDeptId;
|
||||
@ApiModelProperty("店铺名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("商户logo")
|
||||
private String logo;
|
||||
|
||||
@ApiModelProperty("是否默认")
|
||||
private String isDefault;
|
||||
|
||||
@ApiModelProperty("联系人姓名")
|
||||
private String contact;
|
||||
|
||||
@ApiModelProperty("微信支付商户号")
|
||||
private String wxMchId;
|
||||
|
||||
@ApiModelProperty("微信支付APIv2密钥")
|
||||
private String wxApiV2;
|
||||
|
||||
@ApiModelProperty("支付宝appId")
|
||||
private String alipayAppId;
|
||||
|
||||
@ApiModelProperty("支付宝应用私钥")
|
||||
private String alipayPrivateKey;
|
||||
|
||||
@ApiModelProperty("支付宝应用公钥")
|
||||
private String alipayPublicKey;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ -83,28 +68,10 @@ public class MtStore implements Serializable {
|
||||
@ApiModelProperty("统一社会信用代码")
|
||||
private String creditCode;
|
||||
|
||||
@ApiModelProperty("银行名称")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("银行卡账户名")
|
||||
private String bankCardName;
|
||||
|
||||
@ApiModelProperty("银行卡卡号")
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty("备注信息")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("状态,A:有效/启用;D:无效")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("最后操作人")
|
||||
private String operator;
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package com.fuint.repository.mapper;
|
||||
package com.fuint.business.store.mapper;
|
||||
|
||||
import com.fuint.repository.bean.StoreDistanceBean;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -17,7 +17,6 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
|
||||
|
||||
MtStore queryStoreByName(@Param("name") String name);
|
||||
|
||||
void resetDefaultStore();
|
||||
|
||||
List<MtStore> findStoresByIds(@Param("ids") List<Integer> ids);
|
||||
|
@ -1,16 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.repository.mapper.MtStoreMapper">
|
||||
<select id="queryStoreByName" resultType="com.fuint.repository.model.MtStore">
|
||||
select * from mt_store t where t.NAME = #{name}
|
||||
<mapper namespace="com.fuint.business.store.mapper.MtStoreMapper">
|
||||
<select id="queryStoreByName" resultType="com.fuint.business.store.entity.MtStore">
|
||||
select * from mt_store t where t.name = #{name}
|
||||
</select>
|
||||
|
||||
<update id="resetDefaultStore">
|
||||
update mt_store p set p.IS_DEFAULT = 'N'
|
||||
</update>
|
||||
|
||||
<select id="findStoresByIds" resultType="com.fuint.repository.model.MtStore">
|
||||
select * from mt_store where ID in
|
||||
<select id="findStoresByIds" resultType="com.fuint.business.store.entity.MtStore">
|
||||
select * from mt_store where id in
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@ -18,10 +15,7 @@
|
||||
|
||||
<select id="queryByDistance" resultType="com.fuint.repository.bean.StoreDistanceBean">
|
||||
SELECT t.id,(6371 * ACOS(COS( RADIANS(#{latitude}))*COS(RADIANS(t.latitude))*COS(RADIANS(t.longitude ) - RADIANS(#{longitude})) + SIN(RADIANS(#{latitude}))*SIN(RADIANS(t.latitude)))) AS distance
|
||||
FROM mt_store t WHERE t.status = 'A'
|
||||
<if test="merchantId != null and merchantId != ''">
|
||||
AND t.MERCHANT_ID = #{merchantId}
|
||||
</if>
|
||||
FROM mt_store t WHERE t.status = 'q'
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND t.name LIKE concat('%',#{keyword},'%')
|
||||
</if>
|
@ -1,11 +1,11 @@
|
||||
package com.fuint.common.service;
|
||||
package com.fuint.business.store.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.common.dto.StoreDto;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -1,22 +1,22 @@
|
||||
package com.fuint.common.service.impl;
|
||||
package com.fuint.business.store.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.dto.StoreDto;
|
||||
import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.enums.YesOrNoEnum;
|
||||
import com.fuint.common.service.MerchantService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.framework.annoation.OperationServiceLog;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.repository.bean.StoreDistanceBean;
|
||||
import com.fuint.repository.mapper.MtMerchantMapper;
|
||||
import com.fuint.repository.mapper.MtStoreMapper;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.repository.model.MtMerchant;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@ -73,25 +73,18 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
||||
lambdaQueryWrapper.eq(MtStore::getStatus, status);
|
||||
}
|
||||
String merchantId = paginationRequest.getSearchParams().get("merchantId") == null ? "" : paginationRequest.getSearchParams().get("merchantId").toString();
|
||||
if (StringUtils.isNotBlank(merchantId)) {
|
||||
lambdaQueryWrapper.eq(MtStore::getMerchantId, merchantId);
|
||||
}
|
||||
String storeId = paginationRequest.getSearchParams().get("storeId") == null ? "" : paginationRequest.getSearchParams().get("storeId").toString();
|
||||
if (StringUtils.isNotBlank(storeId)) {
|
||||
lambdaQueryWrapper.eq(MtStore::getId, storeId);
|
||||
}
|
||||
|
||||
lambdaQueryWrapper.orderByAsc(MtStore::getStatus).orderByDesc(MtStore::getIsDefault);
|
||||
lambdaQueryWrapper.orderByAsc(MtStore::getStatus);
|
||||
List<MtStore> storeList = mtStoreMapper.selectList(lambdaQueryWrapper);
|
||||
List<StoreDto> dataList = new ArrayList<>();
|
||||
|
||||
for (MtStore mtStore : storeList) {
|
||||
StoreDto storeDto = new StoreDto();
|
||||
BeanUtils.copyProperties(mtStore, storeDto);
|
||||
MtMerchant mtMerchant = mtMerchantMapper.selectById(mtStore.getMerchantId());
|
||||
if (mtMerchant != null) {
|
||||
storeDto.setMerchantName(mtMerchant.getName());
|
||||
}
|
||||
dataList.add(storeDto);
|
||||
}
|
||||
|
||||
@ -125,27 +118,8 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
||||
mtStore.setName(storeDto.getName());
|
||||
mtStore.setLogo(storeDto.getLogo());
|
||||
mtStore.setContact(storeDto.getContact());
|
||||
mtStore.setOperator(storeDto.getOperator());
|
||||
if (storeDto.getWxMchId() != null) {
|
||||
mtStore.setWxMchId(storeDto.getWxMchId());
|
||||
}
|
||||
if (storeDto.getWxApiV2() != null) {
|
||||
mtStore.setWxApiV2(storeDto.getWxApiV2());
|
||||
}
|
||||
if (storeDto.getAlipayAppId() != null) {
|
||||
mtStore.setAlipayAppId(storeDto.getAlipayAppId());
|
||||
}
|
||||
if (storeDto.getAlipayPrivateKey() != null) {
|
||||
mtStore.setAlipayPrivateKey(storeDto.getAlipayPrivateKey());
|
||||
}
|
||||
if (storeDto.getAlipayPublicKey() != null) {
|
||||
mtStore.setAlipayPublicKey(storeDto.getAlipayPublicKey());
|
||||
}
|
||||
mtStore.setLicense(storeDto.getLicense());
|
||||
mtStore.setCreditCode(storeDto.getCreditCode());
|
||||
mtStore.setBankName(storeDto.getBankName());
|
||||
mtStore.setBankCardName(storeDto.getBankCardName());
|
||||
mtStore.setBankCardNo(storeDto.getBankCardNo());
|
||||
mtStore.setUpdateTime(new Date());
|
||||
if (storeDto.getId() == null) {
|
||||
mtStore.setCreateTime(new Date());
|
||||
@ -153,21 +127,11 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
||||
mtStore.setDescription(storeDto.getDescription());
|
||||
mtStore.setPhone(storeDto.getPhone());
|
||||
|
||||
if (storeDto.getIsDefault() != null) {
|
||||
if (storeDto.getIsDefault().equals(YesOrNoEnum.YES.getKey())) {
|
||||
mtStoreMapper.resetDefaultStore();
|
||||
}
|
||||
}
|
||||
|
||||
mtStore.setIsDefault(storeDto.getIsDefault());
|
||||
mtStore.setAddress(storeDto.getAddress());
|
||||
mtStore.setHours(storeDto.getHours());
|
||||
mtStore.setLatitude(storeDto.getLatitude());
|
||||
mtStore.setLongitude(storeDto.getLongitude());
|
||||
mtStore.setStatus(storeDto.getStatus());
|
||||
if (storeDto.getMerchantId() != null) {
|
||||
mtStore.setMerchantId(storeDto.getMerchantId());
|
||||
}
|
||||
|
||||
if (mtStore.getStatus() == null) {
|
||||
mtStore.setStatus(StatusEnum.ENABLED.getKey());
|
||||
@ -295,7 +259,6 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
||||
|
||||
mtStore.setStatus(status);
|
||||
mtStore.setUpdateTime(new Date());
|
||||
mtStore.setOperator(operator);
|
||||
|
||||
mtStoreMapper.updateById(mtStore);
|
||||
}
|
||||
@ -319,11 +282,8 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
||||
lambdaQueryWrapper.eq(MtStore::getStatus, status);
|
||||
}
|
||||
String merchantId = params.get("merchantId") == null ? "" : params.get("merchantId").toString();
|
||||
if (StringUtils.isNotBlank(merchantId)) {
|
||||
lambdaQueryWrapper.eq(MtStore::getMerchantId, merchantId);
|
||||
}
|
||||
|
||||
lambdaQueryWrapper.orderByAsc(MtStore::getStatus).orderByDesc(MtStore::getIsDefault);
|
||||
lambdaQueryWrapper.orderByAsc(MtStore::getStatus);
|
||||
List<MtStore> dataList = mtStoreMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
return dataList;
|
@ -25,10 +25,10 @@ public class UserConstants
|
||||
public static final String ROLE_DISABLE = "1";
|
||||
|
||||
/** 部门正常状态 */
|
||||
public static final String DEPT_NORMAL = "0";
|
||||
public static final String DEPT_NORMAL = "qy";
|
||||
|
||||
/** 部门停用状态 */
|
||||
public static final String DEPT_DISABLE = "1";
|
||||
public static final String DEPT_DISABLE = "jy";
|
||||
|
||||
/** 字典正常状态 */
|
||||
public static final String DICT_NORMAL = "0";
|
||||
|
@ -2,7 +2,7 @@ package com.fuint.common.dto;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fuint.repository.model.MtCoupon;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
@ -3,7 +3,7 @@ package com.fuint.common.dto;
|
||||
import com.fuint.repository.model.MtGoodsCate;
|
||||
import com.fuint.repository.model.MtGoodsSku;
|
||||
import com.fuint.repository.model.MtGoodsSpec;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fuint.common.dto;
|
||||
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.fuint.common.dto;
|
||||
|
||||
import com.fuint.repository.model.MtCoupon;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.fuint.common.dto;
|
||||
|
||||
import com.fuint.repository.model.MtRefund;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.common.dto.AccountDto;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.service.AccountService;
|
||||
|
@ -8,6 +8,8 @@ import com.alipay.api.internal.util.AlipaySignature;
|
||||
import com.alipay.api.response.AlipayTradePayResponse;
|
||||
import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||
import com.alipay.api.response.AlipayTradeRefundResponse;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.bean.AliPayBean;
|
||||
import com.fuint.common.dto.OrderDto;
|
||||
import com.fuint.common.dto.UserOrderDto;
|
||||
@ -141,11 +143,6 @@ public class AlipayServiceImpl implements AlipayService {
|
||||
|
||||
// 优先读取店铺的支付账号
|
||||
MtStore mtStore = storeService.queryStoreById(storeId);
|
||||
if (mtStore != null && StringUtil.isNotEmpty(mtStore.getAlipayAppId()) && StringUtil.isNotEmpty(mtStore.getAlipayPrivateKey()) && StringUtil.isNotEmpty(mtStore.getAlipayPublicKey())) {
|
||||
appId = mtStore.getAlipayAppId();
|
||||
privateKey = mtStore.getAlipayPrivateKey();
|
||||
publicKey = mtStore.getAlipayPublicKey();
|
||||
}
|
||||
|
||||
aliPayApiConfig = AliPayApiConfig.builder()
|
||||
.setAppId(appId)
|
||||
|
@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.common.dto.GoodsCateDto;
|
||||
import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.service.CateService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.framework.annoation.OperationServiceLog;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
@ -15,7 +15,7 @@ import com.fuint.repository.mapper.MtGoodsCateMapper;
|
||||
import com.fuint.repository.mapper.MtGoodsMapper;
|
||||
import com.fuint.repository.model.MtGoods;
|
||||
import com.fuint.repository.model.MtGoodsCate;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -3,12 +3,13 @@ package com.fuint.common.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.common.dto.ConfirmLogDto;
|
||||
import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.service.ConfirmLogService;
|
||||
import com.fuint.common.service.CouponService;
|
||||
import com.fuint.common.service.MemberService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.common.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.CouponDto;
|
||||
import com.fuint.common.dto.ReqCouponDto;
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.common.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.GoodsDto;
|
||||
import com.fuint.common.dto.GoodsSpecValueDto;
|
||||
@ -13,7 +14,7 @@ import com.fuint.common.enums.YesOrNoEnum;
|
||||
import com.fuint.common.service.CateService;
|
||||
import com.fuint.common.service.GoodsService;
|
||||
import com.fuint.common.service.SettingService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.framework.annoation.OperationServiceLog;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
@ -417,7 +418,6 @@ public class GoodsServiceImpl extends ServiceImpl<MtGoodsMapper, MtGoods> implem
|
||||
if (mtStore == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Integer merchantId = mtStore.getMerchantId() == null ? 0 : mtStore.getMerchantId();
|
||||
List<MtGoods> goodsList = new ArrayList<>();
|
||||
List<MtGoodsSku> skuList = new ArrayList<>();
|
||||
if (StringUtil.isNotEmpty(keyword)) {
|
||||
@ -426,12 +426,6 @@ public class GoodsServiceImpl extends ServiceImpl<MtGoodsMapper, MtGoods> implem
|
||||
if (skuList != null && skuList.size() > 0) {
|
||||
MtGoods goods = mtGoodsMapper.selectById(skuList.get(0).getGoodsId());
|
||||
goodsList.add(goods);
|
||||
} else {
|
||||
if (keyword != null && StringUtil.isNotEmpty(keyword)) {
|
||||
goodsList = mtGoodsMapper.searchStoreGoodsList(merchantId, storeId, keyword);
|
||||
} else {
|
||||
goodsList = mtGoodsMapper.getStoreGoodsList(merchantId, storeId);
|
||||
}
|
||||
}
|
||||
List<MtGoods> dataList = new ArrayList<>();
|
||||
if (goodsList.size() > 0) {
|
||||
@ -531,9 +525,6 @@ public class GoodsServiceImpl extends ServiceImpl<MtGoodsMapper, MtGoods> implem
|
||||
|
||||
Integer merchantId = 0;
|
||||
MtStore mtStore = storeService.queryStoreById(storeId);
|
||||
if (mtStore != null) {
|
||||
merchantId = mtStore.getMerchantId();
|
||||
}
|
||||
Page<MtGoods> pageHelper = PageHelper.startPage(page, pageSize);
|
||||
List<GoodsDto> dataList = new ArrayList<>();
|
||||
|
||||
|
@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.MemberTopDto;
|
||||
import com.fuint.common.dto.UserDto;
|
||||
|
@ -11,9 +11,9 @@ import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.repository.mapper.MtMerchantMapper;
|
||||
import com.fuint.repository.mapper.MtStoreMapper;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.repository.model.MtMerchant;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@ -222,9 +222,6 @@ public class MerchantServiceImpl extends ServiceImpl<MtMerchantMapper, MtMerchan
|
||||
String storeId = params.get("storeId") == null ? "" : params.get("storeId").toString();
|
||||
if (StringUtils.isNotBlank(storeId) && StringUtil.isEmpty(merchantId)) {
|
||||
MtStore mtStore = mtStoreMapper.selectById(storeId);
|
||||
if (mtStore != null && mtStore.getMerchantId() > 0) {
|
||||
lambdaQueryWrapper.eq(MtMerchant::getId, mtStore.getMerchantId());
|
||||
}
|
||||
}
|
||||
String name = params.get("name") == null ? "" : params.get("name").toString();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
|
@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.*;
|
||||
import com.fuint.common.enums.*;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.common.service.impl;
|
||||
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.OrderDto;
|
||||
import com.fuint.common.dto.UserInfo;
|
||||
|
@ -7,14 +7,14 @@ import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.service.MemberService;
|
||||
import com.fuint.common.service.SendSmsService;
|
||||
import com.fuint.common.service.StaffService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.framework.annoation.OperationServiceLog;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.repository.mapper.MtStaffMapper;
|
||||
import com.fuint.repository.model.MtStaff;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.common.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.config.Message;
|
||||
import com.fuint.common.dto.CouponDto;
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.common.service.impl;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.bean.WxPayBean;
|
||||
import com.fuint.common.dto.OrderDto;
|
||||
import com.fuint.common.dto.UserOrderDto;
|
||||
@ -739,10 +741,6 @@ public class WeixinServiceImpl implements WeixinService {
|
||||
MtStore mtStore = storeService.queryStoreById(storeId);
|
||||
String mchId = wxPayBean.getMchId();
|
||||
String apiV2 = wxPayBean.getApiV2();
|
||||
if (mtStore != null && StringUtil.isNotEmpty(mtStore.getWxApiV2()) && StringUtil.isNotEmpty(mtStore.getWxMchId())) {
|
||||
mchId = mtStore.getWxMchId();
|
||||
apiV2 = mtStore.getWxApiV2();
|
||||
}
|
||||
apiConfig = WxPayApiConfig.builder()
|
||||
.appId(wxPayBean.getAppId())
|
||||
.mchId(mchId)
|
||||
@ -755,14 +753,6 @@ public class WeixinServiceImpl implements WeixinService {
|
||||
String wxAppId = env.getProperty("weixin.official.appId");
|
||||
String wxAppSecret = env.getProperty("weixin.official.appSecret");
|
||||
|
||||
if (mtStore != null) {
|
||||
MtMerchant mtMerchant = merchantService.queryMerchantById(mtStore.getMerchantId());
|
||||
if (mtMerchant != null && StringUtil.isNotEmpty(mtMerchant.getWxOfficialAppId()) && StringUtil.isNotEmpty(mtMerchant.getWxOfficialAppSecret())) {
|
||||
wxAppId = mtMerchant.getWxOfficialAppId();
|
||||
wxAppSecret = mtMerchant.getWxOfficialAppSecret();
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isNotEmpty(wxAppId) && StringUtil.isNotEmpty(wxAppSecret)) {
|
||||
apiConfig.setAppId(wxAppId);
|
||||
apiConfig.setApiKey(wxAppSecret);
|
||||
|
@ -3,7 +3,7 @@ package com.fuint.module.backendApi.controller;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.ArticleDto;
|
||||
import com.fuint.common.service.ArticleService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
@ -14,7 +14,7 @@ import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.repository.model.MtArticle;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
@ -14,7 +14,7 @@ import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.common.service.BannerService;
|
||||
import com.fuint.repository.model.MtBanner;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.dto.*;
|
||||
import com.fuint.common.enums.OrderModeEnum;
|
||||
import com.fuint.common.enums.PlatformTypeEnum;
|
||||
|
@ -7,7 +7,7 @@ import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.service.AccountService;
|
||||
import com.fuint.common.service.CateService;
|
||||
import com.fuint.common.service.SettingService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.CommonUtil;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
@ -16,7 +16,7 @@ import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtGoodsCate;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.TAccount;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -2,7 +2,7 @@ package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.service.CommissionRuleService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
@ -12,7 +12,7 @@ import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.repository.model.MtCommissionRule;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -2,7 +2,7 @@ package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.service.CommissionRuleService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
@ -12,7 +12,7 @@ import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.repository.model.MtCommissionRule;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.*;
|
||||
import com.fuint.common.enums.CouponTypeEnum;
|
||||
|
@ -2,6 +2,8 @@ package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.*;
|
||||
import com.fuint.common.enums.GoodsTypeEnum;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.UserDto;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.dto.*;
|
||||
import com.fuint.common.enums.*;
|
||||
import com.fuint.common.param.OrderListParam;
|
||||
@ -9,7 +10,7 @@ import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtSetting;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
import com.fuint.repository.model.TAccount;
|
||||
import com.fuint.utils.StringUtil;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.GoodsDto;
|
||||
|
@ -7,7 +7,7 @@ import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.enums.YesOrNoEnum;
|
||||
import com.fuint.common.service.MerchantService;
|
||||
import com.fuint.common.service.SettingService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.CommonUtil;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
@ -16,7 +16,7 @@ import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtMerchant;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.ParamDto;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.module.clientApi.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.dto.TokenDto;
|
||||
import com.fuint.common.dto.UserInfo;
|
||||
import com.fuint.common.enums.GenderEnum;
|
||||
@ -13,7 +14,7 @@ import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtMerchant;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
import com.fuint.repository.model.MtVerifyCode;
|
||||
import com.fuint.utils.StringUtil;
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.fuint.module.clientApi.controller;
|
||||
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -6,12 +6,12 @@ import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.service.MemberService;
|
||||
import com.fuint.common.service.MerchantService;
|
||||
import com.fuint.common.service.SettingService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -103,9 +103,6 @@ public class ClientSystemController extends BaseController {
|
||||
if (!storeInfo.getStatus().equals(StatusEnum.ENABLED.getKey())) {
|
||||
storeInfo = null;
|
||||
}
|
||||
if (storeInfo != null && !merchantId.equals(storeInfo.getMerchantId())) {
|
||||
storeInfo = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,14 +63,11 @@ public class SysDeptController extends BaseController
|
||||
* 新增部门
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResponseObject add(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
public ResponseObject add(@Validated @RequestBody SysDept dept) throws Exception {
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
{
|
||||
return getFailureResult("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
dept.setCreateBy(nowAccountInfo.getId().toString());
|
||||
return getSuccessResult(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
|
@ -38,27 +38,16 @@ public class SysDept extends BaseEntity
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
//节点类型:1代理商2连锁店3基本门店
|
||||
private String deptType;
|
||||
|
||||
/** 负责人 */
|
||||
private Integer leaderAccountId;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 部门状态:0正常,1停用 */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
|
||||
/** 子部门 */
|
||||
|
@ -95,11 +95,4 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
|
||||
*/
|
||||
public int updateDeptChildren(@Param("depts") List<SysDept> depts);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectDeptList" resultType="com.fuint.system.dept.entity.SysDept">
|
||||
select *
|
||||
from sys_dept d
|
||||
where d.del_flag = '0'
|
||||
where 1=1
|
||||
<if test="dept.deptId != null and dept.deptId != 0">
|
||||
AND dept_id = #{dept.deptId}
|
||||
</if>
|
||||
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_dept
|
||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||
where parent_id = #{deptId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenDeptById" resultType="com.fuint.system.dept.entity.SysDept">
|
||||
@ -61,13 +61,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||
select count(*) from sys_dept where status = 0 and find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultType="com.fuint.system.dept.entity.SysDept">
|
||||
select *
|
||||
from sys_dept
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
@ -91,9 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
@ -94,7 +94,7 @@ public interface ISysDeptService extends IService<SysDept>
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(SysDept dept);
|
||||
public int insertDept(SysDept dept) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
|
@ -1,7 +1,13 @@
|
||||
package com.fuint.system.dept.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.store.entity.ChainStoreInfo;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.ChainStoreInfoService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.constant.UserConstants;
|
||||
import com.fuint.common.domain.TreeSelect;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
@ -14,6 +20,7 @@ import com.fuint.system.dept.mapper.SysDeptMapper;
|
||||
import com.fuint.system.dept.service.ISysDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@ -29,6 +36,11 @@ import java.util.stream.Collectors;
|
||||
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> implements ISysDeptService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ChainStoreInfoService chainStoreService;
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
@ -173,8 +185,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDept(SysDept dept)
|
||||
{
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertDept(SysDept dept) throws Exception {
|
||||
if (null!=dept.getParentId()){
|
||||
SysDept info = baseMapper.selectDeptById(dept.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
@ -184,6 +196,47 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
}
|
||||
//处理店铺
|
||||
if(StringUtils.isNotEmpty(dept.getDeptType())){
|
||||
if (dept.getDeptType().equals("3")){
|
||||
//基本门店
|
||||
SysDept parentDept = this.getById(dept.getParentId());
|
||||
if (parentDept.getDeptType().equals("2")){
|
||||
//父节点是连锁店
|
||||
LambdaQueryWrapper<ChainStoreInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ChainStoreInfo::getContractDeptId,parentDept.getDeptId());
|
||||
ChainStoreInfo chainStoreInfo = chainStoreService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(chainStoreInfo)){
|
||||
MtStore store =new MtStore();
|
||||
store.setName(dept.getDeptName());
|
||||
store.setChainStoreId(chainStoreInfo.getId());
|
||||
store.setContractDeptId(dept.getDeptId());
|
||||
storeService.save(store);
|
||||
}else {
|
||||
throw new Exception("数据有误,请联系管理员");
|
||||
}
|
||||
}else {
|
||||
throw new Exception("请先创建连锁店节点,在建立普通门店");
|
||||
}
|
||||
}else if(dept.getDeptType().equals("2")){
|
||||
//连锁店
|
||||
SysDept parentDept = this.getById(dept.getParentId());
|
||||
if (parentDept.getDeptType().equals("1")){
|
||||
ChainStoreInfo chainStoreInfo = new ChainStoreInfo();
|
||||
chainStoreInfo.setStoreName(dept.getDeptName());
|
||||
chainStoreInfo.setContractDeptId(dept.getDeptId());
|
||||
chainStoreService.save(chainStoreInfo);
|
||||
}else {
|
||||
throw new Exception("请在正确的节点类型下创建连锁店");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//代理商
|
||||
dept.setDeptType("1");
|
||||
}
|
||||
if (StringUtils.isEmpty(dept.getStatus())){
|
||||
dept.setStatus("qy");
|
||||
}
|
||||
return baseMapper.insert(dept);
|
||||
}
|
||||
|
||||
@ -205,6 +258,19 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
dept.setAncestors(newAncestors);
|
||||
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
|
||||
}
|
||||
if (dept.getDeptType().equals("2")){
|
||||
LambdaQueryWrapper<ChainStoreInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ChainStoreInfo::getContractDeptId,dept.getDeptId());
|
||||
ChainStoreInfo chainStoreInfo = chainStoreService.getOne(queryWrapper);
|
||||
chainStoreInfo.setStoreName(dept.getDeptName());
|
||||
chainStoreService.updateById(chainStoreInfo);
|
||||
}else if (dept.getDeptType().equals("3")){
|
||||
LambdaQueryWrapper<MtStore> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MtStore::getContractDeptId,dept.getDeptId());
|
||||
MtStore store = storeService.getOne(queryWrapper);
|
||||
store.setName(dept.getDeptName());
|
||||
storeService.updateById(store);
|
||||
}
|
||||
int result = baseMapper.updateById(dept);
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
||||
&& !StringUtils.equals("0", dept.getAncestors()))
|
||||
@ -256,7 +322,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
@Override
|
||||
public int deleteDeptById(Long deptId)
|
||||
{
|
||||
return baseMapper.deleteDeptById(deptId);
|
||||
return baseMapper.deleteById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,8 +43,7 @@ public class DictUtils
|
||||
Object arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(arrayCache))
|
||||
{
|
||||
List<SysDictData> res = JSONArray.parseArray(JSONArray.toJSONString(arrayCache),SysDictData.class);
|
||||
return res;
|
||||
return JSONArray.parseArray(JSONArray.toJSONString(arrayCache),SysDictData.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.fuint.system.user.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.common.dto.AccountDto;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.RoleDto;
|
||||
@ -10,16 +9,14 @@ import com.fuint.common.enums.StatusEnum;
|
||||
import com.fuint.common.service.AccountService;
|
||||
import com.fuint.common.service.DutyService;
|
||||
import com.fuint.common.service.MerchantService;
|
||||
import com.fuint.common.service.StoreService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.CommonUtil;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.repository.model.MtMerchant;
|
||||
import com.fuint.repository.model.MtStore;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.repository.model.TAccount;
|
||||
import com.fuint.repository.model.TDuty;
|
||||
import com.fuint.utils.StringUtil;
|
||||
|
Loading…
Reference in New Issue
Block a user