去除外键之产品类型表jsh_materialcategory相关修改

This commit is contained in:
qiankunpingtai
2019-04-11 10:01:33 +08:00
parent a184aabd9b
commit 3fa79da3aa
7 changed files with 139 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.MaterialCategory;
import com.jsh.erp.datasource.entities.SerialNumberEx;
@@ -151,9 +152,20 @@ public class MaterialCategoryController {
* @return java.lang.Object
*/
@RequestMapping(value = "/batchDeleteMaterialCategory")
public Object batchDeleteMaterialCategory(@RequestParam("ids") String ids) throws Exception {
public Object batchDeleteMaterialCategory(@RequestParam("ids") String ids,@RequestParam(value="deleteType",
required =false,defaultValue= BusinessConstants.DELETE_TYPE_NORMAL)String deleteType) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
int i= materialCategoryService.batchDeleteMaterialCategoryByIds(ids);
int i=0;
if(BusinessConstants.DELETE_TYPE_NORMAL.equals(deleteType)){
i= materialCategoryService.batchDeleteMaterialCategoryByIdsNormal(ids);
}else if(BusinessConstants.DELETE_TYPE_FORCE.equals(deleteType)){
i= materialCategoryService.batchDeleteMaterialCategoryByIds(ids);
}else{
logger.error("异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]",
ExceptionConstants.DELETE_REFUSED_CODE,ExceptionConstants.DELETE_REFUSED_MSG,ids,deleteType);
throw new BusinessRunTimeException(ExceptionConstants.DELETE_REFUSED_CODE,
ExceptionConstants.DELETE_REFUSED_MSG);
}
if(i<1){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_DELETE_FAILED_CODE,
ExceptionConstants.MATERIAL_CATEGORY_DELETE_FAILED_MSG);