mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
根据站点id逻辑删除 分润配置
This commit is contained in:
@@ -24,4 +24,6 @@ public interface StationSplitConfigMapper {
|
||||
* 根据运营商id和站点id逻辑删除
|
||||
*/
|
||||
int deleteByMerchantIdAndStationId(@Param("merchantId") String merchantId, @Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
||||
}
|
||||
|
||||
int deleteByStationId(@Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.StationSplitConfig;
|
||||
import com.jsowell.pile.dto.SplitConfigDTO;
|
||||
import com.jsowell.pile.vo.web.ShareMemberVO;
|
||||
@@ -19,6 +18,9 @@ public interface StationSplitConfigService {
|
||||
// 根据站点id查询站点分账配置信息
|
||||
List<StationSplitConfig> queryByStationId(String stationId);
|
||||
|
||||
// 根据站点id删除站点分账配置信息
|
||||
void deleteByStationId(String stationId, String userName, Date date);
|
||||
|
||||
/**
|
||||
* 根据站点id查询站点分账配置信息, 如果没有配置分账用户, 则执行初始化操作
|
||||
* @param stationId
|
||||
@@ -26,6 +28,7 @@ public interface StationSplitConfigService {
|
||||
*/
|
||||
List<StationSplitConfig> queryByStationIdWithInit(String stationId);
|
||||
|
||||
// 根据商户id和站点id删除站点分账配置信息
|
||||
void deleteByMerchantIdAndStationId(String merchantId, String stationId, String userName, Date date);
|
||||
|
||||
List<SplitConfigVO> querySplitConfigByStationId(String stationId);
|
||||
|
||||
@@ -62,6 +62,8 @@ public class StationSplitConfigServiceImpl implements StationSplitConfigService{
|
||||
|
||||
/**
|
||||
* 通过merchantId stationId 删除缓存、数据库数据
|
||||
*
|
||||
* 这个方法对于更换运营商的站点,存在问题, 废弃
|
||||
* @param merchantId
|
||||
* @param stationId
|
||||
* @param userName
|
||||
@@ -78,6 +80,24 @@ public class StationSplitConfigServiceImpl implements StationSplitConfigService{
|
||||
redisCache.deleteObject(redisKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过stationId 删除缓存、数据库数据
|
||||
* @param merchantId
|
||||
* @param stationId
|
||||
* @param userName
|
||||
* @param date
|
||||
*/
|
||||
@Override
|
||||
public void deleteByStationId(String stationId, String userName, Date date) {
|
||||
// 先删除缓存
|
||||
String redisKey = CacheConstants.QUERY_STATION_SPLIT_CONFIG + stationId;
|
||||
redisCache.deleteObject(redisKey);
|
||||
// 删除数据库数据
|
||||
stationSplitConfigMapper.deleteByStationId(stationId, userName, date);
|
||||
// 再次删除缓存数据
|
||||
redisCache.deleteObject(redisKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StationSplitConfig> queryByStationIdWithInit(String stationId) {
|
||||
// 查询站点分账配置
|
||||
@@ -225,7 +245,7 @@ public class StationSplitConfigServiceImpl implements StationSplitConfigService{
|
||||
}
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
// 先删除该充电站的所有分成配置 逻辑删除
|
||||
deleteByMerchantIdAndStationId(splitConfigDTO.getMerchantId(), splitConfigDTO.getStationId(), userName, DateUtils.getNowDate());
|
||||
this.deleteByStationId(splitConfigDTO.getStationId(), userName, DateUtils.getNowDate());
|
||||
// 保存到数据库
|
||||
List<StationSplitConfig> splitConfigList = Lists.newArrayList();
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
|
||||
@@ -51,7 +51,14 @@
|
||||
update station_split_config
|
||||
set del_flag = '1', update_by = #{updateBy}, update_time = #{updateTime}
|
||||
where del_flag = '0'
|
||||
<!--and merchant_id = #{merchantId}-->
|
||||
and merchant_id = #{merchantId}
|
||||
and station_id = #{stationId}
|
||||
</update>
|
||||
|
||||
<update id="deleteByStationId">
|
||||
update station_split_config
|
||||
set del_flag = '1', update_by = #{updateBy}, update_time = #{updateTime}
|
||||
where del_flag = '0'
|
||||
and station_id = #{stationId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user