Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product
commit
479f0c1079
|
@ -48,4 +48,7 @@ public class ShippingTemplatesFreeRespVO implements Serializable {
|
||||||
@NotNull(message = "请填写包邮金额")
|
@NotNull(message = "请填写包邮金额")
|
||||||
@DecimalMin(value = "0", message = "包邮金额不能低于0")
|
@DecimalMin(value = "0", message = "包邮金额不能低于0")
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(description = "分组唯一值", required = true)
|
||||||
|
private String uniqid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,8 @@ public class ShippingTemplatesNoDeliveryRespVO implements Serializable {
|
||||||
@NotNull(message = "请选择城市")
|
@NotNull(message = "请选择城市")
|
||||||
private String cityId;
|
private String cityId;
|
||||||
|
|
||||||
|
@Schema(description = "分组唯一值", required = true)
|
||||||
|
private String uniqid;
|
||||||
|
|
||||||
@Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4")
|
@Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4")
|
||||||
private String provinceId;
|
private String provinceId;
|
||||||
|
|
|
@ -55,4 +55,7 @@ public class ShippingTemplatesRegionRespVO implements Serializable {
|
||||||
@DecimalMin(value = "0.1", message = "续件运费金额不能低于0.1")
|
@DecimalMin(value = "0.1", message = "续件运费金额不能低于0.1")
|
||||||
private BigDecimal renewalPrice;
|
private BigDecimal renewalPrice;
|
||||||
|
|
||||||
|
@Schema(description = "分组唯一值", required = true)
|
||||||
|
private String uniqid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class ShippingTemplatesReqVO implements Serializable {
|
||||||
private Boolean noDelivery;
|
private Boolean noDelivery;
|
||||||
|
|
||||||
@Schema(description = "指定不送设置", required = true)
|
@Schema(description = "指定不送设置", required = true)
|
||||||
private List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOS;
|
private ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS;
|
||||||
|
|
||||||
@Schema(description = "排序", example = "0")
|
@Schema(description = "排序", example = "0")
|
||||||
@NotNull(message = "排序数字必须填写")
|
@NotNull(message = "排序数字必须填写")
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.shop.dal.dataobject.express;
|
package cn.iocoder.yudao.module.shop.dal.dataobject.express;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
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.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
|
@ -45,5 +45,10 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable {
|
||||||
|
|
||||||
private Integer provinceId;
|
private Integer provinceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组唯一值
|
||||||
|
*/
|
||||||
|
private String uniqid;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,11 @@ public class ShippingTemplatesRegionDO implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer cityId;
|
private Integer cityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组唯一值
|
||||||
|
*/
|
||||||
|
private String uniqid;
|
||||||
|
|
||||||
|
|
||||||
private Integer provinceId;
|
private Integer provinceId;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||||
@Validated
|
@Validated
|
||||||
public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTemplatesNoDeliveryDO> {
|
public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTemplatesNoDeliveryDO> {
|
||||||
|
|
||||||
void saveAll(List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesFreeRespVOList, Integer id);
|
void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Integer id);
|
||||||
|
|
||||||
List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Integer tempId);
|
List<ShippingTemplatesNoDeliveryRespVO> getListGroup(Integer tempId);
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliver
|
||||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService;
|
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService;
|
||||||
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.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
@ -36,23 +37,23 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
||||||
* @since 2020-05-20
|
* @since 2020-05-20
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void saveAll(List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
|
public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
|
||||||
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
|
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
|
||||||
|
|
||||||
delete(tempId);
|
delete(tempId);
|
||||||
for (ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO : shippingTemplatesNoDeliveryRespVOS) {
|
String uniqueKey = DigestUtils.md5Hex(shippingTemplatesNoDeliveryRespVOS.toString());
|
||||||
if(shippingTemplatesNoDeliveryRespVO.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVO.getCityId().equals("0")){
|
if(shippingTemplatesNoDeliveryRespVOS.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVOS.getCityId().equals("0")){
|
||||||
cityIdList = getCityIdList();
|
cityIdList = getCityIdList();
|
||||||
}else{
|
}else{
|
||||||
cityIdList = StrUtils.stringToArray(shippingTemplatesNoDeliveryRespVO.getCityId());
|
cityIdList = StrUtils.stringToArray(shippingTemplatesNoDeliveryRespVOS.getCityId());
|
||||||
}
|
}
|
||||||
for (Integer cityId: cityIdList) {
|
for (Integer cityId: cityIdList) {
|
||||||
ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO();
|
ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO();
|
||||||
shippingTemplatesNoDeliveryDO.setCityId(cityId);
|
shippingTemplatesNoDeliveryDO.setCityId(cityId);
|
||||||
|
shippingTemplatesNoDeliveryDO.setUniqid(uniqueKey);
|
||||||
shippingTemplatesNoDeliveryDO.setTempId(tempId);
|
shippingTemplatesNoDeliveryDO.setTempId(tempId);
|
||||||
shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO);
|
shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//批量保存模板数据
|
//批量保存模板数据
|
||||||
saveBatch(shippingTemplatesNoDeliveryDOS);
|
saveBatch(shippingTemplatesNoDeliveryDOS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
||||||
for (Integer cityId: cityIdList) {
|
for (Integer cityId: cityIdList) {
|
||||||
ShippingTemplatesRegionDO shippingTemplatesRegionDO = new ShippingTemplatesRegionDO();
|
ShippingTemplatesRegionDO shippingTemplatesRegionDO = new ShippingTemplatesRegionDO();
|
||||||
shippingTemplatesRegionDO.setCityId(cityId);
|
shippingTemplatesRegionDO.setCityId(cityId);
|
||||||
|
shippingTemplatesRegionDO.setUniqid(uniqueKey);
|
||||||
// shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
|
// shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
|
||||||
shippingTemplatesRegionDO.setRenewal(shippingTemplatesRegionRespVO.getRenewal());
|
shippingTemplatesRegionDO.setRenewal(shippingTemplatesRegionRespVO.getRenewal());
|
||||||
shippingTemplatesRegionDO.setRenewalPrice(shippingTemplatesRegionRespVO.getRenewalPrice());
|
shippingTemplatesRegionDO.setRenewalPrice(shippingTemplatesRegionRespVO.getRenewalPrice());
|
||||||
|
|
|
@ -109,12 +109,11 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
||||||
shippingTemplatesFreeService.saveAll(shippingTemplatesFreeRespVOList, request.getType(), shippingTemplatesDO.getId());
|
shippingTemplatesFreeService.saveAll(shippingTemplatesFreeRespVOList, request.getType(), shippingTemplatesDO.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOList = request.getShippingTemplatesNoDeliveryRespVOS();
|
ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO = request.getShippingTemplatesNoDeliveryRespVOS();
|
||||||
if(null != shippingTemplatesNoDeliveryRespVOList && shippingTemplatesNoDeliveryRespVOList.size() > 0){
|
if(!ObjectUtil.isNull(shippingTemplatesNoDeliveryRespVO)){
|
||||||
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVOList, shippingTemplatesDO.getId());
|
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVO, shippingTemplatesDO.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,9 +168,9 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
||||||
if(CollUtil.isNotEmpty(shippingTemplatesFreeRespVOList) && request.getAppoint()){
|
if(CollUtil.isNotEmpty(shippingTemplatesFreeRespVOList) && request.getAppoint()){
|
||||||
shippingTemplatesFreeService.saveAll(shippingTemplatesFreeRespVOList, request.getType(), shippingTemplatesDO.getId());
|
shippingTemplatesFreeService.saveAll(shippingTemplatesFreeRespVOList, request.getType(), shippingTemplatesDO.getId());
|
||||||
}
|
}
|
||||||
List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOList = request.getShippingTemplatesNoDeliveryRespVOS();
|
ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO= request.getShippingTemplatesNoDeliveryRespVOS();
|
||||||
if(CollUtil.isNotEmpty(shippingTemplatesNoDeliveryRespVOList)){
|
if(ObjectUtil.isNotNull(shippingTemplatesNoDeliveryRespVO)){
|
||||||
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVOList, shippingTemplatesDO.getId());
|
shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVO, shippingTemplatesDO.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
<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="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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
<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="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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
<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="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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue