去除外键之多单位表jsh_unit相关修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.unit.UnitService;
|
||||
@@ -34,9 +35,20 @@ public class UnitController {
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteUnitByIds")
|
||||
public Object batchDeleteUnitByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
public Object batchDeleteUnitByIds(@RequestParam("ids") String ids,@RequestParam(value="deleteType",
|
||||
required =false,defaultValue= BusinessConstants.DELETE_TYPE_NORMAL)String deleteType) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= unitService.batchDeleteUnitByIds(ids);
|
||||
int i=0;
|
||||
if(BusinessConstants.DELETE_TYPE_NORMAL.equals(deleteType)){
|
||||
i= unitService.batchDeleteUnitByIdsNormal(ids);
|
||||
}else if(BusinessConstants.DELETE_TYPE_FORCE.equals(deleteType)){
|
||||
i= unitService.batchDeleteUnitByIds(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){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.UNIT_DELETE_FAILED_CODE,ExceptionConstants.UNIT_DELETE_FAILED_MSG,ids);
|
||||
|
||||
Reference in New Issue
Block a user