|
@@ -66,44 +66,44 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
|
detailDO.setPicUrl(picUrl);
|
|
|
iotInspectOrderDetailMapper.updateById(detailDO);
|
|
|
//更新order的json串
|
|
|
- List<IotInspectRouteDO> routeDOS = JSON.parseArray(order.getDeviceIds(), IotInspectRouteDO.class);
|
|
|
- List<IotInspectRouteDO> newArray = new ArrayList<>();
|
|
|
- for (IotInspectRouteDO routeDO : routeDOS) {
|
|
|
- IotInspectRouteDO newRoute = new IotInspectRouteDO();
|
|
|
- BeanUtils.copyProperties(routeDO, newRoute);
|
|
|
- List<Map> maps = JSON.parseArray(routeDO.getItemJson(), Map.class);
|
|
|
- List<Map> newMaps = new ArrayList<>();
|
|
|
- for (Map map : maps) {
|
|
|
- Map newMap = new HashMap();
|
|
|
-// BeanUtils.copyProperties(map, newMap);
|
|
|
- newMap.put("itemId", map.get("itemId"));
|
|
|
- newMap.put("index", map.get("index"));
|
|
|
- newMap.put("item", map.get("item"));
|
|
|
- newMap.put("standard", map.get("standard"));
|
|
|
- if (Objects.nonNull(map.get("ifNormal"))) {
|
|
|
- newMap.put("ifNormal", map.get("ifNormal"));
|
|
|
- }
|
|
|
- if (Objects.nonNull(map.get("description"))) {
|
|
|
- newMap.put("description", map.get("description"));
|
|
|
- }
|
|
|
- if (Objects.nonNull(map.get("picUrl"))) {
|
|
|
- newMap.put("picUrl", map.get("picUrl"));
|
|
|
- }
|
|
|
- if (String.valueOf(map.get("index")).equals(indexId)) {
|
|
|
- newMap.put("ifNormal", "true".equals(ifNormal));
|
|
|
- if (StringUtils.isNotBlank(description)) {
|
|
|
- newMap.put("description", description);
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(picUrl)) {
|
|
|
- newMap.put("picUrl", picUrl);
|
|
|
- }
|
|
|
- }
|
|
|
- newMaps.add(newMap);
|
|
|
- }
|
|
|
- newRoute.setItemJson(JSON.toJSONString(newMaps));
|
|
|
- newArray.add(newRoute);
|
|
|
- }
|
|
|
- order.setDeviceIds(JSON.toJSONString(newArray));
|
|
|
+// List<IotInspectRouteDO> routeDOS = JSON.parseArray(order.getDeviceIds(), IotInspectRouteDO.class);
|
|
|
+// List<IotInspectRouteDO> newArray = new ArrayList<>();
|
|
|
+// for (IotInspectRouteDO routeDO : routeDOS) {
|
|
|
+// IotInspectRouteDO newRoute = new IotInspectRouteDO();
|
|
|
+// BeanUtils.copyProperties(routeDO, newRoute);
|
|
|
+// List<Map> maps = JSON.parseArray(routeDO.getItemJson(), Map.class);
|
|
|
+// List<Map> newMaps = new ArrayList<>();
|
|
|
+// for (Map map : maps) {
|
|
|
+// Map newMap = new HashMap();
|
|
|
+//// BeanUtils.copyProperties(map, newMap);
|
|
|
+// newMap.put("itemId", map.get("itemId"));
|
|
|
+// newMap.put("index", map.get("index"));
|
|
|
+// newMap.put("item", map.get("item"));
|
|
|
+// newMap.put("standard", map.get("standard"));
|
|
|
+// if (Objects.nonNull(map.get("ifNormal"))) {
|
|
|
+// newMap.put("ifNormal", map.get("ifNormal"));
|
|
|
+// }
|
|
|
+// if (Objects.nonNull(map.get("description"))) {
|
|
|
+// newMap.put("description", map.get("description"));
|
|
|
+// }
|
|
|
+// if (Objects.nonNull(map.get("picUrl"))) {
|
|
|
+// newMap.put("picUrl", map.get("picUrl"));
|
|
|
+// }
|
|
|
+// if (String.valueOf(map.get("index")).equals(indexId)) {
|
|
|
+// newMap.put("ifNormal", "true".equals(ifNormal));
|
|
|
+// if (StringUtils.isNotBlank(description)) {
|
|
|
+// newMap.put("description", description);
|
|
|
+// }
|
|
|
+// if (StringUtils.isNotBlank(picUrl)) {
|
|
|
+// newMap.put("picUrl", picUrl);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// newMaps.add(newMap);
|
|
|
+// }
|
|
|
+// newRoute.setItemJson(JSON.toJSONString(newMaps));
|
|
|
+// newArray.add(newRoute);
|
|
|
+// }
|
|
|
+// order.setDeviceIds(JSON.toJSONString(newArray));
|
|
|
boolean ma = iotInspectOrderDetailMapper.selectList("order_id", orderId).stream().anyMatch(e -> Objects.isNull(e.getIfNormal()));
|
|
|
if (!ma) {
|
|
|
order.setStatus("finished");
|