|
|
@@ -60,7 +60,7 @@ public class PolicyFeeServiceImpl implements PolicyFeeService {
|
|
|
private final ThirdPartyStationInfoMapper stationInfoMapper;
|
|
|
|
|
|
@Override
|
|
|
- public List<TimePeriodPriceVO> getPolicyFee(long stationId, int salesType, int thirdPartyId) {
|
|
|
+ public List<TimePeriodPriceVO> getPolicyFee(long stationId, int salesType, Long firmId, Long thirdPartyId) {
|
|
|
List<TimePeriodPriceVO> timePeriodPriceVOS = new ArrayList<>();
|
|
|
|
|
|
// 查询设备信息
|
|
|
@@ -91,7 +91,8 @@ public class PolicyFeeServiceImpl implements PolicyFeeService {
|
|
|
.eq(PolicyFee::getStationInfoId, stationId)
|
|
|
.eq(PolicyFee::getIsDeleted, 0)
|
|
|
.eq(PolicyFee::getSalesType, salesType)
|
|
|
- .eq(salesType != 0, PolicyFee::getThirdPartyId, thirdPartyId))
|
|
|
+ .eq(salesType == 1, PolicyFee::getFirmId, firmId)
|
|
|
+ .eq(salesType == 2, PolicyFee::getThirdPartyId, thirdPartyId))
|
|
|
.stream()
|
|
|
.collect(Collectors.toMap(
|
|
|
PolicyFee::getStartTime,
|
|
|
@@ -148,12 +149,13 @@ public class PolicyFeeServiceImpl implements PolicyFeeService {
|
|
|
|
|
|
@Override
|
|
|
public boolean addPolicyFee(AddPolicyFeeDTO addPolicyFeeDTO) {
|
|
|
- // 根据站点+时段+销售类型+渠道方查询是否已存在
|
|
|
+ // 根据站点+时段+销售类型+企业/渠道方查询是否已存在
|
|
|
PolicyFee existPolicyFee = policyFeeMapper.selectOne(Wrappers.<PolicyFee>lambdaQuery()
|
|
|
.eq(PolicyFee::getStationInfoId, addPolicyFeeDTO.getStationInfoId())
|
|
|
.eq(PolicyFee::getStartTime, addPolicyFeeDTO.getTimePeriod())
|
|
|
.eq(PolicyFee::getSalesType, addPolicyFeeDTO.getSalesType())
|
|
|
- .eq(addPolicyFeeDTO.getSalesType() != 0, PolicyFee::getThirdPartyId, addPolicyFeeDTO.getThirdPartyId())
|
|
|
+ .eq(addPolicyFeeDTO.getSalesType() == 1, PolicyFee::getFirmId, addPolicyFeeDTO.getFirmId())
|
|
|
+ .eq(addPolicyFeeDTO.getSalesType() == 2, PolicyFee::getThirdPartyId, addPolicyFeeDTO.getThirdPartyId())
|
|
|
.eq(PolicyFee::getIsDeleted, 0)
|
|
|
.last("limit 1"));
|
|
|
|
|
|
@@ -168,6 +170,7 @@ public class PolicyFeeServiceImpl implements PolicyFeeService {
|
|
|
policyFee.setStartTime(addPolicyFeeDTO.getTimePeriod());
|
|
|
policyFee.setOpFee(addPolicyFeeDTO.getOperationServiceFee());
|
|
|
policyFee.setSalesType(addPolicyFeeDTO.getSalesType());
|
|
|
+ policyFee.setFirmId(addPolicyFeeDTO.getFirmId());
|
|
|
policyFee.setThirdPartyId(addPolicyFeeDTO.getThirdPartyId());
|
|
|
boolean inserted = policyFeeMapper.insert(policyFee) > 0;
|
|
|
|