diff --git a/erp_web/js/pages/financial/financial_base.js b/erp_web/js/pages/financial/financial_base.js index 874e4ccd..a9e37e5d 100644 --- a/erp_web/js/pages/financial/financial_base.js +++ b/erp_web/js/pages/financial/financial_base.js @@ -486,8 +486,11 @@ { $.ajax({ type:"post", - url: "/accountHead/" + accountHeadID + "/delete", + url: "/accountHead/batchDeleteAccountHeadByIds", dataType: "json", + data:{ + ids: accountHeadID + }, success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -576,7 +579,7 @@ //批量删除 $.ajax({ type:"post", - url: "/accountHead/batchDelete", + url: "/accountHead/batchDeleteAccountHeadByIds", dataType: "json", async : false, data: ({ diff --git a/erp_web/js/pages/manage/supplier.js b/erp_web/js/pages/manage/supplier.js index bb95183a..8c71d20a 100644 --- a/erp_web/js/pages/manage/supplier.js +++ b/erp_web/js/pages/manage/supplier.js @@ -170,8 +170,11 @@ var supplierTotalInfo = supplierInfo.split("AaBb"); $.ajax({ type:"post", - url: "/supplier/" + supplierTotalInfo[0] + "/delete", + url: "/supplier/batchDeleteSupplierByIds", dataType: "json", + data: ({ + ids : supplierTotalInfo[0] + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -210,7 +213,7 @@ } $.ajax({ type:"post", - url: "/supplier/batchDelete", + url: "/supplier/batchDeleteSupplierByIds", dataType: "json", async : false, data: ({ diff --git a/erp_web/pages/manage/account.html b/erp_web/pages/manage/account.html index f3a00aec..afbdd180 100644 --- a/erp_web/pages/manage/account.html +++ b/erp_web/pages/manage/account.html @@ -225,8 +225,11 @@ var accountTotalInfo = accountInfo.split("AaBb"); $.ajax({ type: "post", - url: "/account/" + accountTotalInfo[0] + "/delete", + url: "/account/batchDeleteAccountByIds", dataType: "json", + data: ({ + ids: accountTotalInfo[0] + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -264,7 +267,7 @@ } $.ajax({ type: "post", - url: "/account/batchDelete", + url: "/account/batchDeleteAccountByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/app.html b/erp_web/pages/manage/app.html index 4d8f47af..ae793d78 100644 --- a/erp_web/pages/manage/app.html +++ b/erp_web/pages/manage/app.html @@ -270,8 +270,11 @@ if (r) { $.ajax({ type: "post", - url: "/app/" + appID + "/delete", + url: "/app/batchDeleteAppByIds", dataType: "json", + data: ({ + ids: appID + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -309,7 +312,7 @@ } $.ajax({ type: "post", - url: "/app/batchDelete", + url: "/app/batchDeleteAppByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/depot.html b/erp_web/pages/manage/depot.html index 1e76e3c4..43a77881 100644 --- a/erp_web/pages/manage/depot.html +++ b/erp_web/pages/manage/depot.html @@ -255,8 +255,11 @@ if (r) { $.ajax({ type: "post", - url: "/depot/" + depotID + "/delete", + url: "/depot/batchDeleteDepotByIds", dataType: "json", + data: ({ + ids: depotID + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -294,7 +297,7 @@ } $.ajax({ type: "post", - url: "/depot/batchDelete", + url: "/depot/batchDeleteDepotByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/functions.html b/erp_web/pages/manage/functions.html index 9eabea9c..d0592cbe 100644 --- a/erp_web/pages/manage/functions.html +++ b/erp_web/pages/manage/functions.html @@ -268,8 +268,11 @@ if (r) { $.ajax({ type: "post", - url: "/functions/" + functionsID + "/delete", + url: "/functions/batchDeleteFunctionsByIds", dataType: "json", + data: ({ + ids: functionsID + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -307,7 +310,7 @@ } $.ajax({ type: "post", - url: "/functions/batchDelete", + url: "/functions/batchDeleteFunctionsByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/inOutItem.html b/erp_web/pages/manage/inOutItem.html index 1ef0954a..f61b8880 100644 --- a/erp_web/pages/manage/inOutItem.html +++ b/erp_web/pages/manage/inOutItem.html @@ -225,8 +225,11 @@ var inOutItemTotalInfo = inOutItemInfo.split("AaBb"); $.ajax({ type: "post", - url: "/inOutItem/" + inOutItemTotalInfo[0] + "/delete", + url: "/inOutItem/batchDeleteInOutItemByIds", dataType: "json", + data: ({ + ids: inOutItemTotalInfo[0] + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -264,7 +267,7 @@ } $.ajax({ type: "post", - url: "/inOutItem/batchDelete", + url: "/inOutItem/batchDeleteInOutItemByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/role.html b/erp_web/pages/manage/role.html index b3751071..e2a933f3 100644 --- a/erp_web/pages/manage/role.html +++ b/erp_web/pages/manage/role.html @@ -203,8 +203,11 @@ if (r) { $.ajax({ type: "post", - url: "/role/" + roleID + "/delete", + url: "/role/batchDeleteRoleByIds", dataType: "json", + data: ({ + ids: roleID, + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -242,7 +245,7 @@ } $.ajax({ type: "post", - url: "/role/batchDelete", + url: "/role/batchDeleteRoleByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/systemConfig.html b/erp_web/pages/manage/systemConfig.html index d9da5789..9c9718fe 100644 --- a/erp_web/pages/manage/systemConfig.html +++ b/erp_web/pages/manage/systemConfig.html @@ -192,8 +192,11 @@ if (r) { $.ajax({ type: "post", - url: "/systemConfig/" + systemConfigId + "/delete", + url: "/systemConfig/batchDeleteSystemConfigByIds", dataType: "json", + data: ({ + ids: systemConfigId + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -235,7 +238,7 @@ } else { $.ajax({ type: "post", - url: "/systemConfig/batchDelete", + url: "/systemConfig/batchDeleteSystemConfigByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/manage/unit.html b/erp_web/pages/manage/unit.html index be36d4ad..7b352659 100644 --- a/erp_web/pages/manage/unit.html +++ b/erp_web/pages/manage/unit.html @@ -197,8 +197,11 @@ if (r) { $.ajax({ type: "post", - url: "/unit/" + unitID + "/delete", + url: "/unit/batchDeleteUnitByIds", dataType: "json", + data: ({ + ids: unitID + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -237,7 +240,7 @@ } $.ajax({ type: "post", - url: "/unit/batchDelete", + url: "/unit/batchDeleteUnitByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/materials/material.html b/erp_web/pages/materials/material.html index 5ea4ff23..bb52820a 100644 --- a/erp_web/pages/materials/material.html +++ b/erp_web/pages/materials/material.html @@ -771,8 +771,11 @@ if (r) { $.ajax({ type: "post", - url: "/material/" + materialID + "/delete", + url: "/material/batchDeleteMaterialByIds", dataType: "json", + data: ({ + ids: materialID + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -811,7 +814,7 @@ } $.ajax({ type: "post", - url: "/material/batchDelete", + url: "/material/batchDeleteMaterialByIds", dataType: "json", async: false, data: ({ diff --git a/erp_web/pages/materials/person.html b/erp_web/pages/materials/person.html index fd43819c..6803f865 100644 --- a/erp_web/pages/materials/person.html +++ b/erp_web/pages/materials/person.html @@ -249,8 +249,11 @@ if (r) { $.ajax({ type: "post", - url: "/person/" + personID + "/delete", + url: "/person/batchDeletePersonByIds", dataType: "json", + data: ({ + ids: personID + }), success: function (res) { if(res && res.code == 200) { $("#searchBtn").click(); @@ -289,7 +292,7 @@ } $.ajax({ type: "post", - url: "/person/batchDelete", + url: "/person/batchDeletePersonByIds", dataType: "json", async: false, data: ({ diff --git a/sql/华夏ERP数据库设计汇总.xlsx b/sql/华夏ERP数据库设计汇总.xlsx index 5913f39c..06b216c5 100644 Binary files a/sql/华夏ERP数据库设计汇总.xlsx and b/sql/华夏ERP数据库设计汇总.xlsx differ diff --git a/src/main/java/com/jsh/erp/constants/ExceptionConstants.java b/src/main/java/com/jsh/erp/constants/ExceptionConstants.java index 5fe743c9..662ad688 100644 --- a/src/main/java/com/jsh/erp/constants/ExceptionConstants.java +++ b/src/main/java/com/jsh/erp/constants/ExceptionConstants.java @@ -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 diff --git a/src/main/java/com/jsh/erp/controller/AccountController.java b/src/main/java/com/jsh/erp/controller/AccountController.java index c6fc55d2..a571b9be 100644 --- a/src/main/java/com/jsh/erp/controller/AccountController.java +++ b/src/main/java/com/jsh/erp/controller/AccountController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/AccountHeadController.java b/src/main/java/com/jsh/erp/controller/AccountHeadController.java index 06e37225..3faab1e2 100644 --- a/src/main/java/com/jsh/erp/controller/AccountHeadController.java +++ b/src/main/java/com/jsh/erp/controller/AccountHeadController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/AccountItemController.java b/src/main/java/com/jsh/erp/controller/AccountItemController.java index 04ba1695..7eb2ef6b 100644 --- a/src/main/java/com/jsh/erp/controller/AccountItemController.java +++ b/src/main/java/com/jsh/erp/controller/AccountItemController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/AppController.java b/src/main/java/com/jsh/erp/controller/AppController.java index c79a7da0..d695cdac 100644 --- a/src/main/java/com/jsh/erp/controller/AppController.java +++ b/src/main/java/com/jsh/erp/controller/AppController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/DepotController.java b/src/main/java/com/jsh/erp/controller/DepotController.java index b65a4b08..a28c58e6 100644 --- a/src/main/java/com/jsh/erp/controller/DepotController.java +++ b/src/main/java/com/jsh/erp/controller/DepotController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/DepotItemController.java b/src/main/java/com/jsh/erp/controller/DepotItemController.java index 45db728f..d7dc3025 100644 --- a/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/FunctionsController.java b/src/main/java/com/jsh/erp/controller/FunctionsController.java index c0f01ebd..87a8812b 100644 --- a/src/main/java/com/jsh/erp/controller/FunctionsController.java +++ b/src/main/java/com/jsh/erp/controller/FunctionsController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/InOutItemController.java b/src/main/java/com/jsh/erp/controller/InOutItemController.java index 0116bb85..6d67ca1b 100644 --- a/src/main/java/com/jsh/erp/controller/InOutItemController.java +++ b/src/main/java/com/jsh/erp/controller/InOutItemController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/MaterialController.java b/src/main/java/com/jsh/erp/controller/MaterialController.java index 44e08fb3..9fbb582d 100644 --- a/src/main/java/com/jsh/erp/controller/MaterialController.java +++ b/src/main/java/com/jsh/erp/controller/MaterialController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java b/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java new file mode 100644 index 00000000..6577e48c --- /dev/null +++ b/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java @@ -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; + } +} diff --git a/src/main/java/com/jsh/erp/controller/PersonController.java b/src/main/java/com/jsh/erp/controller/PersonController.java index 4b396cb9..2f310b19 100644 --- a/src/main/java/com/jsh/erp/controller/PersonController.java +++ b/src/main/java/com/jsh/erp/controller/PersonController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/RoleController.java b/src/main/java/com/jsh/erp/controller/RoleController.java index 0c4c04c5..7c58768b 100644 --- a/src/main/java/com/jsh/erp/controller/RoleController.java +++ b/src/main/java/com/jsh/erp/controller/RoleController.java @@ -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; + } + } diff --git a/src/main/java/com/jsh/erp/controller/SupplierController.java b/src/main/java/com/jsh/erp/controller/SupplierController.java index 1b6bc81c..586e2296 100644 --- a/src/main/java/com/jsh/erp/controller/SupplierController.java +++ b/src/main/java/com/jsh/erp/controller/SupplierController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/controller/SystemConfigController.java b/src/main/java/com/jsh/erp/controller/SystemConfigController.java new file mode 100644 index 00000000..fb1a0111 --- /dev/null +++ b/src/main/java/com/jsh/erp/controller/SystemConfigController.java @@ -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; + } + +} diff --git a/src/main/java/com/jsh/erp/controller/UnitController.java b/src/main/java/com/jsh/erp/controller/UnitController.java new file mode 100644 index 00000000..385d1dc7 --- /dev/null +++ b/src/main/java/com/jsh/erp/controller/UnitController.java @@ -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; + } +} diff --git a/src/main/java/com/jsh/erp/controller/UserBusinessController.java b/src/main/java/com/jsh/erp/controller/UserBusinessController.java index 9f04ed08..08e856fd 100644 --- a/src/main/java/com/jsh/erp/controller/UserBusinessController.java +++ b/src/main/java/com/jsh/erp/controller/UserBusinessController.java @@ -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; + } } diff --git a/src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java index 993a55e3..dee82806 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java @@ -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 getDetailByNumber( @Param("billNo") String billNo); + + int batchDeleteAccountHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/AccountItemMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/AccountItemMapperEx.java index 8f290c08..4bf07c5b 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/AccountItemMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/AccountItemMapperEx.java @@ -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 getDetailList( @Param("headerId") Long headerId); + int batchDeleteAccountItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java index 630de121..01dae501 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/AppMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/AppMapperEx.java index 3bffd10e..5b5700a7 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/AppMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/AppMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java index ef7cd3f9..2d39b552 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java @@ -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[]); } diff --git a/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java index 50ff8cc8..35180b82 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java @@ -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[]); } diff --git a/src/main/java/com/jsh/erp/datasource/mappers/DepotMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/DepotMapperEx.java index 19263dc5..917dc453 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/DepotMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/DepotMapperEx.java @@ -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 getDepotList(Map params); + + int batchDeleteDepotByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/FunctionsMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/FunctionsMapperEx.java index d1fb761a..2b4b8369 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/FunctionsMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/FunctionsMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/InOutItemMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/InOutItemMapperEx.java index a8d92819..903aa40a 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/InOutItemMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/InOutItemMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java index a68aefe2..8f022cc4 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java @@ -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 getMaterialEnableSerialNumberList(Map parameterMap); + + int batchDeleteMaterialByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); } diff --git a/src/main/java/com/jsh/erp/datasource/mappers/MaterialPropertyMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/MaterialPropertyMapperEx.java index 080b79e7..7404be52 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/MaterialPropertyMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/MaterialPropertyMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/PersonMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/PersonMapperEx.java index e4cb00a8..5fc0d187 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/PersonMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/PersonMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java index a3737326..969a0cd4 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java index 1bee2015..0ccf8241 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/SystemConfigMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/SystemConfigMapperEx.java index 8ad32ced..e4903cef 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/SystemConfigMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/SystemConfigMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java index 045a7025..960cc3f9 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/UnitMapperEx.java @@ -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[]); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java new file mode 100644 index 00000000..8e135be7 --- /dev/null +++ b/src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java @@ -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[]); +} diff --git a/src/main/java/com/jsh/erp/service/account/AccountService.java b/src/main/java/com/jsh/erp/service/account/AccountService.java index ee0fa68b..cc6b800d 100644 --- a/src/main/java/com/jsh/erp/service/account/AccountService.java +++ b/src/main/java/com/jsh/erp/service/account/AccountService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java b/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java index 4775564c..01c54ea8 100644 --- a/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java +++ b/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java b/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java index acec5149..319d2bb7 100644 --- a/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java +++ b/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/app/AppService.java b/src/main/java/com/jsh/erp/service/app/AppService.java index 6486bdd9..5e97b3b3 100644 --- a/src/main/java/com/jsh/erp/service/app/AppService.java +++ b/src/main/java/com/jsh/erp/service/app/AppService.java @@ -1,20 +1,27 @@ 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.entities.UserBusiness; 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.service.userBusiness.UserBusinessService; 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 @@ -25,6 +32,10 @@ public class AppService { private AppMapper appMapper; @Resource private AppMapperEx appMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; @Resource private UserBusinessService userBusinessService; @@ -111,6 +122,15 @@ public class AppService { List 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); + } public List findAppByUserId(String userId) { List roleList = userBusinessService.findRoleByUserId(userId); diff --git a/src/main/java/com/jsh/erp/service/depot/DepotService.java b/src/main/java/com/jsh/erp/service/depot/DepotService.java index e6371684..6e6a2c20 100644 --- a/src/main/java/com/jsh/erp/service/depot/DepotService.java +++ b/src/main/java/com/jsh/erp/service/depot/DepotService.java @@ -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 list = depotMapper.selectByExample(example); return list.size(); } @@ -102,5 +113,13 @@ public class DepotService { public List getDepotList(Map 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); + } } diff --git a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 8f51410e..7157b58e 100644 --- a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -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 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 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()) list = functionsMapper.selectByExample(example); return list.size(); } @@ -99,4 +110,13 @@ public class FunctionsService { List 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); + } } diff --git a/src/main/java/com/jsh/erp/service/inOutItem/InOutItemService.java b/src/main/java/com/jsh/erp/service/inOutItem/InOutItemService.java index 236e74af..79468ab2 100644 --- a/src/main/java/com/jsh/erp/service/inOutItem/InOutItemService.java +++ b/src/main/java/com/jsh/erp/service/inOutItem/InOutItemService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/material/MaterialService.java b/src/main/java/com/jsh/erp/service/material/MaterialService.java index 3f8a5dc6..6884551a 100644 --- a/src/main/java/com/jsh/erp/service/material/MaterialService.java +++ b/src/main/java/com/jsh/erp/service/material/MaterialService.java @@ -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 list = materialMapper.selectByExample(example); return list.size(); } @@ -211,4 +208,13 @@ public class MaterialService { public List getMaterialEnableSerialNumberList(Map 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); + } } diff --git a/src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java b/src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java index bb51a37b..96355e42 100644 --- a/src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java +++ b/src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java @@ -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); + + } } diff --git a/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelService.java b/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelService.java index bfc12e53..7daffcfe 100644 --- a/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelService.java +++ b/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelService.java @@ -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); diff --git a/src/main/java/com/jsh/erp/service/person/PersonService.java b/src/main/java/com/jsh/erp/service/person/PersonService.java index 60401dbc..2876516e 100644 --- a/src/main/java/com/jsh/erp/service/person/PersonService.java +++ b/src/main/java/com/jsh/erp/service/person/PersonService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/role/RoleService.java b/src/main/java/com/jsh/erp/service/role/RoleService.java index 215950fc..4c592124 100644 --- a/src/main/java/com/jsh/erp/service/role/RoleService.java +++ b/src/main/java/com/jsh/erp/service/role/RoleService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java b/src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java index 12b61615..40d7df06 100644 --- a/src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java +++ b/src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java @@ -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 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); } } diff --git a/src/main/java/com/jsh/erp/service/supplier/SupplierService.java b/src/main/java/com/jsh/erp/service/supplier/SupplierService.java index dfd1d112..3706c432 100644 --- a/src/main/java/com/jsh/erp/service/supplier/SupplierService.java +++ b/src/main/java/com/jsh/erp/service/supplier/SupplierService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java b/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java index 9b83bfb4..696d8c3b 100644 --- a/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java +++ b/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java @@ -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 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); + } } diff --git a/src/main/java/com/jsh/erp/service/unit/UnitService.java b/src/main/java/com/jsh/erp/service/unit/UnitService.java index 0fbc0a02..2838306a 100644 --- a/src/main/java/com/jsh/erp/service/unit/UnitService.java +++ b/src/main/java/com/jsh/erp/service/unit/UnitService.java @@ -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 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); + } + + } diff --git a/src/main/java/com/jsh/erp/service/user/UserService.java b/src/main/java/com/jsh/erp/service/user/UserService.java index 740bf6e0..3d009ff6 100644 --- a/src/main/java/com/jsh/erp/service/user/UserService.java +++ b/src/main/java/com/jsh/erp/service/user/UserService.java @@ -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 userStatus=new ArrayList(); + userStatus.add(BusinessConstants.USER_STATUS_DELETE); + userStatus.add(BusinessConstants.USER_STATUS_BANNED); + example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name).andStatusNotIn(userStatus); List list = userMapper.selectByExample(example); return list.size(); } diff --git a/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java b/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java index 8109082e..74493325 100644 --- a/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java +++ b/src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java @@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject; import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.datasource.entities.App; import com.jsh.erp.datasource.entities.Functions; +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.service.CommonQueryManager; import com.jsh.erp.service.app.AppService; import com.jsh.erp.service.functions.FunctionsService; +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; @@ -24,6 +27,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.HashSet; +import java.util.Date; import java.util.List; import java.util.Set; @@ -34,7 +38,11 @@ public class UserBusinessService { @Resource private UserBusinessMapper userBusinessMapper; @Resource + private UserBusinessMapperEx userBusinessMapperEx; + @Resource private LogService logService; + @Resource + private UserService userService; @Resource private FunctionsService functionsService; @@ -151,6 +159,15 @@ public class UserBusinessService { List 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); + } /** * 通过功能(RoleFunctions)权限更新应用(RoleApp)权限 diff --git a/src/main/resources/mapper_xml/AccountHeadMapperEx.xml b/src/main/resources/mapper_xml/AccountHeadMapperEx.xml index 6d386574..e2424d3f 100644 --- a/src/main/resources/mapper_xml/AccountHeadMapperEx.xml +++ b/src/main/resources/mapper_xml/AccountHeadMapperEx.xml @@ -11,9 +11,9 @@ + + update jsh_accounthead + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/AccountItemMapperEx.xml b/src/main/resources/mapper_xml/AccountItemMapperEx.xml index 857c92d0..9e1e49c4 100644 --- a/src/main/resources/mapper_xml/AccountItemMapperEx.xml +++ b/src/main/resources/mapper_xml/AccountItemMapperEx.xml @@ -20,6 +20,7 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -38,13 +39,25 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_accountitem + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/AccountMapperEx.xml b/src/main/resources/mapper_xml/AccountMapperEx.xml index 32aae43b..d2ed1259 100644 --- a/src/main/resources/mapper_xml/AccountMapperEx.xml +++ b/src/main/resources/mapper_xml/AccountMapperEx.xml @@ -28,6 +28,7 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -47,64 +48,66 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_account + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/AppMapperEx.xml b/src/main/resources/mapper_xml/AppMapperEx.xml index e05a0c20..8422d73c 100644 --- a/src/main/resources/mapper_xml/AppMapperEx.xml +++ b/src/main/resources/mapper_xml/AppMapperEx.xml @@ -11,6 +11,7 @@ and type='${type}' + and ifnull(delete_Flag,'0') !='1' order by sort asc limit #{offset},#{rows} @@ -27,5 +28,16 @@ and type='${type}' + and ifnull(delete_Flag,'0') !='1' + + update jsh_app + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml index 97a73ee9..261374a2 100644 --- a/src/main/resources/mapper_xml/DepotHeadMapperEx.xml +++ b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -44,11 +44,11 @@ select count(1) - from jsh_depothead dh inner join jsh_depotitem di on di.HeaderId=dh.id - inner join jsh_material m on m.id=di.MaterialId - inner join jsh_supplier s on s.id=dh.OrganId - inner join (select id,name as dName from jsh_depot) d on d.id=di.DepotId + from jsh_depothead dh + inner join jsh_depotitem di on di.HeaderId=dh.id and ifnull(di.delete_Flag,'0') !='1' + inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1' + inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1' + inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1' where dh.OperTime >='${beginTime}' and dh.OperTime <='${endTime}' and dh.OrganId = ${oId} @@ -152,14 +160,16 @@ and dh.Type='${type}' + and ifnull(dh.delete_Flag,'0') !='1' ORDER BY OperTime DESC,Number desc select count(1) from - (select di.MaterialId, m.mName,m.Model,m.categoryName from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId + (select di.MaterialId, m.mName,m.Model,m.categoryName from jsh_depothead dh + INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1' INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName - from jsh_material INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id) m - on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime <='${endTime}' + from jsh_material + INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2' + where ifnull(jsh_material.delete_Flag,'0') !='1' + ) m on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime <='${endTime}' and dh.OrganId = ${oId} @@ -219,25 +240,30 @@ and di.DepotId in (${dids}) + and ifnull(dh.delete_Flag,'0') !='1' GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName) a + + update jsh_depothead + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/src/main/resources/mapper_xml/DepotItemMapperEx.xml index 0cf8f0b2..0341d2a2 100644 --- a/src/main/resources/mapper_xml/DepotItemMapperEx.xml +++ b/src/main/resources/mapper_xml/DepotItemMapperEx.xml @@ -55,6 +55,7 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -73,39 +74,52 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' select count(1) from (select m.id from jsh_depotitem di - inner join jsh_material m on di.MaterialId=m.id + inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1' where 1=1 and di.HeaderId in (${headIds}) @@ -167,112 +192,150 @@ and di.MaterialId in (${materialIds}) + and ifnull(di.delete_Flag,'0') !='1' group by m.id) cc delete from jsh_depotitem @@ -302,6 +367,27 @@ ) + + update jsh_depotitem + set delete_Flag='1' + where 1=1 + and HeaderId in + ( + + #{depotheadId} + + ) + + + update jsh_depotitem + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + diff --git a/src/main/resources/mapper_xml/DepotMapperEx.xml b/src/main/resources/mapper_xml/DepotMapperEx.xml index 66c77665..5ce8de63 100644 --- a/src/main/resources/mapper_xml/DepotMapperEx.xml +++ b/src/main/resources/mapper_xml/DepotMapperEx.xml @@ -18,6 +18,7 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' order by sort asc limit #{offset},#{rows} @@ -37,6 +38,7 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_depot + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + diff --git a/src/main/resources/mapper_xml/FunctionsMapperEx.xml b/src/main/resources/mapper_xml/FunctionsMapperEx.xml index 8ccff97d..e3ed78f1 100644 --- a/src/main/resources/mapper_xml/FunctionsMapperEx.xml +++ b/src/main/resources/mapper_xml/FunctionsMapperEx.xml @@ -11,6 +11,7 @@ and type='${type}' + and ifnull(delete_Flag,'0') !='1' order by sort asc limit #{offset},#{rows} @@ -27,5 +28,16 @@ and type='${type}' + and ifnull(delete_Flag,'0') !='1' + + update jsh_functions + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/InOutItemMapperEx.xml b/src/main/resources/mapper_xml/InOutItemMapperEx.xml index 997c3807..c3dc04a4 100644 --- a/src/main/resources/mapper_xml/InOutItemMapperEx.xml +++ b/src/main/resources/mapper_xml/InOutItemMapperEx.xml @@ -14,6 +14,7 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -32,5 +33,16 @@ and remark like '%${remark}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_inoutitem + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/MaterialMapperEx.xml b/src/main/resources/mapper_xml/MaterialMapperEx.xml index 1e07a6fc..c115e2f5 100644 --- a/src/main/resources/mapper_xml/MaterialMapperEx.xml +++ b/src/main/resources/mapper_xml/MaterialMapperEx.xml @@ -13,8 +13,8 @@ @@ -81,8 +93,8 @@ + + update jsh_material + set delete_Flag='1' + where 1=1 + and ifnull(delete_Flag,'0') !='1' + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml b/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml index 8728e018..eb5f8a81 100644 --- a/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml +++ b/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml @@ -8,6 +8,7 @@ and nativeName like '%${name}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -20,5 +21,16 @@ and nativeName like '%${name}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_materialproperty + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/PersonMapperEx.xml b/src/main/resources/mapper_xml/PersonMapperEx.xml index aef0f3f1..39d8b013 100644 --- a/src/main/resources/mapper_xml/PersonMapperEx.xml +++ b/src/main/resources/mapper_xml/PersonMapperEx.xml @@ -11,6 +11,7 @@ and type='${type}' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -26,5 +27,16 @@ and type='${type}' + and ifnull(delete_Flag,'0') !='1' + + update jsh_person + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/RoleMapperEx.xml b/src/main/resources/mapper_xml/RoleMapperEx.xml index 2f630000..b7485492 100644 --- a/src/main/resources/mapper_xml/RoleMapperEx.xml +++ b/src/main/resources/mapper_xml/RoleMapperEx.xml @@ -5,6 +5,7 @@ SELECT * FROM jsh_role WHERE 1=1 + and ifnull(delete_Flag,'0') !='1' and name like '%${name}%' @@ -17,8 +18,19 @@ COUNT(id) FROM jsh_role WHERE 1=1 + and ifnull(delete_Flag,'0') !='1' and name like '%${name}%' + + update jsh_role + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/SerialNumberMapperEx.xml b/src/main/resources/mapper_xml/SerialNumberMapperEx.xml index acb1e855..2a4a0c4c 100644 --- a/src/main/resources/mapper_xml/SerialNumberMapperEx.xml +++ b/src/main/resources/mapper_xml/SerialNumberMapperEx.xml @@ -15,8 +15,8 @@ ser.update_Time,mat.name as materialName,null as creator,null as updater,null as creatorName, null as updaterName,ser.depothead_Id, dh.number as depotHeadNumber,concat(dh.SubType,dh.Type) as depotHeadType FROM jsh_serial_number ser - left join jsh_material mat on mat.id = ser.material_Id - left join jsh_depothead dh on dh.id= ser.depothead_Id + left join jsh_material mat on mat.id = ser.material_Id and ifnull(mat.delete_Flag,'0') !='1' + left join jsh_depothead dh on dh.id= ser.depothead_Id and ifnull(dh.delete_Flag,'0') !='1' where 1=1 @@ -36,7 +36,7 @@ SELECT COUNT(ser.id) FROM jsh_serial_number ser - left JOIN jsh_material mat on mat.id = ser.material_Id + left JOIN jsh_material mat on mat.id = ser.material_Id and ifnull(mat.delete_Flag,'0') !='1' where 1=1 @@ -55,7 +55,7 @@ ser.update_Time,ser.creator,ser.updater,mat.name as materialName,cr.username as creatorName, ur.username as updaterName,ser.depothead_Id FROM jsh_serial_number ser - left JOIN jsh_material mat on mat.id = ser.material_Id + left JOIN jsh_material mat on mat.id = ser.material_Id and ifnull(mat.delete_Flag,'0') !='1' left join jsh_user cr on ser.creator=cr.id and ifnull(cr.status,'0') not in('1','2') left join jsh_user ur on ser.updater=ur.id and ifnull(ur.status,'0') not in('1','2') where 1=1 @@ -231,7 +231,6 @@ update jsh_serial_number set update_Time=#{updateTime},updater=#{updater},delete_Flag='1' where 1=1 - and ifnull(delete_Flag,'0') !='1' and id in ( #{id} diff --git a/src/main/resources/mapper_xml/SupplierMapperEx.xml b/src/main/resources/mapper_xml/SupplierMapperEx.xml index 29422b6c..868df611 100644 --- a/src/main/resources/mapper_xml/SupplierMapperEx.xml +++ b/src/main/resources/mapper_xml/SupplierMapperEx.xml @@ -20,6 +20,7 @@ and description like '%${description}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -44,6 +45,7 @@ and description like '%${description}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_supplier + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/SystemConfigMapperEx.xml b/src/main/resources/mapper_xml/SystemConfigMapperEx.xml index abac0f87..b0867a48 100644 --- a/src/main/resources/mapper_xml/SystemConfigMapperEx.xml +++ b/src/main/resources/mapper_xml/SystemConfigMapperEx.xml @@ -8,6 +8,7 @@ and company_name like '%${companyName}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -20,5 +21,16 @@ and company_name like '%${companyName}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_systemconfig + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/UnitMapperEx.xml b/src/main/resources/mapper_xml/UnitMapperEx.xml index 66e4b978..f02e0a86 100644 --- a/src/main/resources/mapper_xml/UnitMapperEx.xml +++ b/src/main/resources/mapper_xml/UnitMapperEx.xml @@ -8,6 +8,7 @@ and UName like '%${name}%' + and ifnull(delete_Flag,'0') !='1' limit #{offset},#{rows} @@ -20,5 +21,16 @@ and UName like '%${name}%' + and ifnull(delete_Flag,'0') !='1' + + update jsh_unit + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/UserBusinessMapperEx.xml b/src/main/resources/mapper_xml/UserBusinessMapperEx.xml new file mode 100644 index 00000000..74f73c09 --- /dev/null +++ b/src/main/resources/mapper_xml/UserBusinessMapperEx.xml @@ -0,0 +1,15 @@ + + + + + update jsh_serial_number + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + \ No newline at end of file