|
@@ -152,14 +152,16 @@ public class CmcDeviceApprovalController extends BaseController
|
152
|
152
|
CmcProject cmcProject = new CmcProject();
|
153
|
153
|
cmcProject.setProjectId(formDataJson.getString("projectId"));
|
154
|
154
|
CmcProject project = cmcProjectService.selectCmcProjectByProjectId(cmcProject.getProjectId());
|
155
|
|
- if (project.getDevices() != null) {
|
156
|
|
- String[] projectDevices = project.getDevices().split(",");
|
157
|
|
- String[] devices = deviceString.split(",");
|
158
|
|
- project.setDevices(String.join(",", CollectionUtils.union(Arrays.asList(projectDevices), Arrays.asList(devices))));
|
|
155
|
+ if (project != null) {
|
|
156
|
+ if (project.getDevices() != null) {
|
|
157
|
+ String[] projectDevices = project.getDevices().split(",");
|
|
158
|
+ String[] devices = deviceString.split(",");
|
|
159
|
+ project.setDevices(String.join(",", CollectionUtils.union(Arrays.asList(projectDevices), Arrays.asList(devices))));
|
|
160
|
+ }
|
|
161
|
+ else
|
|
162
|
+ project.setDevices(deviceString);
|
|
163
|
+ cmcProjectService.updateCmcProject(project);
|
159
|
164
|
}
|
160
|
|
- else
|
161
|
|
- project.setDevices(deviceString);
|
162
|
|
- cmcProjectService.updateCmcProject(project);
|
163
|
165
|
}
|
164
|
166
|
String[] devices = deviceString.split(",");
|
165
|
167
|
BigDecimal estimateCost = new BigDecimal(0);
|