Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
1bc2813034
@ -7,7 +7,11 @@ import com.cim.idm.framework.IDMFrameServiceProxy;
|
|||||||
import com.cim.idm.model.BSERPlocation;
|
import com.cim.idm.model.BSERPlocation;
|
||||||
import com.cim.idm.model.CheckPlan1;
|
import com.cim.idm.model.CheckPlan1;
|
||||||
import com.cim.idm.model.StorageSpec;
|
import com.cim.idm.model.StorageSpec;
|
||||||
|
import com.cim.idm.response.BaseResponse;
|
||||||
|
import com.cim.idm.response.RespGenerator;
|
||||||
import com.cim.idm.utils.AjaxResult;
|
import com.cim.idm.utils.AjaxResult;
|
||||||
|
import com.cim.idm.wmspackage.storage.StorageServiceProxy;
|
||||||
|
import com.cim.idm.wmspackage.storage.management.data.StorageSpecKey;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -30,8 +34,6 @@ import java.util.Objects;
|
|||||||
public class StorageController {
|
public class StorageController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/getORG", method = RequestMethod.POST)
|
@RequestMapping(value = "/getORG", method = RequestMethod.POST)
|
||||||
public AjaxResult getORG(@RequestBody JSONObject in ){
|
public AjaxResult getORG(@RequestBody JSONObject in ){
|
||||||
|
|
||||||
@ -226,4 +228,71 @@ public class StorageController {
|
|||||||
return AjaxResult.me().setResultObj(list);
|
return AjaxResult.me().setResultObj(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/addStorage", method = RequestMethod.POST)
|
||||||
|
public BaseResponse<Object> addStorage(@RequestBody Map<String, Object> param) {
|
||||||
|
// 获取参数
|
||||||
|
String storageName = (String) param.get("STORAGENAME");
|
||||||
|
String description = (String) param.get("DESCRIPTION");
|
||||||
|
String siteName = (String) param.get("SITENAME");
|
||||||
|
String erpFactory = (String) param.get("ERPFACTORY");
|
||||||
|
// 异常
|
||||||
|
StorageSpecKey storageSpecKey = new StorageSpecKey();
|
||||||
|
storageSpecKey.setStorageName(storageName);
|
||||||
|
storageSpecKey.setSiteName(siteName);
|
||||||
|
com.cim.idm.wmspackage.storage.management.data.StorageSpec storageSpec = null;
|
||||||
|
try {
|
||||||
|
storageSpec = StorageServiceProxy.getStorageSpecService().selectByKey(storageSpecKey);
|
||||||
|
if (Objects.nonNull(storageSpec)) {
|
||||||
|
return RespGenerator.returnError("已存在该货位!");
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
|
||||||
|
}
|
||||||
|
storageSpec = new com.cim.idm.wmspackage.storage.management.data.StorageSpec();
|
||||||
|
// 构建数据
|
||||||
|
storageSpec.setKey(storageSpecKey);
|
||||||
|
storageSpec.setDescription(description);
|
||||||
|
storageSpec.setErpFactory(erpFactory);
|
||||||
|
// 插入数据
|
||||||
|
StorageServiceProxy.getStorageSpecService().insert(storageSpec);
|
||||||
|
return RespGenerator.returnOK(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/editStorage", method = RequestMethod.POST)
|
||||||
|
public BaseResponse<Object> editStorage(@RequestBody Map<String, Object> param) {
|
||||||
|
// 获取参数
|
||||||
|
String storageName = (String) param.get("STORAGENAME");
|
||||||
|
String siteName = (String) param.get("SITENAME");
|
||||||
|
String description = (String) param.get("DESCRIPTION");
|
||||||
|
// 获取数据
|
||||||
|
StorageSpecKey storageSpecKey = new StorageSpecKey();
|
||||||
|
storageSpecKey.setStorageName(storageName);
|
||||||
|
storageSpecKey.setSiteName(siteName);
|
||||||
|
com.cim.idm.wmspackage.storage.management.data.StorageSpec storageSpec = null;
|
||||||
|
try {
|
||||||
|
storageSpec = StorageServiceProxy.getStorageSpecService().selectByKey(storageSpecKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return RespGenerator.returnError("未找到该货位!");
|
||||||
|
}
|
||||||
|
// 构建数据
|
||||||
|
storageSpec.setDescription(description);
|
||||||
|
// 更新数据
|
||||||
|
StorageServiceProxy.getStorageSpecService().update(storageSpec);
|
||||||
|
return RespGenerator.returnOK(param);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/delStorage", method = RequestMethod.POST)
|
||||||
|
public BaseResponse<Map<String, Object>> delStorage(@RequestBody Map<String, Object> param) {
|
||||||
|
// 获取参数
|
||||||
|
String storageName = (String) param.get("STORAGENAME");
|
||||||
|
String siteName = (String) param.get("SITENAME");
|
||||||
|
// 组建数据
|
||||||
|
StorageSpecKey storageSpec = new StorageSpecKey();
|
||||||
|
storageSpec.setStorageName(storageName);
|
||||||
|
storageSpec.setSiteName(siteName);
|
||||||
|
// 删除数据
|
||||||
|
StorageServiceProxy.getStorageSpecService().delete(storageSpec);
|
||||||
|
return RespGenerator.returnOK(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user