测试环境中 账号 OK888 YS2024 账号下 店铺管理>>店铺管理 中 编号16318844 数据重复问题排查

This commit is contained in:
ywh 2024-08-17 18:46:59 +08:00
parent b937cb0882
commit 8e1e0b93f4
5 changed files with 34 additions and 2 deletions

View File

@ -35,6 +35,8 @@ public interface BusStoreConfigInfoMapper
*/ */
public int insertBusStoreConfigInfo(BusStoreConfigInfo busStoreConfigInfo); public int insertBusStoreConfigInfo(BusStoreConfigInfo busStoreConfigInfo);
public Integer countBusStoreConfigInfo(String storeCode);
/** /**
* 修改店铺配置信息 * 修改店铺配置信息
* *
@ -59,4 +61,6 @@ public interface BusStoreConfigInfoMapper
*/ */
public int deleteBusStoreConfigInfoByIds(Long[] ids); public int deleteBusStoreConfigInfoByIds(Long[] ids);
public int deleteBusStoreConfigInfoByCode(String storeCode);
} }

View File

@ -1,11 +1,14 @@
package com.ruoyi.business.service.impl; package com.ruoyi.business.service.impl;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils;
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 com.ruoyi.business.mapper.BusStoreConfigInfoMapper; import com.ruoyi.business.mapper.BusStoreConfigInfoMapper;
import com.ruoyi.business.domain.BusStoreConfigInfo; import com.ruoyi.business.domain.BusStoreConfigInfo;
import com.ruoyi.business.service.IBusStoreConfigInfoService; import com.ruoyi.business.service.IBusStoreConfigInfoService;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 店铺配置信息Service业务层处理 * 店铺配置信息Service业务层处理
@ -49,9 +52,17 @@ public class BusStoreConfigInfoServiceImpl implements IBusStoreConfigInfoService
* @param busStoreConfigInfo 店铺配置信息 * @param busStoreConfigInfo 店铺配置信息
* @return 结果 * @return 结果
*/ */
@Transactional
@Override @Override
public int insertBusStoreConfigInfo(BusStoreConfigInfo busStoreConfigInfo) public int insertBusStoreConfigInfo(BusStoreConfigInfo busStoreConfigInfo)
{ {
if(busStoreConfigInfo != null && StringUtils.isNotBlank(busStoreConfigInfo.getStoreCode())){
String storeCode = busStoreConfigInfo.getStoreCode();
Integer c = busStoreConfigInfoMapper.countBusStoreConfigInfo(storeCode);
if(c > 0){
busStoreConfigInfoMapper.deleteBusStoreConfigInfoByCode(storeCode);
}
}
return busStoreConfigInfoMapper.insertBusStoreConfigInfo(busStoreConfigInfo); return busStoreConfigInfoMapper.insertBusStoreConfigInfo(busStoreConfigInfo);
} }

View File

@ -11,6 +11,7 @@ import com.ruoyi.business.domain.resp.RespBusStoreInfo;
import com.ruoyi.business.mapper.BusMarketOperationInfoMapper; import com.ruoyi.business.mapper.BusMarketOperationInfoMapper;
import com.ruoyi.business.mapper.BusSaleInfoMapper; import com.ruoyi.business.mapper.BusSaleInfoMapper;
import com.ruoyi.business.mapper.BusStoreConfigInfoMapper; import com.ruoyi.business.mapper.BusStoreConfigInfoMapper;
import com.ruoyi.business.service.IBusStoreConfigInfoService;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
@ -44,6 +45,9 @@ public class BusStoreInfoServiceImpl implements IBusStoreInfoService
@Autowired @Autowired
private BusMarketOperationInfoMapper busMarketOperationInfoMapper; private BusMarketOperationInfoMapper busMarketOperationInfoMapper;
@Autowired
private IBusStoreConfigInfoService busStoreConfigInfoService;
/** /**
* 查询店铺信息 * 查询店铺信息
* *
@ -225,7 +229,8 @@ public class BusStoreInfoServiceImpl implements IBusStoreInfoService
List<BusStoreConfigInfo> ll = busStoreConfigInfoMapper.selectBusStoreConfigInfoList(busStoreConfigInfo1); List<BusStoreConfigInfo> ll = busStoreConfigInfoMapper.selectBusStoreConfigInfoList(busStoreConfigInfo1);
// 配置新增修改 // 配置新增修改
if(ll.size() == 0){ if(ll.size() == 0){
count = busStoreConfigInfoMapper.insertBusStoreConfigInfo(busStoreConfigInfo); // count = busStoreConfigInfoMapper.insertBusStoreConfigInfo(busStoreConfigInfo);
count = busStoreConfigInfoService.insertBusStoreConfigInfo(busStoreConfigInfo);
}else if(ll.size() ==1){ }else if(ll.size() ==1){
busStoreConfigInfo.setId(ll.get(0).getId()); busStoreConfigInfo.setId(ll.get(0).getId());
if(StringUtils.isEmpty(busStoreConfigInfo.getMarketingChannels())){ if(StringUtils.isEmpty(busStoreConfigInfo.getMarketingChannels())){

View File

@ -92,6 +92,9 @@ public class MeituanServiceImpl implements IMeituanService {
@Autowired @Autowired
private BusStoreDayHistoryInfoMapper busStoreDayHistoryInfoMapper; private BusStoreDayHistoryInfoMapper busStoreDayHistoryInfoMapper;
@Autowired
private IBusStoreConfigInfoService busStoreConfigInfoService;
private static CloseableHttpClient client1 = HttpClientBuilder.create().build(); private static CloseableHttpClient client1 = HttpClientBuilder.create().build();
/** /**
@ -158,7 +161,8 @@ public class MeituanServiceImpl implements IMeituanService {
busStoreConfigInfo.setMinOrderNum(1); busStoreConfigInfo.setMinOrderNum(1);
busStoreConfigInfo.setMaxOrderNum(1); busStoreConfigInfo.setMaxOrderNum(1);
busStoreConfigInfo.setSelfDeliveryDuration(60); busStoreConfigInfo.setSelfDeliveryDuration(60);
busStoreConfigInfoMapper.insertBusStoreConfigInfo(busStoreConfigInfo); // busStoreConfigInfoMapper.insertBusStoreConfigInfo(busStoreConfigInfo);
busStoreConfigInfoService.insertBusStoreConfigInfo(busStoreConfigInfo);
} else if (list.size() == 1) { } else if (list.size() == 1) {
// 不同代理人绑定 // 不同代理人绑定

View File

@ -63,6 +63,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="countBusStoreConfigInfo" parameterType="java.lang.String" resultType="java.lang.Integer">
select count(1) from bus_store_config_info where store_code = #{storeCode} limit 0,1
</select>
<delete id="deleteBusStoreConfigInfoByCode" parameterType="java.lang.String">
delete from bus_store_config_info where store_code = #{storeCode}
</delete>
<insert id="insertBusStoreConfigInfo" parameterType="BusStoreConfigInfo"> <insert id="insertBusStoreConfigInfo" parameterType="BusStoreConfigInfo">
insert into bus_store_config_info insert into bus_store_config_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">