| | |
| | | import com.java110.dto.machine.MachineDto; |
| | | import com.java110.entity.order.Business; |
| | | import com.java110.intf.common.IMachineInnerServiceSMO; |
| | | import com.java110.job.adapt.IDatabusAdapt; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.ximoIot.asyn.IXimoMachineAsyn; |
| | | import com.java110.po.machine.MachinePo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * @desc add by 吴学文 18:58 |
| | | */ |
| | | @Component(value = "ximoDeleteMachineTransactionIotAdapt") |
| | | public class XimoDeleteMachineTransactionIotAdapt implements IDatabusAdapt { |
| | | public class XimoDeleteMachineTransactionIotAdapt extends DatabusAdaptImpl { |
| | | |
| | | @Autowired |
| | | private IXimoMachineAsyn ximoMachineAsynImpl; |
| | |
| | | if (bObj instanceof JSONObject) { |
| | | businessMachines = new JSONArray(); |
| | | businessMachines.add(bObj); |
| | | } else if (bObj instanceof List) { |
| | | businessMachines = JSONArray.parseArray(JSONObject.toJSONString(bObj)); |
| | | } else { |
| | | businessMachines = (JSONArray) bObj; |
| | | } |
| | |
| | | MachinePo machinePo = BeanConvertUtil.covertBean(businessMachine, MachinePo.class); |
| | | MachineDto machineDto = new MachineDto(); |
| | | machineDto.setMachineId(machinePo.getMachineId()); |
| | | List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto); |
| | | |
| | | Assert.listOnlyOne(machineDtos, "未找到设备"); |
| | | // List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto); |
| | | // |
| | | // Assert.listOnlyOne(machineDtos, "未找到设备"); |
| | | |
| | | MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>(); |
| | | |
| | | postParameters.add("extCommunityUuid", machineDtos.get(0)); |
| | | //postParameters.add("devSn", machinePo.getMachineCode()); |
| | | postParameters.add("uuids", machinePo.getMachineId()); |
| | | postParameters.add("extCommunityUuid", machinePo.getCommunityId()); |
| | | postParameters.add("devSns", machinePo.getMachineCode()); |
| | | //postParameters.add("uuids", machinePo.getMachineId()); |
| | | ximoMachineAsynImpl.deleteSend(postParameters); |
| | | } |
| | | } |