批次-设备清单 保存逻辑调整:只保存非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("保存成功!");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue