Your Name
2023-04-17 da3b5c72fa45bc26a9868c2b26e3efda14845179
service-common/src/main/java/com/java110/common/cmd/chargeMachine/SaveChargeMachineCmd.java
@@ -23,14 +23,14 @@
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.chargeMachinePort.ChargeMachinePortDto;
import com.java110.dto.chargeMachine.ChargeMachineDto;
import com.java110.dto.chargeMachine.ChargeMachinePortDto;
import com.java110.intf.common.IChargeMachinePortV1InnerServiceSMO;
import com.java110.intf.common.IChargeMachineSpecV1InnerServiceSMO;
import com.java110.intf.common.IChargeMachineV1InnerServiceSMO;
import com.java110.po.chargeMachine.ChargeMachinePo;
import com.java110.po.chargeMachinePort.ChargeMachinePortPo;
import com.java110.po.chargeMachineSpec.ChargeMachineSpecPo;
import com.java110.po.meterMachineSpec.MeterMachineSpecPo;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
@@ -71,11 +71,18 @@
        Assert.hasKeyAndValue(reqJson, "machineName", "请求报文中未包含machineName");
        Assert.hasKeyAndValue(reqJson, "machineCode", "请求报文中未包含machineCode");
        Assert.hasKeyAndValue(reqJson, "implBean", "请求报文中未包含implBean");
        Assert.hasKeyAndValue(reqJson, "durationPrice", "请求报文中未包含durationPrice");
        Assert.hasKeyAndValue(reqJson, "energyPrice", "请求报文中未包含energyPrice");
        Assert.hasKeyAndValue(reqJson, "ruleId", "请求报文中未包含ruleId");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "portCount", "请求报文中未包含portCount");
        ChargeMachineDto chargeMachineDto = new ChargeMachineDto();
        chargeMachineDto.setMachineCode(reqJson.getString("machineCode"));
        int count = chargeMachineV1InnerServiceSMOImpl.queryChargeMachinesCount(chargeMachineDto);
        if (count > 0) {
            throw new CmdException("充电桩编号已存在");
        }
        JSONArray specs = reqJson.getJSONArray("specs");
        if (specs == null || specs.size() < 1) {