把商品扩展字段表改为带租户id的模式

This commit is contained in:
jishenghua
2025-03-25 23:37:31 +08:00
parent ef587ae8f9
commit a9edd44f6c
10 changed files with 190 additions and 37 deletions

View File

@@ -27,8 +27,8 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnStr;
/**
* Description
*
* @Author: qiankunpingtai
* @Date: 2019/3/29 15:24
* @Author: jsh
* @Date: 2025/3/25 15:24
*/
@RestController
@RequestMapping(value = "/materialProperty")
@@ -79,6 +79,23 @@ public class MaterialPropertyController extends BaseController {
return returnStr(objectMap, update);
}
@PostMapping(value = "/addOrUpdate")
@ApiOperation(value = "新增或修改")
public String addOrUpdate(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
String nativeName = obj.getString("nativeName");
String anotherName = obj.getString("anotherName");
boolean exist = materialPropertyService.checkIsNativeNameExist(nativeName);
int res;
if(!exist) {
obj.put("id", null);
res = materialPropertyService.insertMaterialProperty(obj, request);
} else {
res = materialPropertyService.updateMaterialPropertyByNativeName(nativeName, anotherName);
}
return returnStr(objectMap, res);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {