diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java index 41d6eb02c..6ebf045e5 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesController.java @@ -74,7 +74,7 @@ public class ShippingTemplatesController { @Operation(summary = "删除") @RequestMapping(value = "/delete", method = RequestMethod.GET) @Parameter(name="id", description="模板ID", required = true) - public CommonResult delete(@RequestParam(value = "id") Integer id){ + public CommonResult 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 update(@RequestParam Integer id, @RequestBody @Validated ShippingTemplatesReqVO request){ + public CommonResult 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 info(@RequestParam(value = "id") Integer id){ + public CommonResult info(@RequestParam(value = "id") Long id){ return CommonResult.success(shippingTemplatesService.getInfo(id)); } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesFreeController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesFreeController.java index 7cfc4406d..b9ad6f7c9 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesFreeController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesFreeController.java @@ -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> getList(@RequestParam Integer tempId){ + public CommonResult> getList(@RequestParam Long tempId){ return CommonResult.success(shippingTemplatesFreeService.getListGroup(tempId)); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java index 8af8816bc..cf71141e6 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesNoDeliveryController.java @@ -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> getList(@RequestParam Integer tempId){ + public CommonResult> getList(@RequestParam Long tempId){ return CommonResult.success(shippingTemplatesNoDeliveryService.getListGroup(tempId)); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesRegionController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesRegionController.java index 38644efd9..3e1c873c6 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesRegionController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/ShippingTemplatesRegionController.java @@ -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> getList(@RequestParam Integer tempId){ + public CommonResult> getList(@RequestParam Long tempId){ return CommonResult.success(shippingTemplatesRegionService.getListGroup(tempId)); } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java index 8a38f241e..55c184313 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java @@ -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; /** *模板名称 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java index eee0c694c..5f8df0866 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java @@ -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; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java index 7790300b3..3699315d9 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java @@ -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 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java index 17b544165..eaae338ab 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java @@ -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 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesFreeMapper.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesFreeMapper.java index bbb40e3eb..37dc7e802 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesFreeMapper.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesFreeMapper.java @@ -22,5 +22,5 @@ import java.util.List; @Mapper public interface ShippingTemplatesFreeMapper extends BaseMapperX { - List getListGroup(Integer tempId); + List getListGroup(Long tempId); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesNoDeliveryMapper.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesNoDeliveryMapper.java index 1713de8cd..5b4b5c610 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesNoDeliveryMapper.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesNoDeliveryMapper.java @@ -22,6 +22,6 @@ import java.util.List; @Mapper public interface ShippingTemplatesNoDeliveryMapper extends BaseMapperX { - List getList(Integer tempId); + List getList(Long tempId); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesRegionMapper.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesRegionMapper.java index 3beeed1bd..c730ec7e6 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesRegionMapper.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ShippingTemplatesRegionMapper.java @@ -22,5 +22,5 @@ import java.util.List; @Mapper public interface ShippingTemplatesRegionMapper extends BaseMapperX { - List getListGroup(Integer tempId); + List getListGroup(Long tempId); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesFreeService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesFreeService.java index dc99df313..a782b28a5 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesFreeService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesFreeService.java @@ -24,15 +24,15 @@ import java.util.List; @Validated public interface ShippingTemplatesFreeService extends IService { - void saveAll(List shippingTemplatesFreeRespVOList, Integer type, Integer id); + void saveAll(List shippingTemplatesFreeRespVOList, Integer type, Long id); - List getListGroup(Integer tempId); + List getListGroup(Long tempId); /** * 删除 * @param tempId 运费模板id */ - Boolean delete(Integer tempId); + Boolean delete(Long tempId); /** * 根据模板编号、城市ID查询 @@ -40,5 +40,5 @@ public interface ShippingTemplatesFreeService extends IService { - void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Integer id); + void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Long id); - List getListGroup(Integer tempId); + List getListGroup(Long tempId); /** * 根据模板编号、城市ID查询 @@ -35,7 +35,7 @@ public interface ShippingTemplatesNoDeliveryService extends IService { - void saveAll(List shippingTemplatesRegionRespVOList, Integer type, Integer id); + void saveAll(List shippingTemplatesRegionRespVOList, Integer type, Long id); - List getListGroup(Integer tempId); + List 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 */ 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); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java index 9082dca02..4a536a9f8 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java @@ -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 shippingTemplatesFreeRespVOList, Integer type, Integer tempId) { + public void saveAll(List shippingTemplatesFreeRespVOList, Integer type, Long tempId) { ArrayList shippingTemplatesFreesListDO = new ArrayList<>(); @@ -82,6 +80,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId); @@ -119,7 +118,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId); return dao.delete(lambdaQueryWrapper) > 0; @@ -129,7 +128,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId); lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getStatus, false); @@ -143,7 +142,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl lqw = new LambdaQueryWrapper<>(); lqw.eq(ShippingTemplatesFreeDO::getTempId, tempId); lqw.eq(ShippingTemplatesFreeDO::getCityId, cityId); @@ -159,7 +158,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl */ @Override - public List getListGroup(Integer tempId) { + public List getListGroup(Long tempId) { return dao.getListGroup(tempId); } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java index 6f32d1d9c..9ac009c18 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java @@ -37,7 +37,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl shippingTemplatesNoDeliveryDOS = new ArrayList<>(); delete(tempId); @@ -64,7 +64,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId); return shippingTemplatesNoDeliveryMapper.delete(lambdaQueryWrapper) > 0; @@ -92,7 +92,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl */ @Override - public List getListGroup(Integer tempId) { + public List getListGroup(Long tempId) { return shippingTemplatesNoDeliveryMapper.getList(tempId); } @@ -103,7 +103,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl lqw = new LambdaQueryWrapper<>(); lqw.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId); lqw.eq(ShippingTemplatesNoDeliveryDO::getCityId, cityId); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java index 3654cc64c..b097ee8dd 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java @@ -59,9 +59,8 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl shippingTemplatesRegionRespVOList, Integer type, Integer tempId) { + public void saveAll(List shippingTemplatesRegionRespVOList, Integer type, Long tempId) { ArrayList shippingTemplatesRegionDOList = new ArrayList<>(); //把目前模板下的所有数据标记为无效 @@ -95,6 +94,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); @@ -134,7 +134,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, false); @@ -148,7 +148,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getCityId, cityId); @@ -163,12 +163,12 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl */ @Override - public List getListGroup(Integer tempId) { + public List getListGroup(Long tempId) { return dao.getListGroup(tempId); } @Override - public Boolean delete(Integer tempId) { + public Boolean delete(Long tempId) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId); return dao.delete(lambdaQueryWrapper) > 0; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java index 2a0984795..7b2d86a3d 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesServiceImpl.java @@ -146,7 +146,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl { shippingTemplatesRegionService.delete(id); shippingTemplatesFreeService.delete(id); @@ -200,7 +200,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl 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()) {// 指定包邮 // 判断是否在指定包邮区域内 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml index 818c5057c..a49c12531 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml @@ -2,7 +2,7 @@ - SELECT city_id, province_id, title, `number`, price, uniqid FROM diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml index 6b042f88e..856d423e4 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml @@ -2,7 +2,7 @@ - SELECT city_id, province_id, title, uniqid FROM diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml index c984f8d77..3cb6e86ad 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml @@ -2,7 +2,7 @@ - SELECT city_id, province_id, `first`, first_price, title, `renewal`, renewal_price, uniqid FROM diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java index a0b8708ec..ba044b319 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java @@ -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); diff --git a/yudao-server/src/main/resources/application-prod.yaml b/yudao-server/src/main/resources/application-prod.yaml index 87f3a7fa6..0b9da0c0b 100644 --- a/yudao-server/src/main/resources/application-prod.yaml +++ b/yudao-server/src/main/resources/application-prod.yaml @@ -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 \ No newline at end of file diff --git a/yudao-ui-app/components/paymentMember/index.vue b/yudao-ui-app/components/paymentMember/index.vue index a55247b9c..615bf0643 100644 --- a/yudao-ui-app/components/paymentMember/index.vue +++ b/yudao-ui-app/components/paymentMember/index.vue @@ -20,8 +20,7 @@ - @@ -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' - }); - }); }) } } diff --git a/yudao-ui-app/libs/pay.js b/yudao-ui-app/libs/pay.js new file mode 100644 index 000000000..a6635551f --- /dev/null +++ b/yudao-ui-app/libs/pay.js @@ -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 diff --git a/yudao-ui-app/static/images/mallLogo.png b/yudao-ui-app/static/images/mallLogo.png index 65c18a6ef..303ffdf7d 100644 Binary files a/yudao-ui-app/static/images/mallLogo.png and b/yudao-ui-app/static/images/mallLogo.png differ