批次-设备清单 保存逻辑调整:只保存非0个的设备信息 修改时删除改为0个数量的设备信息
This commit is contained in:
parent
bd13a5aaa8
commit
5324a8d969
|
|
@ -200,6 +200,7 @@ public class DeviceManagerController extends JeecgController<DeviceManager, IDev
|
|||
|
||||
/**
|
||||
* 查询对应机构+批次 各护理单元已配置的设备数量
|
||||
*
|
||||
* @param batchNo
|
||||
* @param orgCode
|
||||
* @return
|
||||
|
|
@ -212,10 +213,14 @@ public class DeviceManagerController extends JeecgController<DeviceManager, IDev
|
|||
@RequestMapping(value = "/batchSave", method = RequestMethod.POST)
|
||||
public Result<String> batchSave(@RequestBody List<DevicePreview> list) {
|
||||
list.forEach(item -> {
|
||||
if (item.getId() == null) {
|
||||
if (item.getId() == null && item.getPurchaseQuantity() != null && item.getPurchaseQuantity() != 0) {
|
||||
service.addPreviewPlan(item);
|
||||
} else {
|
||||
if (item.getPurchaseQuantity() != null && item.getPurchaseQuantity() != 0) {
|
||||
service.updatePreviewPlan(item);
|
||||
} else {
|
||||
service.deletePreviewPlan(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
return Result.OK("保存成功!");
|
||||
|
|
@ -228,11 +233,11 @@ public class DeviceManagerController extends JeecgController<DeviceManager, IDev
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/getNuListByOrgCode")
|
||||
public Result<Map<String,Map<String, Object>>> getNuListByOrgCode(@RequestParam("orgCode") String orgCode) {
|
||||
if(StringUtils.isBlank(orgCode)){
|
||||
public Result<Map<String, Map<String, Object>>> getNuListByOrgCode(@RequestParam("orgCode") String orgCode) {
|
||||
if (StringUtils.isBlank(orgCode)) {
|
||||
return Result.error("orgCode不能为空");
|
||||
}
|
||||
Map<String,Map<String, Object>> result = service.getNuListByOrgCode(orgCode);
|
||||
Map<String, Map<String, Object>> result = service.getNuListByOrgCode(orgCode);
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,4 +52,5 @@ public interface IDeviceManagerService extends IService<DeviceManager> {
|
|||
List<DevicePreview> queryQuantityByOrgCode(String batchNo, String orgCode);
|
||||
|
||||
Map<String,Map<String, Object>> getNuListByOrgCode(String orgCode);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ public class DeviceManagerServiceImpl extends ServiceImpl<DeviceManagerMapper, D
|
|||
"wsdjList", wsdjStr,
|
||||
"children", children
|
||||
);
|
||||
result.put(info.getNuId(),map);
|
||||
result.put(info.getNuId(), map);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue