!41 全局修改物理删除为逻辑删除,同时修改查询语句过滤删除标识

Merge pull request !41 from 乾坤平台/master
This commit is contained in:
乾坤平台
2019-04-01 21:05:18 +08:00
committed by 季圣华
85 changed files with 1632 additions and 224 deletions

View File

@@ -486,8 +486,11 @@
{ {
$.ajax({ $.ajax({
type:"post", type:"post",
url: "/accountHead/" + accountHeadID + "/delete", url: "/accountHead/batchDeleteAccountHeadByIds",
dataType: "json", dataType: "json",
data:{
ids: accountHeadID
},
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -576,7 +579,7 @@
//批量删除 //批量删除
$.ajax({ $.ajax({
type:"post", type:"post",
url: "/accountHead/batchDelete", url: "/accountHead/batchDeleteAccountHeadByIds",
dataType: "json", dataType: "json",
async : false, async : false,
data: ({ data: ({

View File

@@ -170,8 +170,11 @@
var supplierTotalInfo = supplierInfo.split("AaBb"); var supplierTotalInfo = supplierInfo.split("AaBb");
$.ajax({ $.ajax({
type:"post", type:"post",
url: "/supplier/" + supplierTotalInfo[0] + "/delete", url: "/supplier/batchDeleteSupplierByIds",
dataType: "json", dataType: "json",
data: ({
ids : supplierTotalInfo[0]
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -210,7 +213,7 @@
} }
$.ajax({ $.ajax({
type:"post", type:"post",
url: "/supplier/batchDelete", url: "/supplier/batchDeleteSupplierByIds",
dataType: "json", dataType: "json",
async : false, async : false,
data: ({ data: ({

View File

@@ -225,8 +225,11 @@
var accountTotalInfo = accountInfo.split("AaBb"); var accountTotalInfo = accountInfo.split("AaBb");
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/account/" + accountTotalInfo[0] + "/delete", url: "/account/batchDeleteAccountByIds",
dataType: "json", dataType: "json",
data: ({
ids: accountTotalInfo[0]
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -264,7 +267,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/account/batchDelete", url: "/account/batchDeleteAccountByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -270,8 +270,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/app/" + appID + "/delete", url: "/app/batchDeleteAppByIds",
dataType: "json", dataType: "json",
data: ({
ids: appID
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -309,7 +312,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/app/batchDelete", url: "/app/batchDeleteAppByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -255,8 +255,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/depot/" + depotID + "/delete", url: "/depot/batchDeleteDepotByIds",
dataType: "json", dataType: "json",
data: ({
ids: depotID
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -294,7 +297,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/depot/batchDelete", url: "/depot/batchDeleteDepotByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -268,8 +268,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/functions/" + functionsID + "/delete", url: "/functions/batchDeleteFunctionsByIds",
dataType: "json", dataType: "json",
data: ({
ids: functionsID
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -307,7 +310,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/functions/batchDelete", url: "/functions/batchDeleteFunctionsByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -225,8 +225,11 @@
var inOutItemTotalInfo = inOutItemInfo.split("AaBb"); var inOutItemTotalInfo = inOutItemInfo.split("AaBb");
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/inOutItem/" + inOutItemTotalInfo[0] + "/delete", url: "/inOutItem/batchDeleteInOutItemByIds",
dataType: "json", dataType: "json",
data: ({
ids: inOutItemTotalInfo[0]
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -264,7 +267,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/inOutItem/batchDelete", url: "/inOutItem/batchDeleteInOutItemByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -203,8 +203,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/role/" + roleID + "/delete", url: "/role/batchDeleteRoleByIds",
dataType: "json", dataType: "json",
data: ({
ids: roleID,
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -242,7 +245,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/role/batchDelete", url: "/role/batchDeleteRoleByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -192,8 +192,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/systemConfig/" + systemConfigId + "/delete", url: "/systemConfig/batchDeleteSystemConfigByIds",
dataType: "json", dataType: "json",
data: ({
ids: systemConfigId
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -235,7 +238,7 @@
} else { } else {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/systemConfig/batchDelete", url: "/systemConfig/batchDeleteSystemConfigByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -197,8 +197,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/unit/" + unitID + "/delete", url: "/unit/batchDeleteUnitByIds",
dataType: "json", dataType: "json",
data: ({
ids: unitID
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -237,7 +240,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/unit/batchDelete", url: "/unit/batchDeleteUnitByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -771,8 +771,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/material/" + materialID + "/delete", url: "/material/batchDeleteMaterialByIds",
dataType: "json", dataType: "json",
data: ({
ids: materialID
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -811,7 +814,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/material/batchDelete", url: "/material/batchDeleteMaterialByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -249,8 +249,11 @@
if (r) { if (r) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/person/" + personID + "/delete", url: "/person/batchDeletePersonByIds",
dataType: "json", dataType: "json",
data: ({
ids: personID
}),
success: function (res) { success: function (res) {
if(res && res.code == 200) { if(res && res.code == 200) {
$("#searchBtn").click(); $("#searchBtn").click();
@@ -289,7 +292,7 @@
} }
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/person/batchDelete", url: "/person/batchDeletePersonByIds",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({

View File

@@ -42,9 +42,163 @@ public class ExceptionConstants {
//登录名已存在 //登录名已存在
public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003; public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003;
public static final String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名已存在"; 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 * type = 75
@@ -57,7 +211,7 @@ public class ExceptionConstants {
public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败"; public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败";
//修改商品类别信息失败 //修改商品类别信息失败
public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002; 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 int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003;
public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在"; 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 int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005;
public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根目录不支持删除"; public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根目录不支持删除";
/** /**
* 商品信息 * 商品信息
* type = 80 * 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 int MATERIAL_NOT_EXISTS_CODE = 8000000;
public static final String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在"; 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 int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004;
public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足"; 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 * type = 105
@@ -105,7 +318,7 @@ public class ExceptionConstants {
public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003; public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003;
public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败"; public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败";
/** /**
* 机构 * 机构信息
* type = 110 * type = 110
* */ * */
//添加机构信息失败 //添加机构信息失败
@@ -140,6 +353,8 @@ public class ExceptionConstants {
public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002; public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002;
public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败"; public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败";
/** /**
* 标准正常返回/操作成功返回 * 标准正常返回/操作成功返回
* @return * @return

View File

@@ -2,8 +2,10 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Account; import com.jsh.erp.datasource.entities.Account;
import com.jsh.erp.datasource.vo.AccountVo4InOutList; import com.jsh.erp.datasource.vo.AccountVo4InOutList;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.account.AccountService; import com.jsh.erp.service.account.AccountService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo; import com.jsh.erp.utils.ErpInfo;
@@ -138,5 +140,27 @@ public class AccountController {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
} }
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -1,8 +1,10 @@
package com.jsh.erp.controller; package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.AccountHead; import com.jsh.erp.datasource.entities.AccountHead;
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx; import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.accountHead.AccountHeadService; import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo; import com.jsh.erp.utils.ErpInfo;
@@ -146,5 +148,27 @@ public class AccountHeadController {
} }
return allMoney; return allMoney;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -2,8 +2,10 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.AccountItem; import com.jsh.erp.datasource.entities.AccountItem;
import com.jsh.erp.datasource.vo.AccountItemVo4List; 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.accountItem.AccountItemService;
import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.log.LogService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
@@ -104,5 +106,27 @@ public class AccountItemController {
} }
return res; return res;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -2,8 +2,10 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.App; import com.jsh.erp.datasource.entities.App;
import com.jsh.erp.datasource.entities.UserBusiness; 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.app.AppService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
@@ -225,4 +227,26 @@ public class AppController {
} }
return res; return res;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -7,8 +7,10 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jsh.erp.constants.BusinessConstants; 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.Depot;
import com.jsh.erp.datasource.entities.DepotEx; 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.depot.DepotService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
@@ -173,5 +175,26 @@ public class DepotController {
queryInfo.setTotal(pageInfo.getTotal()); queryInfo.setTotal(pageInfo.getTotal());
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -3,7 +3,9 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.*; import com.jsh.erp.datasource.entities.*;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.depotItem.DepotItemService; import com.jsh.erp.service.depotItem.DepotItemService;
import com.jsh.erp.service.material.MaterialService; import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
@@ -782,4 +784,25 @@ public class DepotItemController {
} }
return sumPrice; return sumPrice;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -2,7 +2,9 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Functions; 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.functions.FunctionsService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
@@ -275,4 +277,25 @@ public class FunctionsController {
} }
return res; return res;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -2,7 +2,9 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.InOutItem; import com.jsh.erp.datasource.entities.InOutItem;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.inOutItem.InOutItemService; import com.jsh.erp.service.inOutItem.InOutItemService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -54,5 +56,26 @@ public class InOutItemController {
} }
return res; return res;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -6,9 +6,11 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jsh.erp.constants.BusinessConstants; 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.DepotEx;
import com.jsh.erp.datasource.entities.Material; import com.jsh.erp.datasource.entities.Material;
import com.jsh.erp.datasource.entities.MaterialVo4Unit; import com.jsh.erp.datasource.entities.MaterialVo4Unit;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.material.MaterialService; import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import jxl.Sheet; import jxl.Sheet;
@@ -341,4 +343,25 @@ public class MaterialController {
queryInfo.setTotal(pageInfo.getTotal()); queryInfo.setTotal(pageInfo.getTotal());
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -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
* websitehttp://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;
}
}

View File

@@ -2,7 +2,9 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Person; import com.jsh.erp.datasource.entities.Person;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.person.PersonService; import com.jsh.erp.service.person.PersonService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -121,4 +123,25 @@ public class PersonController {
} }
return dataArray; return dataArray;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -2,8 +2,11 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Role; 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.role.RoleService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -77,4 +80,26 @@ public class RoleController {
return roleService.getRole(); return roleService.getRole();
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -2,8 +2,11 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Supplier; 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.supplier.SupplierService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import jxl.Sheet; import jxl.Sheet;
@@ -40,6 +43,8 @@ public class SupplierController {
@Resource @Resource
private UserBusinessService userBusinessService; private UserBusinessService userBusinessService;
@Resource
private UserService userService;
/** /**
* 更新供应商-只更新预付款,其余用原来的值 * 更新供应商-只更新预付款,其余用原来的值
@@ -437,5 +442,26 @@ public class SupplierController {
return null; return null;
} }
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -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
* websitehttp://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;
}
}

View File

@@ -0,0 +1,48 @@
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.unit.UnitService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* Description
*
* @Author: qiankunpingtai
* @Date: 2019/4/1 15:38
*/
@RestController
@RequestMapping(value = "/unit")
public class UnitController {
private Logger logger = LoggerFactory.getLogger(UnitController.class);
@Resource
private UnitService unitService;
/**
* create by: qiankunpingtai
* websitehttp://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;
}
}

View File

@@ -1,7 +1,10 @@
package com.jsh.erp.controller; package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.UserBusiness; 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.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo; import com.jsh.erp.utils.ErpInfo;
@@ -27,6 +30,8 @@ public class UserBusinessController {
@Resource @Resource
private UserBusinessService userBusinessService; private UserBusinessService userBusinessService;
@Resource
private UserService userService;
@GetMapping(value = "/getBasicData") @GetMapping(value = "/getBasicData")
public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId, public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId,
@@ -86,4 +91,26 @@ public class UserBusinessController {
} }
return res; return res;
} }
/**
* create by: qiankunpingtai
* websitehttp://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;
}
} }

View File

@@ -6,6 +6,7 @@ import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
public interface AccountHeadMapperEx { public interface AccountHeadMapperEx {
@@ -34,4 +35,6 @@ public interface AccountHeadMapperEx {
List<AccountHeadVo4ListEx> getDetailByNumber( List<AccountHeadVo4ListEx> getDetailByNumber(
@Param("billNo") String billNo); @Param("billNo") String billNo);
int batchDeleteAccountHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.AccountItemExample;
import com.jsh.erp.datasource.vo.AccountItemVo4List; import com.jsh.erp.datasource.vo.AccountItemVo4List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface AccountItemMapperEx { public interface AccountItemMapperEx {
@@ -24,4 +25,5 @@ public interface AccountItemMapperEx {
List<AccountItemVo4List> getDetailList( List<AccountItemVo4List> getDetailList(
@Param("headerId") Long headerId); @Param("headerId") Long headerId);
int batchDeleteAccountItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -6,6 +6,7 @@ import com.jsh.erp.datasource.vo.AccountVo4InOutList;
import com.jsh.erp.datasource.vo.AccountVo4List; import com.jsh.erp.datasource.vo.AccountVo4List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface AccountMapperEx { public interface AccountMapperEx {
@@ -29,4 +30,6 @@ public interface AccountMapperEx {
int findAccountInOutListCount( int findAccountInOutListCount(
@Param("accountId") Long accountId); @Param("accountId") Long accountId);
int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.App;
import com.jsh.erp.datasource.entities.AppExample; import com.jsh.erp.datasource.entities.AppExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface AppMapperEx { public interface AppMapperEx {
@@ -17,4 +18,6 @@ public interface AppMapperEx {
Long countsByApp( Long countsByApp(
@Param("name") String name, @Param("name") String name,
@Param("type") String type); @Param("type") String type);
int batchDeleteAppByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -8,6 +8,7 @@ import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -112,4 +113,6 @@ public interface DepotHeadMapperEx {
* 获得一个全局唯一的数作为订单号的追加 * 获得一个全局唯一的数作为订单号的追加
* */ * */
Long getBuildOnlyNumber(@Param("seq_name") String seq_name); Long getBuildOnlyNumber(@Param("seq_name") String seq_name);
int batchDeleteDepotHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -143,6 +144,14 @@ public interface DepotItemMapperEx {
@Param("enableSerialNumber")String enableSerialNumber); @Param("enableSerialNumber")String enableSerialNumber);
/** /**
* 根据单据主表id删除单据子表数据 * 根据单据主表id删除单据子表数据
* 物理删除,已弃用
* */ * */
@Deprecated
int deleteDepotItemByDepotHeadIds(@Param("depotheadIds")Long []depotHeadIds); 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[]);
} }

View File

@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.DepotEx;
import com.jsh.erp.datasource.entities.DepotExample; import com.jsh.erp.datasource.entities.DepotExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -23,4 +24,6 @@ public interface DepotMapperEx {
@Param("remark") String remark); @Param("remark") String remark);
List<DepotEx> getDepotList(Map<String, Object> params); List<DepotEx> getDepotList(Map<String, Object> params);
int batchDeleteDepotByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Functions;
import com.jsh.erp.datasource.entities.FunctionsExample; import com.jsh.erp.datasource.entities.FunctionsExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface FunctionsMapperEx { public interface FunctionsMapperEx {
@@ -17,4 +18,6 @@ public interface FunctionsMapperEx {
Long countsByFunctions( Long countsByFunctions(
@Param("name") String name, @Param("name") String name,
@Param("type") String type); @Param("type") String type);
int batchDeleteFunctionsByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.InOutItem;
import com.jsh.erp.datasource.entities.InOutItemExample; import com.jsh.erp.datasource.entities.InOutItemExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface InOutItemMapperEx { public interface InOutItemMapperEx {
@@ -19,4 +20,6 @@ public interface InOutItemMapperEx {
@Param("name") String name, @Param("name") String name,
@Param("type") String type, @Param("type") String type,
@Param("remark") String remark); @Param("remark") String remark);
int batchDeleteInOutItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Material;
import com.jsh.erp.datasource.entities.MaterialVo4Unit; import com.jsh.erp.datasource.entities.MaterialVo4Unit;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -54,4 +55,6 @@ public interface MaterialMapperEx {
* 获取开启序列号并且状态正常的商品列表 * 获取开启序列号并且状态正常的商品列表
* */ * */
List<Material> getMaterialEnableSerialNumberList(Map<String, Object> parameterMap); List<Material> getMaterialEnableSerialNumberList(Map<String, Object> parameterMap);
int batchDeleteMaterialByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.MaterialProperty;
import com.jsh.erp.datasource.entities.MaterialPropertyExample; import com.jsh.erp.datasource.entities.MaterialPropertyExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface MaterialPropertyMapperEx { public interface MaterialPropertyMapperEx {
@@ -14,4 +15,6 @@ public interface MaterialPropertyMapperEx {
@Param("rows") Integer rows); @Param("rows") Integer rows);
Long countsByMaterialProperty(@Param("name") String name); Long countsByMaterialProperty(@Param("name") String name);
int batchDeleteMaterialPropertyByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Person;
import com.jsh.erp.datasource.entities.PersonExample; import com.jsh.erp.datasource.entities.PersonExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface PersonMapperEx { public interface PersonMapperEx {
@@ -17,4 +18,6 @@ public interface PersonMapperEx {
Long countsByPerson( Long countsByPerson(
@Param("name") String name, @Param("name") String name,
@Param("type") String type); @Param("type") String type);
int batchDeletePersonByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Role;
import com.jsh.erp.datasource.entities.RoleExample; import com.jsh.erp.datasource.entities.RoleExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface RoleMapperEx { public interface RoleMapperEx {
@@ -15,4 +16,6 @@ public interface RoleMapperEx {
Long countsByRole( Long countsByRole(
@Param("name") String name); @Param("name") String name);
int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Supplier;
import com.jsh.erp.datasource.entities.SupplierExample; import com.jsh.erp.datasource.entities.SupplierExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface SupplierMapperEx { public interface SupplierMapperEx {
@@ -30,4 +31,6 @@ public interface SupplierMapperEx {
@Param("phonenum") String phonenum, @Param("phonenum") String phonenum,
@Param("telephone") String telephone, @Param("telephone") String telephone,
@Param("description") String description); @Param("description") String description);
int batchDeleteSupplierByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.SystemConfig;
import com.jsh.erp.datasource.entities.SystemConfigExample; import com.jsh.erp.datasource.entities.SystemConfigExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface SystemConfigMapperEx { public interface SystemConfigMapperEx {
@@ -15,4 +16,6 @@ public interface SystemConfigMapperEx {
Long countsBySystemConfig( Long countsBySystemConfig(
@Param("companyName") String companyName); @Param("companyName") String companyName);
int batchDeleteSystemConfigByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -4,6 +4,7 @@ import com.jsh.erp.datasource.entities.Unit;
import com.jsh.erp.datasource.entities.UnitExample; import com.jsh.erp.datasource.entities.UnitExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface UnitMapperEx { public interface UnitMapperEx {
@@ -15,4 +16,6 @@ public interface UnitMapperEx {
Long countsByUnit( Long countsByUnit(
@Param("name") String name); @Param("name") String name);
int batchDeleteUnitByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }

View File

@@ -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[]);
}

View File

@@ -7,6 +7,7 @@ import com.jsh.erp.datasource.mappers.*;
import com.jsh.erp.datasource.vo.AccountVo4InOutList; import com.jsh.erp.datasource.vo.AccountVo4InOutList;
import com.jsh.erp.datasource.vo.AccountVo4List; import com.jsh.erp.datasource.vo.AccountVo4List;
import com.jsh.erp.service.log.LogService; 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.StringUtil;
import com.jsh.erp.utils.Tools; import com.jsh.erp.utils.Tools;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -45,6 +46,8 @@ public class AccountService {
private AccountItemMapper accountItemMapper; private AccountItemMapper accountItemMapper;
@Resource @Resource
private LogService logService; private LogService logService;
@Resource
private UserService userService;
public Account getAccount(long id) { public Account getAccount(long id) {
return accountMapper.selectByPrimaryKey(id); return accountMapper.selectByPrimaryKey(id);
@@ -112,7 +115,8 @@ public class AccountService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
AccountExample example = new AccountExample(); AccountExample example = new AccountExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Account> list = accountMapper.selectByExample(example); List<Account> list = accountMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -317,5 +321,13 @@ public class AccountService {
example.createCriteria().andIdEqualTo(accountId); example.createCriteria().andIdEqualTo(accountId);
return accountMapper.updateByExampleSelective(account, example); 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);
}
} }

View File

@@ -1,22 +1,29 @@
package com.jsh.erp.service.accountHead; package com.jsh.erp.service.accountHead;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.AccountHead; import com.jsh.erp.datasource.entities.AccountHead;
import com.jsh.erp.datasource.entities.AccountHeadExample; import com.jsh.erp.datasource.entities.AccountHeadExample;
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx; 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.AccountHeadMapper;
import com.jsh.erp.datasource.mappers.AccountHeadMapperEx; 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.StringUtil;
import com.jsh.erp.utils.Tools; import com.jsh.erp.utils.Tools;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -28,6 +35,10 @@ public class AccountHeadService {
@Resource @Resource
private AccountHeadMapperEx accountHeadMapperEx; private AccountHeadMapperEx accountHeadMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public AccountHead getAccountHead(long id) { public AccountHead getAccountHead(long id) {
return accountHeadMapper.selectByPrimaryKey(id); return accountHeadMapper.selectByPrimaryKey(id);
@@ -87,7 +98,7 @@ public class AccountHeadService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
AccountHeadExample example = new AccountHeadExample(); AccountHeadExample example = new AccountHeadExample();
example.createCriteria().andIdNotEqualTo(id); example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<AccountHead> list = accountHeadMapper.selectByExample(example); List<AccountHead> list = accountHeadMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -122,5 +133,13 @@ public class AccountHeadService {
} }
return resList; 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);
}
} }

View File

@@ -5,10 +5,12 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.AccountItem; import com.jsh.erp.datasource.entities.AccountItem;
import com.jsh.erp.datasource.entities.AccountItemExample; 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.AccountItemMapper;
import com.jsh.erp.datasource.mappers.AccountItemMapperEx; import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
import com.jsh.erp.datasource.vo.AccountItemVo4List; import com.jsh.erp.datasource.vo.AccountItemVo4List;
import com.jsh.erp.service.log.LogService; 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.ErpInfo;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -22,6 +24,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@@ -37,6 +40,8 @@ public class AccountItemService {
private AccountItemMapperEx accountItemMapperEx; private AccountItemMapperEx accountItemMapperEx;
@Resource @Resource
private LogService logService; private LogService logService;
@Resource
private UserService userService;
public AccountItem getAccountItem(long id) { public AccountItem getAccountItem(long id) {
return accountItemMapper.selectByPrimaryKey(id); return accountItemMapper.selectByPrimaryKey(id);
@@ -83,7 +88,7 @@ public class AccountItemService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
AccountItemExample example = new AccountItemExample(); AccountItemExample example = new AccountItemExample();
example.createCriteria().andIdNotEqualTo(id); example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<AccountItem> list = accountItemMapper.selectByExample(example); List<AccountItem> list = accountItemMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -135,10 +140,16 @@ public class AccountItemService {
} }
} }
if (null != deletedJson) { if (null != deletedJson) {
StringBuffer bf=new StringBuffer();
for (int i = 0; i < deletedJson.size(); i++) { for (int i = 0; i < deletedJson.size(); i++) {
JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(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) { if (null != updatedJson) {
for (int i = 0; i < updatedJson.size(); i++) { for (int i = 0; i < updatedJson.size(); i++) {
@@ -168,5 +179,13 @@ public class AccountItemService {
return null; 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);
}
} }

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.app; package com.jsh.erp.service.app;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.App; import com.jsh.erp.datasource.entities.App;
import com.jsh.erp.datasource.entities.AppExample; import com.jsh.erp.datasource.entities.AppExample;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.mappers.AppMapper; import com.jsh.erp.datasource.mappers.AppMapper;
import com.jsh.erp.datasource.mappers.AppMapperEx; import com.jsh.erp.datasource.mappers.AppMapperEx;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -23,6 +30,10 @@ public class AppService {
private AppMapper appMapper; private AppMapper appMapper;
@Resource @Resource
private AppMapperEx appMapperEx; private AppMapperEx appMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public List<App> findDock(){ public List<App> findDock(){
AppExample example = new AppExample(); AppExample example = new AppExample();
@@ -106,4 +117,13 @@ public class AppService {
List<App> list = appMapper.selectByExample(example); List<App> list = appMapper.selectByExample(example);
return list; 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);
}
} }

View File

@@ -1,19 +1,26 @@
package com.jsh.erp.service.depot; package com.jsh.erp.service.depot;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Depot; import com.jsh.erp.datasource.entities.Depot;
import com.jsh.erp.datasource.entities.DepotEx; import com.jsh.erp.datasource.entities.DepotEx;
import com.jsh.erp.datasource.entities.DepotExample; 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.DepotMapper;
import com.jsh.erp.datasource.mappers.DepotMapperEx; 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 com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -26,6 +33,10 @@ public class DepotService {
@Resource @Resource
private DepotMapperEx depotMapperEx; private DepotMapperEx depotMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public Depot getDepot(long id) { public Depot getDepot(long id) {
return depotMapper.selectByPrimaryKey(id); return depotMapper.selectByPrimaryKey(id);
@@ -78,7 +89,7 @@ public class DepotService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
DepotExample example = new DepotExample(); DepotExample example = new DepotExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Depot> list = depotMapper.selectByExample(example); List<Depot> list = depotMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -102,5 +113,13 @@ public class DepotService {
public List<DepotEx> getDepotList(Map<String, Object> parameterMap) { public List<DepotEx> getDepotList(Map<String, Object> parameterMap) {
return depotMapperEx.getDepotList(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);
}
} }

View File

@@ -141,7 +141,7 @@ public class DepotHeadService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
DepotHeadExample example = new DepotHeadExample(); DepotHeadExample example = new DepotHeadExample();
example.createCriteria().andIdNotEqualTo(id); example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<DepotHead> list = depotHeadMapper.selectByExample(example); List<DepotHead> list = depotHeadMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -366,14 +366,14 @@ public class DepotHeadService {
if(depotItemList!=null&&depotItemList.size()>0){ if(depotItemList!=null&&depotItemList.size()>0){
for(DepotItem depotItem:depotItemList){ for(DepotItem depotItem:depotItemList){
//BasicNumber=OperNumber*ratio //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 * create by: cjl
@@ -391,8 +391,17 @@ public class DepotHeadService {
if(StringUtil.isNotEmpty(ids)){ if(StringUtil.isNotEmpty(ids)){
String [] headIds=ids.split(","); String [] headIds=ids.split(",");
for(int i=0;i<headIds.length;i++){ for(int i=0;i<headIds.length;i++){
deleteDepotHeadAndDetail(new Long(headIds[i])); deleteDepotHeadAndDetail(Long.valueOf(headIds[i]));
} }
} }
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteDepotHeadByIds(String ids) {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
String [] idArray=ids.split(",");
return depotHeadMapperEx.batchDeleteDepotHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
}
} }

View File

@@ -105,7 +105,7 @@ public class DepotItemService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
DepotItemExample example = new DepotItemExample(); DepotItemExample example = new DepotItemExample();
example.createCriteria().andIdNotEqualTo(id); example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<DepotItem> list = depotItemMapper.selectByExample(example); List<DepotItem> list = depotItemMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -248,6 +248,7 @@ public class DepotItemService {
* 更新的需要判断货源是否充足 * 更新的需要判断货源是否充足
* */ * */
if (null != deletedJson) { if (null != deletedJson) {
StringBuffer bf=new StringBuffer();
for (int i = 0; i < deletedJson.size(); i++) { for (int i = 0; i < deletedJson.size(); i++) {
//首先回收序列号,如果是调拨,不用处理序列号 //首先回收序列号,如果是调拨,不用处理序列号
JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i)); JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i));
@@ -265,12 +266,17 @@ public class DepotItemService {
continue; continue;
} }
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())){ 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()); new Date(),userInfo==null?null:userInfo.getId());
} }
} }
this.deleteDepotItem(tempDeletedJson.getLong("Id")); this.deleteDepotItem(tempDeletedJson.getLong("Id"));
bf.append(tempDeletedJson.getLong("Id"));
if(i<(deletedJson.size()-1)){
bf.append(",");
}
} }
this.batchDeleteDepotItemByIds(bf.toString());
} }
if (null != insertedJson) { if (null != insertedJson) {
for (int i = 0; i < insertedJson.size(); i++) { for (int i = 0; i < insertedJson.size(); i++) {
@@ -363,7 +369,7 @@ public class DepotItemService {
if(material==null){ if(material==null){
continue; continue;
} }
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getBasicnumber().intValue()){ if(getCurrentInStock(depotItem.getMaterialid())<(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE, throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName())); String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
} }
@@ -401,7 +407,7 @@ public class DepotItemService {
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过 * 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
* */ * */
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) { 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()); new Date(), userInfo == null ? null : userInfo.getId());
} }
/**收回序列号的时候释放库存*/ /**收回序列号的时候释放库存*/
@@ -486,7 +492,7 @@ public class DepotItemService {
} }
/**出库时处理序列号*/ /**出库时处理序列号*/
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){ if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getBasicnumber().intValue()){ if(getCurrentInStock(depotItem.getMaterialid())<(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE, throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName())); String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
} }
@@ -536,5 +542,13 @@ public class DepotItemService {
int outSum = findByTypeAndMaterialId(BusinessConstants.DEPOTHEAD_TYPE_OUT, materialId); int outSum = findByTypeAndMaterialId(BusinessConstants.DEPOTHEAD_TYPE_OUT, materialId);
return (inSum-outSum); return (inSum-outSum);
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteDepotItemByIds(String ids) {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_ITEM,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
String [] idArray=ids.split(",");
return depotItemMapperEx.batchDeleteDepotItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
}
} }

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.functions; package com.jsh.erp.service.functions;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Functions; import com.jsh.erp.datasource.entities.Functions;
import com.jsh.erp.datasource.entities.FunctionsExample; import com.jsh.erp.datasource.entities.FunctionsExample;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.mappers.FunctionsMapper; import com.jsh.erp.datasource.mappers.FunctionsMapper;
import com.jsh.erp.datasource.mappers.FunctionsMapperEx; import com.jsh.erp.datasource.mappers.FunctionsMapperEx;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -24,6 +31,10 @@ public class FunctionsService {
@Resource @Resource
private FunctionsMapperEx functionsMapperEx; private FunctionsMapperEx functionsMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public Functions getFunctions(long id) { public Functions getFunctions(long id) {
return functionsMapper.selectByPrimaryKey(id); return functionsMapper.selectByPrimaryKey(id);
@@ -70,7 +81,7 @@ public class FunctionsService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
FunctionsExample example = new FunctionsExample(); FunctionsExample example = new FunctionsExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Functions> list = functionsMapper.selectByExample(example); List<Functions> list = functionsMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -99,4 +110,13 @@ public class FunctionsService {
List<Functions> list = functionsMapper.selectByExample(example); List<Functions> list = functionsMapper.selectByExample(example);
return list; 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);
}
} }

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.inOutItem; package com.jsh.erp.service.inOutItem;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.InOutItem; import com.jsh.erp.datasource.entities.InOutItem;
import com.jsh.erp.datasource.entities.InOutItemExample; 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.InOutItemMapper;
import com.jsh.erp.datasource.mappers.InOutItemMapperEx; 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 com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -24,6 +31,10 @@ public class InOutItemService {
@Resource @Resource
private InOutItemMapperEx inOutItemMapperEx; private InOutItemMapperEx inOutItemMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public InOutItem getInOutItem(long id) { public InOutItem getInOutItem(long id) {
return inOutItemMapper.selectByPrimaryKey(id); return inOutItemMapper.selectByPrimaryKey(id);
@@ -70,7 +81,7 @@ public class InOutItemService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
InOutItemExample example = new InOutItemExample(); InOutItemExample example = new InOutItemExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<InOutItem> list = inOutItemMapper.selectByExample(example); List<InOutItem> list = inOutItemMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -85,4 +96,13 @@ public class InOutItemService {
example.setOrderByClause("id desc"); example.setOrderByClause("id desc");
return inOutItemMapper.selectByExample(example); 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);
}
} }

View File

@@ -2,13 +2,11 @@ package com.jsh.erp.service.material;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.DepotEx; import com.jsh.erp.datasource.entities.*;
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.mappers.MaterialMapper; import com.jsh.erp.datasource.mappers.MaterialMapper;
import com.jsh.erp.datasource.mappers.MaterialMapperEx; import com.jsh.erp.datasource.mappers.MaterialMapperEx;
import com.jsh.erp.service.log.LogService; 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.BaseResponseInfo;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -20,10 +18,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service @Service
public class MaterialService { public class MaterialService {
@@ -35,6 +30,8 @@ public class MaterialService {
private MaterialMapperEx materialMapperEx; private MaterialMapperEx materialMapperEx;
@Resource @Resource
private LogService logService; private LogService logService;
@Resource
private UserService userService;
public Material getMaterial(long id) { public Material getMaterial(long id) {
return materialMapper.selectByPrimaryKey(id); return materialMapper.selectByPrimaryKey(id);
@@ -120,7 +117,7 @@ public class MaterialService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
MaterialExample example = new MaterialExample(); MaterialExample example = new MaterialExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Material> list = materialMapper.selectByExample(example); List<Material> list = materialMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -211,4 +208,13 @@ public class MaterialService {
public List<Material> getMaterialEnableSerialNumberList(Map<String, Object> parameterMap) { public List<Material> getMaterialEnableSerialNumberList(Map<String, Object> parameterMap) {
return materialMapperEx.getMaterialEnableSerialNumberList(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);
}
} }

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.materialProperty; package com.jsh.erp.service.materialProperty;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.MaterialProperty; import com.jsh.erp.datasource.entities.MaterialProperty;
import com.jsh.erp.datasource.entities.MaterialPropertyExample; 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.MaterialPropertyMapper;
import com.jsh.erp.datasource.mappers.MaterialPropertyMapperEx; 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 com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -24,6 +31,10 @@ public class MaterialPropertyService {
@Resource @Resource
private MaterialPropertyMapperEx materialPropertyMapperEx; private MaterialPropertyMapperEx materialPropertyMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public MaterialProperty getMaterialProperty(long id) { public MaterialProperty getMaterialProperty(long id) {
return materialPropertyMapper.selectByPrimaryKey(id); return materialPropertyMapper.selectByPrimaryKey(id);
@@ -70,4 +81,14 @@ public class MaterialPropertyService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
return 0; 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);
}
} }

View File

@@ -5,6 +5,7 @@ import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.*; import com.jsh.erp.datasource.entities.*;
import com.jsh.erp.datasource.mappers.OrgaUserRelMapper; import com.jsh.erp.datasource.mappers.OrgaUserRelMapper;
import com.jsh.erp.datasource.mappers.OrgaUserRelMapperEx; 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.organization.OrganizationService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
@@ -34,6 +35,8 @@ public class OrgaUserRelService {
private OrgaUserRelMapperEx orgaUserRelMapperEx; private OrgaUserRelMapperEx orgaUserRelMapperEx;
@Resource @Resource
private UserService userService; private UserService userService;
@Resource
private LogService logService;
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertOrgaUserRel(String beanJson, HttpServletRequest request) { public int insertOrgaUserRel(String beanJson, HttpServletRequest request) {
OrgaUserRel orgaUserRel = JSONObject.parseObject(beanJson, OrgaUserRel.class); OrgaUserRel orgaUserRel = JSONObject.parseObject(beanJson, OrgaUserRel.class);

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.person; package com.jsh.erp.service.person;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Person; import com.jsh.erp.datasource.entities.Person;
import com.jsh.erp.datasource.entities.PersonExample; 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.PersonMapper;
import com.jsh.erp.datasource.mappers.PersonMapperEx; 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 com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -24,6 +31,10 @@ public class PersonService {
@Resource @Resource
private PersonMapperEx personMapperEx; private PersonMapperEx personMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public Person getPerson(long id) { public Person getPerson(long id) {
return personMapper.selectByPrimaryKey(id); return personMapper.selectByPrimaryKey(id);
@@ -70,7 +81,7 @@ public class PersonService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
PersonExample example = new PersonExample(); PersonExample example = new PersonExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Person> list = personMapper.selectByExample(example); List<Person> list = personMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -97,6 +108,13 @@ public class PersonService {
return personMapper.selectByExample(example); 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);
}
} }

View File

@@ -1,6 +1,7 @@
package com.jsh.erp.service.role; package com.jsh.erp.service.role;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Role; import com.jsh.erp.datasource.entities.Role;
import com.jsh.erp.datasource.entities.RoleExample; import com.jsh.erp.datasource.entities.RoleExample;
import com.jsh.erp.datasource.entities.User; 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.RoleMapper;
import com.jsh.erp.datasource.mappers.RoleMapperEx; import com.jsh.erp.datasource.mappers.RoleMapperEx;
import com.jsh.erp.datasource.mappers.UserMapper; 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.QueryUtils;
import com.jsh.erp.utils.RegExpTools; import com.jsh.erp.utils.RegExpTools;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -26,6 +32,10 @@ public class RoleService {
@Resource @Resource
private RoleMapperEx roleMapperEx; private RoleMapperEx roleMapperEx;
@Resource
private LogService logService;
@Resource
private UserService userService;
public Role getRole(long id) { public Role getRole(long id) {
return roleMapper.selectByPrimaryKey(id); return roleMapper.selectByPrimaryKey(id);
@@ -76,4 +86,22 @@ public class RoleService {
List<Role> list = roleMapper.selectByExample(example); List<Role> list = roleMapper.selectByExample(example);
return list; return list;
} }
/**
* create by: qiankunpingtai
* websitehttp://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);
}
} }

View File

@@ -96,7 +96,7 @@ public class SerialNumberService {
public int checkIsNameExist(Long id, String serialNumber) { public int checkIsNameExist(Long id, String serialNumber) {
SerialNumberExample example = new SerialNumberExample(); SerialNumberExample example = new SerialNumberExample();
example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber); example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<SerialNumber> list = serialNumberMapper.selectByExample(example); List<SerialNumber> list = serialNumberMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -292,14 +292,14 @@ public class SerialNumberService {
//查询商品下已分配的可用序列号数量 //查询商品下已分配的可用序列号数量
int SerialNumberSum= serialNumberMapperEx.countSerialNumberByMaterialIdAndDepotheadId(depotItem.getMaterialid(),null,BusinessConstants.IS_SELL_HOLD); int SerialNumberSum= serialNumberMapperEx.countSerialNumberByMaterialIdAndDepotheadId(depotItem.getMaterialid(),null,BusinessConstants.IS_SELL_HOLD);
//BasicNumber=OperNumber*ratio //BasicNumber=OperNumber*ratio
if(depotItem.getBasicnumber().intValue()>SerialNumberSum){ if((depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()>SerialNumberSum){
//获取商品名称 //获取商品名称
Material material= materialMapper.selectByPrimaryKey(depotItem.getMaterialid()); Material material= materialMapper.selectByPrimaryKey(depotItem.getMaterialid());
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE, throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG,material==null?"":material.getName())); 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);
} }
} }

View File

@@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Supplier; import com.jsh.erp.datasource.entities.Supplier;
import com.jsh.erp.datasource.entities.SupplierExample; 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.SupplierMapper;
import com.jsh.erp.datasource.mappers.SupplierMapperEx; import com.jsh.erp.datasource.mappers.SupplierMapperEx;
import com.jsh.erp.service.log.LogService; 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.BaseResponseInfo;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -19,6 +21,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -34,6 +37,8 @@ public class SupplierService {
private SupplierMapperEx supplierMapperEx; private SupplierMapperEx supplierMapperEx;
@Resource @Resource
private LogService logService; private LogService logService;
@Resource
private UserService userService;
public Supplier getSupplier(long id) { public Supplier getSupplier(long id) {
return supplierMapper.selectByPrimaryKey(id); return supplierMapper.selectByPrimaryKey(id);
@@ -80,7 +85,7 @@ public class SupplierService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
SupplierExample example = new SupplierExample(); SupplierExample example = new SupplierExample();
example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Supplier> list = supplierMapper.selectByExample(example); List<Supplier> list = supplierMapper.selectByExample(example);
return list.size(); return list.size();
} }
@@ -173,4 +178,13 @@ public class SupplierService {
info.data = data; info.data = data;
return info; 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);
}
} }

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.systemConfig; package com.jsh.erp.service.systemConfig;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.SystemConfig; import com.jsh.erp.datasource.entities.SystemConfig;
import com.jsh.erp.datasource.entities.SystemConfigExample; 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.SystemConfigMapper;
import com.jsh.erp.datasource.mappers.SystemConfigMapperEx; 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 com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -24,6 +31,10 @@ public class SystemConfigService {
@Resource @Resource
private SystemConfigMapperEx systemConfigMapperEx; private SystemConfigMapperEx systemConfigMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public SystemConfig getSystemConfig(long id) { public SystemConfig getSystemConfig(long id) {
return systemConfigMapper.selectByPrimaryKey(id); return systemConfigMapper.selectByPrimaryKey(id);
@@ -69,8 +80,17 @@ public class SystemConfigService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
SystemConfigExample example = new SystemConfigExample(); SystemConfigExample example = new SystemConfigExample();
example.createCriteria().andIdNotEqualTo(id).andCompanyNameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andCompanyNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<SystemConfig> list = systemConfigMapper.selectByExample(example); List<SystemConfig> list = systemConfigMapper.selectByExample(example);
return list.size(); 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);
}
} }

View File

@@ -1,18 +1,25 @@
package com.jsh.erp.service.unit; package com.jsh.erp.service.unit;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Unit; import com.jsh.erp.datasource.entities.Unit;
import com.jsh.erp.datasource.entities.UnitExample; 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.UnitMapper;
import com.jsh.erp.datasource.mappers.UnitMapperEx; 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 com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -24,6 +31,10 @@ public class UnitService {
@Resource @Resource
private UnitMapperEx unitMapperEx; private UnitMapperEx unitMapperEx;
@Resource
private UserService userService;
@Resource
private LogService logService;
public Unit getUnit(long id) { public Unit getUnit(long id) {
return unitMapper.selectByPrimaryKey(id); return unitMapper.selectByPrimaryKey(id);
@@ -70,8 +81,19 @@ public class UnitService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
UnitExample example = new UnitExample(); UnitExample example = new UnitExample();
example.createCriteria().andIdNotEqualTo(id).andUnameEqualTo(name); example.createCriteria().andIdNotEqualTo(id).andUnameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Unit> list = unitMapper.selectByExample(example); List<Unit> list = unitMapper.selectByExample(example);
return list.size(); 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);
}
} }

View File

@@ -28,10 +28,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service @Service
public class UserService { public class UserService {
@@ -193,7 +190,10 @@ public class UserService {
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name) {
UserExample example = new UserExample(); UserExample example = new UserExample();
example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name); List <Byte> userStatus=new ArrayList<Byte>();
userStatus.add(BusinessConstants.USER_STATUS_DELETE);
userStatus.add(BusinessConstants.USER_STATUS_BANNED);
example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name).andStatusNotIn(userStatus);
List<User> list = userMapper.selectByExample(example); List<User> list = userMapper.selectByExample(example);
return list.size(); return list.size();
} }

View File

@@ -2,10 +2,13 @@ package com.jsh.erp.service.userBusiness;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.entities.UserBusiness; import com.jsh.erp.datasource.entities.UserBusiness;
import com.jsh.erp.datasource.entities.UserBusinessExample; import com.jsh.erp.datasource.entities.UserBusinessExample;
import com.jsh.erp.datasource.mappers.UserBusinessMapper; import com.jsh.erp.datasource.mappers.UserBusinessMapper;
import com.jsh.erp.datasource.mappers.UserBusinessMapperEx;
import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -16,6 +19,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@@ -25,7 +29,11 @@ public class UserBusinessService {
@Resource @Resource
private UserBusinessMapper userBusinessMapper; private UserBusinessMapper userBusinessMapper;
@Resource @Resource
private UserBusinessMapperEx userBusinessMapperEx;
@Resource
private LogService logService; private LogService logService;
@Resource
private UserService userService;
public UserBusiness getUserBusiness(long id) { public UserBusiness getUserBusiness(long id) {
return userBusinessMapper.selectByPrimaryKey(id); return userBusinessMapper.selectByPrimaryKey(id);
@@ -126,5 +134,13 @@ public class UserBusinessService {
List<UserBusiness> list = userBusinessMapper.selectByExample(example); List<UserBusiness> list = userBusinessMapper.selectByExample(example);
return list; 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);
}
} }

View File

@@ -11,9 +11,9 @@
<select id="selectByConditionAccountHead" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx"> <select id="selectByConditionAccountHead" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">
select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName
from jsh_accounthead ah from jsh_accounthead ah
left join jsh_supplier s on ah.OrganId=s.id left join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on ah.HandsPersonId=p.id left join jsh_person p on ah.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.AccountId=a.id left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="billNo != null"> <if test="billNo != null">
and ah.BillNo like '%${billNo}%' and ah.BillNo like '%${billNo}%'
@@ -27,6 +27,7 @@
<if test="endTime != null"> <if test="endTime != null">
and ah.BillTime &lt;= '%${endTime}%' and ah.BillTime &lt;= '%${endTime}%'
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
order by ah.Id desc order by ah.Id desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -51,6 +52,7 @@
<if test="endTime != null"> <if test="endTime != null">
and BillTime &lt;= '%${endTime}%' and BillTime &lt;= '%${endTime}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getMaxId" resultType="java.lang.Long"> <select id="getMaxId" resultType="java.lang.Long">
@@ -58,19 +60,32 @@
</select> </select>
<select id="findAllMoney" resultType="java.math.BigDecimal"> <select id="findAllMoney" resultType="java.math.BigDecimal">
select sum(${modeName}) as allMoney from jsh_accounthead where Type='${type}' select sum(${modeName}) as allMoney from jsh_accounthead
where Type='${type}'
and OrganId =${supplierId} and BillTime <![CDATA[ <='${endTime}']]> and OrganId =${supplierId} and BillTime <![CDATA[ <='${endTime}']]>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx"> <select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">
select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName
from jsh_accounthead ah from jsh_accounthead ah
left join jsh_supplier s on ah.OrganId=s.id left join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on ah.HandsPersonId=p.id left join jsh_person p on ah.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.AccountId=a.id left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="billNo != null"> <if test="billNo != null">
and ah.BillNo = '${billNo}' and ah.BillNo = '${billNo}'
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteAccountHeadByIds">
update jsh_accounthead
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -20,6 +20,7 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -38,13 +39,25 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="ResultWithInfoExMap"> <select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="ResultWithInfoExMap">
select ai.*,a.Name AccountName,ioi.Name InOutItemName select ai.*,a.Name AccountName,ioi.Name InOutItemName
from jsh_accountitem ai left join jsh_account a on ai.AccountId=a.id from jsh_accountitem ai left join jsh_account a on ai.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_inoutitem ioi on ai.InOutItemId = ioi.id left join jsh_inoutitem ioi on ai.InOutItemId = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
where ai.HeaderId = ${headerId} where ai.HeaderId = ${headerId}
and ifnull(ai.delete_Flag,'0') !='1'
order by ai.id asc order by ai.id asc
</select> </select>
<update id="batchDeleteAccountItemByIds">
update jsh_accountitem
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -28,6 +28,7 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -47,64 +48,66 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="findAccountInOutList" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultInOutList"> <select id="findAccountInOutList" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultInOutList">
<!--主表出入库涉及的账户 --> <!--主表出入库涉及的账户 -->
select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountId=${accountId} and dh.AccountId=${accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
<!--主表收入和支出涉及的账户 --> <!--主表收入和支出涉及的账户 -->
UNION ALL UNION ALL
select ah.BillNo,ah.Type as newType,s.supplier,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList select ah.BillNo,ah.Type as newType,s.supplier,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) --> <!--明细中涉及的账户(收款,付款,收预付款) -->
UNION ALL UNION ALL
select ah.BillNo,ah.Type as newType,s.supplier,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList select ah.BillNo,ah.Type as newType,s.supplier,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id
inner join jsh_accountitem ai on ai.HeaderId=ah.Id inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款') where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--主表中转出的账户 --> <!--主表中转出的账户 -->
UNION ALL UNION ALL
select ah.BillNo,ah.Type as newType, '' as sName,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList select ah.BillNo,ah.Type as newType, '' as sName,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中被转入的账户 --> <!--明细中被转入的账户 -->
UNION ALL UNION ALL
select ah.BillNo,ah.Type as newType, '' as sName,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList select ah.BillNo,ah.Type as newType, '' as sName,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--多账户的情况 --> <!--多账户的情况 -->
UNION ALL UNION ALL
select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime, select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,
dh.AccountIdList as AList,dh.AccountMoneyList as AMList dh.AccountIdList as AList,dh.AccountMoneyList as AMList
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountIdList like '%${accountId}%' and dh.AccountIdList like '%${accountId}%'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY oTime desc ORDER BY oTime desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -116,57 +119,68 @@
( (
<!--主表出入库涉及的账户 --> <!--主表出入库涉及的账户 -->
select count(1) a select count(1) a
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountId=${accountId} and dh.AccountId=${accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
<!--主表收入和支出涉及的账户 --> <!--主表收入和支出涉及的账户 -->
UNION ALL UNION ALL
select count(1) a select count(1) a
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) --> <!--明细中涉及的账户(收款,付款,收预付款) -->
UNION ALL UNION ALL
select count(1) a select count(1) a
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id
inner join jsh_accountitem ai on ai.HeaderId=ah.Id inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款') where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--主表中转出的账户 --> <!--主表中转出的账户 -->
UNION ALL UNION ALL
select count(1) a select count(1) a
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中被转入的账户 --> <!--明细中被转入的账户 -->
UNION ALL UNION ALL
select count(1) a select count(1) a
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
<!--多账户的情况 --> <!--多账户的情况 -->
UNION ALL UNION ALL
select count(1) a select count(1) a
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountIdList like '%${accountId}%' and dh.AccountIdList like '%${accountId}%'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
) cc ) cc
</select> </select>
<update id="batchDeleteAccountByIds">
update jsh_account
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -11,6 +11,7 @@
<if test="type != null"> <if test="type != null">
and type='${type}' and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
order by sort asc order by sort asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -27,5 +28,16 @@
<if test="type != null"> <if test="type != null">
and type='${type}' and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteAppByIds">
update jsh_app
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -44,11 +44,11 @@
<select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx"> <select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName select dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName
from jsh_depothead dh from jsh_depothead dh
left join jsh_depot d on dh.ProjectId=d.id left join jsh_depot d on dh.ProjectId=d.id and ifnull(d.delete_Flag,'0') !='1'
left join jsh_supplier s on dh.OrganId=s.id left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_depot dd on dh.AllocationProjectId=dd.id left join jsh_depot dd on dh.AllocationProjectId=dd.id and ifnull(dd.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="type != null"> <if test="type != null">
and dh.Type='${type}' and dh.Type='${type}'
@@ -68,6 +68,7 @@
<if test="endTime != null"> <if test="endTime != null">
and dh.OperTime &lt;= (${endTime}) and dh.OperTime &lt;= (${endTime})
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
order by dh.Id desc order by dh.Id desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -96,6 +97,7 @@
<if test="endTime != null"> <if test="endTime != null">
and OperTime &lt;= (${endTime}) and OperTime &lt;= (${endTime})
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getMaxId" resultType="java.lang.Long"> <select id="getMaxId" resultType="java.lang.Long">
@@ -103,17 +105,21 @@
</select> </select>
<select id="findMaterialsListByHeaderId" resultType="java.lang.String"> <select id="findMaterialsListByHeaderId" resultType="java.lang.String">
select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName from jsh_depotitem inner join jsh_material select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName
on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId = ${id} from jsh_depotitem
inner join jsh_material on jsh_depotitem.MaterialId = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1'
where jsh_depotitem.HeaderId = ${id}
and ifnull(jsh_depotitem.delete_Flag,'0') !='1'
</select> </select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.Number,m.`name` MName,m.Model,di.UnitPrice,di.OperNumber,di.AllPrice,s.supplier SName,d.dName DName, select dh.Number,m.`name` MName,m.Model,di.UnitPrice,di.OperNumber,di.AllPrice,s.supplier SName,d.dName DName,
date_format(dh.OperTime, '%Y-%m-%d') OperTime, concat(dh.SubType,dh.Type) as NewType date_format(dh.OperTime, '%Y-%m-%d') OperTime, concat(dh.SubType,dh.Type) as NewType
from jsh_depothead dh inner join jsh_depotitem di on di.HeaderId=dh.id from jsh_depothead dh
inner join jsh_material m on m.id=di.MaterialId inner join jsh_depotitem di on di.HeaderId=dh.id and ifnull(di.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.OrganId inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1'
inner join (select id,name as dName from jsh_depot) d on d.id=di.DepotId 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 &lt;='${endTime}' where dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = ${oId} and dh.OrganId = ${oId}
@@ -127,6 +133,7 @@
<if test="type != null"> <if test="type != null">
and dh.Type='${type}' and dh.Type='${type}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY OperTime DESC,Number desc ORDER BY OperTime DESC,Number desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -135,10 +142,11 @@
<select id="findByAllCount" resultType="java.lang.Integer"> <select id="findByAllCount" resultType="java.lang.Integer">
select count(1) select count(1)
from jsh_depothead dh inner join jsh_depotitem di on di.HeaderId=dh.id from jsh_depothead dh
inner join jsh_material m on m.id=di.MaterialId inner join jsh_depotitem di on di.HeaderId=dh.id and ifnull(di.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.OrganId inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1'
inner join (select id,name as dName from jsh_depot) d on d.id=di.DepotId 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 &lt;='${endTime}' where dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = ${oId} and dh.OrganId = ${oId}
@@ -152,14 +160,16 @@
<if test="type != null"> <if test="type != null">
and dh.Type='${type}' and dh.Type='${type}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY OperTime DESC,Number desc ORDER BY OperTime DESC,Number desc
</select> </select>
<select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount"> <select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount">
select di.MaterialId, m.mName,m.Model,m.categoryName, select di.MaterialId, m.mName,m.Model,m.categoryName,
(select sum(jdi.BasicNumber) numSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi (select sum(jdi.BasicNumber) numSum from jsh_depothead jdh
on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1'
where jdi.MaterialId=di.MaterialId
and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}' and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and jdh.OrganId = ${oId} and jdh.OrganId = ${oId}
@@ -170,10 +180,12 @@
<if test="pid == null"> <if test="pid == null">
and jdi.DepotId in (${dids}) and jdi.DepotId in (${dids})
</if> </if>
and ifnull(jdh.delete_Flag,'0') !='1'
) numSum, ) numSum,
(select sum(jdi.AllPrice) priceSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi (select sum(jdi.AllPrice) priceSum from jsh_depothead jdh
on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1'
where jdi.MaterialId=di.MaterialId
and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}' and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and jdh.OrganId = ${oId} and jdh.OrganId = ${oId}
@@ -184,10 +196,15 @@
<if test="pid == null"> <if test="pid == null">
and jdi.DepotId in (${dids}) and jdi.DepotId in (${dids})
</if> </if>
and ifnull(jdh.delete_Flag,'0') !='1'
) priceSum ) priceSum
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId 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 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 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 &lt;='${endTime}' on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = ${oId} and dh.OrganId = ${oId}
@@ -198,6 +215,7 @@
<if test="pid == null"> <if test="pid == null">
and di.DepotId in (${dids}) and di.DepotId in (${dids})
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -206,10 +224,13 @@
<select id="findInOutMaterialCountTotal" resultType="java.lang.Integer"> <select id="findInOutMaterialCountTotal" resultType="java.lang.Integer">
select count(1) from 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 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 from jsh_material
on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}' 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 &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = ${oId} and dh.OrganId = ${oId}
</if> </if>
@@ -219,25 +240,30 @@
<if test="pid == null"> <if test="pid == null">
and di.DepotId in (${dids}) and di.DepotId in (${dids})
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName) a GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName) a
</select> </select>
<select id="findStatementAccount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStatementAccount"> <select id="findStatementAccount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStatementAccount">
select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier supplierName, select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier supplierName,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单') inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and dh.OrganId=${organId} and dh.OrganId=${organId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
UNION ALL UNION ALL
select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney,ah.ChangeAmount,s.supplier supplierName, select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney,ah.ChangeAmount,s.supplier supplierName,
date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId where s.type='${supType}' inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}'
and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}' and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and ah.OrganId=${organId} and ah.OrganId=${organId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
ORDER BY oTime ORDER BY oTime
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -248,38 +274,44 @@
select sum(a) from select sum(a) from
( (
select count(1) a from jsh_depothead dh select count(1) a from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单') inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and dh.OrganId=${organId} and dh.OrganId=${organId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
UNION ALL UNION ALL
select count(1) a from jsh_accounthead ah select count(1) a from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId where s.type='${supType}' inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}'
and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}' and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and ah.OrganId=${organId} and ah.OrganId=${organId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1'
) cc ) cc
</select> </select>
<select id="findAllMoney" resultType="java.math.BigDecimal"> <select id="findAllMoney" resultType="java.math.BigDecimal">
select sum(${modeName}) as allMoney from jsh_depothead where Type='${type}' and SubType = '${subType}' select sum(${modeName}) as allMoney from jsh_depothead where Type='${type}' and SubType = '${subType}'
and OrganId =${supplierId} and OperTime &lt;='${endTime}' and OrganId =${supplierId} and OperTime &lt;='${endTime}'
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx"> <select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName select dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName
from jsh_depothead dh from jsh_depothead dh
left join jsh_depot d on dh.ProjectId=d.id left join jsh_depot d on dh.ProjectId=d.id and ifnull(d.delete_Flag,'0') !='1'
left join jsh_supplier s on dh.OrganId=s.id left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_depot dd on dh.AllocationProjectId=dd.id left join jsh_depot dd on dh.AllocationProjectId=dd.id and ifnull(dd.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="number != null"> <if test="number != null">
and dh.Number='${number}' and dh.Number='${number}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>
<insert id="adddepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHead" <insert id="adddepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHead"
@@ -396,4 +428,15 @@
select _nextval(#{seq_name}) from dual; select _nextval(#{seq_name}) from dual;
</select> </select>
<update id="batchDeleteDepotHeadByIds">
update jsh_depothead
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -55,6 +55,7 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -73,39 +74,52 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getHeaderIdByMaterial" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="HeaderIdResultMap"> <select id="getHeaderIdByMaterial" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="HeaderIdResultMap">
select dt.HeaderId from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id select dt.HeaderId from jsh_depotitem dt
INNER JOIN jsh_material m on dt.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
where (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%') where (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%')
<if test="depotIds != null"> <if test="depotIds != null">
and dt.DepotId in (${depotIds}) and dt.DepotId in (${depotIds})
</if> </if>
and ifnull(dt.delete_Flag,'0') !='1'
</select> </select>
<select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap"> <select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap">
select dh.Number,concat(dh.SubType,dh.Type) as newType, select dh.Number,concat(dh.SubType,dh.Type) as newType,
case when type='入库' then di.BasicNumber when type='出库' then 0-di.BasicNumber else 0 end as b_num, case when type='入库' then di.BasicNumber when type='出库' then 0-di.BasicNumber else 0 end as b_num,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它' from jsh_depothead dh
and SubType!='调拨' INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
and MaterialId =${mId} ORDER BY oTime desc where dh.type!='其它'
and dh.SubType!='调拨'
and di.MaterialId =${mId}
and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY oTime desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Long"> <select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Long">
select count(1) select count(1)
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它' from jsh_depothead dh
and SubType!='调拨' INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
and MaterialId =${mId} where dh.type!='其它'
and dh.SubType!='调拨'
and di.MaterialId =${mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>
<select id="findStockNumByMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultAndMaterialMap"> <select id="findStockNumByMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultAndMaterialMap">
select di.*,m.Name mName,m.Model mModel from jsh_depotitem di inner join jsh_material m on di.MaterialId=m.Id where 1=1 select di.*,m.Name mName,m.Model mModel from jsh_depotitem di
inner join jsh_material m on di.MaterialId=m.Id and ifnull(m.delete_Flag,'0') !='1'
where 1=1
<if test="mId != null"> <if test="mId != null">
and MaterialId=${mId} and di.MaterialId=${mId}
</if> </if>
and ifnull(di.delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -115,34 +129,44 @@
<if test="mId != null"> <if test="mId != null">
and MaterialId=${mId} and MaterialId=${mId}
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="findByTypeAndMaterialIdIn" resultType="java.lang.Integer"> <select id="findByTypeAndMaterialIdIn" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='入库' select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
and MaterialId = ${mId} INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='入库'
and di.MaterialId = ${mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>
<select id="findByTypeAndMaterialIdOut" resultType="java.lang.Integer"> <select id="findByTypeAndMaterialIdOut" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='出库' select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
and SubType!='调拨' and MaterialId = ${mId} INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='出库'
and dh.SubType!='调拨'
and di.MaterialId = ${mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs, select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs,
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3, m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.UName dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.UName
from jsh_depotitem di left join jsh_material m on di.MaterialId=m.id from jsh_depotitem di
left join jsh_unit u on m.UnitId = u.id left join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depot dp1 on di.DepotId=dp1.id left join jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.AnotherDepotId=dp2.id left join jsh_depot dp1 on di.DepotId=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.AnotherDepotId=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
where di.HeaderId = ${headerId} where di.HeaderId = ${headerId}
and ifnull(di.delete_Flag,'0') !='1'
order by di.id asc order by di.id asc
</select> </select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
from jsh_depotitem di 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 where 1=1
<if test="headIds != null"> <if test="headIds != null">
and di.HeaderId in (${headIds}) and di.HeaderId in (${headIds})
@@ -150,6 +174,7 @@
<if test="materialIds != null"> <if test="materialIds != null">
and di.MaterialId in (${materialIds}) and di.MaterialId in (${materialIds})
</if> </if>
and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color group by m.id,m.Name, m.Model, m.Unit, m.Color
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -159,7 +184,7 @@
<select id="findByAllCount" resultType="java.lang.Integer"> <select id="findByAllCount" resultType="java.lang.Integer">
select count(1) from (select m.id select count(1) from (select m.id
from jsh_depotitem di 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 where 1=1
<if test="headIds != null"> <if test="headIds != null">
and di.HeaderId in (${headIds}) and di.HeaderId in (${headIds})
@@ -167,112 +192,150 @@
<if test="materialIds != null"> <if test="materialIds != null">
and di.MaterialId in (${materialIds}) and di.MaterialId in (${materialIds})
</if> </if>
and ifnull(di.delete_Flag,'0') !='1'
group by m.id) cc group by m.id) cc
</select> </select>
<select id="findByTypeInIsPrev" resultType="java.math.BigDecimal"> <select id="findByTypeInIsPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and where di.HeaderId = dh.id and
((type='入库' and DepotId=${ProjectId}) ((dh.type='入库' and di.DepotId=${ProjectId})
or or
(SubType='调拨' and AnotherDepotId=${ProjectId}) (dh.SubType='调拨' and di.AnotherDepotId=${ProjectId})
or or
(AnotherDepotId=${ProjectId})) (di.AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &lt; '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId}
and dh.OperTime &lt; '${MonthTime}-01 00:00:00'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findByTypeInIsNotPrev" resultType="java.math.BigDecimal"> <select id="findByTypeInIsNotPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and where di.HeaderId = dh.id and
((type='入库' and DepotId=${ProjectId}) ((dh.type='入库' and di.DepotId=${ProjectId})
or or
(SubType='调拨' and AnotherDepotId=${ProjectId}) (dh.SubType='调拨' and di.AnotherDepotId=${ProjectId})
or or
(AnotherDepotId=${ProjectId})) (di.AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &gt;= '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId} and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59' and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findByTypeOutIsPrev" resultType="java.math.BigDecimal"> <select id="findByTypeOutIsPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库' select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
and DepotId= ${ProjectId} where di.HeaderId = dh.id
and MaterialId = ${MId} and dh.type='出库'
and jsh_depothead.OperTime &lt; '${MonthTime}-01 00:00:00' and di.DepotId= ${ProjectId}
and di.MaterialId = ${MId}
and dh.OperTime &lt; '${MonthTime}-01 00:00:00'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findByTypeOutIsNotPrev" resultType="java.math.BigDecimal"> <select id="findByTypeOutIsNotPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库' select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
and DepotId= ${ProjectId} where di.HeaderId = dh.id and dh.type='出库'
and MaterialId = ${MId} and di.DepotId= ${ProjectId}
and jsh_depothead.OperTime &gt;= '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId}
and jsh_depothead.OperTime &lt;= '${MonthTime}-31 23:59:59' and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findPriceByTypeInIsPrev" resultType="java.math.BigDecimal"> <select id="findPriceByTypeInIsPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and where di.HeaderId = dh.id and
((type='入库' and DepotId=${ProjectId}) ((dh.type='入库' and di.DepotId=${ProjectId})
or or
(SubType='调拨' and AnotherDepotId=${ProjectId}) (dh.SubType='调拨' and di.AnotherDepotId=${ProjectId})
or or
(AnotherDepotId=${ProjectId})) (di.AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &lt; '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId}
and dh.OperTime &lt; '${MonthTime}-01 00:00:00'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findPriceByTypeInIsNotPrev" resultType="java.math.BigDecimal"> <select id="findPriceByTypeInIsNotPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and where di.HeaderId = dh.id and
((type='入库' and DepotId=${ProjectId}) ((dh.type='入库' and di.DepotId=${ProjectId})
or or
(SubType='调拨' and AnotherDepotId=${ProjectId}) (dh.SubType='调拨' and di.AnotherDepotId=${ProjectId})
or or
(AnotherDepotId=${ProjectId})) (di.AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &gt;= '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId} and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59' and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findPriceByTypeOutIsPrev" resultType="java.math.BigDecimal"> <select id="findPriceByTypeOutIsPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库' select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
and DepotId= ${ProjectId} where di.HeaderId = dh.id and dh.type='出库'
and MaterialId = ${MId} and di.DepotId= ${ProjectId}
and jsh_depothead.OperTime &lt; '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId}
and dh.OperTime &lt; '${MonthTime}-01 00:00:00'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findPriceByTypeOutIsNotPrev" resultType="java.math.BigDecimal"> <select id="findPriceByTypeOutIsNotPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库' select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
and DepotId= ${ProjectId} where di.HeaderId = dh.id and dh.type='出库'
and MaterialId = ${MId} and di.DepotId= ${ProjectId}
and jsh_depothead.OperTime &gt;= '${MonthTime}-01 00:00:00' and di.MaterialId = ${MId}
and jsh_depothead.OperTime &lt;= '${MonthTime}-31 23:59:59' and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal"> <select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where jsh_depotitem.HeaderId = jsh_depothead.id and type='${type}' and subType='${subType}' where di.HeaderId = dh.id
and MaterialId =${MId} and jsh_depothead.OperTime &gt;= '${MonthTime}-01 00:00:00' and dh.type='${type}' and dh.subType='${subType}'
and jsh_depothead.OperTime &lt;= '${MonthTime}-31 23:59:59' and di.MaterialId =${MId}
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="buyOrSalePrice" resultType="java.math.BigDecimal"> <select id="buyOrSalePrice" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where jsh_depotitem.HeaderId = jsh_depothead.id and type='${type}' and subType='${subType}' where di.HeaderId = dh.id
and MaterialId =${MId} and jsh_depothead.OperTime &gt;= '${MonthTime}-01 00:00:00' and dh.type='${type}' and dh.subType='${subType}'
and jsh_depothead.OperTime &lt;= '${MonthTime}-31 23:59:59' and di.MaterialId =${MId}
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findGiftByTypeIn" resultType="java.math.BigDecimal"> <select id="findGiftByTypeIn" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where jsh_depotitem.HeaderId = jsh_depothead.id and jsh_depothead.SubType='${subType}' where di.HeaderId = dh.id
and jsh_depotitem.AnotherDepotId=${ProjectId} and dh.SubType='${subType}'
and jsh_depotitem.MaterialId =${MId} and di.AnotherDepotId=${ProjectId}
and di.MaterialId =${MId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findGiftByTypeOut" resultType="java.math.BigDecimal"> <select id="findGiftByTypeOut" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where jsh_depotitem.HeaderId = jsh_depothead.id and jsh_depothead.SubType='${subType}' where di.HeaderId = dh.id
and jsh_depotitem.DepotId=${ProjectId} and dh.SubType='${subType}'
and jsh_depotitem.MaterialId =${MId} and di.DepotId=${ProjectId}
and di.MaterialId =${MId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
<select id="findDepotItemListBydepotheadId" resultType="com.jsh.erp.datasource.entities.DepotItem"> <select id="findDepotItemListBydepotheadId" resultType="com.jsh.erp.datasource.entities.DepotItem">
@@ -285,12 +348,14 @@
from jsh_depotitem dep,jsh_material mat from jsh_depotitem dep,jsh_material mat
where 1=1 where 1=1
<if test="depotheadId != null"> <if test="depotheadId != null">
and HeaderId = #{depotheadId} and dep.HeaderId = #{depotheadId}
</if> </if>
and dep.materialid=mat.id and dep.materialid=mat.id
<if test="enableSerialNumber != null"> <if test="enableSerialNumber != null">
and mat.enableSerialNumber = #{enableSerialNumber} and mat.enableSerialNumber = #{enableSerialNumber}
</if> </if>
and ifnull(dep.delete_Flag,'0') !='1'
and ifnull(mat.delete_Flag,'0') !='1'
</select> </select>
<delete id="deleteDepotItemByDepotHeadIds"> <delete id="deleteDepotItemByDepotHeadIds">
delete from jsh_depotitem delete from jsh_depotitem
@@ -302,6 +367,27 @@
</foreach> </foreach>
) )
</delete> </delete>
<update id="batchDeleteDepotItemByDepotHeadIds">
update jsh_depotitem
set delete_Flag='1'
where 1=1
and HeaderId in
(
<foreach collection="depotheadIds" item="depotheadId" separator=",">
#{depotheadId}
</foreach>
)
</update>
<update id="batchDeleteDepotItemByIds">
update jsh_depotitem
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>

View File

@@ -18,6 +18,7 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
order by sort asc order by sort asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -37,6 +38,7 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getDepotList" parameterType="java.util.Map" resultMap="ResultMapEx"> <select id="getDepotList" parameterType="java.util.Map" resultMap="ResultMapEx">
select dep.*,usr.username as principalName select dep.*,usr.username as principalName
@@ -54,8 +56,19 @@
<bind name="remark" value="'%' + _parameter.remark + '%'" /> <bind name="remark" value="'%' + _parameter.remark + '%'" />
and dep.remark like #{remark} and dep.remark like #{remark}
</if> </if>
and ifnull(dep.delete_Flag,'0') !='1'
order by dep.sort asc order by dep.sort asc
</select> </select>
<update id="batchDeleteDepotByIds">
update jsh_depot
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>

View File

@@ -11,6 +11,7 @@
<if test="type != null"> <if test="type != null">
and type='${type}' and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
order by sort asc order by sort asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -27,5 +28,16 @@
<if test="type != null"> <if test="type != null">
and type='${type}' and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteFunctionsByIds">
update jsh_functions
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -14,6 +14,7 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -32,5 +33,16 @@
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteInOutItemByIds">
update jsh_inoutitem
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -13,8 +13,8 @@
<select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList"> <select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
select m.*,u.uname unitName, mc.name categoryName select m.*,u.uname unitName, mc.name categoryName
FROM jsh_material m FROM jsh_material m
left JOIN jsh_unit u on m.UnitId = u.id left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
where 1=1 where 1=1
<if test="name != null"> <if test="name != null">
and m.name like '%${name}%' and m.name like '%${name}%'
@@ -25,6 +25,7 @@
<if test="categoryId != 1"> <if test="categoryId != 1">
and m.CategoryId in (${categoryIds}) and m.CategoryId in (${categoryIds})
</if> </if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.id asc order by m.id asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -35,8 +36,8 @@
SELECT SELECT
COUNT(m.id) COUNT(m.id)
FROM jsh_material m FROM jsh_material m
left JOIN jsh_unit u on m.UnitId = u.id left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
WHERE 1=1 WHERE 1=1
<if test="name != null"> <if test="name != null">
and m.name like '%${name}%' and m.name like '%${name}%'
@@ -47,18 +48,29 @@
<if test="categoryId != 1"> <if test="categoryId != 1">
and m.CategoryId in (${categoryIds}) and m.CategoryId in (${categoryIds})
</if> </if>
and ifnull(m.delete_Flag,'0') !='1'
</select> </select>
<select id="findUnitName" resultType="java.lang.String"> <select id="findUnitName" resultType="java.lang.String">
select jsh_unit.UName from jsh_unit left join jsh_material on UnitId=jsh_unit.id where jsh_material.id = ${mId} select jsh_unit.UName from jsh_unit u
left join jsh_material m on m.UnitId=u.id and ifnull(m.delete_Flag,'0') !='1'
where m.id = ${mId}
and ifnull(u.delete_Flag,'0') !='1'
</select> </select>
<select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap"> <select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.UName from jsh_material m left join jsh_unit u on m.UnitId=u.id where m.id = ${id} select m.*,u.UName from jsh_material m
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.id = ${id}
and ifnull(m.delete_Flag,'0') !='1'
</select> </select>
<select id="findBySelect" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap"> <select id="findBySelect" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.UName from jsh_material m left join jsh_unit u on m.UnitId=u.id where m.enabled=1 ORDER BY Id asc select m.*,u.UName from jsh_material m
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.enabled=1
and ifnull(m.delete_Flag,'0') !='1'
ORDER BY Id asc
</select> </select>
<update id="updatePriceNullByPrimaryKey" parameterType="java.lang.Long"> <update id="updatePriceNullByPrimaryKey" parameterType="java.lang.Long">
@@ -81,8 +93,8 @@
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
select m.*,u.uname unitName, mc.name categoryName select m.*,u.uname unitName, mc.name categoryName
FROM jsh_material m FROM jsh_material m
left JOIN jsh_unit u on m.UnitId = u.id left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
where 1=1 where 1=1
<if test="name != null"> <if test="name != null">
and m.name like '%${name}%' and m.name like '%${name}%'
@@ -93,6 +105,7 @@
<if test="categoryId != 1"> <if test="categoryId != 1">
and m.CategoryId in (${categoryIds}) and m.CategoryId in (${categoryIds})
</if> </if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.id asc order by m.id asc
</select> </select>
<select id="findByMaterialName" resultType="com.jsh.erp.datasource.entities.Material"> <select id="findByMaterialName" resultType="com.jsh.erp.datasource.entities.Material">
@@ -102,6 +115,7 @@
<if test="name != null"> <if test="name != null">
and m.name =#{name} and m.name =#{name}
</if> </if>
and ifnull(m.delete_Flag,'0') !='1'
</select> </select>
<select id="getMaterialEnableSerialNumberList" parameterType="java.util.Map" resultMap="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap"> <select id="getMaterialEnableSerialNumberList" parameterType="java.util.Map" resultMap="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap">
@@ -121,8 +135,20 @@
<bind name="model" value="'%' + _parameter.model + '%'" /> <bind name="model" value="'%' + _parameter.model + '%'" />
and model like #{model} and model like #{model}
</if> </if>
and ifnull(delete_Flag,'0') !='1'
order by id desc order by id desc
</select> </select>
<update id="batchDeleteMaterialByIds">
update jsh_material
set delete_Flag='1'
where 1=1
and ifnull(delete_Flag,'0') !='1'
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -8,6 +8,7 @@
<if test="name != null"> <if test="name != null">
and nativeName like '%${name}%' and nativeName like '%${name}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -20,5 +21,16 @@
<if test="name != null"> <if test="name != null">
and nativeName like '%${name}%' and nativeName like '%${name}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteMaterialPropertyByIds">
update jsh_materialproperty
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -11,6 +11,7 @@
<if test="type != null"> <if test="type != null">
and type='${type}' and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -26,5 +27,16 @@
<if test="type != null"> <if test="type != null">
and type='${type}' and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeletePersonByIds">
update jsh_person
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -5,6 +5,7 @@
SELECT * SELECT *
FROM jsh_role FROM jsh_role
WHERE 1=1 WHERE 1=1
and ifnull(delete_Flag,'0') !='1'
<if test="name != null"> <if test="name != null">
and name like '%${name}%' and name like '%${name}%'
</if> </if>
@@ -17,8 +18,19 @@
COUNT(id) COUNT(id)
FROM jsh_role FROM jsh_role
WHERE 1=1 WHERE 1=1
and ifnull(delete_Flag,'0') !='1'
<if test="name != null"> <if test="name != null">
and name like '%${name}%' and name like '%${name}%'
</if> </if>
</select> </select>
<update id="batchDeleteRoleByIds">
update jsh_role
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -15,8 +15,8 @@
ser.update_Time,mat.name as materialName,null as creator,null as updater,null as creatorName, 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 null as updaterName,ser.depothead_Id, dh.number as depotHeadNumber,concat(dh.SubType,dh.Type) as depotHeadType
FROM jsh_serial_number ser 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_depothead dh on dh.id= ser.depothead_Id left join jsh_depothead dh on dh.id= ser.depothead_Id and ifnull(dh.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="serialNumber != null"> <if test="serialNumber != null">
<bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" /> <bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" />
@@ -36,7 +36,7 @@
SELECT SELECT
COUNT(ser.id) COUNT(ser.id)
FROM jsh_serial_number ser 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 where 1=1
<if test="serialNumber != null"> <if test="serialNumber != null">
<bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" /> <bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" />
@@ -55,7 +55,7 @@
ser.update_Time,ser.creator,ser.updater,mat.name as materialName,cr.username as creatorName, ser.update_Time,ser.creator,ser.updater,mat.name as materialName,cr.username as creatorName,
ur.username as updaterName,ser.depothead_Id ur.username as updaterName,ser.depothead_Id
FROM jsh_serial_number ser 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 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') left join jsh_user ur on ser.updater=ur.id and ifnull(ur.status,'0') not in('1','2')
where 1=1 where 1=1
@@ -231,7 +231,6 @@
update jsh_serial_number update jsh_serial_number
set update_Time=#{updateTime},updater=#{updater},delete_Flag='1' set update_Time=#{updateTime},updater=#{updater},delete_Flag='1'
where 1=1 where 1=1
and ifnull(delete_Flag,'0') !='1'
and id in ( and id in (
<foreach collection="ids" item="id" separator=","> <foreach collection="ids" item="id" separator=",">
#{id} #{id}

View File

@@ -20,6 +20,7 @@
<if test="description != null"> <if test="description != null">
and description like '%${description}%' and description like '%${description}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -44,6 +45,7 @@
<if test="description != null"> <if test="description != null">
and description like '%${description}%' and description like '%${description}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">
@@ -65,5 +67,16 @@
<if test="description != null"> <if test="description != null">
and description like '%${description}%' and description like '%${description}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteSupplierByIds">
update jsh_supplier
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -8,6 +8,7 @@
<if test="companyName != null"> <if test="companyName != null">
and company_name like '%${companyName}%' and company_name like '%${companyName}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -20,5 +21,16 @@
<if test="companyName != null"> <if test="companyName != null">
and company_name like '%${companyName}%' and company_name like '%${companyName}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteSystemConfigByIds">
update jsh_systemconfig
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -8,6 +8,7 @@
<if test="name != null"> <if test="name != null">
and UName like '%${name}%' and UName like '%${name}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -20,5 +21,16 @@
<if test="name != null"> <if test="name != null">
and UName like '%${name}%' and UName like '%${name}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1'
</select> </select>
<update id="batchDeleteUnitByIds">
update jsh_unit
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.UserBusinessMapperEx">
<update id="batchDeleteUserBusinessByIds">
update jsh_serial_number
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>