Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product

pull/2/head
tangqian 2023-05-24 15:41:05 +08:00
commit 479f0c1079
14 changed files with 44 additions and 27 deletions

View File

@ -48,4 +48,7 @@ public class ShippingTemplatesFreeRespVO implements Serializable {
@NotNull(message = "请填写包邮金额")
@DecimalMin(value = "0", message = "包邮金额不能低于0")
private BigDecimal price;
@Schema(description = "分组唯一值", required = true)
private String uniqid;
}

View File

@ -34,7 +34,8 @@ public class ShippingTemplatesNoDeliveryRespVO implements Serializable {
@NotNull(message = "请选择城市")
private String cityId;
@Schema(description = "分组唯一值", required = true)
private String uniqid;
@Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4")
private String provinceId;

View File

@ -55,4 +55,7 @@ public class ShippingTemplatesRegionRespVO implements Serializable {
@DecimalMin(value = "0.1", message = "续件运费金额不能低于0.1")
private BigDecimal renewalPrice;
@Schema(description = "分组唯一值", required = true)
private String uniqid;
}

View File

@ -57,7 +57,7 @@ public class ShippingTemplatesReqVO implements Serializable {
private Boolean noDelivery;
@Schema(description = "指定不送设置", required = true)
private List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOS;
private ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS;
@Schema(description = "排序", example = "0")
@NotNull(message = "排序数字必须填写")

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.shop.dal.dataobject.express;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

View File

@ -45,5 +45,10 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable {
private Integer provinceId;
/**
*
*/
private String uniqid;
}

View File

@ -43,6 +43,11 @@ public class ShippingTemplatesRegionDO implements Serializable {
*/
private Integer cityId;
/**
*
*/
private String uniqid;
private Integer provinceId;

View File

@ -25,7 +25,7 @@ import java.util.List;
@Validated
public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTemplatesNoDeliveryDO> {
void saveAll(List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesFreeRespVOList, Integer id);
void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Integer id);
List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Integer tempId);

View File

@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliver
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService;
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.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@ -36,22 +37,22 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
* @since 2020-05-20
*/
@Override
public void saveAll(List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
delete(tempId);
for (ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO : shippingTemplatesNoDeliveryRespVOS) {
if(shippingTemplatesNoDeliveryRespVO.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVO.getCityId().equals("0")){
cityIdList = getCityIdList();
}else{
cityIdList = StrUtils.stringToArray(shippingTemplatesNoDeliveryRespVO.getCityId());
}
for (Integer cityId: cityIdList) {
ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO();
shippingTemplatesNoDeliveryDO.setCityId(cityId);
shippingTemplatesNoDeliveryDO.setTempId(tempId);
shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO);
}
String uniqueKey = DigestUtils.md5Hex(shippingTemplatesNoDeliveryRespVOS.toString());
if(shippingTemplatesNoDeliveryRespVOS.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVOS.getCityId().equals("0")){
cityIdList = getCityIdList();
}else{
cityIdList = StrUtils.stringToArray(shippingTemplatesNoDeliveryRespVOS.getCityId());
}
for (Integer cityId: cityIdList) {
ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO();
shippingTemplatesNoDeliveryDO.setCityId(cityId);
shippingTemplatesNoDeliveryDO.setUniqid(uniqueKey);
shippingTemplatesNoDeliveryDO.setTempId(tempId);
shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO);
}
//批量保存模板数据
saveBatch(shippingTemplatesNoDeliveryDOS);

View File

@ -78,6 +78,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
for (Integer cityId: cityIdList) {
ShippingTemplatesRegionDO shippingTemplatesRegionDO = new ShippingTemplatesRegionDO();
shippingTemplatesRegionDO.setCityId(cityId);
shippingTemplatesRegionDO.setUniqid(uniqueKey);
// shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
shippingTemplatesRegionDO.setRenewal(shippingTemplatesRegionRespVO.getRenewal());
shippingTemplatesRegionDO.setRenewalPrice(shippingTemplatesRegionRespVO.getRenewalPrice());

View File

@ -109,12 +109,11 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
shippingTemplatesFreeService.saveAll(shippingTemplatesFreeRespVOList, request.getType(), shippingTemplatesDO.getId());
}
List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOList = request.getShippingTemplatesNoDeliveryRespVOS();
if(null != shippingTemplatesNoDeliveryRespVOList && shippingTemplatesNoDeliveryRespVOList.size() > 0){
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVOList, shippingTemplatesDO.getId());
ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO = request.getShippingTemplatesNoDeliveryRespVOS();
if(!ObjectUtil.isNull(shippingTemplatesNoDeliveryRespVO)){
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVO, shippingTemplatesDO.getId());
}
return true;
}
@ -169,9 +168,9 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
if(CollUtil.isNotEmpty(shippingTemplatesFreeRespVOList) && request.getAppoint()){
shippingTemplatesFreeService.saveAll(shippingTemplatesFreeRespVOList, request.getType(), shippingTemplatesDO.getId());
}
List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOList = request.getShippingTemplatesNoDeliveryRespVOS();
if(CollUtil.isNotEmpty(shippingTemplatesNoDeliveryRespVOList)){
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVOList, shippingTemplatesDO.getId());
ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO= request.getShippingTemplatesNoDeliveryRespVOS();
if(ObjectUtil.isNotNull(shippingTemplatesNoDeliveryRespVO)){
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVO, shippingTemplatesDO.getId());
}
return true;

View File

@ -3,6 +3,6 @@
<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 group_concat(`city_id`) AS city_id, province_id, `number`, price FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `id` ORDER BY id ASC
SELECT group_concat(`city_id`) AS city_id, province_id, `number`, price, uniqid FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid`,id ORDER BY id ASC
</select>
</mapper>

View File

@ -3,6 +3,6 @@
<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 group_concat(`city_id`) AS city_id, province_id FROM eb_shipping_templates_no_delivery WHERE temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `id` ORDER BY id ASC
SELECT group_concat(`city_id`) AS city_id, province_id, uniqid FROM eb_shipping_templates_no_delivery WHERE temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid`,id ORDER BY id ASC
</select>
</mapper>

View File

@ -3,6 +3,6 @@
<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 group_concat(`city_id`) AS city_id, `first`, first_price, `renewal`, renewal_price FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `id` ORDER BY id ASC
SELECT group_concat(`city_id`) AS city_id, province_id, `first`, first_price, `renewal`, renewal_price, uniqid FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid`,id ORDER BY id ASC
</select>
</mapper>