!41 全局修改物理删除为逻辑删除,同时修改查询语句过滤删除标识
Merge pull request !41 from 乾坤平台/master
This commit is contained in:
@@ -42,9 +42,163 @@ public class ExceptionConstants {
|
||||
//登录名已存在
|
||||
public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003;
|
||||
public static final String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名已存在";
|
||||
/**
|
||||
* 角色信息
|
||||
* type = 10
|
||||
* */
|
||||
//添加角色信息失败
|
||||
public static final int ROLE_ADD_FAILED_CODE = 1000000;
|
||||
public static final String ROLE_ADD_FAILED_MSG = "添加角色信息失败";
|
||||
//删除角色信息失败
|
||||
public static final int ROLE_DELETE_FAILED_CODE = 1000001;
|
||||
public static final String ROLE_DELETE_FAILED_MSG = "删除角色信息失败";
|
||||
//修改角色信息失败
|
||||
public static final int ROLE_EDIT_FAILED_CODE = 1000002;
|
||||
public static final String ROLE_EDIT_FAILED_MSG = "修改角色信息失败";
|
||||
/**
|
||||
* 应用信息
|
||||
* type = 15
|
||||
* */
|
||||
//添加角色信息失败
|
||||
public static final int APP_ADD_FAILED_CODE = 1500000;
|
||||
public static final String APP_ADD_FAILED_MSG = "添加应用信息失败";
|
||||
//删除角色信息失败
|
||||
public static final int APP_DELETE_FAILED_CODE = 1500001;
|
||||
public static final String APP_DELETE_FAILED_MSG = "删除应用信息失败";
|
||||
//修改角色信息失败
|
||||
public static final int APP_EDIT_FAILED_CODE = 1500002;
|
||||
public static final String APP_EDIT_FAILED_MSG = "修改应用信息失败";
|
||||
/**
|
||||
* 仓库信息
|
||||
* type = 20
|
||||
* */
|
||||
//添加仓库信息失败
|
||||
public static final int DEPOT_ADD_FAILED_CODE = 2000000;
|
||||
public static final String DEPOT_ADD_FAILED_MSG = "添加仓库信息失败";
|
||||
//删除仓库信息失败
|
||||
public static final int DEPOT_DELETE_FAILED_CODE = 2000001;
|
||||
public static final String DEPOT_DELETE_FAILED_MSG = "删除仓库信息失败";
|
||||
//修改仓库信息失败
|
||||
public static final int DEPOT_EDIT_FAILED_CODE = 2000002;
|
||||
public static final String DEPOT_EDIT_FAILED_MSG = "修改仓库信息失败";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 功能模块信息
|
||||
* type = 30
|
||||
* */
|
||||
//添加角色信息失败
|
||||
public static final int FUNCTIONS_ADD_FAILED_CODE = 3000000;
|
||||
public static final String FUNCTIONS_ADD_FAILED_MSG = "添加功能模块信息失败";
|
||||
//删除角色信息失败
|
||||
public static final int FUNCTIONS_DELETE_FAILED_CODE = 3000001;
|
||||
public static final String FUNCTIONS_DELETE_FAILED_MSG = "删除功能模块信息失败";
|
||||
//修改角色信息失败
|
||||
public static final int FUNCTIONS_EDIT_FAILED_CODE = 3000002;
|
||||
public static final String FUNCTIONS_EDIT_FAILED_MSG = "修改功能模块信息失败";
|
||||
/**
|
||||
* 收支项目信息
|
||||
* type = 35
|
||||
* */
|
||||
//添加收支项目信息失败
|
||||
public static final int IN_OUT_ITEM_ADD_FAILED_CODE = 3500000;
|
||||
public static final String IN_OUT_ITEM_ADD_FAILED_MSG = "添加收支项目信息失败";
|
||||
//删除收支项目信息失败
|
||||
public static final int IN_OUT_ITEM_DELETE_FAILED_CODE = 3500001;
|
||||
public static final String IN_OUT_ITEM_DELETE_FAILED_MSG = "删除收支项目信息失败";
|
||||
//修改收支项目信息失败
|
||||
public static final int IN_OUT_ITEM_EDIT_FAILED_CODE = 3500002;
|
||||
public static final String IN_OUT_ITEM_EDIT_FAILED_MSG = "修改收支项目信息失败";
|
||||
/**
|
||||
* 多单位信息
|
||||
* type = 40
|
||||
* */
|
||||
//添加多单位信息失败
|
||||
public static final int UNIT_ADD_FAILED_CODE = 4000000;
|
||||
public static final String UNIT_ADD_FAILED_MSG = "添加多单位信息失败";
|
||||
//删除多单位信息失败
|
||||
public static final int UNIT_DELETE_FAILED_CODE = 4000001;
|
||||
public static final String UNIT_DELETE_FAILED_MSG = "删除多单位信息失败";
|
||||
//修改多单位信息失败
|
||||
public static final int UNIT_EDIT_FAILED_CODE = 4000002;
|
||||
public static final String UNIT_EDIT_FAILED_MSG = "修改多单位信息失败";
|
||||
/**
|
||||
* 经手人信息
|
||||
* type = 45
|
||||
* */
|
||||
//添加经手人信息失败
|
||||
public static final int PERSON_ADD_FAILED_CODE = 4500000;
|
||||
public static final String PERSON_ADD_FAILED_MSG = "添加经手人信息失败";
|
||||
//删除经手人信息失败
|
||||
public static final int PERSON_DELETE_FAILED_CODE = 4500001;
|
||||
public static final String PERSON_DELETE_FAILED_MSG = "删除经手人信息失败";
|
||||
//修改经手人信息失败
|
||||
public static final int PERSON_EDIT_FAILED_CODE = 4500002;
|
||||
public static final String PERSON_EDIT_FAILED_MSG = "修改经手人信息失败";
|
||||
/**
|
||||
* 用户角色模块关系信息
|
||||
* type = 50
|
||||
* */
|
||||
//添加用户角色模块关系信息失败
|
||||
public static final int USER_BUSINESS_ADD_FAILED_CODE = 5000000;
|
||||
public static final String USER_BUSINESS_ADD_FAILED_MSG = "添加用户角色模块关系信息失败";
|
||||
//删除用户角色模块关系信息失败
|
||||
public static final int USER_BUSINESS_DELETE_FAILED_CODE = 5000001;
|
||||
public static final String USER_BUSINESS_DELETE_FAILED_MSG = "删除用户角色模块关系信息失败";
|
||||
//修改用户角色模块关系信息失败
|
||||
public static final int USER_BUSINESS_EDIT_FAILED_CODE = 5000002;
|
||||
public static final String USER_BUSINESS_EDIT_FAILED_MSG = "修改用户角色模块关系信息失败";
|
||||
/**
|
||||
* 系统参数信息
|
||||
* type = 55
|
||||
* */
|
||||
//添加系统参数信息失败
|
||||
public static final int SYSTEM_CONFIG_ADD_FAILED_CODE = 5500000;
|
||||
public static final String SYSTEM_CONFIG_ADD_FAILED_MSG = "添加系统参数信息失败";
|
||||
//删除系统参数信息失败
|
||||
public static final int SYSTEM_CONFIG_DELETE_FAILED_CODE = 5500001;
|
||||
public static final String SYSTEM_CONFIG_DELETE_FAILED_MSG = "删除系统参数信息失败";
|
||||
//修改系统参数信息失败
|
||||
public static final int SYSTEM_CONFIG_EDIT_FAILED_CODE = 5500002;
|
||||
public static final String SYSTEM_CONFIG_EDIT_FAILED_MSG = "修改系统参数信息失败";
|
||||
/**
|
||||
* 商品扩展信息
|
||||
* type = 60
|
||||
* */
|
||||
//添加商品扩展信息失败
|
||||
public static final int MATERIAL_PROPERTY_ADD_FAILED_CODE = 6000000;
|
||||
public static final String MATERIAL_PROPERTY_ADD_FAILED_MSG = "添加商品扩展信息失败";
|
||||
//删除商品扩展信息失败
|
||||
public static final int MATERIAL_PROPERTY_DELETE_FAILED_CODE = 6000001;
|
||||
public static final String MATERIAL_PROPERTY_DELETE_FAILED_MSG = "删除商品扩展信息失败";
|
||||
//修改商品扩展信息失败
|
||||
public static final int MATERIAL_PROPERTY_EDIT_FAILED_CODE = 6000002;
|
||||
public static final String MATERIAL_PROPERTY_EDIT_FAILED_MSG = "修改商品扩展信息失败";
|
||||
/**
|
||||
* 账户信息
|
||||
* type = 65
|
||||
* */
|
||||
//添加账户信息失败
|
||||
public static final int ACCOUNT_ADD_FAILED_CODE = 6500000;
|
||||
public static final String ACCOUNT_ADD_FAILED_MSG = "添加账户信息失败";
|
||||
//删除账户信息失败
|
||||
public static final int ACCOUNT_DELETE_FAILED_CODE = 6500001;
|
||||
public static final String ACCOUNT_DELETE_FAILED_MSG = "删除账户信息失败";
|
||||
//修改账户信息失败
|
||||
public static final int ACCOUNT_EDIT_FAILED_CODE = 6500002;
|
||||
public static final String ACCOUNT_EDIT_FAILED_MSG = "修改账户信息失败";
|
||||
/**
|
||||
* 供应商信息
|
||||
* type = 70
|
||||
* */
|
||||
//添加供应商信息失败
|
||||
public static final int SUPPLIER_ADD_FAILED_CODE = 7000000;
|
||||
public static final String SUPPLIER_ADD_FAILED_MSG = "添加供应商信息失败";
|
||||
//删除供应商信息失败
|
||||
public static final int SUPPLIER_DELETE_FAILED_CODE = 7000001;
|
||||
public static final String SUPPLIER_DELETE_FAILED_MSG = "删除供应商信息失败";
|
||||
//修改供应商信息失败
|
||||
public static final int SUPPLIER_EDIT_FAILED_CODE = 7000002;
|
||||
public static final String SUPPLIER_EDIT_FAILED_MSG = "修改供应商信息失败";
|
||||
/**
|
||||
* 商品类别信息
|
||||
* type = 75
|
||||
@@ -57,7 +211,7 @@ public class ExceptionConstants {
|
||||
public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败";
|
||||
//修改商品类别信息失败
|
||||
public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002;
|
||||
public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "添加商品类别信息失败";
|
||||
public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "修改商品类别信息失败";
|
||||
//商品类别编号已存在
|
||||
public static final int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003;
|
||||
public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在";
|
||||
@@ -67,11 +221,19 @@ public class ExceptionConstants {
|
||||
//根目录不支持删除
|
||||
public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005;
|
||||
public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根目录不支持删除";
|
||||
|
||||
/**
|
||||
* 商品信息
|
||||
* type = 80
|
||||
* */
|
||||
//添加商品信息信息失败
|
||||
public static final int MATERIAL_ADD_FAILED_CODE = 7500000;
|
||||
public static final String MATERIAL_ADD_FAILED_MSG = "添加商品信息失败";
|
||||
//删除商品信息失败
|
||||
public static final int MATERIAL_DELETE_FAILED_CODE = 7500001;
|
||||
public static final String MATERIAL_DELETE_FAILED_MSG = "删除商品信息失败";
|
||||
//修改商品信息失败
|
||||
public static final int MATERIAL_EDIT_FAILED_CODE = 7500002;
|
||||
public static final String MATERIAL_EDIT_FAILED_MSG = "修改商品信息失败";
|
||||
//商品信息不存在
|
||||
public static final int MATERIAL_NOT_EXISTS_CODE = 8000000;
|
||||
public static final String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在";
|
||||
@@ -87,7 +249,58 @@ public class ExceptionConstants {
|
||||
//商品库存不足
|
||||
public static final int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004;
|
||||
public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足";
|
||||
|
||||
/**
|
||||
* 单据信息
|
||||
* type = 85
|
||||
* */
|
||||
//添加单据信息失败
|
||||
public static final int DEPOT_HEAD_ADD_FAILED_CODE = 8500000;
|
||||
public static final String DEPOT_HEAD_ADD_FAILED_MSG = "添加单据信息失败";
|
||||
//删除单据信息失败
|
||||
public static final int DEPOT_HEAD_DELETE_FAILED_CODE = 8500001;
|
||||
public static final String DEPOT_HEAD_DELETE_FAILED_MSG = "删除单据信息失败";
|
||||
//修改单据信息失败
|
||||
public static final int DEPOT_HEAD_EDIT_FAILED_CODE = 8500002;
|
||||
public static final String DEPOT_HEAD_EDIT_FAILED_MSG = "修改单据信息失败";
|
||||
/**
|
||||
* 单据明细信息
|
||||
* type = 90
|
||||
* */
|
||||
//添加单据明细信息失败
|
||||
public static final int DEPOT_ITEM_ADD_FAILED_CODE = 9000000;
|
||||
public static final String DEPOT_ITEM_ADD_FAILED_MSG = "添加单据明细信息失败";
|
||||
//删除单据明细信息失败
|
||||
public static final int DEPOT_ITEM_DELETE_FAILED_CODE = 9000001;
|
||||
public static final String DEPOT_ITEM_DELETE_FAILED_MSG = "删除单据明细信息失败";
|
||||
//修改单据明细信息失败
|
||||
public static final int DEPOT_ITEM_EDIT_FAILED_CODE = 9000002;
|
||||
public static final String DEPOT_ITEM_EDIT_FAILED_MSG = "修改单据明细信息失败";
|
||||
/**
|
||||
* 财务信息
|
||||
* type = 95
|
||||
* */
|
||||
//添加财务信息失败
|
||||
public static final int ACCOUNT_HEAD_ADD_FAILED_CODE = 9500000;
|
||||
public static final String ACCOUNT_HEAD_ADD_FAILED_MSG = "添加财务信息失败";
|
||||
//删除财务信息失败
|
||||
public static final int ACCOUNT_HEAD_DELETE_FAILED_CODE = 9500001;
|
||||
public static final String ACCOUNT_HEAD_DELETE_FAILED_MSG = "删除财务信息失败";
|
||||
//修改财务信息失败
|
||||
public static final int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002;
|
||||
public static final String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败";
|
||||
/**
|
||||
* 财务明细信息
|
||||
* type = 100
|
||||
* */
|
||||
//添加财务明细信息失败
|
||||
public static final int ACCOUNT_ITEM_ADD_FAILED_CODE = 10000000;
|
||||
public static final String ACCOUNT_ITEM_ADD_FAILED_MSG = "添加财务明细信息失败";
|
||||
//删除财务明细信息失败
|
||||
public static final int ACCOUNT_ITEM_DELETE_FAILED_CODE = 10000001;
|
||||
public static final String ACCOUNT_ITEM_DELETE_FAILED_MSG = "删除财务明细信息失败";
|
||||
//修改财务明细信息失败
|
||||
public static final int ACCOUNT_ITEM_EDIT_FAILED_CODE = 10000002;
|
||||
public static final String ACCOUNT_ITEM_EDIT_FAILED_MSG = "修改财务明细信息失败";
|
||||
/**
|
||||
* 序列号
|
||||
* type = 105
|
||||
@@ -105,7 +318,7 @@ public class ExceptionConstants {
|
||||
public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003;
|
||||
public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败";
|
||||
/**
|
||||
* 机构
|
||||
* 机构信息
|
||||
* type = 110
|
||||
* */
|
||||
//添加机构信息失败
|
||||
@@ -140,6 +353,8 @@ public class ExceptionConstants {
|
||||
public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002;
|
||||
public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 标准正常返回/操作成功返回
|
||||
* @return
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Account;
|
||||
import com.jsh.erp.datasource.vo.AccountVo4InOutList;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.account.AccountService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
@@ -138,5 +140,27 @@ public class AccountController {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除账户信息
|
||||
* create time: 2019/3/29 10:49
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteAccountByIds")
|
||||
public Object batchDeleteAccountByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= accountService.batchDeleteAccountByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.ACCOUNT_DELETE_FAILED_CODE,ExceptionConstants.ACCOUNT_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.ACCOUNT_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.AccountHead;
|
||||
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.accountHead.AccountHeadService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
@@ -146,5 +148,27 @@ public class AccountHeadController {
|
||||
}
|
||||
return allMoney;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除账户信息
|
||||
* create time: 2019/3/29 10:49
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteAccountHeadByIds")
|
||||
public Object batchDeleteAccountHeadByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= accountHeadService.batchDeleteAccountHeadByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.ACCOUNT_HEAD_DELETE_FAILED_CODE,ExceptionConstants.ACCOUNT_HEAD_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.ACCOUNT_HEAD_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.AccountItem;
|
||||
import com.jsh.erp.datasource.vo.AccountItemVo4List;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.accountItem.AccountItemService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.utils.*;
|
||||
@@ -104,5 +106,27 @@ public class AccountItemController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除财务明细信息
|
||||
* create time: 2019/3/29 10:56
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteAccountItemByIds")
|
||||
public Object batchDeleteAccountItemByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= accountItemService.batchDeleteAccountItemByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.ACCOUNT_ITEM_DELETE_FAILED_CODE,ExceptionConstants.ACCOUNT_ITEM_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_ITEM_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.ACCOUNT_ITEM_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.datasource.entities.UserBusiness;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.app.AppService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
@@ -225,4 +227,26 @@ public class AppController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除应用信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteAppByIds")
|
||||
public Object batchDeleteAppByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= appService.batchDeleteAppByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.APP_DELETE_FAILED_CODE,ExceptionConstants.APP_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.APP_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.APP_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.datasource.entities.DepotEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.*;
|
||||
@@ -173,5 +175,26 @@ public class DepotController {
|
||||
queryInfo.setTotal(pageInfo.getTotal());
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除仓库信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteDepotByIds")
|
||||
public Object batchDeleteDepotByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= depotService.batchDeleteDepotByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.DEPOT_DELETE_FAILED_CODE,ExceptionConstants.DEPOT_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.DEPOT_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.jsh.erp.controller;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.utils.*;
|
||||
@@ -782,4 +784,25 @@ public class DepotItemController {
|
||||
}
|
||||
return sumPrice;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除单据明细信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteDepotItemByIds")
|
||||
public Object batchDeleteDepotItemByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= depotItemService.batchDeleteDepotItemByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.DEPOT_ITEM_DELETE_FAILED_CODE,ExceptionConstants.DEPOT_ITEM_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.DEPOT_ITEM_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Functions;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.functions.FunctionsService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
@@ -275,4 +277,25 @@ public class FunctionsController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除功能模块信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteFunctionsByIds")
|
||||
public Object batchDeleteFunctionsByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= functionsService.batchDeleteFunctionsByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.FUNCTIONS_DELETE_FAILED_CODE,ExceptionConstants.FUNCTIONS_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.FUNCTIONS_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.FUNCTIONS_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.InOutItem;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.inOutItem.InOutItemService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
@@ -54,5 +56,26 @@ public class InOutItemController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除收支项目信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteInOutItemByIds")
|
||||
public Object batchDeleteInOutItemByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= inOutItemService.batchDeleteInOutItemByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.IN_OUT_ITEM_DELETE_FAILED_CODE,ExceptionConstants.IN_OUT_ITEM_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.IN_OUT_ITEM_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.IN_OUT_ITEM_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.DepotEx;
|
||||
import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.utils.*;
|
||||
import jxl.Sheet;
|
||||
@@ -341,4 +343,25 @@ public class MaterialController {
|
||||
queryInfo.setTotal(pageInfo.getTotal());
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除商品信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteMaterialByIds")
|
||||
public Object batchDeleteMaterialByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= materialService.batchDeleteMaterialByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.MATERIAL_DELETE_FAILED_CODE,ExceptionConstants.MATERIAL_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.MATERIAL_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.service.materialProperty.MaterialPropertyService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Description
|
||||
*
|
||||
* @Author: qiankunpingtai
|
||||
* @Date: 2019/3/29 15:24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/materialProperty")
|
||||
public class MaterialPropertyController {
|
||||
private Logger logger = LoggerFactory.getLogger(MaterialPropertyController.class);
|
||||
@Resource
|
||||
private MaterialPropertyService materialPropertyService;
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除商品扩展信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteMaterialPropertyByIds")
|
||||
public Object batchDeleteMaterialPropertyByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= materialPropertyService.batchDeleteMaterialPropertyByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.MATERIAL_PROPERTY_DELETE_FAILED_CODE,ExceptionConstants.MATERIAL_PROPERTY_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_PROPERTY_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.MATERIAL_PROPERTY_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,9 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Person;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.person.PersonService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
@@ -121,4 +123,25 @@ public class PersonController {
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除经手人信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeletePersonByIds")
|
||||
public Object batchDeletePersonByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= personService.batchDeletePersonByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.PERSON_DELETE_FAILED_CODE,ExceptionConstants.PERSON_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.PERSON_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.PERSON_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,11 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Role;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.role.RoleService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -77,4 +80,26 @@ public class RoleController {
|
||||
return roleService.getRole();
|
||||
}
|
||||
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 逻辑删除角色信息
|
||||
* create time: 2019/3/28 15:39
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteRoleByIds")
|
||||
public Object batchDeleteRoleByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= roleService.batchDeleteRoleByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.ROLE_DELETE_FAILED_CODE,ExceptionConstants.ROLE_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.ROLE_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.ROLE_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,11 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.supplier.SupplierService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.*;
|
||||
import jxl.Sheet;
|
||||
@@ -40,6 +43,8 @@ public class SupplierController {
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
/**
|
||||
* 更新供应商-只更新预付款,其余用原来的值
|
||||
@@ -437,5 +442,26 @@ public class SupplierController {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除供应商信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteSupplierByIds")
|
||||
public Object batchDeleteSupplierByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= supplierService.batchDeleteSupplierByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.SUPPLIER_DELETE_FAILED_CODE,ExceptionConstants.SUPPLIER_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.SUPPLIER_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.SUPPLIER_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.systemConfig.SystemConfigService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Description
|
||||
*
|
||||
* @Author: qiankunpingtai
|
||||
* @Date: 2019/4/1 15:28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/systemConfig")
|
||||
public class SystemConfigController {
|
||||
private Logger logger = LoggerFactory.getLogger(SystemConfigController.class);
|
||||
@Resource
|
||||
private SystemConfigService systemConfigService;
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除系统配置信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteSystemConfigByIds")
|
||||
public Object batchDeleteSystemConfigByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= systemConfigService.batchDeleteSystemConfigByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.SYSTEM_CONFIG_DELETE_FAILED_CODE,ExceptionConstants.SYSTEM_CONFIG_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.SYSTEM_CONFIG_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.SYSTEM_CONFIG_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
48
src/main/java/com/jsh/erp/controller/UnitController.java
Normal file
48
src/main/java/com/jsh/erp/controller/UnitController.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.unit.UnitService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Description
|
||||
*
|
||||
* @Author: qiankunpingtai
|
||||
* @Date: 2019/4/1 15:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/unit")
|
||||
public class UnitController {
|
||||
private Logger logger = LoggerFactory.getLogger(UnitController.class);
|
||||
@Resource
|
||||
private UnitService unitService;
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除系统配置信息
|
||||
* create time: 2019/3/29 11:15
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteUnitByIds")
|
||||
public Object batchDeleteUnitByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= unitService.batchDeleteUnitByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.UNIT_DELETE_FAILED_CODE,ExceptionConstants.UNIT_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.UNIT_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.UNIT_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.UserBusiness;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
@@ -27,6 +30,8 @@ public class UserBusinessController {
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@GetMapping(value = "/getBasicData")
|
||||
public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId,
|
||||
@@ -86,4 +91,26 @@ public class UserBusinessController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 批量删除用户角色模块关系信息
|
||||
* create time: 2019/3/28 15:47
|
||||
* @Param: ids
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/batchDeleteUserBusinessByIds")
|
||||
public Object batchDeleteUserBusinessByIds(@RequestParam("ids") String ids) throws Exception {
|
||||
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
int i= userBusinessService.batchDeleteUserBusinessByIds(ids);
|
||||
if(i<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
||||
ExceptionConstants.USER_BUSINESS_DELETE_FAILED_CODE,ExceptionConstants.USER_BUSINESS_DELETE_FAILED_MSG,ids);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.USER_BUSINESS_DELETE_FAILED_CODE,
|
||||
ExceptionConstants.USER_BUSINESS_DELETE_FAILED_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface AccountHeadMapperEx {
|
||||
@@ -34,4 +35,6 @@ public interface AccountHeadMapperEx {
|
||||
|
||||
List<AccountHeadVo4ListEx> getDetailByNumber(
|
||||
@Param("billNo") String billNo);
|
||||
|
||||
int batchDeleteAccountHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.AccountItemExample;
|
||||
import com.jsh.erp.datasource.vo.AccountItemVo4List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface AccountItemMapperEx {
|
||||
@@ -24,4 +25,5 @@ public interface AccountItemMapperEx {
|
||||
List<AccountItemVo4List> getDetailList(
|
||||
@Param("headerId") Long headerId);
|
||||
|
||||
int batchDeleteAccountItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.jsh.erp.datasource.vo.AccountVo4InOutList;
|
||||
import com.jsh.erp.datasource.vo.AccountVo4List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface AccountMapperEx {
|
||||
@@ -29,4 +30,6 @@ public interface AccountMapperEx {
|
||||
|
||||
int findAccountInOutListCount(
|
||||
@Param("accountId") Long accountId);
|
||||
|
||||
int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.datasource.entities.AppExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface AppMapperEx {
|
||||
@@ -17,4 +18,6 @@ public interface AppMapperEx {
|
||||
Long countsByApp(
|
||||
@Param("name") String name,
|
||||
@Param("type") String type);
|
||||
|
||||
int batchDeleteAppByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -112,4 +113,6 @@ public interface DepotHeadMapperEx {
|
||||
* 获得一个全局唯一的数作为订单号的追加
|
||||
* */
|
||||
Long getBuildOnlyNumber(@Param("seq_name") String seq_name);
|
||||
|
||||
int batchDeleteDepotHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -143,6 +144,14 @@ public interface DepotItemMapperEx {
|
||||
@Param("enableSerialNumber")String enableSerialNumber);
|
||||
/**
|
||||
* 根据单据主表id删除单据子表数据
|
||||
* 物理删除,已弃用
|
||||
* */
|
||||
@Deprecated
|
||||
int deleteDepotItemByDepotHeadIds(@Param("depotheadIds")Long []depotHeadIds);
|
||||
/**
|
||||
* 根据单据主表id删除单据子表数据
|
||||
* */
|
||||
int batchDeleteDepotItemByDepotHeadIds(@Param("depotheadIds")Long []depotHeadIds);
|
||||
|
||||
int batchDeleteDepotItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.DepotEx;
|
||||
import com.jsh.erp.datasource.entities.DepotExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -23,4 +24,6 @@ public interface DepotMapperEx {
|
||||
@Param("remark") String remark);
|
||||
|
||||
List<DepotEx> getDepotList(Map<String, Object> params);
|
||||
|
||||
int batchDeleteDepotByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Functions;
|
||||
import com.jsh.erp.datasource.entities.FunctionsExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface FunctionsMapperEx {
|
||||
@@ -17,4 +18,6 @@ public interface FunctionsMapperEx {
|
||||
Long countsByFunctions(
|
||||
@Param("name") String name,
|
||||
@Param("type") String type);
|
||||
|
||||
int batchDeleteFunctionsByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.InOutItem;
|
||||
import com.jsh.erp.datasource.entities.InOutItemExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface InOutItemMapperEx {
|
||||
@@ -19,4 +20,6 @@ public interface InOutItemMapperEx {
|
||||
@Param("name") String name,
|
||||
@Param("type") String type,
|
||||
@Param("remark") String remark);
|
||||
|
||||
int batchDeleteInOutItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -54,4 +55,6 @@ public interface MaterialMapperEx {
|
||||
* 获取开启序列号并且状态正常的商品列表
|
||||
* */
|
||||
List<Material> getMaterialEnableSerialNumberList(Map<String, Object> parameterMap);
|
||||
|
||||
int batchDeleteMaterialByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.MaterialProperty;
|
||||
import com.jsh.erp.datasource.entities.MaterialPropertyExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface MaterialPropertyMapperEx {
|
||||
@@ -14,4 +15,6 @@ public interface MaterialPropertyMapperEx {
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
Long countsByMaterialProperty(@Param("name") String name);
|
||||
|
||||
int batchDeleteMaterialPropertyByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Person;
|
||||
import com.jsh.erp.datasource.entities.PersonExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface PersonMapperEx {
|
||||
@@ -17,4 +18,6 @@ public interface PersonMapperEx {
|
||||
Long countsByPerson(
|
||||
@Param("name") String name,
|
||||
@Param("type") String type);
|
||||
|
||||
int batchDeletePersonByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Role;
|
||||
import com.jsh.erp.datasource.entities.RoleExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface RoleMapperEx {
|
||||
@@ -15,4 +16,6 @@ public interface RoleMapperEx {
|
||||
|
||||
Long countsByRole(
|
||||
@Param("name") String name);
|
||||
|
||||
int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.datasource.entities.SupplierExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface SupplierMapperEx {
|
||||
@@ -30,4 +31,6 @@ public interface SupplierMapperEx {
|
||||
@Param("phonenum") String phonenum,
|
||||
@Param("telephone") String telephone,
|
||||
@Param("description") String description);
|
||||
|
||||
int batchDeleteSupplierByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.SystemConfig;
|
||||
import com.jsh.erp.datasource.entities.SystemConfigExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface SystemConfigMapperEx {
|
||||
@@ -15,4 +16,6 @@ public interface SystemConfigMapperEx {
|
||||
|
||||
Long countsBySystemConfig(
|
||||
@Param("companyName") String companyName);
|
||||
|
||||
int batchDeleteSystemConfigByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Unit;
|
||||
import com.jsh.erp.datasource.entities.UnitExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface UnitMapperEx {
|
||||
@@ -15,4 +16,6 @@ public interface UnitMapperEx {
|
||||
|
||||
Long countsByUnit(
|
||||
@Param("name") String name);
|
||||
|
||||
int batchDeleteUnitByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date; /**
|
||||
* Description
|
||||
*
|
||||
* @Author: qiankunpingtai
|
||||
* @Date: 2019/3/29 15:09
|
||||
*/
|
||||
public interface UserBusinessMapperEx {
|
||||
int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.jsh.erp.datasource.mappers.*;
|
||||
import com.jsh.erp.datasource.vo.AccountVo4InOutList;
|
||||
import com.jsh.erp.datasource.vo.AccountVo4List;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import com.jsh.erp.utils.Tools;
|
||||
import org.slf4j.Logger;
|
||||
@@ -45,6 +46,8 @@ public class AccountService {
|
||||
private AccountItemMapper accountItemMapper;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
public Account getAccount(long id) {
|
||||
return accountMapper.selectByPrimaryKey(id);
|
||||
@@ -112,7 +115,8 @@ public class AccountService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
AccountExample example = new AccountExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
|
||||
List<Account> list = accountMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -317,5 +321,13 @@ public class AccountService {
|
||||
example.createCriteria().andIdEqualTo(accountId);
|
||||
return accountMapper.updateByExampleSelective(account, example);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteAccountByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return accountMapperEx.batchDeleteAccountByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
package com.jsh.erp.service.accountHead;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.AccountHead;
|
||||
import com.jsh.erp.datasource.entities.AccountHeadExample;
|
||||
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.AccountHeadMapper;
|
||||
import com.jsh.erp.datasource.mappers.AccountHeadMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import com.jsh.erp.utils.Tools;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -28,6 +35,10 @@ public class AccountHeadService {
|
||||
|
||||
@Resource
|
||||
private AccountHeadMapperEx accountHeadMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public AccountHead getAccountHead(long id) {
|
||||
return accountHeadMapper.selectByPrimaryKey(id);
|
||||
@@ -87,7 +98,7 @@ public class AccountHeadService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
AccountHeadExample example = new AccountHeadExample();
|
||||
example.createCriteria().andIdNotEqualTo(id);
|
||||
example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<AccountHead> list = accountHeadMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -122,5 +133,13 @@ public class AccountHeadService {
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteAccountHeadByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_HEAD,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.AccountItem;
|
||||
import com.jsh.erp.datasource.entities.AccountItemExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapper;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.datasource.vo.AccountItemVo4List;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
@@ -22,6 +24,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
@@ -37,6 +40,8 @@ public class AccountItemService {
|
||||
private AccountItemMapperEx accountItemMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
public AccountItem getAccountItem(long id) {
|
||||
return accountItemMapper.selectByPrimaryKey(id);
|
||||
@@ -83,7 +88,7 @@ public class AccountItemService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
AccountItemExample example = new AccountItemExample();
|
||||
example.createCriteria().andIdNotEqualTo(id);
|
||||
example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<AccountItem> list = accountItemMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -135,10 +140,16 @@ public class AccountItemService {
|
||||
}
|
||||
}
|
||||
if (null != deletedJson) {
|
||||
StringBuffer bf=new StringBuffer();
|
||||
for (int i = 0; i < deletedJson.size(); i++) {
|
||||
JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i));
|
||||
this.deleteAccountItem(tempDeletedJson.getLong("Id"));
|
||||
bf.append(tempDeletedJson.getLong("Id"));
|
||||
if(i<(deletedJson.size()-1)){
|
||||
bf.append(",");
|
||||
}
|
||||
|
||||
}
|
||||
this.batchDeleteAccountItemByIds(bf.toString());
|
||||
}
|
||||
if (null != updatedJson) {
|
||||
for (int i = 0; i < updatedJson.size(); i++) {
|
||||
@@ -168,5 +179,13 @@ public class AccountItemService {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteAccountItemByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_ITEM,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return accountItemMapperEx.batchDeleteAccountItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.app;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.datasource.entities.AppExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.AppMapper;
|
||||
import com.jsh.erp.datasource.mappers.AppMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -23,6 +30,10 @@ public class AppService {
|
||||
private AppMapper appMapper;
|
||||
@Resource
|
||||
private AppMapperEx appMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public List<App> findDock(){
|
||||
AppExample example = new AppExample();
|
||||
@@ -106,4 +117,13 @@ public class AppService {
|
||||
List<App> list = appMapper.selectByExample(example);
|
||||
return list;
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteAppByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_APP,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return appMapperEx.batchDeleteAppByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
package com.jsh.erp.service.depot;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.datasource.entities.DepotEx;
|
||||
import com.jsh.erp.datasource.entities.DepotExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.DepotMapper;
|
||||
import com.jsh.erp.datasource.mappers.DepotMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -26,6 +33,10 @@ public class DepotService {
|
||||
|
||||
@Resource
|
||||
private DepotMapperEx depotMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public Depot getDepot(long id) {
|
||||
return depotMapper.selectByPrimaryKey(id);
|
||||
@@ -78,7 +89,7 @@ public class DepotService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
DepotExample example = new DepotExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Depot> list = depotMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -102,5 +113,13 @@ public class DepotService {
|
||||
public List<DepotEx> getDepotList(Map<String, Object> parameterMap) {
|
||||
return depotMapperEx.getDepotList(parameterMap);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteDepotByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return depotMapperEx.batchDeleteDepotByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class DepotHeadService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
DepotHeadExample example = new DepotHeadExample();
|
||||
example.createCriteria().andIdNotEqualTo(id);
|
||||
example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<DepotHead> list = depotHeadMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -366,14 +366,14 @@ public class DepotHeadService {
|
||||
if(depotItemList!=null&&depotItemList.size()>0){
|
||||
for(DepotItem depotItem:depotItemList){
|
||||
//BasicNumber=OperNumber*ratio
|
||||
serialNumberService.cancelSerialNumber(depotItem.getMaterialid(), depotItem.getHeaderid(),depotItem.getBasicnumber().intValue(),userInfo);
|
||||
serialNumberService.cancelSerialNumber(depotItem.getMaterialid(), depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**删除单据子表数据*/
|
||||
depotItemMapperEx.deleteDepotItemByDepotHeadIds(new Long []{id});
|
||||
depotItemMapperEx.batchDeleteDepotItemByDepotHeadIds(new Long []{id});
|
||||
/**删除单据主表信息*/
|
||||
deleteDepotHead(id);
|
||||
batchDeleteDepotHeadByIds(id.toString());
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
@@ -391,8 +391,17 @@ public class DepotHeadService {
|
||||
if(StringUtil.isNotEmpty(ids)){
|
||||
String [] headIds=ids.split(",");
|
||||
for(int i=0;i<headIds.length;i++){
|
||||
deleteDepotHeadAndDetail(new Long(headIds[i]));
|
||||
deleteDepotHeadAndDetail(Long.valueOf(headIds[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteDepotHeadByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return depotHeadMapperEx.batchDeleteDepotHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class DepotItemService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
DepotItemExample example = new DepotItemExample();
|
||||
example.createCriteria().andIdNotEqualTo(id);
|
||||
example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<DepotItem> list = depotItemMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -248,6 +248,7 @@ public class DepotItemService {
|
||||
* 更新的需要判断货源是否充足
|
||||
* */
|
||||
if (null != deletedJson) {
|
||||
StringBuffer bf=new StringBuffer();
|
||||
for (int i = 0; i < deletedJson.size(); i++) {
|
||||
//首先回收序列号,如果是调拨,不用处理序列号
|
||||
JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i));
|
||||
@@ -265,12 +266,17 @@ public class DepotItemService {
|
||||
continue;
|
||||
}
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())){
|
||||
serialNumberMapperEx.cancelSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),depotItem.getBasicnumber().intValue(),
|
||||
serialNumberMapperEx.cancelSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),
|
||||
new Date(),userInfo==null?null:userInfo.getId());
|
||||
}
|
||||
}
|
||||
this.deleteDepotItem(tempDeletedJson.getLong("Id"));
|
||||
bf.append(tempDeletedJson.getLong("Id"));
|
||||
if(i<(deletedJson.size()-1)){
|
||||
bf.append(",");
|
||||
}
|
||||
}
|
||||
this.batchDeleteDepotItemByIds(bf.toString());
|
||||
}
|
||||
if (null != insertedJson) {
|
||||
for (int i = 0; i < insertedJson.size(); i++) {
|
||||
@@ -363,7 +369,7 @@ public class DepotItemService {
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getBasicnumber().intValue()){
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
@@ -401,7 +407,7 @@ public class DepotItemService {
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
serialNumberMapperEx.cancelSerialNumber(depotItem.getMaterialid(), depotItem.getHeaderid(), depotItem.getBasicnumber().intValue(),
|
||||
serialNumberMapperEx.cancelSerialNumber(depotItem.getMaterialid(), depotItem.getHeaderid(), (depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),
|
||||
new Date(), userInfo == null ? null : userInfo.getId());
|
||||
}
|
||||
/**收回序列号的时候释放库存*/
|
||||
@@ -486,7 +492,7 @@ public class DepotItemService {
|
||||
}
|
||||
/**出库时处理序列号*/
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getBasicnumber().intValue()){
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
@@ -536,5 +542,13 @@ public class DepotItemService {
|
||||
int outSum = findByTypeAndMaterialId(BusinessConstants.DEPOTHEAD_TYPE_OUT, materialId);
|
||||
return (inSum-outSum);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteDepotItemByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_ITEM,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return depotItemMapperEx.batchDeleteDepotItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.functions;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Functions;
|
||||
import com.jsh.erp.datasource.entities.FunctionsExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.FunctionsMapper;
|
||||
import com.jsh.erp.datasource.mappers.FunctionsMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -24,6 +31,10 @@ public class FunctionsService {
|
||||
|
||||
@Resource
|
||||
private FunctionsMapperEx functionsMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public Functions getFunctions(long id) {
|
||||
return functionsMapper.selectByPrimaryKey(id);
|
||||
@@ -70,7 +81,7 @@ public class FunctionsService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
FunctionsExample example = new FunctionsExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Functions> list = functionsMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -99,4 +110,13 @@ public class FunctionsService {
|
||||
List<Functions> list = functionsMapper.selectByExample(example);
|
||||
return list;
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteFunctionsByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_FUNCTIONS,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return functionsMapperEx.batchDeleteFunctionsByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.inOutItem;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.InOutItem;
|
||||
import com.jsh.erp.datasource.entities.InOutItemExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.InOutItemMapper;
|
||||
import com.jsh.erp.datasource.mappers.InOutItemMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -24,6 +31,10 @@ public class InOutItemService {
|
||||
|
||||
@Resource
|
||||
private InOutItemMapperEx inOutItemMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public InOutItem getInOutItem(long id) {
|
||||
return inOutItemMapper.selectByPrimaryKey(id);
|
||||
@@ -70,7 +81,7 @@ public class InOutItemService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
InOutItemExample example = new InOutItemExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<InOutItem> list = inOutItemMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -85,4 +96,13 @@ public class InOutItemService {
|
||||
example.setOrderByClause("id desc");
|
||||
return inOutItemMapper.selectByExample(example);
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteInOutItemByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_IN_OUT_ITEM,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return inOutItemMapperEx.batchDeleteInOutItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,11 @@ package com.jsh.erp.service.material;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.DepotEx;
|
||||
import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialExample;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapper;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
@@ -20,10 +18,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class MaterialService {
|
||||
@@ -35,6 +30,8 @@ public class MaterialService {
|
||||
private MaterialMapperEx materialMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
public Material getMaterial(long id) {
|
||||
return materialMapper.selectByPrimaryKey(id);
|
||||
@@ -120,7 +117,7 @@ public class MaterialService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
MaterialExample example = new MaterialExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Material> list = materialMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -211,4 +208,13 @@ public class MaterialService {
|
||||
public List<Material> getMaterialEnableSerialNumberList(Map<String, Object> parameterMap) {
|
||||
return materialMapperEx.getMaterialEnableSerialNumberList(parameterMap);
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteMaterialByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return materialMapperEx.batchDeleteMaterialByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.materialProperty;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.MaterialProperty;
|
||||
import com.jsh.erp.datasource.entities.MaterialPropertyExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.MaterialPropertyMapper;
|
||||
import com.jsh.erp.datasource.mappers.MaterialPropertyMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -24,6 +31,10 @@ public class MaterialPropertyService {
|
||||
|
||||
@Resource
|
||||
private MaterialPropertyMapperEx materialPropertyMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public MaterialProperty getMaterialProperty(long id) {
|
||||
return materialPropertyMapper.selectByPrimaryKey(id);
|
||||
@@ -70,4 +81,14 @@ public class MaterialPropertyService {
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
return 0;
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteMaterialPropertyByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_PROPERTY,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return materialPropertyMapperEx.batchDeleteMaterialPropertyByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.OrgaUserRelMapper;
|
||||
import com.jsh.erp.datasource.mappers.OrgaUserRelMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.organization.OrganizationService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -34,6 +35,8 @@ public class OrgaUserRelService {
|
||||
private OrgaUserRelMapperEx orgaUserRelMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insertOrgaUserRel(String beanJson, HttpServletRequest request) {
|
||||
OrgaUserRel orgaUserRel = JSONObject.parseObject(beanJson, OrgaUserRel.class);
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.person;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Person;
|
||||
import com.jsh.erp.datasource.entities.PersonExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.PersonMapper;
|
||||
import com.jsh.erp.datasource.mappers.PersonMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -24,6 +31,10 @@ public class PersonService {
|
||||
|
||||
@Resource
|
||||
private PersonMapperEx personMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public Person getPerson(long id) {
|
||||
return personMapper.selectByPrimaryKey(id);
|
||||
@@ -70,7 +81,7 @@ public class PersonService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
PersonExample example = new PersonExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Person> list = personMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -97,6 +108,13 @@ public class PersonService {
|
||||
return personMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeletePersonByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_PERSON,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return personMapperEx.batchDeletePersonByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsh.erp.service.role;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Role;
|
||||
import com.jsh.erp.datasource.entities.RoleExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
@@ -8,14 +9,19 @@ import com.jsh.erp.datasource.entities.UserExample;
|
||||
import com.jsh.erp.datasource.mappers.RoleMapper;
|
||||
import com.jsh.erp.datasource.mappers.RoleMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.UserMapper;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
import com.jsh.erp.utils.RegExpTools;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -26,6 +32,10 @@ public class RoleService {
|
||||
|
||||
@Resource
|
||||
private RoleMapperEx roleMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
public Role getRole(long id) {
|
||||
return roleMapper.selectByPrimaryKey(id);
|
||||
@@ -76,4 +86,22 @@ public class RoleService {
|
||||
List<Role> list = roleMapper.selectByExample(example);
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:http://39.105.146.63/symphony/
|
||||
* description:
|
||||
* 逻辑删除角色信息
|
||||
* create time: 2019/3/28 15:44
|
||||
* @Param: ids
|
||||
* @return int
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteRoleByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return roleMapperEx.batchDeleteRoleByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class SerialNumberService {
|
||||
|
||||
public int checkIsNameExist(Long id, String serialNumber) {
|
||||
SerialNumberExample example = new SerialNumberExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber);
|
||||
example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<SerialNumber> list = serialNumberMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -292,14 +292,14 @@ public class SerialNumberService {
|
||||
//查询商品下已分配的可用序列号数量
|
||||
int SerialNumberSum= serialNumberMapperEx.countSerialNumberByMaterialIdAndDepotheadId(depotItem.getMaterialid(),null,BusinessConstants.IS_SELL_HOLD);
|
||||
//BasicNumber=OperNumber*ratio
|
||||
if(depotItem.getBasicnumber().intValue()>SerialNumberSum){
|
||||
if((depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()>SerialNumberSum){
|
||||
//获取商品名称
|
||||
Material material= materialMapper.selectByPrimaryKey(depotItem.getMaterialid());
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
//商品下序列号充足,分配序列号
|
||||
sellSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),depotItem.getBasicnumber().intValue(),userInfo);
|
||||
sellSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),userInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.datasource.entities.SupplierExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.SupplierMapper;
|
||||
import com.jsh.erp.datasource.mappers.SupplierMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
@@ -19,6 +21,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -34,6 +37,8 @@ public class SupplierService {
|
||||
private SupplierMapperEx supplierMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
public Supplier getSupplier(long id) {
|
||||
return supplierMapper.selectByPrimaryKey(id);
|
||||
@@ -80,7 +85,7 @@ public class SupplierService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
SupplierExample example = new SupplierExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Supplier> list = supplierMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@@ -173,4 +178,13 @@ public class SupplierService {
|
||||
info.data = data;
|
||||
return info;
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteSupplierByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return supplierMapperEx.batchDeleteSupplierByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.systemConfig;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.SystemConfig;
|
||||
import com.jsh.erp.datasource.entities.SystemConfigExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.SystemConfigMapper;
|
||||
import com.jsh.erp.datasource.mappers.SystemConfigMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -24,6 +31,10 @@ public class SystemConfigService {
|
||||
|
||||
@Resource
|
||||
private SystemConfigMapperEx systemConfigMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public SystemConfig getSystemConfig(long id) {
|
||||
return systemConfigMapper.selectByPrimaryKey(id);
|
||||
@@ -69,8 +80,17 @@ public class SystemConfigService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
SystemConfigExample example = new SystemConfigExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andCompanyNameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andCompanyNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<SystemConfig> list = systemConfigMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteSystemConfigByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SYSTEM_CONFIG,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return systemConfigMapperEx.batchDeleteSystemConfigByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.jsh.erp.service.unit;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Unit;
|
||||
import com.jsh.erp.datasource.entities.UnitExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.UnitMapper;
|
||||
import com.jsh.erp.datasource.mappers.UnitMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -24,6 +31,10 @@ public class UnitService {
|
||||
|
||||
@Resource
|
||||
private UnitMapperEx unitMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public Unit getUnit(long id) {
|
||||
return unitMapper.selectByPrimaryKey(id);
|
||||
@@ -70,8 +81,19 @@ public class UnitService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
UnitExample example = new UnitExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andUnameEqualTo(name);
|
||||
example.createCriteria().andIdNotEqualTo(id).andUnameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Unit> list = unitMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteUnitByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_UNIT,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return unitMapperEx.batchDeleteUnitByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,10 +28,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
@@ -193,7 +190,10 @@ public class UserService {
|
||||
|
||||
public int checkIsNameExist(Long id, String name) {
|
||||
UserExample example = new UserExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name);
|
||||
List <Byte> userStatus=new ArrayList<Byte>();
|
||||
userStatus.add(BusinessConstants.USER_STATUS_DELETE);
|
||||
userStatus.add(BusinessConstants.USER_STATUS_BANNED);
|
||||
example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name).andStatusNotIn(userStatus);
|
||||
List<User> list = userMapper.selectByExample(example);
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@ package com.jsh.erp.service.userBusiness;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.entities.UserBusiness;
|
||||
import com.jsh.erp.datasource.entities.UserBusinessExample;
|
||||
import com.jsh.erp.datasource.mappers.UserBusinessMapper;
|
||||
import com.jsh.erp.datasource.mappers.UserBusinessMapperEx;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -16,6 +19,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -25,7 +29,11 @@ public class UserBusinessService {
|
||||
@Resource
|
||||
private UserBusinessMapper userBusinessMapper;
|
||||
@Resource
|
||||
private UserBusinessMapperEx userBusinessMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
public UserBusiness getUserBusiness(long id) {
|
||||
return userBusinessMapper.selectByPrimaryKey(id);
|
||||
@@ -126,5 +134,13 @@ public class UserBusinessService {
|
||||
List<UserBusiness> list = userBusinessMapper.selectByExample(example);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteUserBusinessByIds(String ids) {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
User userInfo=userService.getCurrentUser();
|
||||
String [] idArray=ids.split(",");
|
||||
return userBusinessMapperEx.batchDeleteUserBusinessByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user