Commit 5c154c38 authored by 王业雄's avatar 王业雄

fix

parent 8f83ae44
......@@ -9,7 +9,7 @@ import lombok.Getter;
*/
@Getter
public enum BusinessType {
CASH("CASH","VCC业务"),
CASH("CASH","CASH业务"),
VCC("VCC","VCC业务");
private String value;
......
......@@ -19,6 +19,7 @@ public class ChannelRouteResultVo {
private String fundType;
private String orgType;
private String businessType;
private String systermType;
private Integer creditResult;
private String userTag;
private String userLevel;
......
......@@ -17,6 +17,6 @@ public interface IChannelRuleRepository extends JpaRepository<ChannelRuleEntity,
List<ChannelRuleEntity> getAllByIdIn(List<Long> ids);
Boolean deleteAllByChannelIdEqualsAndEnableEquals(Long channelId,Byte enable);
void deleteAllByChannelIdEqualsAndEnableEquals(Long channelId,Byte enable);
}
......@@ -17,6 +17,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
......@@ -64,6 +65,12 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
channelRuleEntities.stream().forEach(channelRuleEntity -> {
ChannelRouteResultVo channelRouteResultVo = new ChannelRouteResultVo();
BeanUtils.copyProperties(channelRuleEntity, channelRouteResultVo);
FundProductEntity one = fundProductRepository.findOne(channelRuleEntity.getFundProductId());
if (Objects.nonNull(one)){
channelRouteResultVo.setSystermType(one.getSystermType());
}
channelRouteResultVos.add(channelRouteResultVo);
});
......@@ -147,6 +154,7 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
}
@Override
@Transactional
public void addChannelConfig(List<ChannelRouteSaveVo> channelRouteSaveVoList,Integer type) {
/**
* 编辑时要去掉所有该渠道有效性为0的其他配置(覆盖之前的未更新编辑信息)
......@@ -167,6 +175,7 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
}else {
channelRuleEntity.setEnable(Byte.valueOf("0"));
}
channelRuleEntity.setUserLevel("["+channelRuleEntity.getUserLevel()+"]");
channelRuleRepository.save(channelRuleEntity);
}
});
......@@ -193,14 +202,13 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
}
@Override
@Transactional
public void updateChannelConfig(Long channelId) {
Boolean aBoolean = channelRuleRepository.deleteAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("1"));
if (aBoolean){
List<ChannelRuleEntity> allByChannelIdEqualsAndEnableEquals = channelRuleRepository.getAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("0"));
allByChannelIdEqualsAndEnableEquals.stream().forEach(channelRuleEntity -> {
channelRuleEntity.setEnable(Byte.valueOf("1"));
channelRuleRepository.save(channelRuleEntity);
});
}
channelRuleRepository.deleteAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("1"));
List<ChannelRuleEntity> allByChannelIdEqualsAndEnableEquals = channelRuleRepository.getAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("0"));
allByChannelIdEqualsAndEnableEquals.stream().forEach(channelRuleEntity -> {
channelRuleEntity.setEnable(Byte.valueOf("1"));
channelRuleRepository.save(channelRuleEntity);
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment