|
|
@@ -3,6 +3,7 @@ package com.zsElectric.boot.business.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.zsElectric.boot.business.mapper.PolicyFeeMapper;
|
|
|
import com.zsElectric.boot.business.mapper.ThirdPartyEquipmentInfoMapper;
|
|
|
+import com.zsElectric.boot.business.mapper.ThirdPartyStationInfoMapper;
|
|
|
import com.zsElectric.boot.business.model.dto.AddPolicyFeeDTO;
|
|
|
import com.zsElectric.boot.business.model.entity.PolicyFee;
|
|
|
import com.zsElectric.boot.business.model.vo.TimePeriodPriceVO;
|
|
|
@@ -10,6 +11,7 @@ import com.zsElectric.boot.business.service.PolicyFeeService;
|
|
|
import com.zsElectric.boot.charging.entity.ThirdPartyEquipmentInfo;
|
|
|
import com.zsElectric.boot.charging.entity.ThirdPartyEquipmentPricePolicy;
|
|
|
import com.zsElectric.boot.charging.entity.ThirdPartyPolicyInfo;
|
|
|
+import com.zsElectric.boot.charging.entity.ThirdPartyStationInfo;
|
|
|
import com.zsElectric.boot.charging.mapper.ThirdPartyEquipmentPricePolicyMapper;
|
|
|
import com.zsElectric.boot.charging.mapper.ThirdPartyPolicyInfoMapper;
|
|
|
import com.zsElectric.boot.system.model.entity.DictItem;
|
|
|
@@ -55,6 +57,8 @@ public class PolicyFeeServiceImpl implements PolicyFeeService {
|
|
|
|
|
|
private final DictItemService dictItemService;
|
|
|
|
|
|
+ private final ThirdPartyStationInfoMapper stationInfoMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public List<TimePeriodPriceVO> getPolicyFee(long stationId, int salesType, int thirdPartyId) {
|
|
|
List<TimePeriodPriceVO> timePeriodPriceVOS = new ArrayList<>();
|
|
|
@@ -165,7 +169,15 @@ public class PolicyFeeServiceImpl implements PolicyFeeService {
|
|
|
policyFee.setOpFee(addPolicyFeeDTO.getOperationServiceFee());
|
|
|
policyFee.setSalesType(addPolicyFeeDTO.getSalesType());
|
|
|
policyFee.setThirdPartyId(addPolicyFeeDTO.getThirdPartyId());
|
|
|
- return policyFeeMapper.insert(policyFee) > 0;
|
|
|
+ boolean inserted = policyFeeMapper.insert(policyFee) > 0;
|
|
|
+
|
|
|
+ // 新增成功后,更新站点的配置状态为已配置
|
|
|
+ if (inserted) {
|
|
|
+ stationInfoMapper.update(null, Wrappers.<ThirdPartyStationInfo>lambdaUpdate()
|
|
|
+ .eq(ThirdPartyStationInfo::getId, addPolicyFeeDTO.getStationInfoId())
|
|
|
+ .set(ThirdPartyStationInfo::getPolicyConfigured, 1));
|
|
|
+ }
|
|
|
+ return inserted;
|
|
|
}
|
|
|
}
|
|
|
}
|