批次-设备清单 保存逻辑调整:只保存非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 batchNo
|
||||||
* @param orgCode
|
* @param orgCode
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -212,10 +213,14 @@ public class DeviceManagerController extends JeecgController<DeviceManager, IDev
|
||||||
@RequestMapping(value = "/batchSave", method = RequestMethod.POST)
|
@RequestMapping(value = "/batchSave", method = RequestMethod.POST)
|
||||||
public Result<String> batchSave(@RequestBody List<DevicePreview> list) {
|
public Result<String> batchSave(@RequestBody List<DevicePreview> list) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
if (item.getId() == null) {
|
if (item.getId() == null && item.getPurchaseQuantity() != null && item.getPurchaseQuantity() != 0) {
|
||||||
service.addPreviewPlan(item);
|
service.addPreviewPlan(item);
|
||||||
} else {
|
} else {
|
||||||
|
if (item.getPurchaseQuantity() != null && item.getPurchaseQuantity() != 0) {
|
||||||
service.updatePreviewPlan(item);
|
service.updatePreviewPlan(item);
|
||||||
|
} else {
|
||||||
|
service.deletePreviewPlan(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Result.OK("保存成功!");
|
return Result.OK("保存成功!");
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,5 @@ public interface IDeviceManagerService extends IService<DeviceManager> {
|
||||||
List<DevicePreview> queryQuantityByOrgCode(String batchNo, String orgCode);
|
List<DevicePreview> queryQuantityByOrgCode(String batchNo, String orgCode);
|
||||||
|
|
||||||
Map<String,Map<String, Object>> getNuListByOrgCode(String orgCode);
|
Map<String,Map<String, Object>> getNuListByOrgCode(String orgCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue