old mode 100644
new mode 100755
| | |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | @Override |
| | | public void execute(Business business, List<Business> businesses) { |
| | | JSONObject data = business.getData(); |
| | | JSONArray businessMachines = new JSONArray(); |
| | | if (data.containsKey(OwnerPo.class.getSimpleName())) { |
| | | Object bObj = data.get(OwnerPo.class.getSimpleName()); |
| | | JSONArray businessMachines = null; |
| | | |
| | | 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; |
| | | } |
| | | for (int bOwnerIndex = 0; bOwnerIndex < businessMachines.size(); bOwnerIndex++) { |
| | | JSONObject businessOwner = businessMachines.getJSONObject(bOwnerIndex); |
| | | doSendMachine(business, businessOwner); |
| | | }else { |
| | | if (data instanceof JSONObject) { |
| | | businessMachines.add(data); |
| | | } |
| | | } |
| | | for (int bOwnerIndex = 0; bOwnerIndex < businessMachines.size(); bOwnerIndex++) { |
| | | JSONObject businessOwner = businessMachines.getJSONObject(bOwnerIndex); |
| | | doSendMachine(business, businessOwner); |
| | | } |
| | | } |
| | | |
| | |
| | | for (RoomDto tRoomDto : rooms) { |
| | | locationObjIds.add(tRoomDto.getUnitId()); |
| | | locationObjIds.add(tRoomDto.getRoomId()); |
| | | locationObjIds.add(tRoomDto.getFloorId()); |
| | | } |
| | | |
| | | machineDto.setLocationObjIds(locationObjIds.toArray(new String[locationObjIds.size()])); |
| | | List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto); |
| | | Assert.listOnlyOne(machineDtos, "未找到设备"); |
| | | for (MachineDto tmpMachineDto : machineDtos) { |
| | | if (!"9999".equals(tmpMachineDto.getMachineTypeCd())) { |
| | | continue; |
| | | } |
| | | MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>(); |
| | | |
| | | postParameters.add("extCommunityUuid", tOwnerDto.getCommunityId()); |
| | | postParameters.add("uuids", tOwnerDto.getMemberId()); |
| | | JSONObject postParameters = new JSONObject(); |
| | | postParameters.put("machineCode", tmpMachineDto.getMachineCode()); |
| | | postParameters.put("userId", tOwnerDto.getMemberId()); |
| | | postParameters.put("name", tOwnerDto.getName()); |
| | | postParameters.put("extMachineId", tmpMachineDto.getMachineId()); |
| | | postParameters.put("extCommunityId", tmpMachineDto.getCommunityId()); |
| | | hcMachineAsynImpl.sendDeleteOwner(postParameters); |
| | | } |
| | | } |