rev:平均分配页面显示问题
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -37,15 +38,16 @@ public class DeviceAssignedController {
|
||||
@PostMapping
|
||||
@Log("新增设备任务分配信息")
|
||||
@ApiOperation("新增设备任务分配信息")
|
||||
public ResponseEntity create(@Validated @RequestBody DeviceAssignedDto resources) {
|
||||
return new ResponseEntity<>(deviceAssignedService.insert(resources), HttpStatus.CREATED);
|
||||
public ResponseEntity create(@Validated @RequestBody Map resources) {
|
||||
deviceAssignedService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改设备任务分配信息")
|
||||
@ApiOperation("修改设备任务分配信息")
|
||||
public ResponseEntity update(@Validated @RequestBody DeviceAssignedDto resources) {
|
||||
deviceAssignedService.updateById(resources);
|
||||
public ResponseEntity update(@Validated @RequestBody Map resources) {
|
||||
deviceAssignedService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ public class DeviceAssignedDto implements Serializable {
|
||||
private String device_code;
|
||||
|
||||
@ApiModelProperty(value = "指令终点")
|
||||
private String inst_nextdevice_code;
|
||||
private String inst_nextDevice_code;
|
||||
|
||||
@ApiModelProperty(value = "任务终点")
|
||||
private String task_nextdevice_code;
|
||||
private String task_nextDevice_code;
|
||||
|
||||
@ApiModelProperty(value = "参数")
|
||||
private String param;
|
||||
|
||||
@@ -124,8 +124,8 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
|
||||
JSONObject param = new JSONObject();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String device_code = whereJson.get("device_code").toString();
|
||||
String task_nextdevice = String.join(",", (List) whereJson.get("task_nextdevice_code"));
|
||||
String inst_nextdevice = String.join(",", (List) whereJson.get("inst_nextdevice_code"));
|
||||
String task_nextdevice = String.join(",", (List) whereJson.get("task_nextDevice_code"));
|
||||
String inst_nextdevice = String.join(",", (List) whereJson.get("inst_nextDevice_code"));
|
||||
ArrayList list = (ArrayList) whereJson.get("tableData");
|
||||
JSONObject jo = new JSONObject();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@@ -133,16 +133,18 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
|
||||
String device = one.get("device").toString();
|
||||
String limit = one.get("limit").toString();
|
||||
String scale = one.get("scale").toString();
|
||||
Boolean inOut = (Boolean) one.get("inOut");
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("limit", limit);
|
||||
data.put("scale", scale);
|
||||
data.put("inOut",inOut);
|
||||
jo.put(device, data);
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
param.put("assigned_id", IdUtil.simpleUUID());
|
||||
param.put("device_code", device_code);
|
||||
param.put("task_nextdevice_code", task_nextdevice.toString());
|
||||
param.put("inst_nextdevice_code", inst_nextdevice.toString());
|
||||
param.put("task_nextDevice_code", task_nextdevice.toString());
|
||||
param.put("inst_nextDevice_code", inst_nextdevice.toString());
|
||||
param.put("param", jo);
|
||||
param.put("is_active", CommonFinalParam.ONE);
|
||||
param.put("is_delete", CommonFinalParam.ONE);
|
||||
@@ -159,12 +161,13 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
|
||||
public void update(Map whereJson) {
|
||||
JSONObject param = new JSONObject();
|
||||
String device_code = whereJson.get("device_code").toString();
|
||||
String task_nextdevice = String.join(",", (List<String>) whereJson.get("task_nextdevice_code"));
|
||||
String inst_nextdevice = String.join(",", (List<String>) whereJson.get("inst_nextdevice_code"));
|
||||
String assgined_id = whereJson.get("assigned_id").toString();
|
||||
String task_nextdevice = String.join(",", (List<String>) whereJson.get("task_nextDevice_code"));
|
||||
String inst_nextdevice = String.join(",", (List<String>) whereJson.get("inst_nextDevice_code"));
|
||||
String assigned_id = whereJson.get("assigned_id").toString();
|
||||
param.put("assigned_id",assigned_id);
|
||||
param.put("device_code", device_code);
|
||||
param.put("task_nextdevice_code", task_nextdevice.toString());
|
||||
param.put("inst_nextdevice_code", inst_nextdevice.toString());
|
||||
param.put("task_nextDevice_code", task_nextdevice.toString());
|
||||
param.put("inst_nextDevice_code", inst_nextdevice.toString());
|
||||
ArrayList list = (ArrayList) whereJson.get("tableData");
|
||||
JSONObject jo = new JSONObject();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@@ -172,9 +175,11 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
|
||||
String device = one.get("device").toString();
|
||||
String limit = one.get("limit").toString();
|
||||
String scale = one.get("scale").toString();
|
||||
Boolean inOut = (Boolean) one.get("inOut");
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("limit", limit);
|
||||
data.put("scale", scale);
|
||||
data.put("inOut", inOut);
|
||||
jo.put(device, data);
|
||||
}
|
||||
param.put("param", jo);
|
||||
@@ -200,8 +205,8 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
|
||||
for (DeviceAssignedDto deviceAssigned : all) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("设备编码", deviceAssigned.getDevice_code());
|
||||
map.put("指令终点", deviceAssigned.getInst_nextdevice_code());
|
||||
map.put("任务终点", deviceAssigned.getTask_nextdevice_code());
|
||||
map.put("指令终点", deviceAssigned.getInst_nextDevice_code());
|
||||
map.put("任务终点", deviceAssigned.getTask_nextDevice_code());
|
||||
map.put("参数", deviceAssigned.getParam());
|
||||
map.put("备注", deviceAssigned.getRemark());
|
||||
map.put("是否启用", deviceAssigned.getIs_active());
|
||||
|
||||
@@ -1559,8 +1559,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
String flag2 = null;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
DeviceAssignedDto dto = list.get(i);
|
||||
String inst_nextDevice_code = dto.getInst_nextdevice_code();
|
||||
String task_nextDevice_code = dto.getTask_nextdevice_code();
|
||||
String inst_nextDevice_code = dto.getInst_nextDevice_code();
|
||||
String task_nextDevice_code = dto.getTask_nextDevice_code();
|
||||
String param = dto.getParam();
|
||||
JSONObject jo = JSON.parseObject(param);
|
||||
String regEx = "[`~!@#$%^&*()+=|{}':;'\\[\\].<>/?~!@#¥%……&*()——+|{}【】':”“’。、?]";
|
||||
|
||||
Reference in New Issue
Block a user