Merge branch 'feature/mall_product_new'

pull/2/head^2
perry 2023-05-26 13:46:04 +08:00
commit f4751d6057
28 changed files with 179 additions and 181 deletions

View File

@ -74,7 +74,7 @@ public class ShippingTemplatesController {
@Operation(summary = "删除")
@RequestMapping(value = "/delete", method = RequestMethod.GET)
@Parameter(name="id", description="模板ID", required = true)
public CommonResult<String> delete(@RequestParam(value = "id") Integer id){
public CommonResult<String> delete(@RequestParam(value = "id") Long id){
if(shippingTemplatesService.remove(id)){
return success("删除成功");
}else{
@ -90,7 +90,7 @@ public class ShippingTemplatesController {
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:update')")
@Operation(summary = "修改")
@RequestMapping(value = "/update", method = RequestMethod.POST)
public CommonResult<String> update(@RequestParam Integer id, @RequestBody @Validated ShippingTemplatesReqVO request){
public CommonResult<String> update(@RequestParam Long id, @RequestBody @Validated ShippingTemplatesReqVO request){
if (shippingTemplatesService.update(id, request)) {
return CommonResult.success("修改成功");
}
@ -105,7 +105,7 @@ public class ShippingTemplatesController {
@Operation(summary = "详情")
@RequestMapping(value = "/info", method = RequestMethod.GET)
@Parameter(name="id", description="模板ID", required = true)
public CommonResult<ShippingTemplatesDO> info(@RequestParam(value = "id") Integer id){
public CommonResult<ShippingTemplatesDO> info(@RequestParam(value = "id") Long id){
return CommonResult.success(shippingTemplatesService.getInfo(id));
}
}

View File

@ -43,7 +43,7 @@ public class ShippingTemplatesFreeController {
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:free:list')")
@Operation(summary = "根据模板id查询数据")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<List<ShippingTemplatesFreeRespVO>> getList(@RequestParam Integer tempId){
public CommonResult<List<ShippingTemplatesFreeRespVO>> getList(@RequestParam Long tempId){
return CommonResult.success(shippingTemplatesFreeService.getListGroup(tempId));
}

View File

@ -43,7 +43,7 @@ public class ShippingTemplatesNoDeliveryController {
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:free:list')")
@Operation(summary = "根据模板id查询数据")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<List<ShippingTemplatesNoDeliveryRespVO>> getList(@RequestParam Integer tempId){
public CommonResult<List<ShippingTemplatesNoDeliveryRespVO>> getList(@RequestParam Long tempId){
return CommonResult.success(shippingTemplatesNoDeliveryService.getListGroup(tempId));
}

View File

@ -43,7 +43,7 @@ public class ShippingTemplatesRegionController {
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:region:list')")
@Operation(summary = "根据模板id查询数据")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<List<ShippingTemplatesRegionRespVO>> getList(@RequestParam Integer tempId){
public CommonResult<List<ShippingTemplatesRegionRespVO>> getList(@RequestParam Long tempId){
return CommonResult.success(shippingTemplatesRegionService.getListGroup(tempId));
}
}

View File

@ -29,7 +29,7 @@ public class ShippingTemplatesDO extends BaseDO {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Integer id;
private Long id;
/**
*

View File

@ -31,12 +31,12 @@ public class ShippingTemplatesFreeDO implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
/**
* ID
*/
private Integer tempId;
private Long tempId;
private Integer provinceId;

View File

@ -30,12 +30,12 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
/**
* ID
*/
private Integer tempId;
private Long tempId;
/**
*ID

View File

@ -31,12 +31,12 @@ public class ShippingTemplatesRegionDO implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
/**
* ID
*/
private Integer tempId;
private Long tempId;
/**
*ID

View File

@ -22,5 +22,5 @@ import java.util.List;
@Mapper
public interface ShippingTemplatesFreeMapper extends BaseMapperX<ShippingTemplatesFreeDO> {
List<ShippingTemplatesFreeRespVO> getListGroup(Integer tempId);
List<ShippingTemplatesFreeRespVO> getListGroup(Long tempId);
}

View File

@ -22,6 +22,6 @@ import java.util.List;
@Mapper
public interface ShippingTemplatesNoDeliveryMapper extends BaseMapperX<ShippingTemplatesNoDeliveryDO> {
List<ShippingTemplatesNoDeliveryRespVO> getList(Integer tempId);
List<ShippingTemplatesNoDeliveryRespVO> getList(Long tempId);
}

View File

@ -22,5 +22,5 @@ import java.util.List;
@Mapper
public interface ShippingTemplatesRegionMapper extends BaseMapperX<ShippingTemplatesRegionDO> {
List<ShippingTemplatesRegionRespVO> getListGroup(Integer tempId);
List<ShippingTemplatesRegionRespVO> getListGroup(Long tempId);
}

View File

@ -24,15 +24,15 @@ import java.util.List;
@Validated
public interface ShippingTemplatesFreeService extends IService<ShippingTemplatesFreeDO> {
void saveAll(List<ShippingTemplatesFreeRespVO> shippingTemplatesFreeRespVOList, Integer type, Integer id);
void saveAll(List<ShippingTemplatesFreeRespVO> shippingTemplatesFreeRespVOList, Integer type, Long id);
List<ShippingTemplatesFreeRespVO> getListGroup(Integer tempId);
List<ShippingTemplatesFreeRespVO> getListGroup(Long tempId);
/**
*
* @param tempId id
*/
Boolean delete(Integer tempId);
Boolean delete(Long tempId);
/**
* ID
@ -40,5 +40,5 @@ public interface ShippingTemplatesFreeService extends IService<ShippingTemplates
* @param cityId ID
* @return
*/
ShippingTemplatesFreeDO getByTempIdAndCityId(Integer tempId, Integer cityId);
ShippingTemplatesFreeDO getByTempIdAndCityId(Long tempId, Integer cityId);
}

View File

@ -25,9 +25,9 @@ import java.util.List;
@Validated
public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTemplatesNoDeliveryDO> {
void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Integer id);
void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Long id);
List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Integer tempId);
List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Long tempId);
/**
* ID
@ -35,7 +35,7 @@ public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTem
* @param cityId ID
* @return
*/
ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Integer tempId, Integer cityId);
ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Long tempId, Integer cityId);
public Boolean delete(Integer tempId);
public Boolean delete(Long tempId);
}

View File

@ -25,16 +25,16 @@ import java.util.List;
@Validated
public interface ShippingTemplatesRegionService extends IService<ShippingTemplatesRegionDO> {
void saveAll(List<ShippingTemplatesRegionRespVO> shippingTemplatesRegionRespVOList, Integer type, Integer id);
void saveAll(List<ShippingTemplatesRegionRespVO> shippingTemplatesRegionRespVOList, Integer type, Long id);
List<ShippingTemplatesRegionRespVO> getListGroup(Integer tempId);
List<ShippingTemplatesRegionRespVO> getListGroup(Long tempId);
/**
*
* @param tempId id
* @return Boolean
*/
Boolean delete(Integer tempId);
Boolean delete(Long tempId);
/**
* ID
@ -42,5 +42,5 @@ public interface ShippingTemplatesRegionService extends IService<ShippingTemplat
* @param cityId ID
* @return
*/
ShippingTemplatesRegionDO getByTempIdAndCityId(Integer tempId, Integer cityId);
ShippingTemplatesRegionDO getByTempIdAndCityId(Long tempId, Integer cityId);
}

View File

@ -35,19 +35,19 @@ public interface ShippingTemplatesService extends IService<ShippingTemplatesDO>
*/
Boolean create(ShippingTemplatesReqVO request);
Boolean update(Integer id, ShippingTemplatesReqVO request);
Boolean update(Long id, ShippingTemplatesReqVO request);
/**
*
* @param id id
* @return Boolean
*/
Boolean remove(Integer id);
Boolean remove(Long id);
/**
*
* @param id id
* @return ShippingTemplates
*/
ShippingTemplatesDO getInfo(Integer id);
ShippingTemplatesDO getInfo(Long id);
}

View File

@ -12,7 +12,6 @@ import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesFreeService
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -48,9 +47,8 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
* @author Mr.Zhang
* @since 2020-05-20
*/
@Async
@Override
public void saveAll(List<ShippingTemplatesFreeRespVO> shippingTemplatesFreeRespVOList, Integer type, Integer tempId) {
public void saveAll(List<ShippingTemplatesFreeRespVO> shippingTemplatesFreeRespVOList, Integer type, Long tempId) {
ArrayList<ShippingTemplatesFreeDO> shippingTemplatesFreesListDO = new ArrayList<>();
@ -82,6 +80,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
//删除模板下的无效数据
deleteStatusFalse(tempId);
}
/**
@ -105,7 +104,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
* @author Mr.Zhang
* @since 2020-05-20
*/
private void updateStatus(Integer tempId) {
private void updateStatus(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
@ -119,7 +118,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
* @param tempId Integer id
*/
@Override
public Boolean delete(Integer tempId) {
public Boolean delete(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
return dao.delete(lambdaQueryWrapper) > 0;
@ -129,7 +128,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
*
* @param tempId Integer id
*/
public Boolean deleteStatusFalse(Integer tempId) {
public Boolean deleteStatusFalse(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getStatus, false);
@ -143,7 +142,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
* @return
*/
@Override
public ShippingTemplatesFreeDO getByTempIdAndCityId(Integer tempId, Integer cityId) {
public ShippingTemplatesFreeDO getByTempIdAndCityId(Long tempId, Integer cityId) {
LambdaQueryWrapper<ShippingTemplatesFreeDO> lqw = new LambdaQueryWrapper<>();
lqw.eq(ShippingTemplatesFreeDO::getTempId, tempId);
lqw.eq(ShippingTemplatesFreeDO::getCityId, cityId);
@ -159,7 +158,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
* @return List<ShippingTemplatesFreeRequest>
*/
@Override
public List<ShippingTemplatesFreeRespVO> getListGroup(Integer tempId) {
public List<ShippingTemplatesFreeRespVO> getListGroup(Long tempId) {
return dao.getListGroup(tempId);
}
}

View File

@ -37,7 +37,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
* @since 2020-05-20
*/
@Override
public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Long tempId) {
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
delete(tempId);
@ -64,7 +64,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
* @param tempId Integer id
*/
@Override
public Boolean delete(Integer tempId) {
public Boolean delete(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
return shippingTemplatesNoDeliveryMapper.delete(lambdaQueryWrapper) > 0;
@ -92,7 +92,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
* @return List<ShippingTemplatesFreeRequest>
*/
@Override
public List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Integer tempId) {
public List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Long tempId) {
return shippingTemplatesNoDeliveryMapper.getList(tempId);
}
@ -103,7 +103,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
* @return
*/
@Override
public ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Integer tempId, Integer cityId) {
public ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Long tempId, Integer cityId) {
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lqw = new LambdaQueryWrapper<>();
lqw.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
lqw.eq(ShippingTemplatesNoDeliveryDO::getCityId, cityId);

View File

@ -59,9 +59,8 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
* @author Mr.Zhang
* @since 2020-05-20
*/
@Async
@Override
public void saveAll(List<ShippingTemplatesRegionRespVO> shippingTemplatesRegionRespVOList, Integer type, Integer tempId) {
public void saveAll(List<ShippingTemplatesRegionRespVO> shippingTemplatesRegionRespVOList, Integer type, Long tempId) {
ArrayList<ShippingTemplatesRegionDO> shippingTemplatesRegionDOList = new ArrayList<>();
//把目前模板下的所有数据标记为无效
@ -95,6 +94,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
//删除模板下的无效数据
deleteStatusFalse(tempId);
}
/**
@ -120,7 +120,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
* @author Mr.Zhang
* @since 2020-05-20
*/
private void updateStatus(Integer tempId) {
private void updateStatus(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
@ -134,7 +134,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
* @param tempId Integer id
* @return Boolean
*/
public Boolean deleteStatusFalse(Integer tempId) {
public Boolean deleteStatusFalse(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, false);
@ -148,7 +148,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
* @return
*/
@Override
public ShippingTemplatesRegionDO getByTempIdAndCityId(Integer tempId, Integer cityId) {
public ShippingTemplatesRegionDO getByTempIdAndCityId(Long tempId, Integer cityId) {
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getCityId, cityId);
@ -163,12 +163,12 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
* @return List<ShippingTemplatesRegionRequest>
*/
@Override
public List<ShippingTemplatesRegionRespVO> getListGroup(Integer tempId) {
public List<ShippingTemplatesRegionRespVO> getListGroup(Long tempId) {
return dao.getListGroup(tempId);
}
@Override
public Boolean delete(Integer tempId) {
public Boolean delete(Long tempId) {
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
return dao.delete(lambdaQueryWrapper) > 0;

View File

@ -146,7 +146,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
* @param request ShippingTemplatesRequest
*/
@Override
public Boolean update(Integer id, ShippingTemplatesReqVO request) {
public Boolean update(Long id, ShippingTemplatesReqVO request) {
ShippingTemplatesDO shippingTemplatesDO = new ShippingTemplatesDO();
shippingTemplatesDO.setId(id);
shippingTemplatesDO.setName(request.getName());
@ -184,7 +184,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
* @return boolean
*/
@Override
public Boolean remove(Integer id) {
public Boolean remove(Long id) {
return transactionTemplate.execute(e -> {
shippingTemplatesRegionService.delete(id);
shippingTemplatesFreeService.delete(id);
@ -200,7 +200,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
* @return ShippingTemplates
*/
@Override
public ShippingTemplatesDO getInfo(Integer id) {
public ShippingTemplatesDO getInfo(Long id) {
ShippingTemplatesDO template = getById(id);
if (ObjectUtil.isNull(template)) {
throw new ServiceException("模板不存在");

View File

@ -4,19 +4,19 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.member.api.address.AddressApi;
import cn.iocoder.yudao.module.member.api.address.UserAddressApi;
import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO;
import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.constants.PayConstants;
import cn.iocoder.yudao.framework.common.enums.Constants;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi;
import cn.iocoder.yudao.module.member.api.address.AddressApi;
import cn.iocoder.yudao.module.member.api.address.UserAddressApi;
import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.constants.PayConstants;
import cn.iocoder.yudao.module.shop.constants.SysConfigConstants;
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderConvert;
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderOneConvert;
@ -28,7 +28,6 @@ import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder;
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrderInfo;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttrValue;
import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesMapper;
import cn.iocoder.yudao.module.shop.dal.mysql.order.StoreOrderMapper;
import cn.iocoder.yudao.module.shop.request.order.*;
import cn.iocoder.yudao.module.shop.request.product.StoreProductReplyAddRequest;
@ -47,7 +46,10 @@ import cn.iocoder.yudao.module.shop.service.product.StoreProductService;
import cn.iocoder.yudao.module.shop.utils.CrmebUtil;
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
import cn.iocoder.yudao.module.shop.utils.RedisUtil;
import cn.iocoder.yudao.module.shop.vo.order.*;
import cn.iocoder.yudao.module.shop.vo.order.OrderInfoDetailVo;
import cn.iocoder.yudao.module.shop.vo.order.OrderInfoVo;
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo;
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoVo;
import cn.iocoder.yudao.module.shop.vo.product.MyRecord;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -62,7 +64,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
@ -692,7 +693,7 @@ public class OrderServiceImpl implements OrderService {
for (Map.Entry<Integer, MyRecord> m : proMap.entrySet()) {
MyRecord value = m.getValue();
Integer tempId = value.getInt("tempId");
Long tempId = value.getLong("tempId");
ShippingTemplatesDO shippingTemplatesDO = shippingTemplatesApi.getById(tempId);
if (shippingTemplatesDO.getAppoint()) {// 指定包邮
// 判断是否在指定包邮区域内

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesFreeMapper">
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO" parameterType="integer">
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO" parameterType="Long">
SELECT
city_id, province_id, title, `number`, price, uniqid
FROM

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliveryMapper">
<select id="getList" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO" parameterType="integer">
<select id="getList" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO" parameterType="Long">
SELECT
city_id, province_id, title, uniqid
FROM

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesRegionMapper">
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO" parameterType="integer">
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO" parameterType="Long">
SELECT
city_id, province_id, `first`, first_price, title, `renewal`, renewal_price, uniqid
FROM

View File

@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
@ -71,11 +72,11 @@ public class PromoterServiceImpl implements PromoterService {
memberUserDO.setMobile(createReqVO.getMobile());
memberUserDO.setStatus(createReqVO.getStatus());
memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length() - 6));
memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP());
memberUserDO = memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP());
}
// 插入
PromoterDO promoter = PromoterConvert.INSTANCE.convert(createReqVO);
promoter.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
promoter.setTenantId(TenantContextHolder.getTenantId());
Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId()));
if (count > 0) {
throw new ServiceException(PROMOTER_EXISTS);

View File

@ -240,5 +240,5 @@ wx:
database: 16 # 数据库索引
password: 20221122@dev # 密码,建议生产环境开启
phone:
query-url: http://cy-phone-bill-inquiry-server:4006/cyywl-phone-query-api/
query-url: http://192.168.1.94:4006/cyywl-phone-query-api/
token: eyIwLnR5cCI6IkpXVCIsImFsZyI6IkhTNTEyIn0

View File

@ -20,8 +20,7 @@
</view>
</view>
<view class="mask" @click='close' v-if="pay_close"></view>
<button style="cursor: pointer;display:none;" class="clipboard"
:data-clipboard-text="alipayLink">
<button style="cursor: pointer;display:none;" class="clipboard" :data-clipboard-text="alipayLink">
</button>
<!-- 支付宝支付界面 -->
<u-modal :show="alipayShow" title="支付宝支付" @confirm="handleConfirm">
@ -38,6 +37,7 @@
wechatOrderPay,
wechatQueryPayResult
} from '@/api/order.js';
import uniPay from '@/libs/pay.js'
import {
memberTopUp
} from '@/api/member.js';
@ -82,126 +82,32 @@
this.alipayShow = false
window.location.reload()
},
//
_copy(context) {
//
let oInput = document.createElement('input');
//
oInput.value = context;
//
document.body.appendChild(oInput);
//
oInput.select();
//
document.execCommand('Copy');
//
this.$util.Tips({
title: '复制链接成功'
})
this.alipayShow = true
//
oInput.remove();
},
close: function() {
this.$emit('onChangeFun', {
action: 'payClose'
});
},
// JSAPI
wxPayJSAPI(payData) {
function onBridgeReady() {
WeixinJSBridge.invoke('getBrandWCPayRequest', {
"appId": payData.appId, //ID
"timeStamp": payData.timeStamp, //1970
"nonceStr": payData.nonceStr, //
"package": payData.packageValue,
"signType": payData.signType, //
"paySign": payData.paySign //
},
function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
window.location.reload()
// uni.switchTab({
// url: '/pages/member_application/index'
// })
}
})
}
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false)
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady)
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady)
}
} else {
onBridgeReady()
}
},
goPay: function(paytype) {
let that = this;
if (that.payInfo.orderInfos.length === 0) return that.$util.Tips({
title: '请选择要支付的订单'
});
uni.showLoading({
title: '支付中',
mask: true
});
if(paytype === 'WXPAY' && that.openId) {
that.payInfo.openid = that.openId
} else if(paytype === 'WXPAY' && !that.openId){
return that.$util.Tips({
title: '请在微信客户端进行支付操作'
});
}
memberTopUp({
...that.payInfo,
payType: paytype
}).then(res => {
let jsConfig = res.data
switch (paytype) {
case 'WXPAY':
uni.hideLoading();
that.wxPayJSAPI(jsConfig.jsapiResult)
break;
case 'ALIPAY':
uni.hideLoading();
this.alipayLink = jsConfig.body
// this._copy(jsConfig.body)
setTimeout(()=>{
document.querySelector(".clipboard").click();
this.alipayShow = true
}, 500)
// const div = document.createElement('div')
// /* data.content */
// div.innerHTML = jsConfig.body
// document.body.appendChild(div)
// document.forms[0].submit()
break;
case 'weixinh5':
uni.hideLoading();
location.replace(jsConfig.mwebUrl + '&redirect_url=' + window.location.protocol +
'//' + window.location.host + goPages + '&status=1');
return that.$util.Tips({
title: "支付中",
icon: 'success'
}, () => {
that.$emit('onChangeFun', {
action: 'pay_complete'
});
});
break;
uniPay({
payInfo: that.payInfo,
payType: paytype,
createOrderFun: memberTopUp,
wxPaySuccess: () => {
window.location.reload()
},
aliPaySuccess: (link) => {
that.alipayLink = link
setTimeout(() => {
document.querySelector(".clipboard").click();
that.alipayShow = true
}, 500)
}
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
}, () => {
that.$emit('onChangeFun', {
action: 'pay_fail'
});
});
})
}
}

91
yudao-ui-app/libs/pay.js Normal file
View File

@ -0,0 +1,91 @@
import util from 'utils/util'
import store from '@/store'
const payTypes = ['WXPAY', 'ALIPAY']
/**
* 统一支付处理方法
* @param payInfo // 支付下单信息
* @param payType // 支付类型
* @param createOrderFun // 预下单方法
* @param wxPaySuccess // 微信支付下单支付成功回调
* @param aliPaySuccess // 支付宝支付下单成功回调
*/
const unityPay = (options) => {
let _options = {
payInfo: {},
payType: '',
createOrderFun: () => {},
wxPaySuccess: () => {},
aliPaySuccess: () => {}
}
Object.assign(_options, options)
if (!_options.payType) {
return util.Tips({
title: '请选择支付方式'
})
}
if (!payTypes.includes(_options.payType)) {
throw new Error('支付方式参数值为 WXPAY、ALIPAY')
}
// 目前微信只支持JSAPIh5支付开通后取消该验证
const openId = store.state.app.openId || ''
if (_options.payType === 'WXPAY' && !openId) {
return util.Tips({
title: '请在微信客户端进行支付操作'
})
}
_options.payInfo.openid = openId
uni.showLoading({
title: '支付中',
mask: true
})
_options.createOrderFun({
..._options.payInfo,
payType: _options.payType
}).then(res => {
const payConfig = res.data
switch (_options.payType) {
// 微信JSAPI支付
case 'WXPAY':
wxPayJSAPI(payConfig.jsapiResult)
break
case 'ALIPAY':
_options.aliPaySuccess(payConfig.body)
break
}
}).catch(() => {
util.Tips({
title: '预下单失败'
})
}).finally(uni.hideLoading)
}
const wxPayJSAPI = (payData) => {
function onBridgeReady() {
WeixinJSBridge.invoke('getBrandWCPayRequest', {
"appId": payData.appId, //公众号ID由商户传入
"timeStamp": payData.timeStamp, //时间戳自1970年以来的秒数
"nonceStr": payData.nonceStr, //随机串
"package": payData.packageValue,
"signType": payData.signType, //微信签名方式:
"paySign": payData.paySign //微信签名
},
function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
_options.wxPaySuccess()
}
})
}
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false)
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady)
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady)
}
} else {
onBridgeReady()
}
}
export default unityPay

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB