Merge branch 'feature/mall_product_new'
commit
f4751d6057
|
@ -74,7 +74,7 @@ public class ShippingTemplatesController {
|
||||||
@Operation(summary = "删除")
|
@Operation(summary = "删除")
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
||||||
@Parameter(name="id", description="模板ID", required = true)
|
@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)){
|
if(shippingTemplatesService.remove(id)){
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}else{
|
}else{
|
||||||
|
@ -90,7 +90,7 @@ public class ShippingTemplatesController {
|
||||||
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:update')")
|
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:update')")
|
||||||
@Operation(summary = "修改")
|
@Operation(summary = "修改")
|
||||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
@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)) {
|
if (shippingTemplatesService.update(id, request)) {
|
||||||
return CommonResult.success("修改成功");
|
return CommonResult.success("修改成功");
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ public class ShippingTemplatesController {
|
||||||
@Operation(summary = "详情")
|
@Operation(summary = "详情")
|
||||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
||||||
@Parameter(name="id", description="模板ID", required = true)
|
@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));
|
return CommonResult.success(shippingTemplatesService.getInfo(id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ShippingTemplatesFreeController {
|
||||||
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:free:list')")
|
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:free:list')")
|
||||||
@Operation(summary = "根据模板id查询数据")
|
@Operation(summary = "根据模板id查询数据")
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
@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));
|
return CommonResult.success(shippingTemplatesFreeService.getListGroup(tempId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ShippingTemplatesNoDeliveryController {
|
||||||
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:free:list')")
|
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:free:list')")
|
||||||
@Operation(summary = "根据模板id查询数据")
|
@Operation(summary = "根据模板id查询数据")
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
@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));
|
return CommonResult.success(shippingTemplatesNoDeliveryService.getListGroup(tempId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ShippingTemplatesRegionController {
|
||||||
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:region:list')")
|
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:region:list')")
|
||||||
@Operation(summary = "根据模板id查询数据")
|
@Operation(summary = "根据模板id查询数据")
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
@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));
|
return CommonResult.success(shippingTemplatesRegionService.getListGroup(tempId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class ShippingTemplatesDO extends BaseDO {
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
private Integer id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*模板名称
|
*模板名称
|
||||||
|
|
|
@ -31,12 +31,12 @@ public class ShippingTemplatesFreeDO implements Serializable {
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板ID
|
* 模板ID
|
||||||
*/
|
*/
|
||||||
private Integer tempId;
|
private Long tempId;
|
||||||
|
|
||||||
|
|
||||||
private Integer provinceId;
|
private Integer provinceId;
|
||||||
|
|
|
@ -30,12 +30,12 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable {
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板ID
|
* 模板ID
|
||||||
*/
|
*/
|
||||||
private Integer tempId;
|
private Long tempId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*城市ID
|
*城市ID
|
||||||
|
|
|
@ -31,12 +31,12 @@ public class ShippingTemplatesRegionDO implements Serializable {
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板ID
|
* 模板ID
|
||||||
*/
|
*/
|
||||||
private Integer tempId;
|
private Long tempId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*城市ID
|
*城市ID
|
||||||
|
|
|
@ -22,5 +22,5 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ShippingTemplatesFreeMapper extends BaseMapperX<ShippingTemplatesFreeDO> {
|
public interface ShippingTemplatesFreeMapper extends BaseMapperX<ShippingTemplatesFreeDO> {
|
||||||
|
|
||||||
List<ShippingTemplatesFreeRespVO> getListGroup(Integer tempId);
|
List<ShippingTemplatesFreeRespVO> getListGroup(Long tempId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,6 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ShippingTemplatesNoDeliveryMapper extends BaseMapperX<ShippingTemplatesNoDeliveryDO> {
|
public interface ShippingTemplatesNoDeliveryMapper extends BaseMapperX<ShippingTemplatesNoDeliveryDO> {
|
||||||
|
|
||||||
List<ShippingTemplatesNoDeliveryRespVO> getList(Integer tempId);
|
List<ShippingTemplatesNoDeliveryRespVO> getList(Long tempId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,5 +22,5 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ShippingTemplatesRegionMapper extends BaseMapperX<ShippingTemplatesRegionDO> {
|
public interface ShippingTemplatesRegionMapper extends BaseMapperX<ShippingTemplatesRegionDO> {
|
||||||
|
|
||||||
List<ShippingTemplatesRegionRespVO> getListGroup(Integer tempId);
|
List<ShippingTemplatesRegionRespVO> getListGroup(Long tempId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,15 +24,15 @@ import java.util.List;
|
||||||
@Validated
|
@Validated
|
||||||
public interface ShippingTemplatesFreeService extends IService<ShippingTemplatesFreeDO> {
|
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
|
* @param tempId 运费模板id
|
||||||
*/
|
*/
|
||||||
Boolean delete(Integer tempId);
|
Boolean delete(Long tempId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据模板编号、城市ID查询
|
* 根据模板编号、城市ID查询
|
||||||
|
@ -40,5 +40,5 @@ public interface ShippingTemplatesFreeService extends IService<ShippingTemplates
|
||||||
* @param cityId 城市ID
|
* @param cityId 城市ID
|
||||||
* @return 运费模板
|
* @return 运费模板
|
||||||
*/
|
*/
|
||||||
ShippingTemplatesFreeDO getByTempIdAndCityId(Integer tempId, Integer cityId);
|
ShippingTemplatesFreeDO getByTempIdAndCityId(Long tempId, Integer cityId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,9 @@ import java.util.List;
|
||||||
@Validated
|
@Validated
|
||||||
public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTemplatesNoDeliveryDO> {
|
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查询
|
* 根据模板编号、城市ID查询
|
||||||
|
@ -35,7 +35,7 @@ public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTem
|
||||||
* @param cityId 城市ID
|
* @param cityId 城市ID
|
||||||
* @return 运费模板
|
* @return 运费模板
|
||||||
*/
|
*/
|
||||||
ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Integer tempId, Integer cityId);
|
ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Long tempId, Integer cityId);
|
||||||
|
|
||||||
public Boolean delete(Integer tempId);
|
public Boolean delete(Long tempId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,16 +25,16 @@ import java.util.List;
|
||||||
@Validated
|
@Validated
|
||||||
public interface ShippingTemplatesRegionService extends IService<ShippingTemplatesRegionDO> {
|
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
|
* @param tempId 运费模板id
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
Boolean delete(Integer tempId);
|
Boolean delete(Long tempId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据模板编号、城市ID查询
|
* 根据模板编号、城市ID查询
|
||||||
|
@ -42,5 +42,5 @@ public interface ShippingTemplatesRegionService extends IService<ShippingTemplat
|
||||||
* @param cityId 城市ID
|
* @param cityId 城市ID
|
||||||
* @return 运费模板
|
* @return 运费模板
|
||||||
*/
|
*/
|
||||||
ShippingTemplatesRegionDO getByTempIdAndCityId(Integer tempId, Integer cityId);
|
ShippingTemplatesRegionDO getByTempIdAndCityId(Long tempId, Integer cityId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,19 +35,19 @@ public interface ShippingTemplatesService extends IService<ShippingTemplatesDO>
|
||||||
*/
|
*/
|
||||||
Boolean create(ShippingTemplatesReqVO request);
|
Boolean create(ShippingTemplatesReqVO request);
|
||||||
|
|
||||||
Boolean update(Integer id, ShippingTemplatesReqVO request);
|
Boolean update(Long id, ShippingTemplatesReqVO request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除模板
|
* 删除模板
|
||||||
* @param id 模板id
|
* @param id 模板id
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
Boolean remove(Integer id);
|
Boolean remove(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取模板信息
|
* 获取模板信息
|
||||||
* @param id 模板id
|
* @param id 模板id
|
||||||
* @return ShippingTemplates
|
* @return ShippingTemplates
|
||||||
*/
|
*/
|
||||||
ShippingTemplatesDO getInfo(Integer id);
|
ShippingTemplatesDO getInfo(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -48,9 +47,8 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
* @author Mr.Zhang
|
* @author Mr.Zhang
|
||||||
* @since 2020-05-20
|
* @since 2020-05-20
|
||||||
*/
|
*/
|
||||||
@Async
|
|
||||||
@Override
|
@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<>();
|
ArrayList<ShippingTemplatesFreeDO> shippingTemplatesFreesListDO = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -82,6 +80,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
|
|
||||||
//删除模板下的无效数据
|
//删除模板下的无效数据
|
||||||
deleteStatusFalse(tempId);
|
deleteStatusFalse(tempId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,7 +104,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
* @author Mr.Zhang
|
* @author Mr.Zhang
|
||||||
* @since 2020-05-20
|
* @since 2020-05-20
|
||||||
*/
|
*/
|
||||||
private void updateStatus(Integer tempId) {
|
private void updateStatus(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
||||||
|
|
||||||
|
@ -119,7 +118,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
* @param tempId Integer 运费模板id
|
* @param tempId Integer 运费模板id
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean delete(Integer tempId) {
|
public Boolean delete(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
||||||
return dao.delete(lambdaQueryWrapper) > 0;
|
return dao.delete(lambdaQueryWrapper) > 0;
|
||||||
|
@ -129,7 +128,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
* 删除模板下的无效数据
|
* 删除模板下的无效数据
|
||||||
* @param tempId Integer 运费模板id
|
* @param tempId Integer 运费模板id
|
||||||
*/
|
*/
|
||||||
public Boolean deleteStatusFalse(Integer tempId) {
|
public Boolean deleteStatusFalse(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getStatus, false);
|
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getStatus, false);
|
||||||
|
@ -143,7 +142,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
* @return 运费模板
|
* @return 运费模板
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ShippingTemplatesFreeDO getByTempIdAndCityId(Integer tempId, Integer cityId) {
|
public ShippingTemplatesFreeDO getByTempIdAndCityId(Long tempId, Integer cityId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesFreeDO> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesFreeDO> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
lqw.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
||||||
lqw.eq(ShippingTemplatesFreeDO::getCityId, cityId);
|
lqw.eq(ShippingTemplatesFreeDO::getCityId, cityId);
|
||||||
|
@ -159,7 +158,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
||||||
* @return List<ShippingTemplatesFreeRequest>
|
* @return List<ShippingTemplatesFreeRequest>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ShippingTemplatesFreeRespVO> getListGroup(Integer tempId) {
|
public List<ShippingTemplatesFreeRespVO> getListGroup(Long tempId) {
|
||||||
return dao.getListGroup(tempId);
|
return dao.getListGroup(tempId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
||||||
* @since 2020-05-20
|
* @since 2020-05-20
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
|
public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Long tempId) {
|
||||||
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
|
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
|
||||||
|
|
||||||
delete(tempId);
|
delete(tempId);
|
||||||
|
@ -64,7 +64,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
||||||
* @param tempId Integer 运费模板id
|
* @param tempId Integer 运费模板id
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean delete(Integer tempId) {
|
public Boolean delete(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
|
||||||
return shippingTemplatesNoDeliveryMapper.delete(lambdaQueryWrapper) > 0;
|
return shippingTemplatesNoDeliveryMapper.delete(lambdaQueryWrapper) > 0;
|
||||||
|
@ -92,7 +92,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
||||||
* @return List<ShippingTemplatesFreeRequest>
|
* @return List<ShippingTemplatesFreeRequest>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Integer tempId) {
|
public List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Long tempId) {
|
||||||
return shippingTemplatesNoDeliveryMapper.getList(tempId);
|
return shippingTemplatesNoDeliveryMapper.getList(tempId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
||||||
* @return 运费模板
|
* @return 运费模板
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Integer tempId, Integer cityId) {
|
public ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Long tempId, Integer cityId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
|
lqw.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
|
||||||
lqw.eq(ShippingTemplatesNoDeliveryDO::getCityId, cityId);
|
lqw.eq(ShippingTemplatesNoDeliveryDO::getCityId, cityId);
|
||||||
|
|
|
@ -59,9 +59,8 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
* @author Mr.Zhang
|
* @author Mr.Zhang
|
||||||
* @since 2020-05-20
|
* @since 2020-05-20
|
||||||
*/
|
*/
|
||||||
@Async
|
|
||||||
@Override
|
@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<>();
|
ArrayList<ShippingTemplatesRegionDO> shippingTemplatesRegionDOList = new ArrayList<>();
|
||||||
|
|
||||||
//把目前模板下的所有数据标记为无效
|
//把目前模板下的所有数据标记为无效
|
||||||
|
@ -95,6 +94,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
|
|
||||||
//删除模板下的无效数据
|
//删除模板下的无效数据
|
||||||
deleteStatusFalse(tempId);
|
deleteStatusFalse(tempId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,7 +120,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
* @author Mr.Zhang
|
* @author Mr.Zhang
|
||||||
* @since 2020-05-20
|
* @since 2020-05-20
|
||||||
*/
|
*/
|
||||||
private void updateStatus(Integer tempId) {
|
private void updateStatus(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
* @param tempId Integer 运费模板id
|
* @param tempId Integer 运费模板id
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
public Boolean deleteStatusFalse(Integer tempId) {
|
public Boolean deleteStatusFalse(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, false);
|
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, false);
|
||||||
|
@ -148,7 +148,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
* @return 运费模板
|
* @return 运费模板
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ShippingTemplatesRegionDO getByTempIdAndCityId(Integer tempId, Integer cityId) {
|
public ShippingTemplatesRegionDO getByTempIdAndCityId(Long tempId, Integer cityId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getCityId, cityId);
|
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getCityId, cityId);
|
||||||
|
@ -163,12 +163,12 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
* @return List<ShippingTemplatesRegionRequest>
|
* @return List<ShippingTemplatesRegionRequest>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ShippingTemplatesRegionRespVO> getListGroup(Integer tempId) {
|
public List<ShippingTemplatesRegionRespVO> getListGroup(Long tempId) {
|
||||||
return dao.getListGroup(tempId);
|
return dao.getListGroup(tempId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean delete(Integer tempId) {
|
public Boolean delete(Long tempId) {
|
||||||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||||
return dao.delete(lambdaQueryWrapper) > 0;
|
return dao.delete(lambdaQueryWrapper) > 0;
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
||||||
* @param request ShippingTemplatesRequest 新增参数
|
* @param request ShippingTemplatesRequest 新增参数
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean update(Integer id, ShippingTemplatesReqVO request) {
|
public Boolean update(Long id, ShippingTemplatesReqVO request) {
|
||||||
ShippingTemplatesDO shippingTemplatesDO = new ShippingTemplatesDO();
|
ShippingTemplatesDO shippingTemplatesDO = new ShippingTemplatesDO();
|
||||||
shippingTemplatesDO.setId(id);
|
shippingTemplatesDO.setId(id);
|
||||||
shippingTemplatesDO.setName(request.getName());
|
shippingTemplatesDO.setName(request.getName());
|
||||||
|
@ -184,7 +184,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean remove(Integer id) {
|
public Boolean remove(Long id) {
|
||||||
return transactionTemplate.execute(e -> {
|
return transactionTemplate.execute(e -> {
|
||||||
shippingTemplatesRegionService.delete(id);
|
shippingTemplatesRegionService.delete(id);
|
||||||
shippingTemplatesFreeService.delete(id);
|
shippingTemplatesFreeService.delete(id);
|
||||||
|
@ -200,7 +200,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
||||||
* @return ShippingTemplates
|
* @return ShippingTemplates
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ShippingTemplatesDO getInfo(Integer id) {
|
public ShippingTemplatesDO getInfo(Long id) {
|
||||||
ShippingTemplatesDO template = getById(id);
|
ShippingTemplatesDO template = getById(id);
|
||||||
if (ObjectUtil.isNull(template)) {
|
if (ObjectUtil.isNull(template)) {
|
||||||
throw new ServiceException("模板不存在");
|
throw new ServiceException("模板不存在");
|
||||||
|
|
|
@ -4,19 +4,19 @@ import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
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.enums.Constants;
|
||||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo;
|
import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
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.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.constants.SysConfigConstants;
|
||||||
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderConvert;
|
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderConvert;
|
||||||
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderOneConvert;
|
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.order.StoreOrderInfo;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
|
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.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.dal.mysql.order.StoreOrderMapper;
|
||||||
import cn.iocoder.yudao.module.shop.request.order.*;
|
import cn.iocoder.yudao.module.shop.request.order.*;
|
||||||
import cn.iocoder.yudao.module.shop.request.product.StoreProductReplyAddRequest;
|
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.CrmebUtil;
|
||||||
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
|
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
|
||||||
import cn.iocoder.yudao.module.shop.utils.RedisUtil;
|
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 cn.iocoder.yudao.module.shop.vo.product.MyRecord;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.support.TransactionTemplate;
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -692,7 +693,7 @@ public class OrderServiceImpl implements OrderService {
|
||||||
|
|
||||||
for (Map.Entry<Integer, MyRecord> m : proMap.entrySet()) {
|
for (Map.Entry<Integer, MyRecord> m : proMap.entrySet()) {
|
||||||
MyRecord value = m.getValue();
|
MyRecord value = m.getValue();
|
||||||
Integer tempId = value.getInt("tempId");
|
Long tempId = value.getLong("tempId");
|
||||||
ShippingTemplatesDO shippingTemplatesDO = shippingTemplatesApi.getById(tempId);
|
ShippingTemplatesDO shippingTemplatesDO = shippingTemplatesApi.getById(tempId);
|
||||||
if (shippingTemplatesDO.getAppoint()) {// 指定包邮
|
if (shippingTemplatesDO.getAppoint()) {// 指定包邮
|
||||||
// 判断是否在指定包邮区域内
|
// 判断是否在指定包邮区域内
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!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">
|
<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
|
SELECT
|
||||||
city_id, province_id, title, `number`, price, uniqid
|
city_id, province_id, title, `number`, price, uniqid
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!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">
|
<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
|
SELECT
|
||||||
city_id, province_id, title, uniqid
|
city_id, province_id, title, uniqid
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!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">
|
<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
|
SELECT
|
||||||
city_id, province_id, `first`, first_price, title, `renewal`, renewal_price, uniqid
|
city_id, province_id, `first`, first_price, title, `renewal`, renewal_price, uniqid
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
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.dal.dataobject.user.MemberUserDO;
|
||||||
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
|
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
|
||||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||||
|
@ -71,11 +72,11 @@ public class PromoterServiceImpl implements PromoterService {
|
||||||
memberUserDO.setMobile(createReqVO.getMobile());
|
memberUserDO.setMobile(createReqVO.getMobile());
|
||||||
memberUserDO.setStatus(createReqVO.getStatus());
|
memberUserDO.setStatus(createReqVO.getStatus());
|
||||||
memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length() - 6));
|
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);
|
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()));
|
Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId()));
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new ServiceException(PROMOTER_EXISTS);
|
throw new ServiceException(PROMOTER_EXISTS);
|
||||||
|
|
|
@ -240,5 +240,5 @@ wx:
|
||||||
database: 16 # 数据库索引
|
database: 16 # 数据库索引
|
||||||
password: 20221122@dev # 密码,建议生产环境开启
|
password: 20221122@dev # 密码,建议生产环境开启
|
||||||
phone:
|
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
|
token: eyIwLnR5cCI6IkpXVCIsImFsZyI6IkhTNTEyIn0
|
|
@ -20,8 +20,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask" @click='close' v-if="pay_close"></view>
|
<view class="mask" @click='close' v-if="pay_close"></view>
|
||||||
<button style="cursor: pointer;display:none;" class="clipboard"
|
<button style="cursor: pointer;display:none;" class="clipboard" :data-clipboard-text="alipayLink">
|
||||||
:data-clipboard-text="alipayLink">
|
|
||||||
</button>
|
</button>
|
||||||
<!-- 支付宝支付界面 -->
|
<!-- 支付宝支付界面 -->
|
||||||
<u-modal :show="alipayShow" title="支付宝支付" @confirm="handleConfirm">
|
<u-modal :show="alipayShow" title="支付宝支付" @confirm="handleConfirm">
|
||||||
|
@ -38,6 +37,7 @@
|
||||||
wechatOrderPay,
|
wechatOrderPay,
|
||||||
wechatQueryPayResult
|
wechatQueryPayResult
|
||||||
} from '@/api/order.js';
|
} from '@/api/order.js';
|
||||||
|
import uniPay from '@/libs/pay.js'
|
||||||
import {
|
import {
|
||||||
memberTopUp
|
memberTopUp
|
||||||
} from '@/api/member.js';
|
} from '@/api/member.js';
|
||||||
|
@ -82,126 +82,32 @@
|
||||||
this.alipayShow = false
|
this.alipayShow = false
|
||||||
window.location.reload()
|
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() {
|
close: function() {
|
||||||
this.$emit('onChangeFun', {
|
this.$emit('onChangeFun', {
|
||||||
action: 'payClose'
|
action: 'payClose'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 微信支付JSAPI调起
|
// 微信支付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) {
|
goPay: function(paytype) {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.payInfo.orderInfos.length === 0) return that.$util.Tips({
|
if (that.payInfo.orderInfos.length === 0) return that.$util.Tips({
|
||||||
title: '请选择要支付的订单'
|
title: '请选择要支付的订单'
|
||||||
});
|
});
|
||||||
uni.showLoading({
|
uniPay({
|
||||||
title: '支付中',
|
payInfo: that.payInfo,
|
||||||
mask: true
|
payType: paytype,
|
||||||
});
|
createOrderFun: memberTopUp,
|
||||||
if(paytype === 'WXPAY' && that.openId) {
|
wxPaySuccess: () => {
|
||||||
that.payInfo.openid = that.openId
|
window.location.reload()
|
||||||
|
},
|
||||||
} else if(paytype === 'WXPAY' && !that.openId){
|
aliPaySuccess: (link) => {
|
||||||
return that.$util.Tips({
|
that.alipayLink = link
|
||||||
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(() => {
|
setTimeout(() => {
|
||||||
document.querySelector(".clipboard").click();
|
document.querySelector(".clipboard").click();
|
||||||
this.alipayShow = true
|
that.alipayShow = true
|
||||||
}, 500)
|
}, 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;
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
|
||||||
uni.hideLoading();
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: err
|
|
||||||
}, () => {
|
|
||||||
that.$emit('onChangeFun', {
|
|
||||||
action: 'pay_fail'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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')
|
||||||
|
}
|
||||||
|
// 目前微信只支持JSAPI,h5支付开通后取消该验证
|
||||||
|
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 |
Loading…
Reference in New Issue