|
@@ -3,6 +3,7 @@ package com.xy.service;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.xy.device.EnumAlgorithmPayConfig;
|
|
|
import com.xy.device.EnumAlgorithmTypes;
|
|
|
import com.xy.device.EnumDeviceCharging;
|
|
@@ -10,8 +11,10 @@ import com.xy.device.EnumDeviceChargingConfigType;
|
|
|
import com.xy.dto.*;
|
|
|
import com.xy.dto.be.MercDto;
|
|
|
import com.xy.entity.DeviceChargingConfig;
|
|
|
+import com.xy.entity.DeviceTypeAlgorithmBeforConfig;
|
|
|
import com.xy.entity.MercFeeConfigAlgorithmType;
|
|
|
import com.xy.entity.SysDictRedis;
|
|
|
+import com.xy.error.CommRuntimeException;
|
|
|
import com.xy.mapper.MercFeeConfigAlgorithmTypeMapper;
|
|
|
import com.xy.service.MercFeeConfigAlgorithmTypeService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -93,8 +96,8 @@ public class MercFeeConfigAlgorithmTypeServiceImpl extends ServiceImpl<MercFeeCo
|
|
|
if (Emptys.check(algorithmPayConfig)) {
|
|
|
MercFeeConfigAlgorithmTypeDto.DeviceAlgorithmPlatformVO dap = new MercFeeConfigAlgorithmTypeDto.DeviceAlgorithmPlatformVO();
|
|
|
dap.setAlgorithmId(algorithmId);
|
|
|
- DeviceAlgorithmChargingDto.AlgorithmMoonConfig algorithmMoonConfig = JSONUtil.parseObj(algorithmPayConfig).toBean(DeviceAlgorithmChargingDto.AlgorithmMoonConfig.class);
|
|
|
- DeviceAlgorithmChargingDto.AlgorithmMoonConfig.Inf inf = algorithmMoonConfig.getInf();
|
|
|
+ DeviceAlgorithmChargingDto.AlgorithmMoonConfig algorithmMoonConfig = JSONUtil.parseObj(algorithmPayConfig.getValue()).toBean(DeviceAlgorithmChargingDto.AlgorithmMoonConfig.class);
|
|
|
+// DeviceAlgorithmChargingDto.AlgorithmMoonConfig.Inf inf = algorithmMoonConfig.getInf();
|
|
|
DeviceAlgorithmChargingDto.AlgorithmMoonConfig.Moon moon = algorithmMoonConfig.getMoon();
|
|
|
dap.setMoonMoney(moon.getMoney());
|
|
|
dap.setMoonSize(moon.getSize());
|
|
@@ -144,6 +147,15 @@ public class MercFeeConfigAlgorithmTypeServiceImpl extends ServiceImpl<MercFeeCo
|
|
|
@PostMapping("save")
|
|
|
@ApiOperation("添加")
|
|
|
public R save(@RequestBody @Validated MercFeeConfigAlgorithmTypeDto.Save save) {
|
|
|
+ Long mercId = save.getMercId();
|
|
|
+ Long algorithmId = save.getAlgorithmId();
|
|
|
+ MercFeeConfigAlgorithmType mc = this.getOne(Wrappers.<MercFeeConfigAlgorithmType>lambdaQuery()
|
|
|
+ .eq(MercFeeConfigAlgorithmType::getMercId, mercId)
|
|
|
+ .eq(MercFeeConfigAlgorithmType::getAlgorithmId, algorithmId)
|
|
|
+ );
|
|
|
+ if (mc != null) {
|
|
|
+ throw new CommRuntimeException("该类型配置已存在,请勿重复添加!");
|
|
|
+ }
|
|
|
MercFeeConfigAlgorithmType saveInfo = copy(MercFeeConfigAlgorithmType.class, save);
|
|
|
save(saveInfo);
|
|
|
return R.ok();
|