从源更新
This commit is contained in:
43
src/main/java/com/jsh/erp/config/SSLConfig.java
Normal file
43
src/main/java/com/jsh/erp/config/SSLConfig.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.jsh.erp.config;
|
||||
|
||||
import org.apache.catalina.Context;
|
||||
import org.apache.catalina.connector.Connector;
|
||||
import org.apache.tomcat.util.descriptor.web.SecurityCollection;
|
||||
import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@ConditionalOnExpression(value = "${server.ssl.enable:true}")
|
||||
@Configuration
|
||||
public class SSLConfig {
|
||||
|
||||
@Bean
|
||||
public Connector connector(){
|
||||
Connector connector=new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
||||
connector.setScheme("http");
|
||||
connector.setPort(80);
|
||||
connector.setSecure(false);
|
||||
connector.setRedirectPort(443);
|
||||
return connector;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TomcatServletWebServerFactory tomcatServletWebServerFactory(Connector connector){
|
||||
TomcatServletWebServerFactory tomcat=new TomcatServletWebServerFactory(){
|
||||
@Override
|
||||
protected void postProcessContext(Context context) {
|
||||
SecurityConstraint securityConstraint=new SecurityConstraint();
|
||||
securityConstraint.setUserConstraint("CONFIDENTIAL");
|
||||
SecurityCollection collection=new SecurityCollection();
|
||||
collection.addPattern("/*");
|
||||
securityConstraint.addCollection(collection);
|
||||
context.addConstraint(securityConstraint);
|
||||
}
|
||||
};
|
||||
tomcat.addAdditionalTomcatConnectors(connector);
|
||||
return tomcat;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,12 +137,13 @@ public class BusinessConstants {
|
||||
public static final byte USER_STATUS_BANNED = 2;
|
||||
/**
|
||||
* 日志操作
|
||||
* 新增、修改、删除
|
||||
* 新增、修改、删除、登录、导入
|
||||
* */
|
||||
public static final String LOG_OPERATION_TYPE_ADD = "新增";
|
||||
public static final String LOG_OPERATION_TYPE_BATCH_ADD = "批量新增";
|
||||
public static final String LOG_OPERATION_TYPE_EDIT = "修改,id:";
|
||||
public static final String LOG_OPERATION_TYPE_DELETE = "删除,id:";
|
||||
public static final String LOG_OPERATION_TYPE_LOGIN = "登录,id:";
|
||||
public static final String LOG_OPERATION_TYPE_IMPORT = "导入";
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,10 +60,10 @@ public class ExceptionConstants {
|
||||
public static final String USER_EDIT_FAILED_MSG = "修改用户信息失败";
|
||||
//用户名已存在
|
||||
public static final int USER_USER_NAME_ALREADY_EXISTS_CODE = 500003;
|
||||
public static final String USER_USER_NAME_ALREADY_EXISTS_MSG = "用户名已存在";
|
||||
public static final String USER_USER_NAME_ALREADY_EXISTS_MSG = "用户名在本系统已存在";
|
||||
//登录名已存在
|
||||
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 = "登录名在本系统已存在";
|
||||
//用户录入数量超出限制
|
||||
public static final int USER_OVER_LIMIT_FAILED_CODE = 500004;
|
||||
public static final String USER_OVER_LIMIT_FAILED_MSG = "用户录入数量超出限制,请联系管理员续费";
|
||||
|
||||
@@ -1,280 +0,0 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.entities.UserBusiness;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.app.AppService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.FileUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @author ji_sheng_hua 752*718*920
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/app")
|
||||
public class AppController {
|
||||
private Logger logger = LoggerFactory.getLogger(AppController.class);
|
||||
|
||||
@Value("${mybatis-plus.status}")
|
||||
private String mybatisPlusStatus;
|
||||
|
||||
@Resource
|
||||
private AppService appService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
/**
|
||||
* 根据用户查询有权限的app
|
||||
* @param userId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findAppByUserId")
|
||||
public JSONObject findAppByUserId(@RequestParam("userId") String userId, HttpServletRequest request)throws Exception {
|
||||
List<UserBusiness> roleList = userBusinessService.findRoleByUserId(userId);
|
||||
String roles = null;
|
||||
if(roleList!=null && roleList.size()>0 && roleList.get(0)!=null){
|
||||
roles = roleList.get(0).getValue();
|
||||
}
|
||||
if(roles!=null) {
|
||||
roles = roles.replaceAll("\\]\\[",",").replaceAll("\\]","").replaceAll("\\[",""); //转为逗号隔开的
|
||||
}
|
||||
List<UserBusiness> appList = userBusinessService.findAppByRoles(roles);
|
||||
String apps = null;
|
||||
if(appList!=null && appList.size()>0 && appList.get(0)!=null){
|
||||
apps = appList.get(0).getValue();
|
||||
}
|
||||
if(apps!=null) {
|
||||
apps = apps.replaceAll("\\]\\[",",").replaceAll("\\]","").replaceAll("\\[",""); //转为逗号隔开的
|
||||
}
|
||||
JSONObject obj = new JSONObject();
|
||||
List<App> dockList = appService.findAppInIds(apps,"dock");
|
||||
JSONArray dockArray = new JSONArray();
|
||||
if (null != dockList) {
|
||||
for (App app : dockList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", app.getId());
|
||||
item.put("title", app.getName());
|
||||
item.put("type", app.getType());
|
||||
item.put("icon", "../../upload/images/deskIcon/" + app.getIcon());
|
||||
item.put("url", app.getUrl());
|
||||
item.put("width", app.getWidth());
|
||||
item.put("height", app.getHeight());
|
||||
item.put("isresize", app.getResize());
|
||||
item.put("isopenmax", app.getOpenmax());
|
||||
item.put("isflash", app.getFlash());
|
||||
dockArray.add(item);
|
||||
}
|
||||
}
|
||||
obj.put("dock",dockArray);
|
||||
|
||||
List<App> deskList = appService.findAppInIds(apps,"desk");
|
||||
JSONArray deskArray = new JSONArray();
|
||||
if (null != deskList) {
|
||||
for (App app : deskList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", app.getId());
|
||||
item.put("title", app.getName());
|
||||
item.put("type", app.getType());
|
||||
item.put("icon", "../../upload/images/deskIcon/" + app.getIcon());
|
||||
item.put("url", "../../pages/common/menu.html?appID=" + app.getNumber() + "&id=" + app.getId());
|
||||
item.put("width", app.getWidth());
|
||||
item.put("height", app.getHeight());
|
||||
item.put("isresize", app.getResize());
|
||||
item.put("isopenmax", app.getOpenmax());
|
||||
item.put("isflash", app.getFlash());
|
||||
deskArray.add(item);
|
||||
}
|
||||
}
|
||||
obj.put("desk",deskArray);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/findDesk")
|
||||
public JSONObject findDesk(HttpServletRequest request)throws Exception {
|
||||
JSONObject obj = new JSONObject();
|
||||
List<App> dockList = appService.findDock();
|
||||
JSONArray dockArray = new JSONArray();
|
||||
if (null != dockList) {
|
||||
for (App app : dockList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", app.getId());
|
||||
item.put("title", app.getName());
|
||||
item.put("type", app.getType());
|
||||
item.put("icon", "../../upload/images/deskIcon/" + app.getIcon());
|
||||
item.put("url", app.getUrl());
|
||||
item.put("width", app.getWidth());
|
||||
item.put("height", app.getHeight());
|
||||
item.put("isresize", app.getResize());
|
||||
item.put("isopenmax", app.getOpenmax());
|
||||
item.put("isflash", app.getFlash());
|
||||
dockArray.add(item);
|
||||
}
|
||||
}
|
||||
obj.put("dock",dockArray);
|
||||
|
||||
List<App> deskList = appService.findDesk();
|
||||
JSONArray deskArray = new JSONArray();
|
||||
if (null != deskList) {
|
||||
for (App app : deskList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", app.getId());
|
||||
item.put("title", app.getName());
|
||||
item.put("type", app.getType());
|
||||
item.put("icon", "../../upload/images/deskIcon/" + app.getIcon());
|
||||
item.put("url", "../../pages/common/menu.html?appID=" + app.getNumber() + "&id=" + app.getId());
|
||||
item.put("width", app.getWidth());
|
||||
item.put("height", app.getHeight());
|
||||
item.put("isresize", app.getResize());
|
||||
item.put("isopenmax", app.getOpenmax());
|
||||
item.put("isflash", app.getFlash());
|
||||
deskArray.add(item);
|
||||
}
|
||||
}
|
||||
obj.put("desk",deskArray);
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色对应应用显示
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findRoleAPP")
|
||||
public JSONArray findRoleAPP(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request)throws Exception {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<App> dataListApp = appService.findRoleAPP();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "应用列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataListApp) {
|
||||
//根据条件从列表里面移除"系统管理"
|
||||
List<App> dataList = new ArrayList<App>();
|
||||
for (App appOne : dataListApp) {
|
||||
if(("open").equals(mybatisPlusStatus)){
|
||||
//从session中获取租户id
|
||||
String loginName = null;
|
||||
Object userInfo = request.getSession().getAttribute("user");
|
||||
if(userInfo != null) {
|
||||
User user = (User) userInfo;
|
||||
loginName = user.getLoginame();
|
||||
}
|
||||
if(("admin").equals(loginName)) {
|
||||
dataList.add(appOne);
|
||||
} else {
|
||||
if(!("系统管理").equals(appOne.getName())) {
|
||||
dataList.add(appOne);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dataList.add(appOne);
|
||||
}
|
||||
}
|
||||
|
||||
//筛选应用列表
|
||||
for (App app : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", app.getId());
|
||||
item.put("text", app.getName());
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + app.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的应用:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
* @param fileInfo
|
||||
* @param request
|
||||
*/
|
||||
@PostMapping(value = "/uploadImg")
|
||||
public BaseResponseInfo uploadImg(MultipartFile fileInfo, @RequestParam("fileInfoName") String fileName,
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
if (fileInfo != null) {
|
||||
String basePath = request.getSession().getServletContext().getRealPath("/"); //默认windows文件路径,linux环境下生成的目录与项目同级,而不是下级
|
||||
String path = basePath + "upload/images/deskIcon/"; //windows环境下的路径
|
||||
Properties pro = System.getProperties();
|
||||
String osName = pro.getProperty("os.name");//获得当前操作系统的名称
|
||||
if("Linux".equals(osName) || "linux".equals(osName) || "LINUX".equals(osName)){
|
||||
path = basePath + "/upload/images/deskIcon/"; //linux环境下的路径
|
||||
}
|
||||
FileUtils.SaveFileFromInputStream(fileInfo.getInputStream(), path, fileName);
|
||||
res.code = 200;
|
||||
res.data = "上传图片成功";
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取图片失败";
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "上传图片失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:https://qiankunpingtai.cn
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.datasource.entities.DepotEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.systemConfig.SystemConfigService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.*;
|
||||
import org.slf4j.Logger;
|
||||
@@ -40,6 +41,9 @@ public class DepotController {
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
@Resource
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@GetMapping(value = "/getAllList")
|
||||
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
@@ -102,6 +106,14 @@ public class DepotController {
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户拥有权限的仓库列表
|
||||
* @param type
|
||||
* @param keyId
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/findDepotByUserId")
|
||||
public JSONArray findDepotByUserId(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) throws Exception{
|
||||
@@ -110,6 +122,7 @@ public class DepotController {
|
||||
List<Depot> dataList = depotService.findUserDepot();
|
||||
//开始拼接json数据
|
||||
if (null != dataList) {
|
||||
boolean depotFlag = systemConfigService.getDepotFlag();
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
//勾选判断1
|
||||
@@ -119,7 +132,7 @@ public class DepotController {
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
if (!depotFlag || flag) {
|
||||
item.put("id", depot.getId());
|
||||
item.put("depotName", depot.getName());
|
||||
arr.add(item);
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import com.jsh.erp.utils.Tools;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -30,6 +31,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
import static com.jsh.erp.utils.Tools.getNow3;
|
||||
|
||||
/**
|
||||
* @author ji-sheng-hua 752*718*920
|
||||
@@ -39,9 +41,6 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
public class DepotHeadController {
|
||||
private Logger logger = LoggerFactory.getLogger(DepotHeadController.class);
|
||||
|
||||
@Value("${mybatis-plus.status}")
|
||||
private String mybatisPlusStatus;
|
||||
|
||||
@Resource
|
||||
private DepotHeadService depotHeadService;
|
||||
|
||||
@@ -377,15 +376,12 @@ public class DepotHeadController {
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated, HttpServletRequest request) throws Exception{
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
if(("open").equals(mybatisPlusStatus)) {
|
||||
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
|
||||
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null);
|
||||
if(count>= billsNumLimit) {
|
||||
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
|
||||
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
|
||||
} else {
|
||||
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
|
||||
}
|
||||
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
|
||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null);
|
||||
if(count>= billsNumLimit) {
|
||||
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
|
||||
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
|
||||
} else {
|
||||
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
|
||||
}
|
||||
@@ -405,12 +401,16 @@ public class DepotHeadController {
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/updateDepotHeadAndDetail")
|
||||
public Object updateDepotHeadAndDetail(@RequestParam("id") Long id,@RequestParam("info") String beanJson,@RequestParam("inserted") String inserted,
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated,@RequestParam("preTotalPrice") BigDecimal preTotalPrice) throws Exception{
|
||||
|
||||
public Object updateDepotHeadAndDetail(@RequestParam("id") Long id,
|
||||
@RequestParam("info") String beanJson,
|
||||
@RequestParam("inserted") String inserted,
|
||||
@RequestParam("deleted") String deleted,
|
||||
@RequestParam("updated") String updated,
|
||||
@RequestParam("preTotalPrice") BigDecimal preTotalPrice,
|
||||
HttpServletRequest request) throws Exception{
|
||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
depotHeadService.updateDepotHeadAndDetail(id,beanJson,inserted,deleted,updated,preTotalPrice);
|
||||
depotHeadService.updateDepotHeadAndDetail(id,beanJson,inserted,deleted,updated,preTotalPrice,tenantId);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
@@ -443,4 +443,39 @@ public class DepotHeadController {
|
||||
depotHeadService.batchDeleteDepotHeadAndDetail(ids);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计今日销售额、本月销售额、本月进货额
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getBuyAndSaleStatistics")
|
||||
public BaseResponseInfo getBuyAndSaleStatistics(HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
String today = Tools.getNow() + " 00:00:00";
|
||||
String firstDay = Tools.getCurrentMonth() + "-01 00:00:00";
|
||||
BigDecimal todaySale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
|
||||
1, today, getNow3()); //今日销售出库
|
||||
BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
|
||||
0, today, getNow3()); //今日零售出库
|
||||
BigDecimal monthSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
|
||||
1,firstDay, getNow3()); //本月销售出库
|
||||
BigDecimal monthRetailSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
|
||||
0,firstDay, getNow3()); //本月零售出库
|
||||
BigDecimal monthBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购",
|
||||
1, firstDay, getNow3()); //本月采购入库
|
||||
map.put("todaySale", todaySale.add(todayRetailSale));
|
||||
map.put("thisMonthSale", monthSale.add(monthRetailSale));
|
||||
map.put("thisMonthBuy", monthBuy);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,10 +24,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
@@ -98,30 +96,6 @@ public class DepotItemController {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findStockNumById")
|
||||
public String findStockNumById(
|
||||
@RequestParam("projectId") Integer pid,
|
||||
@RequestParam("materialId") String mId,
|
||||
HttpServletRequest request) throws Exception{
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
//存放数据json数组
|
||||
Long materialId = Long.valueOf(mId);
|
||||
Long depotId = Long.valueOf(pid);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
JSONObject item = new JSONObject();
|
||||
/**查询指定仓库下指定材料的库存数量*/
|
||||
item.put("thisSum", depotItemService.getCurrentRepByMaterialIdAndDepotId(materialId,depotId));
|
||||
dataArray.add(item);
|
||||
objectMap.put("page", dataArray);
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 只根据商品id查询库存数量
|
||||
* @param mId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findStockNumByMaterialId")
|
||||
public String findStockNumByMaterialId(
|
||||
@RequestParam("materialId") String mId,
|
||||
@@ -166,6 +140,7 @@ public class DepotItemController {
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = new ArrayList<DepotItemVo4WithInfoEx>();
|
||||
if(headerId != 0) {
|
||||
@@ -260,11 +235,11 @@ public class DepotItemController {
|
||||
return materialOther;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查找所有的明细
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param projectId
|
||||
* @param monthTime
|
||||
* @param headIds
|
||||
* @param materialIds
|
||||
@@ -272,10 +247,10 @@ public class DepotItemController {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findByAll")
|
||||
@RequestMapping(value = "/findByAll")
|
||||
public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage,
|
||||
@RequestParam("pageSize") Integer pageSize,
|
||||
@RequestParam("projectId") Integer projectId,
|
||||
@RequestParam("depotId") Long depotId,
|
||||
@RequestParam("monthTime") String monthTime,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
@@ -283,45 +258,34 @@ public class DepotItemController {
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
|
||||
String[] mpArr = mpList.split(",");
|
||||
int total = depotItemService.findByAllCount(headIds, materialIds);
|
||||
map.put("total", total);
|
||||
//存放数据json数组
|
||||
Integer pid = projectId;
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
BigDecimal prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true).subtract(sumNumber("出库", pid, diEx.getMId(), monthTime, true));
|
||||
BigDecimal InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true).subtract(sumPrice("出库", pid, diEx.getMId(), monthTime, true));
|
||||
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||
Long mId = diEx.getMId();
|
||||
String timeA = monthTime+"-01 00:00:00";
|
||||
String timeB = monthTime+"-31 23:59:59";
|
||||
item.put("MaterialName", diEx.getMName());
|
||||
item.put("MaterialModel", diEx.getMModel());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, diEx);
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", diEx.getMColor());
|
||||
item.put("MaterialUnit", diEx.getMaterialUnit());
|
||||
BigDecimal unitPrice = BigDecimal.ZERO;
|
||||
if ((prevSum .add(InSum).subtract(OutSum)).compareTo(BigDecimal.ZERO)!= 0) {
|
||||
unitPrice = (prevPrice.add(InPrice).subtract(OutPrice)).divide(prevSum.add(InSum).subtract(OutSum),2, BigDecimal.ROUND_HALF_UP);
|
||||
/**
|
||||
* 2019-01-15通过除法算出金额后,保留两位小数
|
||||
* */
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
unitPrice= new BigDecimal(df.format(unitPrice));
|
||||
}
|
||||
item.put("UnitPrice", unitPrice);
|
||||
item.put("prevSum", prevSum);
|
||||
item.put("InSum", InSum);
|
||||
item.put("OutSum", OutSum);
|
||||
item.put("thisSum", prevSum.add(InSum).subtract(OutSum));
|
||||
item.put("thisAllPrice", prevPrice.add(InPrice).subtract(OutPrice));
|
||||
item.put("unitName", getUName(diEx.getMaterialUnit(), diEx.getUName()));
|
||||
item.put("UnitPrice", getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy()));
|
||||
item.put("prevSum", depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId));
|
||||
item.put("InSum", depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId));
|
||||
item.put("OutSum", depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId));
|
||||
BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
|
||||
item.put("thisSum", thisSum);
|
||||
item.put("thisAllPrice", thisSum.multiply(getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy())));
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
@@ -336,32 +300,87 @@ public class DepotItemController {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel表格
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param monthTime
|
||||
* @param headIds
|
||||
* @param materialIds
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/exportExcel")
|
||||
public void exportExcel(@RequestParam("currentPage") Integer currentPage,
|
||||
@RequestParam("pageSize") Integer pageSize,
|
||||
@RequestParam("depotId") Long depotId,
|
||||
@RequestParam("monthTime") String monthTime,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
|
||||
//存放数据json数组
|
||||
String[] names = {"名称", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
|
||||
String title = "库存报表";
|
||||
List<String[]> objects = new ArrayList<String[]>();
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
Long mId = diEx.getMId();
|
||||
String timeA = monthTime+"-01 00:00:00";
|
||||
String timeB = monthTime+"-31 23:59:59";
|
||||
String[] objs = new String[9];
|
||||
objs[0] = diEx.getMName().toString();
|
||||
objs[1] = diEx.getMModel().toString();
|
||||
objs[2] = diEx.getMaterialUnit().toString();
|
||||
objs[3] = getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy()).toString();
|
||||
objs[4] = depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId).toString();
|
||||
objs[5] = depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
|
||||
objs[6] = depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
|
||||
BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
|
||||
objs[7] = thisSum.toString();
|
||||
objs[8] = thisSum.multiply(getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy())).toString();
|
||||
objects.add(objs);
|
||||
}
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName() + "-" + monthTime, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计总计金额
|
||||
* @param pid
|
||||
* @param monthTime
|
||||
* @param headIds
|
||||
* @param materialIds
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/totalCountMoney")
|
||||
public BaseResponseInfo totalCountMoney(@RequestParam("projectId") Integer pid,
|
||||
@RequestParam("monthTime") String monthTime,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
HttpServletRequest request) throws Exception{
|
||||
@RequestMapping(value = "/totalCountMoney")
|
||||
public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId,
|
||||
@RequestParam("monthTime") String monthTime,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
HttpServletRequest request) throws Exception{
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, null, null);
|
||||
BigDecimal thisAllPrice = BigDecimal.ZERO;
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
BigDecimal prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true).subtract(sumPrice("出库", pid, diEx.getMId(), monthTime, true));
|
||||
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||
thisAllPrice = thisAllPrice .add(prevPrice.add(InPrice).subtract(OutPrice));
|
||||
Long mId = diEx.getMId();
|
||||
BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
|
||||
BigDecimal unitPrice = getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy());
|
||||
thisAllPrice = thisAllPrice.add(thisSum.multiply(unitPrice));
|
||||
}
|
||||
}
|
||||
map.put("totalCount", thisAllPrice);
|
||||
@@ -375,6 +394,8 @@ public class DepotItemController {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 进货统计
|
||||
* @param currentPage
|
||||
@@ -499,134 +520,6 @@ public class DepotItemController {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel表格
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param projectId
|
||||
* @param monthTime
|
||||
* @param headIds
|
||||
* @param materialIds
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/exportExcel")
|
||||
public void exportExcel(@RequestParam("currentPage") Integer currentPage,
|
||||
@RequestParam("pageSize") Integer pageSize,
|
||||
@RequestParam("projectId") Integer projectId,
|
||||
@RequestParam("monthTime") String monthTime,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
HttpServletRequest request, HttpServletResponse response)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
|
||||
//存放数据json数组
|
||||
Integer pid = projectId;
|
||||
String[] names = {"名称", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
|
||||
String title = "库存报表";
|
||||
List<String[]> objects = new ArrayList<String[]>();
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
String[] objs = new String[9];
|
||||
BigDecimal prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true).subtract(sumNumber("出库", pid, diEx.getMId(), monthTime, true));
|
||||
BigDecimal InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true).subtract(sumPrice("出库", pid, diEx.getMId(), monthTime, true));
|
||||
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||
BigDecimal unitPrice = BigDecimal.ZERO;
|
||||
if ((prevSum.add(InSum).subtract(OutSum)).compareTo(BigDecimal.ZERO) != 0) {
|
||||
unitPrice = (prevPrice.add(InPrice).subtract(OutPrice)).divide(prevSum.add(InSum).subtract(OutSum),2, BigDecimal.ROUND_HALF_UP);
|
||||
/**
|
||||
* 2019-01-15通过除法算出金额后,保留两位小数
|
||||
* */
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
unitPrice= new BigDecimal(df.format(unitPrice));
|
||||
}
|
||||
BigDecimal thisSum = prevSum.add(InSum).subtract(OutSum);
|
||||
BigDecimal thisAllPrice = prevPrice.add(InPrice).subtract(OutPrice);
|
||||
objs[0] = diEx.getMName().toString();
|
||||
objs[1] = diEx.getMModel().toString();
|
||||
objs[2] = diEx.getMaterialUnit().toString();
|
||||
objs[3] = unitPrice.toString();
|
||||
objs[4] = prevSum.toString();
|
||||
objs[5] = InSum.toString();
|
||||
objs[6] = OutSum.toString();
|
||||
objs[7] = thisSum.toString();
|
||||
objs[8] = thisAllPrice.toString();
|
||||
objects.add(objs);
|
||||
}
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName() + "-" + monthTime, response);
|
||||
res.code = 200;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导出失败";
|
||||
res.code = 500;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量合计
|
||||
*
|
||||
* @param type
|
||||
* @param MId
|
||||
* @param MonthTime
|
||||
* @param isPrev
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal sumNumber(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev)throws Exception {
|
||||
BigDecimal sumNumber = BigDecimal.ZERO;
|
||||
try {
|
||||
BigDecimal sum = depotItemService.findByType(type, ProjectId, MId, MonthTime, isPrev);
|
||||
if(sum != null) {
|
||||
sumNumber = sum;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sumNumber;
|
||||
}
|
||||
|
||||
public BigDecimal assembleNumber(String subType, String mType, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) throws Exception{
|
||||
BigDecimal assembleNumber = BigDecimal.ZERO;
|
||||
try {
|
||||
BigDecimal sum = depotItemService.findAssembleByType(subType, mType, ProjectId, MId, MonthTime, isPrev);
|
||||
if(sum != null) {
|
||||
assembleNumber = sum;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return assembleNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 价格合计
|
||||
*
|
||||
* @param type
|
||||
* @param MId
|
||||
* @param MonthTime
|
||||
* @param isPrev
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal sumPrice(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) throws Exception{
|
||||
BigDecimal sumPrice = BigDecimal.ZERO;
|
||||
try {
|
||||
BigDecimal sum = depotItemService.findPriceByType(type, ProjectId, MId, MonthTime, isPrev);
|
||||
if(sum != null) {
|
||||
sumPrice = sum;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sumPrice;
|
||||
}
|
||||
|
||||
public BigDecimal sumNumberBuyOrSale(String type, String subType, Long MId, String MonthTime)throws Exception {
|
||||
BigDecimal sumNumber = BigDecimal.ZERO;
|
||||
@@ -655,6 +548,30 @@ public class DepotItemController {
|
||||
}
|
||||
return sumPrice;
|
||||
}
|
||||
/**
|
||||
* 获取单价
|
||||
* @param presetPriceOne
|
||||
* @param priceStrategy
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getUnitPrice(BigDecimal presetPriceOne, String priceStrategy) {
|
||||
BigDecimal unitPrice = BigDecimal.ZERO;
|
||||
if(presetPriceOne != null) {
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
unitPrice = new BigDecimal(df.format(presetPriceOne));
|
||||
} else {
|
||||
JSONArray priceArr = JSONArray.parseArray(priceStrategy);
|
||||
if(priceArr!=null && priceArr.get(0)!=null) {
|
||||
JSONObject priceObj = JSONObject.parseObject(priceArr.get(0).toString());
|
||||
BigDecimal basicPresetPriceOne = priceObj.getJSONObject("basic").getBigDecimal("PresetPriceOne");
|
||||
if(basicPresetPriceOne!=null) {
|
||||
unitPrice = basicPresetPriceOne;
|
||||
}
|
||||
}
|
||||
}
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:https://qiankunpingtai.cn
|
||||
@@ -707,7 +624,6 @@ public class DepotItemController {
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param projectId
|
||||
* @param monthTime
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
@@ -753,4 +669,62 @@ public class DepotItemController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计采购或销售的总金额
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping(value = "/buyOrSalePrice")
|
||||
public BaseResponseInfo buyOrSalePrice(HttpServletRequest request, HttpServletResponse response)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
Date date = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
||||
String dateString = formatter.format(date);
|
||||
List<String> list = Tools.getSixMonth(dateString);
|
||||
map.put("monthList", list);
|
||||
List<BigDecimal> buyPriceList = new ArrayList<BigDecimal>();
|
||||
for(String month: list) {
|
||||
BigDecimal outPrice = depotItemService.inOrOutPrice("入库", "采购", month);
|
||||
BigDecimal inPrice = depotItemService.inOrOutPrice("出库", "采购退货", month);
|
||||
buyPriceList.add(outPrice.subtract(inPrice));
|
||||
}
|
||||
map.put("buyPriceList", buyPriceList);
|
||||
List<BigDecimal> salePriceList = new ArrayList<BigDecimal>();
|
||||
for(String month: list) {
|
||||
BigDecimal outPrice = depotItemService.inOrOutPrice("出库", "销售", month);
|
||||
BigDecimal inPrice = depotItemService.inOrOutPrice("入库", "销售退货", month);
|
||||
salePriceList.add(outPrice.subtract(inPrice));
|
||||
}
|
||||
map.put("salePriceList", salePriceList);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "统计失败";
|
||||
res.code = 500;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* 获取单位
|
||||
* @param materialUnit
|
||||
* @param uName
|
||||
* @return
|
||||
*/
|
||||
public String getUName(String materialUnit, String uName) {
|
||||
String unitName = null;
|
||||
if(!StringUtil.isEmpty(materialUnit)) {
|
||||
unitName = materialUnit;
|
||||
} else if(!StringUtil.isEmpty(uName)) {
|
||||
unitName = uName.substring(0,uName.indexOf(","));
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,338 +1,330 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Functions;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.functions.FunctionsService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ji-sheng-hua 华夏ERP
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/functions")
|
||||
public class FunctionsController {
|
||||
private Logger logger = LoggerFactory.getLogger(FunctionsController.class);
|
||||
|
||||
@Value("${mybatis-plus.status}")
|
||||
private String mybatisPlusStatus;
|
||||
|
||||
@Resource
|
||||
private FunctionsService functionsService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
@PostMapping(value = "/findMenu")
|
||||
public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber,
|
||||
@RequestParam(value="hasFunctions") String hasFunctions,
|
||||
HttpServletRequest request)throws Exception {
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
try {
|
||||
String fc = hasFunctions; //当前用户所拥有的功能列表,格式如:[1][2][5]
|
||||
List<Functions> dataList = functionsService.getRoleFunctions(pNumber);
|
||||
if (null != dataList) {
|
||||
for (Functions functions : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", functions.getId());
|
||||
List<Functions> dataList1 = functionsService.getRoleFunctions(functions.getNumber());
|
||||
JSONArray dataArray1 = new JSONArray();
|
||||
if (dataList1.size() != 0) {
|
||||
item.put("text", functions.getName()); //是目录就没链接
|
||||
for (Functions functions1 : dataList1) {
|
||||
item.put("state", "open"); //如果不为空,节点展开
|
||||
JSONObject item1 = new JSONObject();
|
||||
List<Functions> dataList2 = functionsService.getRoleFunctions(functions1.getNumber());
|
||||
if (fc.indexOf("[" + functions1.getId().toString() + "]") != -1 || dataList2.size() != 0) {
|
||||
item1.put("id", functions1.getId());
|
||||
JSONArray dataArray2 = new JSONArray();
|
||||
if (dataList2.size() != 0) {
|
||||
item1.put("text", functions1.getName());//是目录就没链接
|
||||
for (Functions functions2 : dataList2) {
|
||||
item1.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item2 = new JSONObject();
|
||||
List<Functions> dataList3 = functionsService.getRoleFunctions(functions2.getNumber());
|
||||
if (fc.indexOf("[" + functions2.getId().toString() + "]") != -1 || dataList3.size() != 0) {
|
||||
item2.put("id", functions2.getId());
|
||||
JSONArray dataArray3 = new JSONArray();
|
||||
if (dataList3.size() != 0) {
|
||||
item2.put("text", functions2.getName());//是目录就没链接
|
||||
for (Functions functions3 : dataList3) {
|
||||
item2.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item3 = new JSONObject();
|
||||
item3.put("id", functions3.getId());
|
||||
item3.put("text", functions3.getName());
|
||||
//
|
||||
dataArray3.add(item3);
|
||||
item2.put("children", dataArray3);
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
item2.put("text", "<a onclick=\"NewTab('" + functions2.getName() + "','" + functions2.getUrl() + "','" + functions2.getId() + "')\">" + functions2.getName() + "</a>");
|
||||
dataArray2.add(item2);
|
||||
item1.put("children", dataArray2);
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
//item2.put("text", "<a onclick=\"NewTab('" + functions2.getName() + "','" + functions2.getUrl() + "','" + functions2.getId() + "')\">" + functions2.getName() + "</a>");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
item1.put("text", "<a onclick=\"NewTab('" + functions1.getName() + "','" + functions1.getUrl() + "','" + functions1.getId() + "')\">" + functions1.getName() + "</a>");
|
||||
dataArray1.add(item1);
|
||||
item.put("children", dataArray1);
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
//item1.put("text", "<a onclick=\"NewTab('" + functions1.getName() + "','" + functions1.getUrl() + "','" + functions1.getId() + "')\">" + functions1.getName() + "</a>");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
item.put("text", "<a onclick=\"NewTab('" + functions.getName() + "','" + functions.getUrl() + "','" + functions.getId() + "')\">" + functions.getName() + "</a>");
|
||||
}
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色对应功能显示
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findRoleFunctions")
|
||||
public JSONArray findRoleFunctions(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request)throws Exception {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Functions> dataListFun = functionsService.findRoleFunctions("0");
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "功能列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataListFun) {
|
||||
//根据条件从列表里面移除"系统管理"
|
||||
List<Functions> dataList = new ArrayList<Functions>();
|
||||
for (Functions fun : dataListFun) {
|
||||
if(("open").equals(mybatisPlusStatus)){
|
||||
//从session中获取租户id
|
||||
String loginName = null;
|
||||
Object userInfo = request.getSession().getAttribute("user");
|
||||
if(userInfo != null) {
|
||||
User user = (User) userInfo;
|
||||
loginName = user.getLoginame();
|
||||
}
|
||||
if(("admin").equals(loginName)) {
|
||||
dataList.add(fun);
|
||||
} else {
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* create time: 2019/4/28 11:24
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 为什么要移除系统管理?
|
||||
* 我觉得应该允许多级管理的存在
|
||||
*/
|
||||
// if(!("系统管理").equals(fun.getName())) {
|
||||
// dataList.add(fun);
|
||||
// }
|
||||
dataList.add(fun);
|
||||
}
|
||||
} else {
|
||||
dataList.add(fun);
|
||||
}
|
||||
}
|
||||
|
||||
//筛选功能列表
|
||||
for (Functions functions : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", functions.getId());
|
||||
item.put("text", functions.getName());
|
||||
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
List<Functions> dataList1 = functionsService.findRoleFunctions(functions.getNumber());
|
||||
JSONArray dataArray1 = new JSONArray();
|
||||
if (null != dataList1) {
|
||||
|
||||
for (Functions functions1 : dataList1) {
|
||||
item.put("state", "open"); //如果不为空,节点不展开
|
||||
JSONObject item1 = new JSONObject();
|
||||
item1.put("id", functions1.getId());
|
||||
item1.put("text", functions1.getName());
|
||||
|
||||
//勾选判断2
|
||||
//Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions1.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item1.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
List<Functions> dataList2 = functionsService.findRoleFunctions(functions1.getNumber());
|
||||
JSONArray dataArray2 = new JSONArray();
|
||||
if (null != dataList2) {
|
||||
|
||||
for (Functions functions2 : dataList2) {
|
||||
item1.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item2 = new JSONObject();
|
||||
item2.put("id", functions2.getId());
|
||||
item2.put("text", functions2.getName());
|
||||
|
||||
//勾选判断3
|
||||
//Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions2.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item2.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
List<Functions> dataList3 = functionsService.findRoleFunctions(functions2.getNumber());
|
||||
JSONArray dataArray3 = new JSONArray();
|
||||
if (null != dataList3) {
|
||||
|
||||
for (Functions functions3 : dataList3) {
|
||||
item2.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item3 = new JSONObject();
|
||||
item3.put("id", functions3.getId());
|
||||
item3.put("text", functions3.getName());
|
||||
|
||||
//勾选判断4
|
||||
//Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions3.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item3.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
dataArray3.add(item3);
|
||||
item2.put("children", dataArray3);
|
||||
}
|
||||
}
|
||||
|
||||
dataArray2.add(item2);
|
||||
item1.put("children", dataArray2);
|
||||
}
|
||||
}
|
||||
|
||||
dataArray1.add(item1);
|
||||
item.put("children", dataArray1);
|
||||
}
|
||||
|
||||
}
|
||||
dataArray.add(item);
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id列表查找功能信息
|
||||
* @param functionsIds
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findByIds")
|
||||
public BaseResponseInfo findByIds(@RequestParam("functionsIds") String functionsIds,
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<Functions> dataList = functionsService.findByIds(functionsIds);
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", dataList.size());
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Functions functions : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("Id", functions.getId());
|
||||
item.put("Name", functions.getName());
|
||||
item.put("PushBtn", functions.getPushbtn());
|
||||
item.put("op", 1);
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("rows", dataArray);
|
||||
res.code = 200;
|
||||
res.data = outer;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:https://qiankunpingtai.cn
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Functions;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.functions.FunctionsService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ji-sheng-hua 华夏ERP
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/functions")
|
||||
public class FunctionsController {
|
||||
private Logger logger = LoggerFactory.getLogger(FunctionsController.class);
|
||||
|
||||
@Resource
|
||||
private FunctionsService functionsService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
@PostMapping(value = "/findMenu")
|
||||
public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber,
|
||||
@RequestParam(value="hasFunctions") String hasFunctions,
|
||||
HttpServletRequest request)throws Exception {
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
try {
|
||||
String fc = hasFunctions; //当前用户所拥有的功能列表,格式如:[1][2][5]
|
||||
List<Functions> dataList = functionsService.getRoleFunctions(pNumber);
|
||||
if (null != dataList) {
|
||||
for (Functions functions : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", functions.getId());
|
||||
List<Functions> dataList1 = functionsService.getRoleFunctions(functions.getNumber());
|
||||
JSONArray dataArray1 = new JSONArray();
|
||||
if (dataList1.size() != 0) {
|
||||
item.put("text", functions.getName()); //是目录就没链接
|
||||
item.put("icon", functions.getIcon());
|
||||
for (Functions functions1 : dataList1) {
|
||||
item.put("state", "open"); //如果不为空,节点展开
|
||||
JSONObject item1 = new JSONObject();
|
||||
List<Functions> dataList2 = functionsService.getRoleFunctions(functions1.getNumber());
|
||||
if (fc.indexOf("[" + functions1.getId().toString() + "]") != -1 || dataList2.size() != 0) {
|
||||
item1.put("id", functions1.getId());
|
||||
JSONArray dataArray2 = new JSONArray();
|
||||
if (dataList2.size() != 0) {
|
||||
item1.put("text", functions1.getName());//是目录就没链接
|
||||
item1.put("icon", functions1.getIcon());
|
||||
for (Functions functions2 : dataList2) {
|
||||
item1.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item2 = new JSONObject();
|
||||
List<Functions> dataList3 = functionsService.getRoleFunctions(functions2.getNumber());
|
||||
if (fc.indexOf("[" + functions2.getId().toString() + "]") != -1 || dataList3.size() != 0) {
|
||||
item2.put("id", functions2.getId());
|
||||
JSONArray dataArray3 = new JSONArray();
|
||||
if (dataList3.size() != 0) {
|
||||
item2.put("text", functions2.getName());//是目录就没链接
|
||||
item2.put("icon", functions2.getIcon());
|
||||
for (Functions functions3 : dataList3) {
|
||||
item2.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item3 = new JSONObject();
|
||||
item3.put("id", functions3.getId());
|
||||
item3.put("text", functions3.getName());
|
||||
item3.put("icon", functions3.getIcon());
|
||||
//
|
||||
dataArray3.add(item3);
|
||||
item2.put("children", dataArray3);
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
item2.put("text", functions2.getName());
|
||||
item2.put("icon", functions2.getIcon());
|
||||
item2.put("url", functions2.getUrl());
|
||||
dataArray2.add(item2);
|
||||
item1.put("children", dataArray2);
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
item1.put("text", functions1.getName());
|
||||
item1.put("icon", functions1.getIcon());
|
||||
item1.put("url", functions1.getUrl());
|
||||
dataArray1.add(item1);
|
||||
item.put("children", dataArray1);
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//不是目录,有链接
|
||||
item.put("text", functions.getName());
|
||||
item.put("icon", functions.getIcon());
|
||||
item.put("url", functions.getUrl());
|
||||
}
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色对应功能显示
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findRoleFunctions")
|
||||
public JSONArray findRoleFunctions(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request)throws Exception {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Functions> dataListFun = functionsService.findRoleFunctions("0");
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "功能列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataListFun) {
|
||||
//根据条件从列表里面移除"系统管理"
|
||||
List<Functions> dataList = new ArrayList<Functions>();
|
||||
for (Functions fun : dataListFun) {
|
||||
//从session中获取租户id
|
||||
String loginName = null;
|
||||
Object userInfo = request.getSession().getAttribute("user");
|
||||
if(userInfo != null) {
|
||||
User user = (User) userInfo;
|
||||
loginName = user.getLoginame();
|
||||
}
|
||||
if(("admin").equals(loginName)) {
|
||||
dataList.add(fun);
|
||||
} else {
|
||||
if(!("系统管理").equals(fun.getName())) {
|
||||
dataList.add(fun);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//筛选功能列表
|
||||
for (Functions functions : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", functions.getId());
|
||||
item.put("text", functions.getName());
|
||||
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
List<Functions> dataList1 = functionsService.findRoleFunctions(functions.getNumber());
|
||||
JSONArray dataArray1 = new JSONArray();
|
||||
if (null != dataList1) {
|
||||
|
||||
for (Functions functions1 : dataList1) {
|
||||
item.put("state", "open"); //如果不为空,节点不展开
|
||||
JSONObject item1 = new JSONObject();
|
||||
item1.put("id", functions1.getId());
|
||||
item1.put("text", functions1.getName());
|
||||
|
||||
//勾选判断2
|
||||
//Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions1.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item1.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
List<Functions> dataList2 = functionsService.findRoleFunctions(functions1.getNumber());
|
||||
JSONArray dataArray2 = new JSONArray();
|
||||
if (null != dataList2) {
|
||||
|
||||
for (Functions functions2 : dataList2) {
|
||||
item1.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item2 = new JSONObject();
|
||||
item2.put("id", functions2.getId());
|
||||
item2.put("text", functions2.getName());
|
||||
|
||||
//勾选判断3
|
||||
//Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions2.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item2.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
List<Functions> dataList3 = functionsService.findRoleFunctions(functions2.getNumber());
|
||||
JSONArray dataArray3 = new JSONArray();
|
||||
if (null != dataList3) {
|
||||
|
||||
for (Functions functions3 : dataList3) {
|
||||
item2.put("state", "closed"); //如果不为空,节点不展开
|
||||
JSONObject item3 = new JSONObject();
|
||||
item3.put("id", functions3.getId());
|
||||
item3.put("text", functions3.getName());
|
||||
|
||||
//勾选判断4
|
||||
//Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + functions3.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item3.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
|
||||
dataArray3.add(item3);
|
||||
item2.put("children", dataArray3);
|
||||
}
|
||||
}
|
||||
|
||||
dataArray2.add(item2);
|
||||
item1.put("children", dataArray2);
|
||||
}
|
||||
}
|
||||
|
||||
dataArray1.add(item1);
|
||||
item.put("children", dataArray1);
|
||||
}
|
||||
|
||||
}
|
||||
dataArray.add(item);
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id列表查找功能信息
|
||||
* @param functionsIds
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findByIds")
|
||||
public BaseResponseInfo findByIds(@RequestParam("functionsIds") String functionsIds,
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<Functions> dataList = functionsService.findByIds(functionsIds);
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", dataList.size());
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Functions functions : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("Id", functions.getId());
|
||||
item.put("Name", functions.getName());
|
||||
item.put("PushBtn", functions.getPushbtn());
|
||||
item.put("op", 1);
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("rows", dataArray);
|
||||
res.code = 200;
|
||||
res.data = outer;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:https://qiankunpingtai.cn
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,12 +201,10 @@ public class MaterialController {
|
||||
public void exportExcel(@RequestParam("name") String name,
|
||||
@RequestParam("model") String model,
|
||||
@RequestParam("categoryIds") String categoryIds,
|
||||
HttpServletRequest request, HttpServletResponse response)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
List<MaterialVo4Unit> dataList = materialService.findByAll(name, model, categoryIds);
|
||||
List<MaterialVo4Unit> dataList = materialService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
|
||||
StringUtil.toNull(categoryIds));
|
||||
String[] names = {"品名", "类型", "型号", "安全存量", "单位", "零售价", "最低售价", "预计采购价", "批发价", "备注", "状态"};
|
||||
String title = "商品信息";
|
||||
List<String[]> objects = new ArrayList<String[]>();
|
||||
@@ -229,14 +227,8 @@ public class MaterialController {
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName(), response);
|
||||
res.code = 200;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导出失败";
|
||||
res.code = 500;
|
||||
} finally {
|
||||
map.put("message", message);
|
||||
res.data = map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +257,6 @@ public class MaterialController {
|
||||
info.code = 400;
|
||||
info.data = data;
|
||||
}
|
||||
//读取所有的摄像机编码
|
||||
//每行中数据顺序 "品名","类型","型号","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"
|
||||
List<Material> mList = new ArrayList<Material>();
|
||||
for (int i = 1; i < src.getRows(); i++) {
|
||||
|
||||
57
src/main/java/com/jsh/erp/controller/MsgController.java
Normal file
57
src/main/java/com/jsh/erp/controller/MsgController.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Msg;
|
||||
import com.jsh.erp.service.msg.MsgService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ji sheng hua 华夏ERP
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/msg")
|
||||
public class MsgController {
|
||||
private Logger logger = LoggerFactory.getLogger(MsgController.class);
|
||||
|
||||
@Resource
|
||||
private MsgService msgService;
|
||||
|
||||
@GetMapping("/getMsgByStatus")
|
||||
public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status,
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<Msg> list = msgService.getMsgByStatus(status);
|
||||
res.code = 200;
|
||||
res.data = list;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@PostMapping("/batchUpdateStatus")
|
||||
public BaseResponseInfo batchUpdateStatus(@RequestParam("ids") String ids,
|
||||
@RequestParam("status") String status,
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
msgService.batchUpdateStatus(ids, status);
|
||||
res.code = 200;
|
||||
res.data = "更新成功";
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -50,13 +50,6 @@ public class RoleController {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Role> dataList = roleService.findUserRole();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "角色列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Role role : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
@@ -72,12 +65,9 @@ public class RoleController {
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.supplier.SupplierService;
|
||||
import com.jsh.erp.service.systemConfig.SystemConfigService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.*;
|
||||
@@ -44,6 +45,10 @@ public class SupplierController {
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
@Resource
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@@ -81,6 +86,7 @@ public class SupplierController {
|
||||
List<Supplier> supplierList = supplierService.findBySelectCus();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
boolean customerFlag = systemConfigService.getCustomerFlag();
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
//勾选判断1
|
||||
@@ -90,7 +96,7 @@ public class SupplierController {
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的客户:存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
if (!customerFlag || flag) {
|
||||
item.put("id", supplier.getId());
|
||||
item.put("supplier", supplier.getSupplier()); //客户名称
|
||||
dataArray.add(item);
|
||||
@@ -297,10 +303,7 @@ public class SupplierController {
|
||||
@RequestParam("phonenum") String phonenum,
|
||||
@RequestParam("telephone") String telephone,
|
||||
@RequestParam("description") String description,
|
||||
HttpServletRequest request, HttpServletResponse response)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
List<Supplier> dataList = supplierService.findByAll(supplier, type, phonenum, telephone, description);
|
||||
String[] names = {"名称", "类型", "联系人", "电话", "电子邮箱", "预收款", "期初应收", "期初应付", "备注", "传真", "手机", "地址", "纳税人识别号", "开户行", "账号", "税率", "状态"};
|
||||
@@ -331,14 +334,8 @@ public class SupplierController {
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName(), response);
|
||||
res.code = 200;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导出失败";
|
||||
res.code = 500;
|
||||
} finally {
|
||||
map.put("message", message);
|
||||
res.data = map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +397,6 @@ public class SupplierController {
|
||||
info.code = 400;
|
||||
info.data = data;
|
||||
}
|
||||
//读取所有的摄像机编码
|
||||
//每行中数据顺序 "名称","类型","联系人","电话","电子邮箱","预收款","期初应收","期初应付","备注","传真","手机","地址","纳税人识别号","开户行","账号","税率","状态"
|
||||
List<Supplier> sList = new ArrayList<Supplier>();
|
||||
for (int i = 1; i < src.getRows(); i++) {
|
||||
|
||||
@@ -7,16 +7,21 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Tenant;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.entities.UserEx;
|
||||
import com.jsh.erp.datasource.vo.TreeNodeEx;
|
||||
import com.jsh.erp.exception.BusinessParamCheckingException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.tenant.TenantService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -37,21 +42,18 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
public class UserController {
|
||||
private Logger logger = LoggerFactory.getLogger(UserController.class);
|
||||
|
||||
@Value("${mybatis-plus.status}")
|
||||
private String mybatisPlusStatus;
|
||||
|
||||
@Value("${manage.ip}")
|
||||
private String manageIp;
|
||||
|
||||
@Value("${manage.port}")
|
||||
private Integer managePort;
|
||||
|
||||
@Value("${manage.roleId}")
|
||||
private Long manageRoleId;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Resource
|
||||
private TenantService tenantService;
|
||||
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
private static String message = "成功";
|
||||
private static final String HTTP = "http://";
|
||||
private static final String CODE_OK = "200";
|
||||
@@ -82,6 +84,7 @@ public class UserController {
|
||||
try {
|
||||
userStatus = userService.validateUser(username, password);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(">>>>>>>>>>>>>用户 " + username + " 登录 login 方法 访问服务层异常====", e);
|
||||
msgTip = "access service exception";
|
||||
}
|
||||
@@ -106,39 +109,24 @@ public class UserController {
|
||||
// new Timestamp(System.currentTimeMillis()), (short) 0, "管理用户:" + username + " 登录系统", username + " 登录系统"));
|
||||
msgTip = "user can login";
|
||||
request.getSession().setAttribute("user",user);
|
||||
if(("open").equals(mybatisPlusStatus)) {
|
||||
String tenantId = null;
|
||||
String userNumLimit = null;
|
||||
String billsNumLimit = null;
|
||||
if(user.getTenantId()==null){
|
||||
msgTip="用户数据错误,请联系管理员!";
|
||||
break;
|
||||
}
|
||||
JSONObject obj=null;
|
||||
if(user.getTenantId()!=-1){
|
||||
String url = HTTP + manageIp + ":" + managePort + "/tenant/getTenant?tenantId=" + user.getTenantId();
|
||||
obj = HttpClient.httpGet(url);
|
||||
if(obj!=null && obj.getString("code").equals(CODE_OK)) {
|
||||
JSONObject dataObj = obj.getJSONObject("data");
|
||||
if(dataObj!=null) {
|
||||
tenantId = dataObj.getString("tenantId");
|
||||
userNumLimit = dataObj.getString("userNumLimit");
|
||||
billsNumLimit = dataObj.getString("billsNumLimit");
|
||||
}
|
||||
if(user.getTenantId()!=null) {
|
||||
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
|
||||
if(tenant!=null) {
|
||||
Long tenantId = tenant.getTenantId();
|
||||
Integer userNumLimit = tenant.getUserNumLimit();
|
||||
Integer billsNumLimit = tenant.getBillsNumLimit();
|
||||
if(tenantId!=null) {
|
||||
request.getSession().setAttribute("tenantId",tenantId); //租户tenantId
|
||||
request.getSession().setAttribute("userNumLimit",userNumLimit); //用户限制数
|
||||
request.getSession().setAttribute("billsNumLimit",billsNumLimit); //单据限制数
|
||||
}
|
||||
}else{
|
||||
tenantId=user.getTenantId().toString();
|
||||
userNumLimit=BusinessConstants.TEST_USER_NUM_LIMIT;
|
||||
billsNumLimit=BusinessConstants.TEST_BILLS_NUM_LIMIT;
|
||||
}
|
||||
if(tenantId!=null) {
|
||||
request.getSession().setAttribute("tenantId",tenantId); //租户tenantId
|
||||
request.getSession().setAttribute("userNumLimit",userNumLimit); //用户限制数
|
||||
request.getSession().setAttribute("billsNumLimit",billsNumLimit); //单据限制数
|
||||
}
|
||||
}
|
||||
request.getSession().setAttribute("mybatisPlusStatus",mybatisPlusStatus); //开启状态
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getId()).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(">>>>>>>>>>>>>>>查询用户名为:" + username + " ,用户信息异常", e);
|
||||
}
|
||||
break;
|
||||
@@ -157,6 +145,7 @@ public class UserController {
|
||||
logger.info("===============用户登录 login 方法调用结束===============");
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
res.code = 500;
|
||||
res.data = "用户登录失败";
|
||||
}
|
||||
@@ -189,12 +178,9 @@ public class UserController {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
request.getSession().removeAttribute("user");
|
||||
request.getSession().removeAttribute("mybatisPlusStatus");
|
||||
if(("open").equals(mybatisPlusStatus)) {
|
||||
request.getSession().removeAttribute("tenantId");
|
||||
request.getSession().removeAttribute("userNumLimit");
|
||||
request.getSession().removeAttribute("billsNumLimit");
|
||||
}
|
||||
request.getSession().removeAttribute("tenantId");
|
||||
request.getSession().removeAttribute("userNumLimit");
|
||||
request.getSession().removeAttribute("billsNumLimit");
|
||||
response.sendRedirect("/login.html");
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
@@ -330,16 +316,11 @@ public class UserController {
|
||||
@ResponseBody
|
||||
public Object addUser(@RequestParam("info") String beanJson, HttpServletRequest request)throws Exception{
|
||||
JSONObject result = ExceptionConstants.standardSuccess();
|
||||
if(("open").equals(mybatisPlusStatus)) {
|
||||
Long userNumLimit = Long.parseLong(request.getSession().getAttribute("userNumLimit").toString());
|
||||
Long count = userService.countUser(null,null);
|
||||
if(count>= userNumLimit) {
|
||||
throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE,
|
||||
ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG);
|
||||
} else {
|
||||
UserEx ue= JSON.parseObject(beanJson, UserEx.class);
|
||||
userService.addUserAndOrgUserRel(ue);
|
||||
}
|
||||
Long userNumLimit = Long.parseLong(request.getSession().getAttribute("userNumLimit").toString());
|
||||
Long count = userService.countUser(null,null);
|
||||
if(count>= userNumLimit) {
|
||||
throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE,
|
||||
ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG);
|
||||
} else {
|
||||
UserEx ue= JSON.parseObject(beanJson, UserEx.class);
|
||||
userService.addUserAndOrgUserRel(ue);
|
||||
@@ -365,32 +346,6 @@ public class UserController {
|
||||
ue.setLoginame(loginame);
|
||||
ue.setPassword(password);
|
||||
ue = userService.registerUser(ue,manageRoleId);
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* create time: 2019/4/9 17:17
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 这里涉及到多个项目,需要用分布式事务去处理
|
||||
* 为了不使问题复杂化,暂时另外开启一个线程去处理其它项目的数据操作
|
||||
*/
|
||||
final UserEx ueFinal=ue;
|
||||
final ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
executorService.execute(() -> {
|
||||
try{
|
||||
//调第三方接口创建租户管理信息
|
||||
String url = HTTP + manageIp + ":" + managePort + "/tenant/add";
|
||||
JSONObject tenantObj = new JSONObject();
|
||||
tenantObj.put("tenantId", ueFinal.getId());
|
||||
tenantObj.put("loginName",ueFinal.getLoginame());
|
||||
String param = URLEncoder.encode(tenantObj.toString());
|
||||
HttpClient.httpPost(url + "?info=" + param, param);
|
||||
logger.info("===============创建租户信息完成===============");
|
||||
}catch(Exception e){
|
||||
//记录一下第三方接口创建租户管理信息创建失败
|
||||
logger.debug("调用第三方接口创建租户管理信息失败:tenantId:[{}],loginName:[{}]",ueFinal.getId(),ueFinal.getLoginame());
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
@@ -437,20 +392,4 @@ public class UserController {
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
@GetMapping("/getTenantStatus")
|
||||
public BaseResponseInfo getTenantStatus(HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
data.put("status", mybatisPlusStatus);
|
||||
res.code = 200;
|
||||
res.data = data;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,547 +0,0 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
public class App {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Number
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String number;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Name
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Type
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Icon
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.URL
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Width
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String width;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Height
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.ReSize
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Boolean resize;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.OpenMax
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Boolean openmax;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Flash
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Boolean flash;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.ZL
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String zl;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Sort
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String sort;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Remark
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.Enabled
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.delete_Flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String deleteFlag;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_app.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Id
|
||||
*
|
||||
* @return the value of jsh_app.Id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Id
|
||||
*
|
||||
* @param id the value for jsh_app.Id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Number
|
||||
*
|
||||
* @return the value of jsh_app.Number
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Number
|
||||
*
|
||||
* @param number the value for jsh_app.Number
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setNumber(String number) {
|
||||
this.number = number == null ? null : number.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Name
|
||||
*
|
||||
* @return the value of jsh_app.Name
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Name
|
||||
*
|
||||
* @param name the value for jsh_app.Name
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Type
|
||||
*
|
||||
* @return the value of jsh_app.Type
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Type
|
||||
*
|
||||
* @param type the value for jsh_app.Type
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Icon
|
||||
*
|
||||
* @return the value of jsh_app.Icon
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Icon
|
||||
*
|
||||
* @param icon the value for jsh_app.Icon
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon == null ? null : icon.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.URL
|
||||
*
|
||||
* @return the value of jsh_app.URL
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.URL
|
||||
*
|
||||
* @param url the value for jsh_app.URL
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
this.url = url == null ? null : url.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Width
|
||||
*
|
||||
* @return the value of jsh_app.Width
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Width
|
||||
*
|
||||
* @param width the value for jsh_app.Width
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setWidth(String width) {
|
||||
this.width = width == null ? null : width.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Height
|
||||
*
|
||||
* @return the value of jsh_app.Height
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Height
|
||||
*
|
||||
* @param height the value for jsh_app.Height
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setHeight(String height) {
|
||||
this.height = height == null ? null : height.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.ReSize
|
||||
*
|
||||
* @return the value of jsh_app.ReSize
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Boolean getResize() {
|
||||
return resize;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.ReSize
|
||||
*
|
||||
* @param resize the value for jsh_app.ReSize
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setResize(Boolean resize) {
|
||||
this.resize = resize;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.OpenMax
|
||||
*
|
||||
* @return the value of jsh_app.OpenMax
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Boolean getOpenmax() {
|
||||
return openmax;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.OpenMax
|
||||
*
|
||||
* @param openmax the value for jsh_app.OpenMax
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setOpenmax(Boolean openmax) {
|
||||
this.openmax = openmax;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Flash
|
||||
*
|
||||
* @return the value of jsh_app.Flash
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Boolean getFlash() {
|
||||
return flash;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Flash
|
||||
*
|
||||
* @param flash the value for jsh_app.Flash
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setFlash(Boolean flash) {
|
||||
this.flash = flash;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.ZL
|
||||
*
|
||||
* @return the value of jsh_app.ZL
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getZl() {
|
||||
return zl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.ZL
|
||||
*
|
||||
* @param zl the value for jsh_app.ZL
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setZl(String zl) {
|
||||
this.zl = zl == null ? null : zl.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Sort
|
||||
*
|
||||
* @return the value of jsh_app.Sort
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Sort
|
||||
*
|
||||
* @param sort the value for jsh_app.Sort
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort == null ? null : sort.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Remark
|
||||
*
|
||||
* @return the value of jsh_app.Remark
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Remark
|
||||
*
|
||||
* @param remark the value for jsh_app.Remark
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark == null ? null : remark.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.Enabled
|
||||
*
|
||||
* @return the value of jsh_app.Enabled
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Boolean getEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.Enabled
|
||||
*
|
||||
* @param enabled the value for jsh_app.Enabled
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.delete_Flag
|
||||
*
|
||||
* @return the value of jsh_app.delete_Flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getDeleteFlag() {
|
||||
return deleteFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.delete_Flag
|
||||
*
|
||||
* @param deleteFlag the value for jsh_app.delete_Flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setDeleteFlag(String deleteFlag) {
|
||||
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_app.tenant_id
|
||||
*
|
||||
* @return the value of jsh_app.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Long getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_app.tenant_id
|
||||
*
|
||||
* @param tenantId the value for jsh_app.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setTenantId(Long tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class DepotItemVo4WithInfoEx extends DepotItem{
|
||||
|
||||
private Long MId;
|
||||
@@ -30,6 +32,10 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
|
||||
|
||||
private String UName;
|
||||
|
||||
private BigDecimal presetPriceOne;
|
||||
|
||||
private String priceStrategy;
|
||||
|
||||
public Long getMId() {
|
||||
return MId;
|
||||
}
|
||||
@@ -141,4 +147,20 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
|
||||
public void setUName(String UName) {
|
||||
this.UName = UName;
|
||||
}
|
||||
|
||||
public BigDecimal getPresetPriceOne() {
|
||||
return presetPriceOne;
|
||||
}
|
||||
|
||||
public void setPresetPriceOne(BigDecimal presetPriceOne) {
|
||||
this.presetPriceOne = presetPriceOne;
|
||||
}
|
||||
|
||||
public String getPriceStrategy() {
|
||||
return priceStrategy;
|
||||
}
|
||||
|
||||
public void setPriceStrategy(String priceStrategy) {
|
||||
this.priceStrategy = priceStrategy;
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,14 @@ public class Functions {
|
||||
*/
|
||||
private String pushbtn;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_functions.icon
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_functions.delete_Flag
|
||||
@@ -337,6 +345,30 @@ public class Functions {
|
||||
this.pushbtn = pushbtn == null ? null : pushbtn.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_functions.icon
|
||||
*
|
||||
* @return the value of jsh_functions.icon
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_functions.icon
|
||||
*
|
||||
* @param icon the value for jsh_functions.icon
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon == null ? null : icon.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_functions.delete_Flag
|
||||
|
||||
@@ -864,6 +864,76 @@ public class FunctionsExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconIsNull() {
|
||||
addCriterion("icon is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconIsNotNull() {
|
||||
addCriterion("icon is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconEqualTo(String value) {
|
||||
addCriterion("icon =", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconNotEqualTo(String value) {
|
||||
addCriterion("icon <>", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconGreaterThan(String value) {
|
||||
addCriterion("icon >", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("icon >=", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconLessThan(String value) {
|
||||
addCriterion("icon <", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconLessThanOrEqualTo(String value) {
|
||||
addCriterion("icon <=", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconLike(String value) {
|
||||
addCriterion("icon like", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconNotLike(String value) {
|
||||
addCriterion("icon not like", value, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconIn(List<String> values) {
|
||||
addCriterion("icon in", values, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconNotIn(List<String> values) {
|
||||
addCriterion("icon not in", values, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconBetween(String value1, String value2) {
|
||||
addCriterion("icon between", value1, value2, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIconNotBetween(String value1, String value2) {
|
||||
addCriterion("icon not between", value1, value2, "icon");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagIsNull() {
|
||||
addCriterion("delete_Flag is null");
|
||||
return (Criteria) this;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class MaterialVo4Unit extends Material{
|
||||
|
||||
private String materialOther;
|
||||
|
||||
private Long stock;
|
||||
private BigDecimal stock;
|
||||
|
||||
public String getUnitName() {
|
||||
return unitName;
|
||||
@@ -36,11 +36,11 @@ public class MaterialVo4Unit extends Material{
|
||||
this.materialOther = materialOther;
|
||||
}
|
||||
|
||||
public Long getStock() {
|
||||
public BigDecimal getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
public void setStock(Long stock) {
|
||||
public void setStock(BigDecimal stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
}
|
||||
261
src/main/java/com/jsh/erp/datasource/entities/Msg.java
Normal file
261
src/main/java/com/jsh/erp/datasource/entities/Msg.java
Normal file
@@ -0,0 +1,261 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Msg {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.msg_title
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String msgTitle;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.msg_content
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String msgContent;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.create_time
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.type
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.status
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_msg.delete_Flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String deleteFlag;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.id
|
||||
*
|
||||
* @return the value of jsh_msg.id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.id
|
||||
*
|
||||
* @param id the value for jsh_msg.id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.msg_title
|
||||
*
|
||||
* @return the value of jsh_msg.msg_title
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getMsgTitle() {
|
||||
return msgTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.msg_title
|
||||
*
|
||||
* @param msgTitle the value for jsh_msg.msg_title
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setMsgTitle(String msgTitle) {
|
||||
this.msgTitle = msgTitle == null ? null : msgTitle.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.msg_content
|
||||
*
|
||||
* @return the value of jsh_msg.msg_content
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getMsgContent() {
|
||||
return msgContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.msg_content
|
||||
*
|
||||
* @param msgContent the value for jsh_msg.msg_content
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setMsgContent(String msgContent) {
|
||||
this.msgContent = msgContent == null ? null : msgContent.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.create_time
|
||||
*
|
||||
* @return the value of jsh_msg.create_time
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.create_time
|
||||
*
|
||||
* @param createTime the value for jsh_msg.create_time
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.type
|
||||
*
|
||||
* @return the value of jsh_msg.type
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.type
|
||||
*
|
||||
* @param type the value for jsh_msg.type
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.status
|
||||
*
|
||||
* @return the value of jsh_msg.status
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.status
|
||||
*
|
||||
* @param status the value for jsh_msg.status
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.tenant_id
|
||||
*
|
||||
* @return the value of jsh_msg.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Long getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.tenant_id
|
||||
*
|
||||
* @param tenantId the value for jsh_msg.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setTenantId(Long tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_msg.delete_Flag
|
||||
*
|
||||
* @return the value of jsh_msg.delete_Flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getDeleteFlag() {
|
||||
return deleteFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_msg.delete_Flag
|
||||
*
|
||||
* @param deleteFlag the value for jsh_msg.delete_Flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setDeleteFlag(String deleteFlag) {
|
||||
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
|
||||
}
|
||||
}
|
||||
833
src/main/java/com/jsh/erp/datasource/entities/MsgExample.java
Normal file
833
src/main/java/com/jsh/erp/datasource/entities/MsgExample.java
Normal file
@@ -0,0 +1,833 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class MsgExample {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public MsgExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleIsNull() {
|
||||
addCriterion("msg_title is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleIsNotNull() {
|
||||
addCriterion("msg_title is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleEqualTo(String value) {
|
||||
addCriterion("msg_title =", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleNotEqualTo(String value) {
|
||||
addCriterion("msg_title <>", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleGreaterThan(String value) {
|
||||
addCriterion("msg_title >", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("msg_title >=", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleLessThan(String value) {
|
||||
addCriterion("msg_title <", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleLessThanOrEqualTo(String value) {
|
||||
addCriterion("msg_title <=", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleLike(String value) {
|
||||
addCriterion("msg_title like", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleNotLike(String value) {
|
||||
addCriterion("msg_title not like", value, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleIn(List<String> values) {
|
||||
addCriterion("msg_title in", values, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleNotIn(List<String> values) {
|
||||
addCriterion("msg_title not in", values, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleBetween(String value1, String value2) {
|
||||
addCriterion("msg_title between", value1, value2, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgTitleNotBetween(String value1, String value2) {
|
||||
addCriterion("msg_title not between", value1, value2, "msgTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentIsNull() {
|
||||
addCriterion("msg_content is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentIsNotNull() {
|
||||
addCriterion("msg_content is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentEqualTo(String value) {
|
||||
addCriterion("msg_content =", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentNotEqualTo(String value) {
|
||||
addCriterion("msg_content <>", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentGreaterThan(String value) {
|
||||
addCriterion("msg_content >", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("msg_content >=", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentLessThan(String value) {
|
||||
addCriterion("msg_content <", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentLessThanOrEqualTo(String value) {
|
||||
addCriterion("msg_content <=", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentLike(String value) {
|
||||
addCriterion("msg_content like", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentNotLike(String value) {
|
||||
addCriterion("msg_content not like", value, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentIn(List<String> values) {
|
||||
addCriterion("msg_content in", values, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentNotIn(List<String> values) {
|
||||
addCriterion("msg_content not in", values, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentBetween(String value1, String value2) {
|
||||
addCriterion("msg_content between", value1, value2, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgContentNotBetween(String value1, String value2) {
|
||||
addCriterion("msg_content not between", value1, value2, "msgContent");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNull() {
|
||||
addCriterion("type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNotNull() {
|
||||
addCriterion("type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeEqualTo(String value) {
|
||||
addCriterion("type =", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotEqualTo(String value) {
|
||||
addCriterion("type <>", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThan(String value) {
|
||||
addCriterion("type >", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("type >=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThan(String value) {
|
||||
addCriterion("type <", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("type <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLike(String value) {
|
||||
addCriterion("type like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotLike(String value) {
|
||||
addCriterion("type not like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIn(List<String> values) {
|
||||
addCriterion("type in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> values) {
|
||||
addCriterion("type not in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeBetween(String value1, String value2) {
|
||||
addCriterion("type between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("type not between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("status is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("status is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("status =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("status <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("status >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("status >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("status <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("status <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("status like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("status not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("status in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("status not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("status between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("status not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIsNull() {
|
||||
addCriterion("tenant_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIsNotNull() {
|
||||
addCriterion("tenant_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdEqualTo(Long value) {
|
||||
addCriterion("tenant_id =", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdNotEqualTo(Long value) {
|
||||
addCriterion("tenant_id <>", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdGreaterThan(Long value) {
|
||||
addCriterion("tenant_id >", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("tenant_id >=", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdLessThan(Long value) {
|
||||
addCriterion("tenant_id <", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("tenant_id <=", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIn(List<Long> values) {
|
||||
addCriterion("tenant_id in", values, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdNotIn(List<Long> values) {
|
||||
addCriterion("tenant_id not in", values, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdBetween(Long value1, Long value2) {
|
||||
addCriterion("tenant_id between", value1, value2, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("tenant_id not between", value1, value2, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagIsNull() {
|
||||
addCriterion("delete_Flag is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagIsNotNull() {
|
||||
addCriterion("delete_Flag is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagEqualTo(String value) {
|
||||
addCriterion("delete_Flag =", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagNotEqualTo(String value) {
|
||||
addCriterion("delete_Flag <>", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagGreaterThan(String value) {
|
||||
addCriterion("delete_Flag >", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("delete_Flag >=", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagLessThan(String value) {
|
||||
addCriterion("delete_Flag <", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagLessThanOrEqualTo(String value) {
|
||||
addCriterion("delete_Flag <=", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagLike(String value) {
|
||||
addCriterion("delete_Flag like", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagNotLike(String value) {
|
||||
addCriterion("delete_Flag not like", value, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagIn(List<String> values) {
|
||||
addCriterion("delete_Flag in", values, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagNotIn(List<String> values) {
|
||||
addCriterion("delete_Flag not in", values, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagBetween(String value1, String value2) {
|
||||
addCriterion("delete_Flag between", value1, value2, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteFlagNotBetween(String value1, String value2) {
|
||||
addCriterion("delete_Flag not between", value1, value2, "deleteFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated do_not_delete_during_merge
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,22 @@ public class SystemConfig {
|
||||
*/
|
||||
private String companyPostCode;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_systemconfig.depot_flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String depotFlag;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_systemconfig.customer_flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String customerFlag;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_systemconfig.tenant_id
|
||||
@@ -241,6 +257,54 @@ public class SystemConfig {
|
||||
this.companyPostCode = companyPostCode == null ? null : companyPostCode.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_systemconfig.depot_flag
|
||||
*
|
||||
* @return the value of jsh_systemconfig.depot_flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getDepotFlag() {
|
||||
return depotFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_systemconfig.depot_flag
|
||||
*
|
||||
* @param depotFlag the value for jsh_systemconfig.depot_flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setDepotFlag(String depotFlag) {
|
||||
this.depotFlag = depotFlag == null ? null : depotFlag.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_systemconfig.customer_flag
|
||||
*
|
||||
* @return the value of jsh_systemconfig.customer_flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getCustomerFlag() {
|
||||
return customerFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_systemconfig.customer_flag
|
||||
*
|
||||
* @param customerFlag the value for jsh_systemconfig.customer_flag
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setCustomerFlag(String customerFlag) {
|
||||
this.customerFlag = customerFlag == null ? null : customerFlag.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_systemconfig.tenant_id
|
||||
|
||||
@@ -674,6 +674,146 @@ public class SystemConfigExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagIsNull() {
|
||||
addCriterion("depot_flag is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagIsNotNull() {
|
||||
addCriterion("depot_flag is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagEqualTo(String value) {
|
||||
addCriterion("depot_flag =", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagNotEqualTo(String value) {
|
||||
addCriterion("depot_flag <>", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagGreaterThan(String value) {
|
||||
addCriterion("depot_flag >", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("depot_flag >=", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagLessThan(String value) {
|
||||
addCriterion("depot_flag <", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagLessThanOrEqualTo(String value) {
|
||||
addCriterion("depot_flag <=", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagLike(String value) {
|
||||
addCriterion("depot_flag like", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagNotLike(String value) {
|
||||
addCriterion("depot_flag not like", value, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagIn(List<String> values) {
|
||||
addCriterion("depot_flag in", values, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagNotIn(List<String> values) {
|
||||
addCriterion("depot_flag not in", values, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagBetween(String value1, String value2) {
|
||||
addCriterion("depot_flag between", value1, value2, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDepotFlagNotBetween(String value1, String value2) {
|
||||
addCriterion("depot_flag not between", value1, value2, "depotFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagIsNull() {
|
||||
addCriterion("customer_flag is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagIsNotNull() {
|
||||
addCriterion("customer_flag is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagEqualTo(String value) {
|
||||
addCriterion("customer_flag =", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagNotEqualTo(String value) {
|
||||
addCriterion("customer_flag <>", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagGreaterThan(String value) {
|
||||
addCriterion("customer_flag >", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("customer_flag >=", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagLessThan(String value) {
|
||||
addCriterion("customer_flag <", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagLessThanOrEqualTo(String value) {
|
||||
addCriterion("customer_flag <=", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagLike(String value) {
|
||||
addCriterion("customer_flag like", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagNotLike(String value) {
|
||||
addCriterion("customer_flag not like", value, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagIn(List<String> values) {
|
||||
addCriterion("customer_flag in", values, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagNotIn(List<String> values) {
|
||||
addCriterion("customer_flag not in", values, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagBetween(String value1, String value2) {
|
||||
addCriterion("customer_flag between", value1, value2, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCustomerFlagNotBetween(String value1, String value2) {
|
||||
addCriterion("customer_flag not between", value1, value2, "customerFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIsNull() {
|
||||
addCriterion("tenant_id is null");
|
||||
return (Criteria) this;
|
||||
|
||||
197
src/main/java/com/jsh/erp/datasource/entities/Tenant.java
Normal file
197
src/main/java/com/jsh/erp/datasource/entities/Tenant.java
Normal file
@@ -0,0 +1,197 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Tenant {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_tenant.id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_tenant.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_tenant.login_name
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_tenant.user_num_limit
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Integer userNumLimit;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_tenant.bills_num_limit
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Integer billsNumLimit;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column jsh_tenant.create_time
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_tenant.id
|
||||
*
|
||||
* @return the value of jsh_tenant.id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_tenant.id
|
||||
*
|
||||
* @param id the value for jsh_tenant.id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_tenant.tenant_id
|
||||
*
|
||||
* @return the value of jsh_tenant.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Long getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_tenant.tenant_id
|
||||
*
|
||||
* @param tenantId the value for jsh_tenant.tenant_id
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setTenantId(Long tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_tenant.login_name
|
||||
*
|
||||
* @return the value of jsh_tenant.login_name
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_tenant.login_name
|
||||
*
|
||||
* @param loginName the value for jsh_tenant.login_name
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName == null ? null : loginName.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_tenant.user_num_limit
|
||||
*
|
||||
* @return the value of jsh_tenant.user_num_limit
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Integer getUserNumLimit() {
|
||||
return userNumLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_tenant.user_num_limit
|
||||
*
|
||||
* @param userNumLimit the value for jsh_tenant.user_num_limit
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setUserNumLimit(Integer userNumLimit) {
|
||||
this.userNumLimit = userNumLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_tenant.bills_num_limit
|
||||
*
|
||||
* @return the value of jsh_tenant.bills_num_limit
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Integer getBillsNumLimit() {
|
||||
return billsNumLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_tenant.bills_num_limit
|
||||
*
|
||||
* @param billsNumLimit the value for jsh_tenant.bills_num_limit
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setBillsNumLimit(Integer billsNumLimit) {
|
||||
this.billsNumLimit = billsNumLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column jsh_tenant.create_time
|
||||
*
|
||||
* @return the value of jsh_tenant.create_time
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column jsh_tenant.create_time
|
||||
*
|
||||
* @param createTime the value for jsh_tenant.create_time
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
673
src/main/java/com/jsh/erp/datasource/entities/TenantExample.java
Normal file
673
src/main/java/com/jsh/erp/datasource/entities/TenantExample.java
Normal file
@@ -0,0 +1,673 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class TenantExample {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public TenantExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIsNull() {
|
||||
addCriterion("tenant_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIsNotNull() {
|
||||
addCriterion("tenant_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdEqualTo(Long value) {
|
||||
addCriterion("tenant_id =", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdNotEqualTo(Long value) {
|
||||
addCriterion("tenant_id <>", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdGreaterThan(Long value) {
|
||||
addCriterion("tenant_id >", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("tenant_id >=", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdLessThan(Long value) {
|
||||
addCriterion("tenant_id <", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("tenant_id <=", value, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIn(List<Long> values) {
|
||||
addCriterion("tenant_id in", values, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdNotIn(List<Long> values) {
|
||||
addCriterion("tenant_id not in", values, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdBetween(Long value1, Long value2) {
|
||||
addCriterion("tenant_id between", value1, value2, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("tenant_id not between", value1, value2, "tenantId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameIsNull() {
|
||||
addCriterion("login_name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameIsNotNull() {
|
||||
addCriterion("login_name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameEqualTo(String value) {
|
||||
addCriterion("login_name =", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameNotEqualTo(String value) {
|
||||
addCriterion("login_name <>", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameGreaterThan(String value) {
|
||||
addCriterion("login_name >", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("login_name >=", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameLessThan(String value) {
|
||||
addCriterion("login_name <", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("login_name <=", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameLike(String value) {
|
||||
addCriterion("login_name like", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameNotLike(String value) {
|
||||
addCriterion("login_name not like", value, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameIn(List<String> values) {
|
||||
addCriterion("login_name in", values, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameNotIn(List<String> values) {
|
||||
addCriterion("login_name not in", values, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameBetween(String value1, String value2) {
|
||||
addCriterion("login_name between", value1, value2, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLoginNameNotBetween(String value1, String value2) {
|
||||
addCriterion("login_name not between", value1, value2, "loginName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitIsNull() {
|
||||
addCriterion("user_num_limit is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitIsNotNull() {
|
||||
addCriterion("user_num_limit is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitEqualTo(Integer value) {
|
||||
addCriterion("user_num_limit =", value, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitNotEqualTo(Integer value) {
|
||||
addCriterion("user_num_limit <>", value, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitGreaterThan(Integer value) {
|
||||
addCriterion("user_num_limit >", value, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("user_num_limit >=", value, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitLessThan(Integer value) {
|
||||
addCriterion("user_num_limit <", value, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("user_num_limit <=", value, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitIn(List<Integer> values) {
|
||||
addCriterion("user_num_limit in", values, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitNotIn(List<Integer> values) {
|
||||
addCriterion("user_num_limit not in", values, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitBetween(Integer value1, Integer value2) {
|
||||
addCriterion("user_num_limit between", value1, value2, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserNumLimitNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("user_num_limit not between", value1, value2, "userNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitIsNull() {
|
||||
addCriterion("bills_num_limit is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitIsNotNull() {
|
||||
addCriterion("bills_num_limit is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitEqualTo(Integer value) {
|
||||
addCriterion("bills_num_limit =", value, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitNotEqualTo(Integer value) {
|
||||
addCriterion("bills_num_limit <>", value, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitGreaterThan(Integer value) {
|
||||
addCriterion("bills_num_limit >", value, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("bills_num_limit >=", value, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitLessThan(Integer value) {
|
||||
addCriterion("bills_num_limit <", value, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("bills_num_limit <=", value, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitIn(List<Integer> values) {
|
||||
addCriterion("bills_num_limit in", values, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitNotIn(List<Integer> values) {
|
||||
addCriterion("bills_num_limit not in", values, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitBetween(Integer value1, Integer value2) {
|
||||
addCriterion("bills_num_limit between", value1, value2, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillsNumLimitNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("bills_num_limit not between", value1, value2, "billsNumLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated do_not_delete_during_merge
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.datasource.entities.AppExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface AppMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(AppExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(AppExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(App record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(App record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<App> selectByExample(AppExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
App selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") App record, @Param("example") AppExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") App record, @Param("example") AppExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(App record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_app
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(App record);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.datasource.entities.AppExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface AppMapperEx {
|
||||
|
||||
List<App> selectByConditionApp(
|
||||
@Param("name") String name,
|
||||
@Param("type") String type,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
Long countsByApp(
|
||||
@Param("name") String name,
|
||||
@Param("type") String type);
|
||||
|
||||
int batchDeleteAppByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||
}
|
||||
@@ -110,7 +110,6 @@ public interface DepotHeadMapperEx {
|
||||
* */
|
||||
void updatedepotHead(DepotHead depotHead);
|
||||
|
||||
void updateBuildOnlyNumber();
|
||||
/**
|
||||
* 获得一个全局唯一的数作为订单号的追加
|
||||
* */
|
||||
@@ -125,4 +124,11 @@ public interface DepotHeadMapperEx {
|
||||
List<DepotHead> getDepotHeadListByHandsPersonIds(@Param("handsPersonIds") String[] handsPersonIds);
|
||||
|
||||
List<DepotHead> getDepotHeadListByDepotIds(@Param("depotIds") String[] depotIds);
|
||||
|
||||
BigDecimal getBuyAndSaleStatistics(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("hasSupplier") Integer hasSupplier,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
|
||||
import com.jsh.erp.datasource.vo.DepotItemVo4Stock;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -35,21 +36,6 @@ public interface DepotItemMapperEx {
|
||||
Long findDetailByTypeAndMaterialIdCounts(
|
||||
@Param("mId") Long mId);
|
||||
|
||||
List<DepotItemVo4Material> findStockNumByMaterialIdList(
|
||||
@Param("mId") Long mId,
|
||||
@Param("monthTime") String monthTime,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
Long findStockNumByMaterialIdCounts(
|
||||
@Param("mId") Long mId,
|
||||
@Param("monthTime") String monthTime);
|
||||
|
||||
Long findByTypeAndMaterialIdIn(
|
||||
@Param("mId") Long mId);
|
||||
|
||||
Long findByTypeAndMaterialIdOut(
|
||||
@Param("mId") Long mId);
|
||||
|
||||
int findByTypeAndDepotIdAndMaterialIdIn(
|
||||
@Param("depotId") Long depotId,
|
||||
@@ -72,62 +58,6 @@ public interface DepotItemMapperEx {
|
||||
@Param("headIds") String headIds,
|
||||
@Param("materialIds") String materialIds);
|
||||
|
||||
BigDecimal findByTypeInIsPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findByTypeInIsNotPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findByTypeOutIsPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findByTypeOutIsNotPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
|
||||
|
||||
BigDecimal findPriceByTypeInIsPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findPriceByTypeInIsNotPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findPriceByTypeOutIsPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findPriceByTypeOutIsNotPrev(
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findAssembleIsPrev(
|
||||
@Param("subType") String subType,
|
||||
@Param("mType") String mType,
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal findAssembleIsNotPrev(
|
||||
@Param("subType") String subType,
|
||||
@Param("mType") String mType,
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId,
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
BigDecimal buyOrSaleNumber(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@@ -142,22 +72,23 @@ public interface DepotItemMapperEx {
|
||||
@Param("MonthTime") String MonthTime,
|
||||
@Param("sumType") String sumType);
|
||||
|
||||
BigDecimal findGiftByTypeIn(
|
||||
BigDecimal inOrOutPrice(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId);
|
||||
@Param("MonthTime") String MonthTime);
|
||||
|
||||
DepotItemVo4Stock getStockByParam(
|
||||
@Param("depotId") Long depotId,
|
||||
@Param("mId") Long mId,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("tenantId") Long tenantId);
|
||||
|
||||
BigDecimal findGiftByTypeOut(
|
||||
@Param("subType") String subType,
|
||||
@Param("ProjectId") Integer ProjectId,
|
||||
@Param("MId") Long MId);
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 通过单据主表id查询所有单据子表数据
|
||||
* create time: 2019/1/24 16:56
|
||||
* @Param: depotheadId
|
||||
* @return java.util.List<com.jsh.erp.datasource.entities.DepotItem>
|
||||
* 通过单据主表id查询所有单据子表数据
|
||||
* @param depotheadId
|
||||
* @param enableSerialNumber
|
||||
* @return
|
||||
*/
|
||||
List<DepotItem> findDepotItemListBydepotheadId(@Param("depotheadId")Long depotheadId,
|
||||
@Param("enableSerialNumber")String enableSerialNumber);
|
||||
@@ -178,11 +109,12 @@ public interface DepotItemMapperEx {
|
||||
|
||||
List<DepotItem> getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds);
|
||||
|
||||
|
||||
List<DepotItemStockWarningCount> findStockWarningCount(@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows, @Param("pid") Integer pid);
|
||||
|
||||
int findStockWarningCountTotal( @Param("pid") Integer pid);
|
||||
|
||||
BigDecimal getFinishNumber(@Param("mid") Long mid, @Param("linkNumber") String linkNumber);
|
||||
|
||||
BigDecimal getCurrentRepByMaterialIdAndDepotId(@Param("materialId") Long materialId, @Param("depotId") Long depotId,@Param("tenantId")Long tenantId);
|
||||
}
|
||||
|
||||
96
src/main/java/com/jsh/erp/datasource/mappers/MsgMapper.java
Normal file
96
src/main/java/com/jsh/erp/datasource/mappers/MsgMapper.java
Normal file
@@ -0,0 +1,96 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Msg;
|
||||
import com.jsh.erp.datasource.entities.MsgExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface MsgMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(MsgExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(MsgExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(Msg record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(Msg record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<Msg> selectByExample(MsgExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
Msg selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") Msg record, @Param("example") MsgExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") Msg record, @Param("example") MsgExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(Msg record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_msg
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(Msg record);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Msg;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsgMapperEx {
|
||||
|
||||
List<Msg> selectByConditionMsg(
|
||||
@Param("name") String name,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
Long countsByMsg(
|
||||
@Param("name") String name);
|
||||
|
||||
int batchDeleteMsgByIds(@Param("ids") String ids[]);
|
||||
|
||||
int insertSelectiveByTask(Msg record);
|
||||
|
||||
int checkIsNameExistByTask(@Param("msgTitle") String msgTitle);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Tenant;
|
||||
import com.jsh.erp.datasource.entities.TenantExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TenantMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(TenantExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(TenantExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(Tenant record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(Tenant record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<Tenant> selectByExample(TenantExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
Tenant selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") Tenant record, @Param("example") TenantExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") Tenant record, @Param("example") TenantExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(Tenant record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_tenant
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(Tenant record);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Tenant;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TenantMapperEx {
|
||||
|
||||
List<Tenant> selectByConditionTenant(
|
||||
@Param("loginName") String loginName,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
Long countsByTenant(
|
||||
@Param("loginName") String loginName);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.jsh.erp.datasource.vo;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class DepotItemVo4Stock {
|
||||
|
||||
private BigDecimal inNum;
|
||||
private BigDecimal outNum;
|
||||
|
||||
public BigDecimal getInNum() {
|
||||
return inNum;
|
||||
}
|
||||
|
||||
public void setInNum(BigDecimal inNum) {
|
||||
this.inNum = inNum;
|
||||
}
|
||||
|
||||
public BigDecimal getOutNum() {
|
||||
return outNum;
|
||||
}
|
||||
|
||||
public void setOutNum(BigDecimal outNum) {
|
||||
this.outNum = outNum;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ public class LogVo4List extends Log {
|
||||
|
||||
private String username;
|
||||
|
||||
private String createTimeStr;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@@ -13,4 +15,12 @@ public class LogVo4List extends Log {
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getCreateTimeStr() {
|
||||
return createTimeStr;
|
||||
}
|
||||
|
||||
public void setCreateTimeStr(String createTimeStr) {
|
||||
this.createTimeStr = createTimeStr;
|
||||
}
|
||||
}
|
||||
27
src/main/java/com/jsh/erp/exception/JshException.java
Normal file
27
src/main/java/com/jsh/erp/exception/JshException.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.jsh.erp.exception;
|
||||
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* 封装日志打印,收集日志
|
||||
* author: ji shenghua, qq 752718 920
|
||||
*/
|
||||
public class JshException {
|
||||
|
||||
public static void readFail(Logger logger, Exception e) {
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
|
||||
public static void writeFail(Logger logger, Exception e) {
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import java.util.regex.Pattern;
|
||||
@WebFilter(filterName = "LogCostFilter", urlPatterns = {"/*"},
|
||||
initParams = {@WebInitParam(name = "ignoredUrl", value = ".css#.js#.jpg#.png#.gif#.ico"),
|
||||
@WebInitParam(name = "filterPath",
|
||||
value = "/user/login#/user/registerUser#/user/getTenantStatus")})
|
||||
value = "/user/login#/user/registerUser")})
|
||||
public class LogCostFilter implements Filter {
|
||||
|
||||
private static final String FILTER_PATH = "filterPath";
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
package com.jsh.erp.service;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jishenghua 2018-10-7 15:25:39
|
||||
* user-5
|
||||
* role-10
|
||||
* app-15
|
||||
* depot-20
|
||||
* log-25
|
||||
* functions-30
|
||||
* inOutItem-35
|
||||
* unit-40
|
||||
* person-45
|
||||
* userBusiness-50
|
||||
* systemConfig-55
|
||||
* materialProperty-60
|
||||
* account-65
|
||||
* supplier-70
|
||||
* materialCategory-75
|
||||
* material-80
|
||||
* depotHead-85
|
||||
* depotItem-90
|
||||
* accountHead-95
|
||||
* accountItem-100
|
||||
* serialNumber-105
|
||||
* organization-110
|
||||
* orgaUserRel-115
|
||||
*/
|
||||
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
public @interface ResourceInfo {
|
||||
String value();
|
||||
int type();
|
||||
}
|
||||
package com.jsh.erp.service;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jishenghua 2018-10-7 15:25:39
|
||||
* user-5
|
||||
* role-10
|
||||
* depot-20
|
||||
* log-25
|
||||
* functions-30
|
||||
* inOutItem-35
|
||||
* unit-40
|
||||
* person-45
|
||||
* userBusiness-50
|
||||
* systemConfig-55
|
||||
* materialProperty-60
|
||||
* account-65
|
||||
* supplier-70
|
||||
* materialCategory-75
|
||||
* material-80
|
||||
* depotHead-85
|
||||
* depotItem-90
|
||||
* accountHead-95
|
||||
* accountItem-100
|
||||
* serialNumber-105
|
||||
* organization-110
|
||||
* orgaUserRel-115
|
||||
* tenant-120
|
||||
* msg-125
|
||||
*/
|
||||
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
public @interface ResourceInfo {
|
||||
String value();
|
||||
int type();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.mappers.*;
|
||||
import com.jsh.erp.datasource.vo.AccountVo4InOutList;
|
||||
import com.jsh.erp.datasource.vo.AccountVo4List;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -69,10 +70,7 @@ public class AccountService {
|
||||
try{
|
||||
list=accountMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -84,10 +82,7 @@ public class AccountService {
|
||||
try{
|
||||
list = accountMapperEx.selectByConditionAccount(name, serialNo, remark, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
String timeStr = Tools.getCurrentMonth();
|
||||
if (null != list && null !=timeStr) {
|
||||
@@ -112,10 +107,7 @@ public class AccountService {
|
||||
try{
|
||||
result=accountMapperEx.countsByAccount(name, serialNo, remark);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -131,10 +123,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapper.insertSelective(account);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -147,10 +136,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapper.updateByPrimaryKeySelective(account);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -161,10 +147,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -178,10 +161,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -193,10 +173,7 @@ public class AccountService {
|
||||
try{
|
||||
list = accountMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -209,10 +186,7 @@ public class AccountService {
|
||||
try{
|
||||
list = accountMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -247,10 +221,7 @@ public class AccountService {
|
||||
try{
|
||||
dataList = depotHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (dataList != null) {
|
||||
for (DepotHead depotHead : dataList) {
|
||||
@@ -296,10 +267,7 @@ public class AccountService {
|
||||
try{
|
||||
dataList = accountHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (dataList != null) {
|
||||
for (AccountHead accountHead : dataList) {
|
||||
@@ -340,10 +308,7 @@ public class AccountService {
|
||||
try{
|
||||
dataList = accountHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (dataList != null) {
|
||||
String ids = "";
|
||||
@@ -411,10 +376,7 @@ public class AccountService {
|
||||
try{
|
||||
dataList = depotHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (dataList != null) {
|
||||
for (DepotHead depotHead : dataList) {
|
||||
@@ -442,10 +404,7 @@ public class AccountService {
|
||||
try{
|
||||
list = accountMapperEx.findAccountInOutList(accountId, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -455,10 +414,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapperEx.findAccountInOutListCount(accountId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -475,10 +431,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapper.updateByExampleSelective(account, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -493,10 +446,7 @@ public class AccountService {
|
||||
try{
|
||||
result = accountMapperEx.batchDeleteAccountByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -530,10 +480,7 @@ public class AccountService {
|
||||
try{
|
||||
accountHeadList = accountHeadMapperEx.getAccountHeadListByAccountIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(accountHeadList!=null&&accountHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]",
|
||||
@@ -548,10 +495,7 @@ public class AccountService {
|
||||
try{
|
||||
accountItemList = accountItemMapperEx.getAccountItemListByAccountIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(accountItemList!=null&&accountItemList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]",
|
||||
@@ -566,10 +510,7 @@ public class AccountService {
|
||||
try{
|
||||
depotHeadList = depotHeadMapperEx.getDepotHeadListByAccountIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(depotHeadList!=null&&depotHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]",
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.AccountHeadMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.accountItem.AccountItemService;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -51,10 +52,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result=accountHeadMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -65,10 +63,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
list=accountHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -79,10 +74,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
list = accountHeadMapperEx.selectByConditionAccountHead(type, billNo, beginTime, endTime, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (null != list) {
|
||||
for (AccountHeadVo4ListEx ah : list) {
|
||||
@@ -103,10 +95,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapperEx.countsByAccountHead(type, billNo, beginTime, endTime);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -118,10 +107,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapper.insertSelective(accountHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -134,10 +120,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapper.updateByPrimaryKeySelective(accountHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -148,10 +131,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -165,10 +145,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -180,15 +157,11 @@ public class AccountHeadService {
|
||||
try{
|
||||
list = accountHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal findAllMoney(Integer supplierId, String type, String mode, String endTime) {
|
||||
String modeName = "";
|
||||
if (mode.equals("实际")) {
|
||||
@@ -200,10 +173,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapperEx.findAllMoney(supplierId, type, modeName, endTime);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -264,10 +234,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
list = accountHeadMapperEx.getDetailByNumber(billNo);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (null != list) {
|
||||
for (AccountHeadVo4ListEx ah : list) {
|
||||
@@ -293,10 +260,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
result = accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -328,10 +292,7 @@ public class AccountHeadService {
|
||||
try{
|
||||
accountItemList = accountItemMapperEx.getAccountItemListByHeaderIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(accountItemList!=null&&accountItemList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,HeaderIds[{}]",
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapper;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.datasource.vo.AccountItemVo4List;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
@@ -51,10 +52,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result=accountItemMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -66,10 +64,7 @@ public class AccountItemService {
|
||||
try{
|
||||
list=accountItemMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -79,10 +74,7 @@ public class AccountItemService {
|
||||
try{
|
||||
list = accountItemMapperEx.selectByConditionAccountItem(name, type, remark, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -92,10 +84,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapperEx.countsByAccountItem(name, type, remark);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -107,10 +96,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapper.insertSelective(accountItem);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -123,10 +109,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapper.updateByPrimaryKeySelective(accountItem);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -137,10 +120,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -154,10 +134,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -169,10 +146,7 @@ public class AccountItemService {
|
||||
try{
|
||||
list = accountItemMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -183,10 +157,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapper.insertSelective(accountItem);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -197,10 +168,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapper.updateByPrimaryKeySelective(accountItem);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -210,10 +178,7 @@ public class AccountItemService {
|
||||
try{
|
||||
list = accountItemMapperEx.getDetailList(headerId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -301,10 +266,7 @@ public class AccountItemService {
|
||||
try{
|
||||
result = accountItemMapperEx.batchDeleteAccountItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.jsh.erp.service.app;
|
||||
|
||||
import com.jsh.erp.service.ResourceInfo;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jishenghua qq752718920 2018-10-7 15:26:27
|
||||
*/
|
||||
@ResourceInfo(value = "app", type = 15)
|
||||
@Inherited
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface AppResource {
|
||||
}
|
||||
@@ -1,294 +0,0 @@
|
||||
package com.jsh.erp.service.app;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.AppMapper;
|
||||
import com.jsh.erp.datasource.mappers.AppMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AppService {
|
||||
private Logger logger = LoggerFactory.getLogger(AppService.class);
|
||||
|
||||
@Resource
|
||||
private AppMapper appMapper;
|
||||
@Resource
|
||||
private AppMapperEx appMapperEx;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
public List<App> findDock()throws Exception{
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andZlEqualTo("dock").andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("Sort");
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 桌面功能菜单初始化列表
|
||||
* create time: 2019/1/11 16:59
|
||||
* @Param: null
|
||||
* @return
|
||||
*/
|
||||
public List<App> findDesk()throws Exception{
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andZlEqualTo("desk").andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("Sort");
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public App getApp(long id)throws Exception {
|
||||
App result=null;
|
||||
try{
|
||||
result=appMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<App> getApp()throws Exception {
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<App> select(String name, String type, int offset, int rows)throws Exception {
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapperEx.selectByConditionApp(name, type, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countApp(String name, String type)throws Exception {
|
||||
Long result=null;
|
||||
try{
|
||||
result=appMapperEx.countsByApp(name, type);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insertApp(String beanJson, HttpServletRequest request)throws Exception {
|
||||
App app = JSONObject.parseObject(beanJson, App.class);
|
||||
int result=0;
|
||||
try{
|
||||
result=appMapper.insertSelective(app);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int updateApp(String beanJson, Long id) throws Exception{
|
||||
App app = JSONObject.parseObject(beanJson, App.class);
|
||||
app.setId(id);
|
||||
int result=0;
|
||||
try{
|
||||
result=appMapper.updateByPrimaryKeySelective(app);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int deleteApp(Long id)throws Exception {
|
||||
int result=0;
|
||||
try{
|
||||
result=appMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteApp(String ids)throws Exception {
|
||||
List<Long> idList = StringUtil.strToLongList(ids);
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andIdIn(idList);
|
||||
int result=0;
|
||||
try{
|
||||
result=appMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<App> findRoleAPP()throws Exception{
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("Sort");
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<App> findAppInIds(String ids, String type)throws Exception{
|
||||
List<Long> idList = StringUtil.strToLongList(ids);
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andZlEqualTo(type).andEnabledEqualTo(true).andIdIn(idList)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("Sort");
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteAppByIds(String ids) throws Exception{
|
||||
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(",");
|
||||
int result=0;
|
||||
try{
|
||||
result=appMapperEx.batchDeleteAppByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<App> findAppByUserId(String userId)throws Exception {
|
||||
List<UserBusiness> roleList = userBusinessService.findRoleByUserId(userId);
|
||||
String roles = null;
|
||||
if(roleList!=null && roleList.size()>0 && roleList.get(0)!=null){
|
||||
roles = roleList.get(0).getValue();
|
||||
}
|
||||
if(roles!=null) {
|
||||
roles = roles.replaceAll("\\]\\[",",").replaceAll("\\]","").replaceAll("\\[",""); //转为逗号隔开的
|
||||
}
|
||||
List<UserBusiness> appList = userBusinessService.findAppByRoles(roles);
|
||||
String apps = null;
|
||||
if(appList!=null && appList.size()>0 && appList.get(0)!=null){
|
||||
apps = appList.get(0).getValue();
|
||||
}
|
||||
if(apps!=null) {
|
||||
apps = apps.replaceAll("\\]\\[",",").replaceAll("\\]","").replaceAll("\\[",""); //转为逗号隔开的
|
||||
}
|
||||
|
||||
List<App> deskList = findAppInIds(apps,"desk");
|
||||
|
||||
return deskList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过number列表查询app list
|
||||
* @param numberList
|
||||
* @return
|
||||
*/
|
||||
public List<App> findAppByNumber(List<String> numberList) throws Exception{
|
||||
|
||||
AppExample example = new AppExample();
|
||||
example.createCriteria().andEnabledEqualTo(true).andNumberIn(numberList);
|
||||
List<App> list=null;
|
||||
try{
|
||||
list=appMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.jsh.erp.service.depot;
|
||||
|
||||
import com.jsh.erp.service.ICommonQuery;
|
||||
import com.jsh.erp.service.app.AppResource;
|
||||
import com.jsh.erp.utils.Constants;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.*;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -46,10 +47,7 @@ public class DepotService {
|
||||
try{
|
||||
result=depotMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -61,10 +59,7 @@ public class DepotService {
|
||||
try{
|
||||
list=depotMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -77,10 +72,7 @@ public class DepotService {
|
||||
try{
|
||||
list=depotMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -90,10 +82,7 @@ public class DepotService {
|
||||
try{
|
||||
list=depotMapperEx.selectByConditionDepot(name, type, remark, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -103,10 +92,7 @@ public class DepotService {
|
||||
try{
|
||||
result=depotMapperEx.countsByDepot(name, type, remark);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -118,10 +104,7 @@ public class DepotService {
|
||||
try{
|
||||
result=depotMapper.insertSelective(depot);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -134,10 +117,7 @@ public class DepotService {
|
||||
try{
|
||||
result= depotMapper.updateByPrimaryKeySelective(depot);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -148,10 +128,7 @@ public class DepotService {
|
||||
try{
|
||||
result= depotMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -165,10 +142,7 @@ public class DepotService {
|
||||
try{
|
||||
result= depotMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -180,10 +154,7 @@ public class DepotService {
|
||||
try{
|
||||
list= depotMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -196,10 +167,7 @@ public class DepotService {
|
||||
try{
|
||||
list= depotMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -212,10 +180,7 @@ public class DepotService {
|
||||
try{
|
||||
list= depotMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -225,10 +190,7 @@ public class DepotService {
|
||||
try{
|
||||
list= depotMapperEx.getDepotList(parameterMap);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -243,10 +205,7 @@ public class DepotService {
|
||||
try{
|
||||
result= depotMapperEx.batchDeleteDepotByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -280,10 +239,7 @@ public class DepotService {
|
||||
try{
|
||||
depotHeadList= depotHeadMapperEx.getDepotHeadListByDepotIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(depotHeadList!=null&&depotHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,DepotIds[{}]",
|
||||
@@ -298,10 +254,7 @@ public class DepotService {
|
||||
try{
|
||||
depotItemList= depotItemMapperEx.getDepotItemListListByDepotIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(depotItemList!=null&&depotItemList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,DepotIds[{}]",
|
||||
@@ -329,10 +282,7 @@ public class DepotService {
|
||||
try{
|
||||
result = depotMapper.updateByExampleSelective(depot, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4List;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.serialNumber.SerialNumberService;
|
||||
@@ -65,10 +66,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result=depotHeadMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -80,10 +78,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list=depotHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -95,10 +90,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (null != list) {
|
||||
for (DepotHeadVo4List dh : list) {
|
||||
@@ -106,10 +98,6 @@ public class DepotHeadService {
|
||||
String otherMoneyListStr = dh.getOthermoneylist().replace("[", "").replace("]", "").replaceAll("\"", "");
|
||||
dh.setOthermoneylist(otherMoneyListStr);
|
||||
}
|
||||
if(dh.getOthermoneyitem() != null) {
|
||||
String otherMoneyItemStr = dh.getOthermoneyitem().replace("[", "").replace("]", "").replaceAll("\"", "");
|
||||
dh.setOthermoneyitem(otherMoneyItemStr);
|
||||
}
|
||||
if(dh.getChangeamount() != null) {
|
||||
dh.setChangeamount(dh.getChangeamount().abs());
|
||||
}
|
||||
@@ -134,10 +122,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result=depotHeadMapperEx.countsByDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -158,10 +143,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result=depotHeadMapper.insert(depotHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -172,10 +154,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
dh = depotHeadMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
depotHead.setId(id);
|
||||
@@ -186,10 +165,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result = depotHeadMapper.updateByPrimaryKey(depotHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -200,10 +176,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result = depotHeadMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -217,10 +190,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result = depotHeadMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -232,10 +202,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list = depotHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -254,10 +221,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result = depotHeadMapper.updateByExampleSelective(depotHead, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -270,10 +234,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
buildOnlyNumber= depotHeadMapperEx.getBuildOnlyNumber(BusinessConstants.DEPOT_NUMBER_SEQ);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -290,15 +251,13 @@ public class DepotHeadService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String findMaterialsListByHeaderId(Long id)throws Exception {
|
||||
String result = null;
|
||||
try{
|
||||
result = depotHeadMapperEx.findMaterialsListByHeaderId(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -312,10 +271,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list = depotHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -329,10 +285,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list =depotHeadMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -342,10 +295,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list =depotHeadMapperEx.findByAll(beginTime, endTime, type, pid, dids, oId, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -355,10 +305,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, pid, dids, oId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -368,10 +315,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, pid, dids, oId, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -381,10 +325,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, pid, dids, oId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -394,10 +335,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list =depotHeadMapperEx.findStatementAccount(beginTime, endTime, organId, supType, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -407,10 +345,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result =depotHeadMapperEx.findStatementAccountCount(beginTime, endTime, organId, supType);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -426,10 +361,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
result =depotHeadMapperEx.findAllMoney(supplierId, type, subType, modeName, endTime);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -490,10 +422,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
list = depotHeadMapperEx.getDetailByNumber(number);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (null != list) {
|
||||
for (DepotHeadVo4List dh : list) {
|
||||
@@ -539,16 +468,14 @@ public class DepotHeadService {
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
//判断用户是否已经登录过,登录过不再处理
|
||||
User userInfo=userService.getCurrentUser();
|
||||
depotHead.setHandspersonid(userInfo==null?null:userInfo.getId());
|
||||
depotHead.setOperpersonname(userInfo==null?null:userInfo.getUsername());
|
||||
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
|
||||
try{
|
||||
depotHeadMapperEx.adddepotHead(depotHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
|
||||
/**入库和出库处理预付款信息*/
|
||||
@@ -568,10 +495,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
depotHeadMapper.updateByExampleSelective(depotHeadOrders, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -589,7 +513,8 @@ public class DepotHeadService {
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void updateDepotHeadAndDetail(Long id, String beanJson, String inserted, String deleted, String updated, BigDecimal preTotalPrice)throws Exception {
|
||||
public void updateDepotHeadAndDetail(Long id, String beanJson, String inserted, String deleted, String updated,
|
||||
BigDecimal preTotalPrice, Long tenantId)throws Exception {
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
@@ -603,10 +528,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
depotHeadMapperEx.updatedepotHead(depotHead);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
/**入库和出库处理预付款信息*/
|
||||
if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPaytype())){
|
||||
@@ -642,10 +564,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
depotItemList = depotItemMapperEx.findDepotItemListBydepotheadId(id,BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
/**回收序列号*/
|
||||
@@ -660,10 +579,7 @@ public class DepotHeadService {
|
||||
try{
|
||||
depotItemMapperEx.batchDeleteDepotItemByDepotHeadIds(new Long []{id});
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
|
||||
/**删除单据主表信息*/
|
||||
@@ -700,11 +616,12 @@ public class DepotHeadService {
|
||||
try{
|
||||
result = depotHeadMapperEx.batchDeleteDepotHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public BigDecimal getBuyAndSaleStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) {
|
||||
return depotHeadMapperEx.getBuyAndSaleStatistics(type, subType, hasSupplier, beginTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ import com.jsh.erp.datasource.mappers.DepotItemMapper;
|
||||
import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.SerialNumberMapperEx;
|
||||
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
|
||||
import com.jsh.erp.datasource.vo.DepotItemVo4Stock;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.service.serialNumber.SerialNumberService;
|
||||
@@ -217,48 +219,7 @@ public class DepotItemService {
|
||||
try{
|
||||
result = depotItemMapperEx.findDetailByTypeAndMaterialIdCounts(mId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<DepotItemVo4Material> findStockNumByMaterialIdList(Map<String, String> map)throws Exception {
|
||||
String mIdStr = map.get("mId");
|
||||
Long mId = null;
|
||||
if(!StringUtil.isEmpty(mIdStr)) {
|
||||
mId = Long.valueOf(mIdStr);
|
||||
}
|
||||
String monthTime = map.get("monthTime");
|
||||
List<DepotItemVo4Material> list =null;
|
||||
try{
|
||||
list = depotItemMapperEx.findStockNumByMaterialIdList(mId, monthTime, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long findStockNumByMaterialIdCounts(Map<String, String> map)throws Exception {
|
||||
String mIdStr = map.get("mId");
|
||||
Long mId = null;
|
||||
if(!StringUtil.isEmpty(mIdStr)) {
|
||||
mId = Long.parseLong(mIdStr);
|
||||
}
|
||||
String monthTime = map.get("monthTime");
|
||||
Long result =null;
|
||||
try{
|
||||
result = depotItemMapperEx.findStockNumByMaterialIdCounts(mId, monthTime);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -269,10 +230,7 @@ public class DepotItemService {
|
||||
try{
|
||||
result = depotItemMapper.insertSelective(depotItem);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -283,31 +241,10 @@ public class DepotItemService {
|
||||
try{
|
||||
result = depotItemMapper.updateByPrimaryKeySelective(depotItem);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return depotItemMapper.updateByPrimaryKeySelective(depotItem);
|
||||
}
|
||||
|
||||
public Long findByTypeAndMaterialId(String type, Long mId) throws Exception{
|
||||
Long result = 0l;
|
||||
try{
|
||||
if(type.equals(TYPE)) {
|
||||
result= depotItemMapperEx.findByTypeAndMaterialIdIn(mId);
|
||||
} else {
|
||||
result= depotItemMapperEx.findByTypeAndMaterialIdOut(mId);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int findByTypeAndMaterialIdAndDepotId(String type, Long mId, Long depotId) {
|
||||
if(type.equals(TYPE)) {
|
||||
return depotItemMapperEx.findByTypeAndDepotIdAndMaterialIdIn(depotId, mId);
|
||||
@@ -321,10 +258,7 @@ public class DepotItemService {
|
||||
try{
|
||||
list = depotItemMapperEx.getDetailList(headerId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -334,10 +268,7 @@ public class DepotItemService {
|
||||
try{
|
||||
list = depotItemMapperEx.findByAll(headIds, materialIds, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -347,86 +278,13 @@ public class DepotItemService {
|
||||
try{
|
||||
result = depotItemMapperEx.findByAllCount(headIds, materialIds);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public BigDecimal findByType(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev)throws Exception {
|
||||
BigDecimal result=null;
|
||||
try{
|
||||
if (TYPE.equals(type)) {
|
||||
if (isPrev) {
|
||||
result= depotItemMapperEx.findByTypeInIsPrev(ProjectId, MId, MonthTime);
|
||||
} else {
|
||||
result= depotItemMapperEx.findByTypeInIsNotPrev(ProjectId, MId, MonthTime);
|
||||
}
|
||||
} else {
|
||||
if (isPrev) {
|
||||
result= depotItemMapperEx.findByTypeOutIsPrev(ProjectId, MId, MonthTime);
|
||||
} else {
|
||||
result= depotItemMapperEx.findByTypeOutIsNotPrev(ProjectId, MId, MonthTime);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public BigDecimal findPriceByType(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev)throws Exception {
|
||||
BigDecimal result=null;
|
||||
try{
|
||||
if (TYPE.equals(type)) {
|
||||
if (isPrev) {
|
||||
result= depotItemMapperEx.findPriceByTypeInIsPrev(ProjectId, MId, MonthTime);
|
||||
} else {
|
||||
result= depotItemMapperEx.findPriceByTypeInIsNotPrev(ProjectId, MId, MonthTime);
|
||||
}
|
||||
} else {
|
||||
if (isPrev) {
|
||||
result= depotItemMapperEx.findPriceByTypeOutIsPrev(ProjectId, MId, MonthTime);
|
||||
} else {
|
||||
result= depotItemMapperEx.findPriceByTypeOutIsNotPrev(ProjectId, MId, MonthTime);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public BigDecimal findAssembleByType(String subType, String mType, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev)throws Exception {
|
||||
BigDecimal result=null;
|
||||
try{
|
||||
if (isPrev) {
|
||||
result= depotItemMapperEx.findAssembleIsPrev(subType, mType, ProjectId, MId, MonthTime);
|
||||
} else {
|
||||
result= depotItemMapperEx.findAssembleIsNotPrev(subType, mType, ProjectId, MId, MonthTime);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public BigDecimal buyOrSale(String type, String subType, Long MId, String MonthTime, String sumType) throws Exception{
|
||||
BigDecimal result=null;
|
||||
BigDecimal result= BigDecimal.ZERO;
|
||||
try{
|
||||
if (SUM_TYPE.equals(sumType)) {
|
||||
result= depotItemMapperEx.buyOrSaleNumber(type, subType, MId, MonthTime, sumType);
|
||||
@@ -440,8 +298,25 @@ public class DepotItemService {
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
/**
|
||||
* 统计采购或销售的总金额
|
||||
* @param type
|
||||
* @param subType
|
||||
* @param MonthTime
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public BigDecimal inOrOutPrice(String type, String subType, String MonthTime) throws Exception{
|
||||
BigDecimal result= BigDecimal.ZERO;
|
||||
try{
|
||||
result = depotItemMapperEx.inOrOutPrice(type, subType, MonthTime);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 2019-02-02修改
|
||||
@@ -466,282 +341,282 @@ public class DepotItemService {
|
||||
//获得当前操作人
|
||||
User userInfo=userService.getCurrentUser();
|
||||
//转为json
|
||||
JSONArray insertedJson = JSONArray.parseArray(inserted);
|
||||
JSONArray deletedJson = JSONArray.parseArray(deleted);
|
||||
JSONArray updatedJson = JSONArray.parseArray(updated);
|
||||
/**
|
||||
* 2019-01-28优先处理删除的
|
||||
* 删除的可以继续卖,删除的需要将使用的序列号回收
|
||||
* 插入的需要判断当前货源是否充足
|
||||
* 更新的需要判断货源是否充足
|
||||
* */
|
||||
if (null != deletedJson) {
|
||||
StringBuffer bf=new StringBuffer();
|
||||
for (int i = 0; i < deletedJson.size(); i++) {
|
||||
//首先回收序列号,如果是调拨,不用处理序列号
|
||||
JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i));
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())
|
||||
&&!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())){
|
||||
DepotItem depotItem = getDepotItem(tempDeletedJson.getLong("Id"));
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())){
|
||||
serialNumberService.cancelSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),
|
||||
userInfo);
|
||||
}
|
||||
}
|
||||
this.deleteDepotItem(tempDeletedJson.getLong("Id"));
|
||||
bf.append(tempDeletedJson.getLong("Id"));
|
||||
if(i<(deletedJson.size()-1)){
|
||||
bf.append(",");
|
||||
}
|
||||
}
|
||||
this.batchDeleteDepotItemByIds(bf.toString());
|
||||
}
|
||||
if (null != insertedJson) {
|
||||
for (int i = 0; i < insertedJson.size(); i++) {
|
||||
DepotItem depotItem = new DepotItem();
|
||||
JSONObject tempInsertedJson = JSONObject.parseObject(insertedJson.getString(i));
|
||||
depotItem.setHeaderid(headerId);
|
||||
depotItem.setMaterialid(tempInsertedJson.getLong("MaterialId"));
|
||||
depotItem.setMunit(tempInsertedJson.getString("Unit"));
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("OperNumber").toString())) {
|
||||
depotItem.setOpernumber(tempInsertedJson.getBigDecimal("OperNumber"));
|
||||
String Unit = tempInsertedJson.get("Unit").toString();
|
||||
BigDecimal oNumber = tempInsertedJson.getBigDecimal("OperNumber");
|
||||
Long mId = Long.parseLong(tempInsertedJson.get("MaterialId").toString());
|
||||
/***
|
||||
* 为什么调用的方法要先把基础单位去掉,去掉之后后续还能获取到?
|
||||
* */
|
||||
//以下进行单位换算
|
||||
// String UnitName = findUnitName(mId); //查询计量单位名称
|
||||
String unitName = materialService.findUnitName(mId);
|
||||
if (!StringUtil.isEmpty(unitName)) {
|
||||
String unitList = unitName.substring(0, unitName.indexOf("("));
|
||||
String ratioList = unitName.substring(unitName.indexOf("("));
|
||||
String basicUnit = unitList.substring(0, unitList.indexOf(",")); //基本单位
|
||||
String otherUnit = unitList.substring(unitList.indexOf(",") + 1); //副单位
|
||||
Integer ratio = Integer.parseInt(ratioList.substring(ratioList.indexOf(":") + 1).replace(")", "")); //比例
|
||||
if (Unit.equals(basicUnit)) { //如果等于基础单位
|
||||
depotItem.setBasicnumber(oNumber); //数量一致
|
||||
} else if (Unit.equals(otherUnit)) { //如果等于副单位
|
||||
depotItem.setBasicnumber(oNumber.multiply(new BigDecimal(ratio)) ); //数量乘以比例
|
||||
}else{
|
||||
//不等于基础单位也不等于副单位,单位存在问题
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_MSG,material==null?"":material.getName(),Unit,basicUnit,otherUnit));
|
||||
}
|
||||
} else {
|
||||
depotItem.setBasicnumber(oNumber); //其他情况
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("UnitPrice").toString())) {
|
||||
depotItem.setUnitprice(tempInsertedJson.getBigDecimal("UnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxUnitPrice").toString())) {
|
||||
depotItem.setTaxunitprice(tempInsertedJson.getBigDecimal("TaxUnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("AllPrice").toString())) {
|
||||
depotItem.setAllprice(tempInsertedJson.getBigDecimal("AllPrice"));
|
||||
}
|
||||
depotItem.setRemark(tempInsertedJson.getString("Remark"));
|
||||
if (tempInsertedJson.get("DepotId") != null && !StringUtil.isEmpty(tempInsertedJson.get("DepotId").toString())) {
|
||||
depotItem.setDepotid(tempInsertedJson.getLong("DepotId"));
|
||||
}
|
||||
if (tempInsertedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempInsertedJson.get("AnotherDepotId").toString())) {
|
||||
depotItem.setAnotherdepotid(tempInsertedJson.getLong("AnotherDepotId"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxRate").toString())) {
|
||||
depotItem.setTaxrate(tempInsertedJson.getBigDecimal("TaxRate"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxMoney").toString())) {
|
||||
depotItem.setTaxmoney(tempInsertedJson.getBigDecimal("TaxMoney"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxLastMoney").toString())) {
|
||||
depotItem.setTaxlastmoney(tempInsertedJson.getBigDecimal("TaxLastMoney"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField1") != null) {
|
||||
depotItem.setOtherfield1(tempInsertedJson.getString("OtherField1"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField2") != null) {
|
||||
depotItem.setOtherfield2(tempInsertedJson.getString("OtherField2"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField3") != null) {
|
||||
depotItem.setOtherfield3(tempInsertedJson.getString("OtherField3"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField4") != null) {
|
||||
depotItem.setOtherfield4(tempInsertedJson.getString("OtherField4"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField5") != null) {
|
||||
depotItem.setOtherfield5(tempInsertedJson.getString("OtherField5"));
|
||||
}
|
||||
if (tempInsertedJson.get("MType") != null) {
|
||||
depotItem.setMtype(tempInsertedJson.getString("MType"));
|
||||
}
|
||||
/**
|
||||
* 出库时判断库存是否充足
|
||||
* */
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
if(getCurrentRepByMaterialIdAndDepotId(material.getId(),depotItem.getDepotid()).compareTo(depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber())==-1){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
|
||||
/**出库时处理序列号*/
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.insertDepotItemWithObj(depotItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (null != updatedJson) {
|
||||
for (int i = 0; i < updatedJson.size(); i++) {
|
||||
JSONObject tempUpdatedJson = JSONObject.parseObject(updatedJson.getString(i));
|
||||
DepotItem depotItem = this.getDepotItem(tempUpdatedJson.getLong("Id"));
|
||||
JSONArray insertedJson = JSONArray.parseArray(inserted);
|
||||
JSONArray deletedJson = JSONArray.parseArray(deleted);
|
||||
JSONArray updatedJson = JSONArray.parseArray(updated);
|
||||
/**
|
||||
* 2019-01-28优先处理删除的
|
||||
* 删除的可以继续卖,删除的需要将使用的序列号回收
|
||||
* 插入的需要判断当前货源是否充足
|
||||
* 更新的需要判断货源是否充足
|
||||
* */
|
||||
if (null != deletedJson) {
|
||||
StringBuffer bf=new StringBuffer();
|
||||
for (int i = 0; i < deletedJson.size(); i++) {
|
||||
//首先回收序列号,如果是调拨,不用处理序列号
|
||||
JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i));
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())
|
||||
&&!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())){
|
||||
DepotItem depotItem = getDepotItem(tempDeletedJson.getLong("Id"));
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
//首先回收序列号
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) {
|
||||
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if (BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
serialNumberService.cancelSerialNumber(depotItem.getMaterialid(), depotItem.getHeaderid(), (depotItem.getBasicnumber() == null ? 0 : depotItem.getBasicnumber()).intValue(),
|
||||
userInfo);
|
||||
}
|
||||
/**收回序列号的时候释放库存*/
|
||||
depotItem.setOpernumber(BigDecimal.ZERO);
|
||||
depotItem.setBasicnumber(BigDecimal.ZERO);
|
||||
this.updateDepotItemWithObj(depotItem);
|
||||
}
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())){
|
||||
serialNumberService.cancelSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),
|
||||
userInfo);
|
||||
}
|
||||
depotItem.setId(tempUpdatedJson.getLong("Id"));
|
||||
depotItem.setMaterialid(tempUpdatedJson.getLong("MaterialId"));
|
||||
depotItem.setMunit(tempUpdatedJson.getString("Unit"));
|
||||
if(!material.getId().equals(depotItem.getMaterialid())){
|
||||
material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("OperNumber").toString())) {
|
||||
depotItem.setOpernumber(tempUpdatedJson.getBigDecimal("OperNumber"));
|
||||
String Unit = tempUpdatedJson.get("Unit").toString();
|
||||
BigDecimal oNumber = tempUpdatedJson.getBigDecimal("OperNumber");
|
||||
Long mId = Long.parseLong(tempUpdatedJson.get("MaterialId").toString());
|
||||
//以下进行单位换算
|
||||
// String UnitName = findUnitName(mId); //查询计量单位名称
|
||||
String unitName = materialService.findUnitName(mId);
|
||||
if (!StringUtil.isEmpty(unitName)) {
|
||||
String unitList = unitName.substring(0, unitName.indexOf("("));
|
||||
String ratioList = unitName.substring(unitName.indexOf("("));
|
||||
String basicUnit = unitList.substring(0, unitList.indexOf(",")); //基本单位
|
||||
String otherUnit = unitList.substring(unitList.indexOf(",") + 1); //副单位
|
||||
Integer ratio = Integer.parseInt(ratioList.substring(ratioList.indexOf(":") + 1).replace(")", "")); //比例
|
||||
if (Unit.equals(basicUnit)) { //如果等于基础单位
|
||||
depotItem.setBasicnumber(oNumber); //数量一致
|
||||
} else if (Unit.equals(otherUnit)) { //如果等于副单位
|
||||
depotItem.setBasicnumber(oNumber.multiply(new BigDecimal(ratio))); //数量乘以比例
|
||||
}else{
|
||||
//不等于基础单位也不等于副单位,单位存在问题
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_MSG,material==null?"":material.getName(),Unit,basicUnit,otherUnit));
|
||||
}
|
||||
} else {
|
||||
depotItem.setBasicnumber(oNumber); //其他情况
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("UnitPrice").toString())) {
|
||||
depotItem.setUnitprice(tempUpdatedJson.getBigDecimal("UnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxUnitPrice").toString())) {
|
||||
depotItem.setTaxunitprice(tempUpdatedJson.getBigDecimal("TaxUnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("AllPrice").toString())) {
|
||||
depotItem.setAllprice(tempUpdatedJson.getBigDecimal("AllPrice"));
|
||||
}
|
||||
depotItem.setRemark(tempUpdatedJson.getString("Remark"));
|
||||
if (tempUpdatedJson.get("DepotId") != null && !StringUtil.isEmpty(tempUpdatedJson.get("DepotId").toString())) {
|
||||
depotItem.setDepotid(tempUpdatedJson.getLong("DepotId"));
|
||||
}
|
||||
if (tempUpdatedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempUpdatedJson.get("AnotherDepotId").toString())) {
|
||||
depotItem.setAnotherdepotid(tempUpdatedJson.getLong("AnotherDepotId"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxRate").toString())) {
|
||||
depotItem.setTaxrate(tempUpdatedJson.getBigDecimal("TaxRate"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxMoney").toString())) {
|
||||
depotItem.setTaxmoney(tempUpdatedJson.getBigDecimal("TaxMoney"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxLastMoney").toString())) {
|
||||
depotItem.setTaxlastmoney(tempUpdatedJson.getBigDecimal("TaxLastMoney"));
|
||||
}
|
||||
depotItem.setOtherfield1(tempUpdatedJson.getString("OtherField1"));
|
||||
depotItem.setOtherfield2(tempUpdatedJson.getString("OtherField2"));
|
||||
depotItem.setOtherfield3(tempUpdatedJson.getString("OtherField3"));
|
||||
depotItem.setOtherfield4(tempUpdatedJson.getString("OtherField4"));
|
||||
depotItem.setOtherfield5(tempUpdatedJson.getString("OtherField5"));
|
||||
depotItem.setMtype(tempUpdatedJson.getString("MType"));
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* create time: 2019/3/25 15:18
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 修改了商品类型时,库中的商品和页面传递的不同
|
||||
* 这里需要重新获取页面传递的商品信息
|
||||
*/
|
||||
if(!material.getId().equals(depotItem.getMaterialid())){
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/**出库时处理序列号*/
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(getCurrentRepByMaterialIdAndDepotId(material.getId(),depotItem.getDepotid())
|
||||
.compareTo(depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber())==-1){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateDepotItemWithObj(depotItem);
|
||||
}
|
||||
this.deleteDepotItem(tempDeletedJson.getLong("Id"));
|
||||
bf.append(tempDeletedJson.getLong("Id"));
|
||||
if(i<(deletedJson.size()-1)){
|
||||
bf.append(",");
|
||||
}
|
||||
}
|
||||
this.batchDeleteDepotItemByIds(bf.toString());
|
||||
}
|
||||
if (null != insertedJson) {
|
||||
for (int i = 0; i < insertedJson.size(); i++) {
|
||||
DepotItem depotItem = new DepotItem();
|
||||
JSONObject tempInsertedJson = JSONObject.parseObject(insertedJson.getString(i));
|
||||
depotItem.setHeaderid(headerId);
|
||||
depotItem.setMaterialid(tempInsertedJson.getLong("MaterialId"));
|
||||
depotItem.setMunit(tempInsertedJson.getString("Unit"));
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("OperNumber").toString())) {
|
||||
depotItem.setOpernumber(tempInsertedJson.getBigDecimal("OperNumber"));
|
||||
String Unit = tempInsertedJson.get("Unit").toString();
|
||||
BigDecimal oNumber = tempInsertedJson.getBigDecimal("OperNumber");
|
||||
Long mId = Long.parseLong(tempInsertedJson.get("MaterialId").toString());
|
||||
/***
|
||||
* 为什么调用的方法要先把基础单位去掉,去掉之后后续还能获取到?
|
||||
* */
|
||||
//以下进行单位换算
|
||||
// String UnitName = findUnitName(mId); //查询计量单位名称
|
||||
String unitName = materialService.findUnitName(mId);
|
||||
if (!StringUtil.isEmpty(unitName)) {
|
||||
String unitList = unitName.substring(0, unitName.indexOf("("));
|
||||
String ratioList = unitName.substring(unitName.indexOf("("));
|
||||
String basicUnit = unitList.substring(0, unitList.indexOf(",")); //基本单位
|
||||
String otherUnit = unitList.substring(unitList.indexOf(",") + 1); //副单位
|
||||
Integer ratio = Integer.parseInt(ratioList.substring(ratioList.indexOf(":") + 1).replace(")", "")); //比例
|
||||
if (Unit.equals(basicUnit)) { //如果等于基础单位
|
||||
depotItem.setBasicnumber(oNumber); //数量一致
|
||||
} else if (Unit.equals(otherUnit)) { //如果等于副单位
|
||||
depotItem.setBasicnumber(oNumber.multiply(new BigDecimal(ratio)) ); //数量乘以比例
|
||||
}else{
|
||||
//不等于基础单位也不等于副单位,单位存在问题
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_MSG,material==null?"":material.getName(),Unit,basicUnit,otherUnit));
|
||||
}
|
||||
} else {
|
||||
depotItem.setBasicnumber(oNumber); //其他情况
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("UnitPrice").toString())) {
|
||||
depotItem.setUnitprice(tempInsertedJson.getBigDecimal("UnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxUnitPrice").toString())) {
|
||||
depotItem.setTaxunitprice(tempInsertedJson.getBigDecimal("TaxUnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("AllPrice").toString())) {
|
||||
depotItem.setAllprice(tempInsertedJson.getBigDecimal("AllPrice"));
|
||||
}
|
||||
depotItem.setRemark(tempInsertedJson.getString("Remark"));
|
||||
if (tempInsertedJson.get("DepotId") != null && !StringUtil.isEmpty(tempInsertedJson.get("DepotId").toString())) {
|
||||
depotItem.setDepotid(tempInsertedJson.getLong("DepotId"));
|
||||
}
|
||||
if (tempInsertedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempInsertedJson.get("AnotherDepotId").toString())) {
|
||||
depotItem.setAnotherdepotid(tempInsertedJson.getLong("AnotherDepotId"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxRate").toString())) {
|
||||
depotItem.setTaxrate(tempInsertedJson.getBigDecimal("TaxRate"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxMoney").toString())) {
|
||||
depotItem.setTaxmoney(tempInsertedJson.getBigDecimal("TaxMoney"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxLastMoney").toString())) {
|
||||
depotItem.setTaxlastmoney(tempInsertedJson.getBigDecimal("TaxLastMoney"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField1") != null) {
|
||||
depotItem.setOtherfield1(tempInsertedJson.getString("OtherField1"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField2") != null) {
|
||||
depotItem.setOtherfield2(tempInsertedJson.getString("OtherField2"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField3") != null) {
|
||||
depotItem.setOtherfield3(tempInsertedJson.getString("OtherField3"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField4") != null) {
|
||||
depotItem.setOtherfield4(tempInsertedJson.getString("OtherField4"));
|
||||
}
|
||||
if (tempInsertedJson.get("OtherField5") != null) {
|
||||
depotItem.setOtherfield5(tempInsertedJson.getString("OtherField5"));
|
||||
}
|
||||
if (tempInsertedJson.get("MType") != null) {
|
||||
depotItem.setMtype(tempInsertedJson.getString("MType"));
|
||||
}
|
||||
/**
|
||||
* 出库时判断库存是否充足
|
||||
* */
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
if(getCurrentRepByMaterialIdAndDepotId(material.getId(),depotItem.getDepotid()).compareTo(depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber())==-1){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
|
||||
/**出库时处理序列号*/
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.insertDepotItemWithObj(depotItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (null != updatedJson) {
|
||||
for (int i = 0; i < updatedJson.size(); i++) {
|
||||
JSONObject tempUpdatedJson = JSONObject.parseObject(updatedJson.getString(i));
|
||||
DepotItem depotItem = this.getDepotItem(tempUpdatedJson.getLong("Id"));
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
//首先回收序列号
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) {
|
||||
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if (BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
serialNumberService.cancelSerialNumber(depotItem.getMaterialid(), depotItem.getHeaderid(), (depotItem.getBasicnumber() == null ? 0 : depotItem.getBasicnumber()).intValue(),
|
||||
userInfo);
|
||||
}
|
||||
/**收回序列号的时候释放库存*/
|
||||
depotItem.setOpernumber(BigDecimal.ZERO);
|
||||
depotItem.setBasicnumber(BigDecimal.ZERO);
|
||||
this.updateDepotItemWithObj(depotItem);
|
||||
}
|
||||
}
|
||||
depotItem.setId(tempUpdatedJson.getLong("Id"));
|
||||
depotItem.setMaterialid(tempUpdatedJson.getLong("MaterialId"));
|
||||
depotItem.setMunit(tempUpdatedJson.getString("Unit"));
|
||||
if(!material.getId().equals(depotItem.getMaterialid())){
|
||||
material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("OperNumber").toString())) {
|
||||
depotItem.setOpernumber(tempUpdatedJson.getBigDecimal("OperNumber"));
|
||||
String Unit = tempUpdatedJson.get("Unit").toString();
|
||||
BigDecimal oNumber = tempUpdatedJson.getBigDecimal("OperNumber");
|
||||
Long mId = Long.parseLong(tempUpdatedJson.get("MaterialId").toString());
|
||||
//以下进行单位换算
|
||||
// String UnitName = findUnitName(mId); //查询计量单位名称
|
||||
String unitName = materialService.findUnitName(mId);
|
||||
if (!StringUtil.isEmpty(unitName)) {
|
||||
String unitList = unitName.substring(0, unitName.indexOf("("));
|
||||
String ratioList = unitName.substring(unitName.indexOf("("));
|
||||
String basicUnit = unitList.substring(0, unitList.indexOf(",")); //基本单位
|
||||
String otherUnit = unitList.substring(unitList.indexOf(",") + 1); //副单位
|
||||
Integer ratio = Integer.parseInt(ratioList.substring(ratioList.indexOf(":") + 1).replace(")", "")); //比例
|
||||
if (Unit.equals(basicUnit)) { //如果等于基础单位
|
||||
depotItem.setBasicnumber(oNumber); //数量一致
|
||||
} else if (Unit.equals(otherUnit)) { //如果等于副单位
|
||||
depotItem.setBasicnumber(oNumber.multiply(new BigDecimal(ratio))); //数量乘以比例
|
||||
}else{
|
||||
//不等于基础单位也不等于副单位,单位存在问题
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_UNIT_NOT_RIGHT_MSG,material==null?"":material.getName(),Unit,basicUnit,otherUnit));
|
||||
}
|
||||
} else {
|
||||
depotItem.setBasicnumber(oNumber); //其他情况
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("UnitPrice").toString())) {
|
||||
depotItem.setUnitprice(tempUpdatedJson.getBigDecimal("UnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxUnitPrice").toString())) {
|
||||
depotItem.setTaxunitprice(tempUpdatedJson.getBigDecimal("TaxUnitPrice"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("AllPrice").toString())) {
|
||||
depotItem.setAllprice(tempUpdatedJson.getBigDecimal("AllPrice"));
|
||||
}
|
||||
depotItem.setRemark(tempUpdatedJson.getString("Remark"));
|
||||
if (tempUpdatedJson.get("DepotId") != null && !StringUtil.isEmpty(tempUpdatedJson.get("DepotId").toString())) {
|
||||
depotItem.setDepotid(tempUpdatedJson.getLong("DepotId"));
|
||||
}
|
||||
if (tempUpdatedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempUpdatedJson.get("AnotherDepotId").toString())) {
|
||||
depotItem.setAnotherdepotid(tempUpdatedJson.getLong("AnotherDepotId"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxRate").toString())) {
|
||||
depotItem.setTaxrate(tempUpdatedJson.getBigDecimal("TaxRate"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxMoney").toString())) {
|
||||
depotItem.setTaxmoney(tempUpdatedJson.getBigDecimal("TaxMoney"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(tempUpdatedJson.get("TaxLastMoney").toString())) {
|
||||
depotItem.setTaxlastmoney(tempUpdatedJson.getBigDecimal("TaxLastMoney"));
|
||||
}
|
||||
depotItem.setOtherfield1(tempUpdatedJson.getString("OtherField1"));
|
||||
depotItem.setOtherfield2(tempUpdatedJson.getString("OtherField2"));
|
||||
depotItem.setOtherfield3(tempUpdatedJson.getString("OtherField3"));
|
||||
depotItem.setOtherfield4(tempUpdatedJson.getString("OtherField4"));
|
||||
depotItem.setOtherfield5(tempUpdatedJson.getString("OtherField5"));
|
||||
depotItem.setMtype(tempUpdatedJson.getString("MType"));
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* create time: 2019/3/25 15:18
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 修改了商品类型时,库中的商品和页面传递的不同
|
||||
* 这里需要重新获取页面传递的商品信息
|
||||
*/
|
||||
if(!material.getId().equals(depotItem.getMaterialid())){
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/**出库时处理序列号*/
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(getCurrentRepByMaterialIdAndDepotId(material.getId(),depotItem.getDepotid())
|
||||
.compareTo(depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber())==-1){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableserialnumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateDepotItemWithObj(depotItem);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
@@ -801,10 +676,7 @@ public class DepotItemService {
|
||||
try{
|
||||
list =depotItemMapperEx.findStockWarningCount( offset, rows, pid);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -814,10 +686,7 @@ public class DepotItemService {
|
||||
try{
|
||||
result =depotItemMapperEx.findStockWarningCountTotal(pid);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -850,4 +719,59 @@ public class DepotItemService {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计该商品已分批出库的总数量-用于订单
|
||||
* @param mid
|
||||
* @param headerId
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public BigDecimal getFinishNumber(Long mid, Long headerId) {
|
||||
DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(headerId);
|
||||
String linkNumber = depotHead.getLinknumber(); //关联单号
|
||||
BigDecimal count = depotItemMapperEx.getFinishNumber(mid, linkNumber);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存统计
|
||||
* @param depotId
|
||||
* @param mId
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getStockByParam(Long depotId, Long mId, String beginTime, String endTime, Long tenantId){
|
||||
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParam(depotId, mId, beginTime, endTime, tenantId);
|
||||
BigDecimal intNum = stockObj.getInNum();
|
||||
BigDecimal outNum = stockObj.getOutNum();
|
||||
return intNum.subtract(outNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库统计
|
||||
* @param depotId
|
||||
* @param mId
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getInNumByParam(Long depotId, Long mId, String beginTime, String endTime, Long tenantId){
|
||||
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParam(depotId, mId, beginTime, endTime, tenantId);
|
||||
return stockObj.getInNum();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库统计
|
||||
* @param depotId
|
||||
* @param mId
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getOutNumByParam(Long depotId, Long mId, String beginTime, String endTime, Long tenantId){
|
||||
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParam(depotId, mId, beginTime, endTime, tenantId);
|
||||
return stockObj.getOutNum();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.jsh.erp.service.functions;
|
||||
|
||||
import com.jsh.erp.service.ICommonQuery;
|
||||
import com.jsh.erp.service.app.AppResource;
|
||||
import com.jsh.erp.service.functions.FunctionsService;
|
||||
import com.jsh.erp.utils.Constants;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.FunctionsMapper;
|
||||
import com.jsh.erp.datasource.mappers.FunctionsMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -44,10 +45,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result=functionsMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -59,10 +57,7 @@ public class FunctionsService {
|
||||
try{
|
||||
list=functionsMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -72,10 +67,7 @@ public class FunctionsService {
|
||||
try{
|
||||
list=functionsMapperEx.selectByConditionFunctions(name, type, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -85,10 +77,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result=functionsMapperEx.countsByFunctions(name, type);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -100,10 +89,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result=functionsMapper.insertSelective(depot);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -116,10 +102,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result=functionsMapper.updateByPrimaryKeySelective(depot);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -130,10 +113,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result=functionsMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -147,10 +127,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result=functionsMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -162,10 +139,7 @@ public class FunctionsService {
|
||||
try{
|
||||
list = functionsMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -179,10 +153,7 @@ public class FunctionsService {
|
||||
try{
|
||||
list = functionsMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -196,10 +167,7 @@ public class FunctionsService {
|
||||
try{
|
||||
list =functionsMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -214,10 +182,7 @@ public class FunctionsService {
|
||||
try{
|
||||
list =functionsMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -233,10 +198,7 @@ public class FunctionsService {
|
||||
try{
|
||||
result =functionsMapperEx.batchDeleteFunctionsByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.InOutItemMapper;
|
||||
import com.jsh.erp.datasource.mappers.InOutItemMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -45,10 +46,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -60,10 +58,7 @@ public class InOutItemService {
|
||||
try{
|
||||
list=inOutItemMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -73,10 +68,7 @@ public class InOutItemService {
|
||||
try{
|
||||
list=inOutItemMapperEx.selectByConditionInOutItem(name, type, remark, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -86,10 +78,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapperEx.countsByInOutItem(name, type, remark);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -101,10 +90,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapper.insertSelective(depot);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -117,10 +103,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapper.updateByPrimaryKeySelective(depot);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -131,10 +114,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -148,10 +128,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -163,10 +140,7 @@ public class InOutItemService {
|
||||
try{
|
||||
list=inOutItemMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
return list==null?0:list.size();
|
||||
@@ -184,10 +158,7 @@ public class InOutItemService {
|
||||
try{
|
||||
list=inOutItemMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -202,10 +173,7 @@ public class InOutItemService {
|
||||
try{
|
||||
result=inOutItemMapperEx.batchDeleteInOutItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -237,10 +205,7 @@ public class InOutItemService {
|
||||
try{
|
||||
accountItemList=accountItemMapperEx.getAccountItemListByInOutItemIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(accountItemList!=null&&accountItemList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,InOutItemIds[{}]",
|
||||
|
||||
@@ -10,7 +10,9 @@ import com.jsh.erp.datasource.mappers.LogMapper;
|
||||
import com.jsh.erp.datasource.mappers.LogMapperEx;
|
||||
import com.jsh.erp.datasource.vo.LogVo4List;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import com.jsh.erp.utils.Tools;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -37,10 +39,7 @@ public class LogService {
|
||||
try{
|
||||
result=logMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -51,10 +50,7 @@ public class LogService {
|
||||
try{
|
||||
list=logMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -65,11 +61,13 @@ public class LogService {
|
||||
try{
|
||||
list=logMapperEx.selectByConditionLog(operation, usernameID, clientIp, status, beginTime, endTime,
|
||||
contentdetails, offset, rows);
|
||||
if (null != list) {
|
||||
for (LogVo4List log : list) {
|
||||
log.setCreateTimeStr(Tools.getCenternTime(log.getCreatetime()));
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -80,10 +78,7 @@ public class LogService {
|
||||
try{
|
||||
result=logMapperEx.countsByLog(operation, usernameID, clientIp, status, beginTime, endTime, contentdetails);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -95,10 +90,7 @@ public class LogService {
|
||||
try{
|
||||
result=logMapper.insertSelective(log);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -111,10 +103,7 @@ public class LogService {
|
||||
try{
|
||||
result=logMapper.updateByPrimaryKeySelective(log);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -125,10 +114,7 @@ public class LogService {
|
||||
try{
|
||||
result=logMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -142,10 +128,7 @@ public class LogService {
|
||||
try{
|
||||
result=logMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -223,14 +206,10 @@ public class LogService {
|
||||
Byte status = 0;
|
||||
log.setStatus(status);
|
||||
log.setContentdetails(type + getModule(apiName));
|
||||
log.setRemark(type + getModule(apiName));
|
||||
try{
|
||||
logMapper.insertSelective(log);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapper;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
@@ -47,10 +48,7 @@ public class MaterialService {
|
||||
try{
|
||||
result=materialMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -62,10 +60,7 @@ public class MaterialService {
|
||||
try{
|
||||
list=materialMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -78,10 +73,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapperEx.selectByConditionMaterial(name, model,categoryIds,mpList, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (null != list) {
|
||||
for (MaterialVo4Unit m : list) {
|
||||
@@ -108,9 +100,8 @@ public class MaterialService {
|
||||
}
|
||||
}
|
||||
m.setMaterialOther(materialOther);
|
||||
Long InSum = depotItemService.findByTypeAndMaterialId("入库", m.getId());
|
||||
Long OutSum = depotItemService.findByTypeAndMaterialId("出库", m.getId());
|
||||
m.setStock(InSum - OutSum);
|
||||
Long tenantId = m.getTenantId();
|
||||
m.setStock(depotItemService.getStockByParam(null,m.getId(),null,null,tenantId));
|
||||
resList.add(m);
|
||||
}
|
||||
}
|
||||
@@ -122,10 +113,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapperEx.countsByMaterial(name, model,categoryIds,mpList);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -138,10 +126,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapper.insertSelective(material);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -160,10 +145,7 @@ public class MaterialService {
|
||||
materialMapperEx.updateUnitIdNullByPrimaryKey(id); //将多单位置空
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -175,10 +157,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -192,10 +171,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -207,10 +183,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -235,10 +208,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -257,10 +227,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapper.updateByExampleSelective(material, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -270,10 +237,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapperEx.findUnitName(mId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -283,10 +247,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapperEx.findById(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -296,10 +257,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapperEx.findBySelect();
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -312,10 +270,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -326,10 +281,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapperEx.findByAll(name, model, categoryIds);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (null != list) {
|
||||
for (MaterialVo4Unit m : list) {
|
||||
@@ -352,8 +304,7 @@ public class MaterialService {
|
||||
info.code = 200;
|
||||
data.put("message", "成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
JshException.writeFail(logger, e);
|
||||
e.printStackTrace();
|
||||
info.code = 500;
|
||||
data.put("message", e.getMessage());
|
||||
@@ -367,10 +318,7 @@ public class MaterialService {
|
||||
try{
|
||||
list= materialMapperEx.getMaterialEnableSerialNumberList(parameterMap);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -385,10 +333,7 @@ public class MaterialService {
|
||||
try{
|
||||
result= materialMapperEx.batchDeleteMaterialByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -421,10 +366,7 @@ public class MaterialService {
|
||||
try{
|
||||
depotItemList= depotItemMapperEx.getDepotItemListListByMaterialIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(depotItemList!=null&&depotItemList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,MaterialIds[{}]",
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.MaterialCategoryMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapperEx;
|
||||
import com.jsh.erp.datasource.vo.TreeNode;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -46,10 +47,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -60,10 +58,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
list=materialCategoryMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -73,10 +68,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
list = getMCList(parentId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -105,10 +97,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
list=materialCategoryMapperEx.selectByConditionMaterialCategory(name, parentId, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -118,10 +107,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapperEx.countsByMaterialCategory(name, parentId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -133,10 +119,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapper.insertSelective(materialCategory);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -149,10 +132,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapper.updateByPrimaryKeySelective(materialCategory);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -163,10 +143,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -180,10 +157,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -199,10 +173,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
list=materialCategoryMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -219,10 +190,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
list=materialCategoryMapperEx.getNodeTree(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -264,10 +232,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapperEx.addMaterialCategory(mc);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -289,10 +254,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result=materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -317,10 +279,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
result= materialCategoryMapperEx.editMaterialCategory(mc);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -339,10 +298,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
mList= materialCategoryMapperEx.getMaterialCategoryBySerialNo(mc.getSerialNo());
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(mList==null||mList.size()<1){
|
||||
//未查询到对应数据,编号可用
|
||||
@@ -397,10 +353,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
materialList= materialMapperEx.getMaterialListByCategoryIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(materialList!=null&&materialList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,CategoryIds[{}]",
|
||||
@@ -415,10 +368,7 @@ public class MaterialCategoryService {
|
||||
try{
|
||||
materialCategoryList= materialCategoryMapperEx.getMaterialCategoryListByCategoryIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(materialCategoryList!=null&&materialCategoryList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,CategoryIds[{}]",
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.MaterialPropertyMapper;
|
||||
import com.jsh.erp.datasource.mappers.MaterialPropertyMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -43,10 +44,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -58,10 +56,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
list=materialPropertyMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -71,10 +66,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
list=materialPropertyMapperEx.selectByConditionMaterialProperty(name, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -84,10 +76,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapperEx.countsByMaterialProperty(name);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -99,10 +88,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapper.insertSelective(materialProperty);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -115,10 +101,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapper.updateByPrimaryKeySelective(materialProperty);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -129,10 +112,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -146,10 +126,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -168,10 +145,7 @@ public class MaterialPropertyService {
|
||||
try{
|
||||
result=materialPropertyMapperEx.batchDeleteMaterialPropertyByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jsh.erp.service.app;
|
||||
package com.jsh.erp.service.msg;
|
||||
|
||||
import com.jsh.erp.service.ICommonQuery;
|
||||
import com.jsh.erp.utils.Constants;
|
||||
@@ -11,62 +11,61 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service(value = "app_component")
|
||||
@AppResource
|
||||
public class AppComponent implements ICommonQuery {
|
||||
@Service(value = "msg_component")
|
||||
@MsgResource
|
||||
public class MsgComponent implements ICommonQuery {
|
||||
|
||||
@Resource
|
||||
private AppService appService;
|
||||
private MsgService msgService;
|
||||
|
||||
@Override
|
||||
public Object selectOne(Long id) throws Exception {
|
||||
return appService.getApp(id);
|
||||
return msgService.getMsg(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> select(Map<String, String> map)throws Exception {
|
||||
return getAppList(map);
|
||||
return getMsgList(map);
|
||||
}
|
||||
|
||||
private List<?> getAppList(Map<String, String> map)throws Exception {
|
||||
private List<?> getMsgList(Map<String, String> map) throws Exception{
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String name = StringUtil.getInfo(search, "name");
|
||||
String type = StringUtil.getInfo(search, "type");
|
||||
String order = QueryUtils.order(map);
|
||||
return appService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
String filter = QueryUtils.filter(map);
|
||||
return msgService.select(name, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long counts(Map<String, String> map)throws Exception {
|
||||
public Long counts(Map<String, String> map) throws Exception{
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String name = StringUtil.getInfo(search, "name");
|
||||
String type = StringUtil.getInfo(search, "type");
|
||||
return appService.countApp(name, type);
|
||||
return msgService.countMsg(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(String beanJson, HttpServletRequest request)throws Exception {
|
||||
return appService.insertApp(beanJson, request);
|
||||
return msgService.insertMsg(beanJson, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(String beanJson, Long id)throws Exception {
|
||||
return appService.updateApp(beanJson, id);
|
||||
return msgService.updateMsg(beanJson, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id)throws Exception {
|
||||
return appService.deleteApp(id);
|
||||
return msgService.deleteMsg(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchDelete(String ids)throws Exception {
|
||||
return appService.batchDeleteApp(ids);
|
||||
return msgService.batchDeleteMsg(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
return 0;
|
||||
return msgService.checkIsNameExist(id, name);
|
||||
}
|
||||
|
||||
}
|
||||
15
src/main/java/com/jsh/erp/service/msg/MsgResource.java
Normal file
15
src/main/java/com/jsh/erp/service/msg/MsgResource.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.jsh.erp.service.msg;
|
||||
|
||||
import com.jsh.erp.service.ResourceInfo;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jishenghua qq752718920 2019-9-7 22:52:35
|
||||
*/
|
||||
@ResourceInfo(value = "msg", type = 125)
|
||||
@Inherited
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MsgResource {
|
||||
}
|
||||
229
src/main/java/com/jsh/erp/service/msg/MsgService.java
Normal file
229
src/main/java/com/jsh/erp/service/msg/MsgService.java
Normal file
@@ -0,0 +1,229 @@
|
||||
package com.jsh.erp.service.msg;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Msg;
|
||||
import com.jsh.erp.datasource.entities.MsgExample;
|
||||
import com.jsh.erp.datasource.mappers.MsgMapper;
|
||||
import com.jsh.erp.datasource.mappers.MsgMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.depotHead.DepotHeadService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class MsgService {
|
||||
private Logger logger = LoggerFactory.getLogger(MsgService.class);
|
||||
@Resource
|
||||
private MsgMapper msgMapper;
|
||||
|
||||
@Resource
|
||||
private MsgMapperEx msgMapperEx;
|
||||
|
||||
@Resource
|
||||
private DepotHeadService depotHeadService;
|
||||
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
public Msg getMsg(long id)throws Exception {
|
||||
Msg result=null;
|
||||
try{
|
||||
result=msgMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<Msg> getMsg()throws Exception {
|
||||
MsgExample example = new MsgExample();
|
||||
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Msg> list=null;
|
||||
try{
|
||||
list=msgMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Msg> select(String name, int offset, int rows)throws Exception {
|
||||
List<Msg> list=null;
|
||||
try{
|
||||
list=msgMapperEx.selectByConditionMsg(name, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countMsg(String name)throws Exception {
|
||||
Long result=null;
|
||||
try{
|
||||
result=msgMapperEx.countsByMsg(name);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insertMsg(String beanJson, HttpServletRequest request)throws Exception {
|
||||
Msg msg = JSONObject.parseObject(beanJson, Msg.class);
|
||||
int result=0;
|
||||
try{
|
||||
result=msgMapper.insertSelective(msg);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int updateMsg(String beanJson, Long id) throws Exception{
|
||||
Msg msg = JSONObject.parseObject(beanJson, Msg.class);
|
||||
msg.setId(id);
|
||||
int result=0;
|
||||
try{
|
||||
result=msgMapper.updateByPrimaryKeySelective(msg);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int deleteMsg(Long id)throws Exception {
|
||||
int result=0;
|
||||
try{
|
||||
result=msgMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteMsg(String ids) throws Exception{
|
||||
List<Long> idList = StringUtil.strToLongList(ids);
|
||||
MsgExample example = new MsgExample();
|
||||
example.createCriteria().andIdIn(idList);
|
||||
int result=0;
|
||||
try{
|
||||
result=msgMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
MsgExample example = new MsgExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andMsgTitleEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Msg> list=null;
|
||||
try{
|
||||
list= msgMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* create by: qiankunpingtai
|
||||
* website:https://qiankunpingtai.cn
|
||||
* description:
|
||||
* 逻辑删除角色信息
|
||||
* create time: 2019/3/28 15:44
|
||||
* @Param: ids
|
||||
* @return int
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteMsgByIds(String ids) throws Exception{
|
||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
String [] idArray=ids.split(",");
|
||||
int result=0;
|
||||
try{
|
||||
result=msgMapperEx.batchDeleteMsgByIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<Msg> getMsgByStatus(String status)throws Exception {
|
||||
MsgExample example = new MsgExample();
|
||||
example.createCriteria().andStatusEqualTo(status).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Msg> list=null;
|
||||
try{
|
||||
list=msgMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void batchUpdateStatus(String ids, String status) throws Exception{
|
||||
List<Long> idList = StringUtil.strToLongList(ids);
|
||||
Msg msg = new Msg();
|
||||
msg.setStatus(status);
|
||||
MsgExample example = new MsgExample();
|
||||
example.createCriteria().andIdIn(idList);
|
||||
try{
|
||||
msgMapper.updateByExampleSelective(msg, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.OrgaUserRelMapper;
|
||||
import com.jsh.erp.datasource.mappers.OrgaUserRelMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.organization.OrganizationService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
@@ -53,10 +54,7 @@ public class OrgaUserRelService {
|
||||
try{
|
||||
result=orgaUserRelMapper.insertSelective(orgaUserRel);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -68,10 +66,7 @@ public class OrgaUserRelService {
|
||||
try{
|
||||
result=orgaUserRelMapper.updateByPrimaryKeySelective(orgaUserRel);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -81,10 +76,7 @@ public class OrgaUserRelService {
|
||||
try{
|
||||
result=orgaUserRelMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -97,10 +89,7 @@ public class OrgaUserRelService {
|
||||
try{
|
||||
result=orgaUserRelMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -137,10 +126,7 @@ public class OrgaUserRelService {
|
||||
try{
|
||||
result=orgaUserRelMapperEx.addOrgaUserRel(orgaUserRel);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result>0){
|
||||
return orgaUserRel;
|
||||
@@ -170,10 +156,7 @@ public class OrgaUserRelService {
|
||||
try{
|
||||
result=orgaUserRelMapperEx.updateOrgaUserRel(orgaUserRel);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result>0){
|
||||
return orgaUserRel;
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.jsh.erp.datasource.mappers.OrganizationMapper;
|
||||
import com.jsh.erp.datasource.mappers.OrganizationMapperEx;
|
||||
import com.jsh.erp.datasource.vo.TreeNode;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -56,10 +57,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapper.insertSelective(organization);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -71,10 +69,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapper.updateByPrimaryKeySelective(organization);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -84,10 +79,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -100,10 +92,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -138,10 +127,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapperEx.addOrganization(org);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -171,10 +157,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapperEx.editOrganization(org);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -184,10 +167,7 @@ public class OrganizationService {
|
||||
try{
|
||||
list=organizationMapperEx.getNodeTree(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -199,10 +179,7 @@ public class OrganizationService {
|
||||
try{
|
||||
list=organizationMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -214,10 +191,7 @@ public class OrganizationService {
|
||||
try{
|
||||
list=organizationMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -269,10 +243,7 @@ public class OrganizationService {
|
||||
result=organizationMapperEx.batchDeleteOrganizationByIds(
|
||||
new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.DepotHeadMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.PersonMapper;
|
||||
import com.jsh.erp.datasource.mappers.PersonMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -48,10 +49,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -63,10 +61,7 @@ public class PersonService {
|
||||
try{
|
||||
list=personMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -76,10 +71,7 @@ public class PersonService {
|
||||
try{
|
||||
list=personMapperEx.selectByConditionPerson(name, type, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -89,10 +81,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapperEx.countsByPerson(name, type);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -104,10 +93,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapper.insertSelective(person);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -120,10 +106,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapper.updateByPrimaryKeySelective(person);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -134,10 +117,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -151,10 +131,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -166,10 +143,7 @@ public class PersonService {
|
||||
try{
|
||||
list=personMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -183,10 +157,7 @@ public class PersonService {
|
||||
try{
|
||||
list=personMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if (null != list) {
|
||||
@@ -205,10 +176,7 @@ public class PersonService {
|
||||
try{
|
||||
list=personMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -224,10 +192,7 @@ public class PersonService {
|
||||
try{
|
||||
result=personMapperEx.batchDeletePersonByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -260,10 +225,7 @@ public class PersonService {
|
||||
try{
|
||||
accountHeadList=accountHeadMapperEx.getAccountHeadListByHandsPersonIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(accountHeadList!=null&&accountHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,HandsPersonIds[{}]",
|
||||
@@ -278,10 +240,7 @@ public class PersonService {
|
||||
try{
|
||||
depotHeadList=depotHeadMapperEx.getDepotHeadListByHandsPersonIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(depotHeadList!=null&&depotHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,HandsPersonIds[{}]",
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.RoleMapper;
|
||||
import com.jsh.erp.datasource.mappers.RoleMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -43,10 +44,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -56,10 +54,7 @@ public class RoleService {
|
||||
try{
|
||||
list=roleMapperEx.getRoleList(parameterMap);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -69,10 +64,7 @@ public class RoleService {
|
||||
try{
|
||||
list=roleMapperEx.selectByConditionRole(name, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -82,10 +74,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapperEx.countsByRole(name);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -97,10 +86,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapper.insertSelective(role);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -113,10 +99,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapper.updateByPrimaryKeySelective(role);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -127,10 +110,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -144,10 +124,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -160,10 +137,7 @@ public class RoleService {
|
||||
try{
|
||||
list=roleMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -187,10 +161,7 @@ public class RoleService {
|
||||
try{
|
||||
result=roleMapperEx.batchDeleteRoleByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.*;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
@@ -53,10 +54,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -67,10 +65,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
list=serialNumberMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -80,10 +75,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
list=serialNumberMapperEx.selectByConditionSerialNumber(serialNumber, materialName,offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -94,10 +86,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapperEx.countSerialNumber(serialNumber, materialName);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -110,10 +99,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapper.insertSelective(serialNumber);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -126,10 +112,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapper.updateByPrimaryKeySelective(serialNumber);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -140,10 +123,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -157,10 +137,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -172,10 +149,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
list=serialNumberMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -192,10 +166,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result=serialNumberMapper.updateByExampleSelective(serialNumber, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -206,10 +177,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
list=serialNumberMapperEx.findById(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -226,10 +194,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
mlist = materialMapperEx.findByMaterialName(materialName);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
if(mlist==null||mlist.size()<1){
|
||||
@@ -250,10 +215,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
list = serialNumberMapperEx.findBySerialNumber(serialNumber);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(list!=null&&list.size()>0){
|
||||
if(list.size()>1){
|
||||
@@ -305,10 +267,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result = serialNumberMapperEx.addSerialNumber(serialNumberEx);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result>0){
|
||||
return serialNumberEx;
|
||||
@@ -333,10 +292,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result = serialNumberMapperEx.updateSerialNumber(serialNumberEx);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result>0){
|
||||
return serialNumberEx;
|
||||
@@ -357,10 +313,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
mlist = materialMapperEx.findByMaterialName(materialName);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if (mlist == null || mlist.size() < 1) {
|
||||
//商品名称不存在
|
||||
@@ -471,10 +424,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result = serialNumberMapperEx.sellSerialNumber(materialId,depotheadId,count,new Date(),user==null?null:user.getId());
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -496,10 +446,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result = serialNumberMapperEx.cancelSerialNumber(materialId,depotheadId,count,new Date(),user==null?null:user.getId());
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -507,7 +454,7 @@ public class SerialNumberService {
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
*批量添加序列号
|
||||
*批量添加序列号,最多500个
|
||||
* create time: 2019/1/29 15:11
|
||||
* @Param: materialName
|
||||
* @Param: serialNumberPrefix
|
||||
@@ -555,10 +502,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result = serialNumberMapperEx.batAddSerialNumber(list);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
serialNumberMapperEx.batAddSerialNumber(list);
|
||||
batAddTotal -= BusinessConstants.BATCH_INSERT_MAX_NUMBER;
|
||||
@@ -585,10 +529,7 @@ public class SerialNumberService {
|
||||
try{
|
||||
result = serialNumberMapperEx.batchDeleteSerialNumberByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.DepotHeadMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.SupplierMapper;
|
||||
import com.jsh.erp.datasource.mappers.SupplierMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.accountHead.AccountHeadService;
|
||||
import com.jsh.erp.service.depotHead.DepotHeadService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
@@ -57,10 +58,7 @@ public class SupplierService {
|
||||
try{
|
||||
result=supplierMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -72,10 +70,7 @@ public class SupplierService {
|
||||
try{
|
||||
list=supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -117,10 +112,7 @@ public class SupplierService {
|
||||
resList.add(s);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
@@ -130,10 +122,7 @@ public class SupplierService {
|
||||
try{
|
||||
result=supplierMapperEx.countsBySupplier(supplier, type, phonenum, telephone, description);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -145,10 +134,7 @@ public class SupplierService {
|
||||
try{
|
||||
result=supplierMapper.insertSelective(supplier);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -167,10 +153,7 @@ public class SupplierService {
|
||||
try{
|
||||
result=supplierMapper.updateByPrimaryKeySelective(supplier);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -181,10 +164,7 @@ public class SupplierService {
|
||||
try{
|
||||
result=supplierMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return supplierMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
@@ -198,10 +178,7 @@ public class SupplierService {
|
||||
try{
|
||||
result=supplierMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -213,10 +190,7 @@ public class SupplierService {
|
||||
try{
|
||||
list= supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -230,10 +204,7 @@ public class SupplierService {
|
||||
try{
|
||||
supplier = supplierMapper.selectByPrimaryKey(supplierId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
int result=0;
|
||||
try{
|
||||
@@ -242,10 +213,7 @@ public class SupplierService {
|
||||
result=supplierMapper.updateByPrimaryKeySelective(supplier);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -258,10 +226,7 @@ public class SupplierService {
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -275,10 +240,7 @@ public class SupplierService {
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -292,10 +254,7 @@ public class SupplierService {
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -309,10 +268,7 @@ public class SupplierService {
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -331,10 +287,7 @@ public class SupplierService {
|
||||
try{
|
||||
result = supplierMapper.updateByExampleSelective(supplier, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -348,10 +301,7 @@ public class SupplierService {
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -362,10 +312,7 @@ public class SupplierService {
|
||||
try{
|
||||
list = supplierMapperEx.findByAll(supplier, type, phonenum, telephone, description);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -383,8 +330,6 @@ public class SupplierService {
|
||||
info.code = 200;
|
||||
data.put("message", "成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
e.printStackTrace();
|
||||
info.code = 500;
|
||||
data.put("message", e.getMessage());
|
||||
@@ -403,10 +348,7 @@ public class SupplierService {
|
||||
try{
|
||||
result = supplierMapperEx.batchDeleteSupplierByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -439,10 +381,7 @@ public class SupplierService {
|
||||
try{
|
||||
accountHeadList = accountHeadMapperEx.getAccountHeadListByOrganIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(accountHeadList!=null&&accountHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,OrganIds[{}]",
|
||||
@@ -457,10 +396,7 @@ public class SupplierService {
|
||||
try{
|
||||
depotHeadList = depotHeadMapperEx.getDepotHeadListByOrganIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(depotHeadList!=null&&depotHeadList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,OrganIds[{}]",
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.SystemConfigMapper;
|
||||
import com.jsh.erp.datasource.mappers.SystemConfigMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -44,10 +45,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -59,10 +57,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
list=systemConfigMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -71,10 +66,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
list=systemConfigMapperEx.selectByConditionSystemConfig(companyName, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -84,10 +76,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapperEx.countsBySystemConfig(companyName);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -99,10 +88,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapper.insertSelective(systemConfig);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -115,10 +101,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapper.updateByPrimaryKeySelective(systemConfig);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -129,10 +112,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -146,10 +126,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -161,10 +138,7 @@ public class SystemConfigService {
|
||||
try{
|
||||
list=systemConfigMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -180,11 +154,42 @@ public class SystemConfigService {
|
||||
try{
|
||||
result=systemConfigMapperEx.batchDeleteSystemConfigByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仓库开关
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public boolean getDepotFlag() throws Exception {
|
||||
boolean depotFlag = false;
|
||||
List<SystemConfig> list = getSystemConfig();
|
||||
if(list.size()>0) {
|
||||
String flag = list.get(0).getDepotFlag();
|
||||
if(("1").equals(flag)) {
|
||||
depotFlag = true;
|
||||
}
|
||||
}
|
||||
return depotFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户开关
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public boolean getCustomerFlag() throws Exception {
|
||||
boolean customerFlag = false;
|
||||
List<SystemConfig> list = getSystemConfig();
|
||||
if(list.size()>0) {
|
||||
String flag = list.get(0).getCustomerFlag();
|
||||
if(("1").equals(flag)) {
|
||||
customerFlag = true;
|
||||
}
|
||||
}
|
||||
return customerFlag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.jsh.erp.service.tenant;
|
||||
|
||||
import com.jsh.erp.service.ICommonQuery;
|
||||
import com.jsh.erp.service.user.UserResource;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.Constants;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service(value = "tenant_component")
|
||||
@TenantResource
|
||||
public class TenantComponent implements ICommonQuery {
|
||||
|
||||
@Resource
|
||||
private TenantService tenantService;
|
||||
|
||||
@Override
|
||||
public Object selectOne(Long id) throws Exception {
|
||||
return tenantService.getTenant(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> select(Map<String, String> map)throws Exception {
|
||||
return getTenantList(map);
|
||||
}
|
||||
|
||||
private List<?> getTenantList(Map<String, String> map)throws Exception {
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String loginName = StringUtil.getInfo(search, "loginName");
|
||||
return tenantService.select(loginName, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long counts(Map<String, String> map)throws Exception {
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String loginName = StringUtil.getInfo(search, "loginName");
|
||||
return tenantService.countTenant(loginName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(String beanJson, HttpServletRequest request)throws Exception {
|
||||
return tenantService.insertTenant(beanJson, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(String beanJson, Long id)throws Exception {
|
||||
return tenantService.updateTenant(beanJson, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id)throws Exception {
|
||||
return tenantService.deleteTenant(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchDelete(String ids)throws Exception {
|
||||
return tenantService.batchDeleteTenant(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
return tenantService.checkIsNameExist(id, name);
|
||||
}
|
||||
|
||||
}
|
||||
15
src/main/java/com/jsh/erp/service/tenant/TenantResource.java
Normal file
15
src/main/java/com/jsh/erp/service/tenant/TenantResource.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.jsh.erp.service.tenant;
|
||||
|
||||
import com.jsh.erp.service.ResourceInfo;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jishenghua qq752718920 2019-6-27 22:56:56
|
||||
*/
|
||||
@ResourceInfo(value = "tenant", type = 120)
|
||||
@Inherited
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TenantResource {
|
||||
}
|
||||
145
src/main/java/com/jsh/erp/service/tenant/TenantService.java
Normal file
145
src/main/java/com/jsh/erp/service/tenant/TenantService.java
Normal file
@@ -0,0 +1,145 @@
|
||||
package com.jsh.erp.service.tenant;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.TenantMapper;
|
||||
import com.jsh.erp.datasource.mappers.TenantMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class TenantService {
|
||||
private Logger logger = LoggerFactory.getLogger(TenantService.class);
|
||||
@Resource
|
||||
private TenantMapper tenantMapper;
|
||||
@Resource
|
||||
private TenantMapperEx tenantMapperEx;
|
||||
|
||||
|
||||
public Tenant getTenant(long id)throws Exception {
|
||||
Tenant result=null;
|
||||
try{
|
||||
result=tenantMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<Tenant> getTenant()throws Exception {
|
||||
TenantExample example = new TenantExample();
|
||||
List<Tenant> list=null;
|
||||
try{
|
||||
list=tenantMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Tenant> select(String loginName, int offset, int rows)throws Exception {
|
||||
List<Tenant> list=null;
|
||||
try{
|
||||
list=tenantMapperEx.selectByConditionTenant(loginName, offset, rows);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countTenant(String loginName)throws Exception {
|
||||
Long result=null;
|
||||
try{
|
||||
result=tenantMapperEx.countsByTenant(loginName);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insertTenant(String beanJson, HttpServletRequest request)throws Exception {
|
||||
Tenant tenant = JSONObject.parseObject(beanJson, Tenant.class);
|
||||
int result=0;
|
||||
try{
|
||||
tenant.setUserNumLimit(2); //默认用户限制数量
|
||||
tenant.setBillsNumLimit(200); //默认单据限制数量
|
||||
tenant.setCreateTime(new Date());
|
||||
result=tenantMapper.insertSelective(tenant);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int updateTenant(String beanJson, Long id)throws Exception {
|
||||
Tenant tenant = JSONObject.parseObject(beanJson, Tenant.class);
|
||||
int result=0;
|
||||
try{
|
||||
tenant.setId(id);
|
||||
result=tenantMapper.updateByPrimaryKeySelective(tenant);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int deleteTenant(Long id)throws Exception {
|
||||
int result=0;
|
||||
try{
|
||||
result= tenantMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDeleteTenant(String ids)throws Exception {
|
||||
List<Long> idList = StringUtil.strToLongList(ids);
|
||||
TenantExample example = new TenantExample();
|
||||
example.createCriteria().andIdIn(idList);
|
||||
int result=0;
|
||||
try{
|
||||
result= tenantMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
TenantExample example = new TenantExample();
|
||||
example.createCriteria().andIdEqualTo(id);
|
||||
List<Tenant> list=null;
|
||||
try{
|
||||
list= tenantMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
public Tenant getTenantByTenantId(long tenantId) {
|
||||
Tenant tenant = new Tenant();
|
||||
TenantExample example = new TenantExample();
|
||||
example.createCriteria().andTenantIdEqualTo(tenantId);
|
||||
List<Tenant> list = tenantMapper.selectByExample(example);
|
||||
if(list.size()>0) {
|
||||
tenant = list.get(0);
|
||||
}
|
||||
return tenant;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.jsh.erp.service.unit;
|
||||
|
||||
import com.jsh.erp.service.ICommonQuery;
|
||||
import com.jsh.erp.service.app.AppResource;
|
||||
import com.jsh.erp.utils.Constants;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsh.erp.datasource.mappers.MaterialMapperEx;
|
||||
import com.jsh.erp.datasource.mappers.UnitMapper;
|
||||
import com.jsh.erp.datasource.mappers.UnitMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -45,10 +46,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -60,10 +58,7 @@ public class UnitService {
|
||||
try{
|
||||
list=unitMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -73,10 +68,7 @@ public class UnitService {
|
||||
try{
|
||||
list=unitMapperEx.selectByConditionUnit(name, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -86,10 +78,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapperEx.countsByUnit(name);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -101,10 +90,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapper.insertSelective(unit);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -117,10 +103,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapper.updateByPrimaryKeySelective(unit);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -131,10 +114,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -148,10 +128,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -163,10 +140,7 @@ public class UnitService {
|
||||
try{
|
||||
list=unitMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -181,10 +155,7 @@ public class UnitService {
|
||||
try{
|
||||
result=unitMapperEx.batchDeleteUnitByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -217,10 +188,7 @@ public class UnitService {
|
||||
try{
|
||||
materialList=materialMapperEx.getMaterialListByUnitIds(idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(materialList!=null&&materialList.size()>0){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,UnitIds[{}]",
|
||||
|
||||
@@ -13,11 +13,11 @@ import com.jsh.erp.datasource.mappers.UserMapper;
|
||||
import com.jsh.erp.datasource.mappers.UserMapperEx;
|
||||
import com.jsh.erp.datasource.vo.TreeNodeEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.orgaUserRel.OrgaUserRelService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.ExceptionCodeConstants;
|
||||
import com.jsh.erp.utils.JshException;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import com.jsh.erp.utils.Tools;
|
||||
import org.apache.ibatis.annotations.DeleteProvider;
|
||||
@@ -60,10 +60,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -74,10 +71,7 @@ public class UserService {
|
||||
try{
|
||||
list=userMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -87,10 +81,7 @@ public class UserService {
|
||||
try{
|
||||
list=userMapperEx.selectByConditionUser(userName, loginName, offset, rows);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -100,10 +91,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapperEx.countsByUser(userName, loginName);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -132,10 +120,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapper.insertSelective(user);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -156,10 +141,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapper.updateByPrimaryKeySelective(user);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -180,10 +162,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapper.updateByPrimaryKeySelective(user);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -208,10 +187,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapper.updateByPrimaryKeySelective(user);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -222,10 +198,7 @@ public class UserService {
|
||||
try{
|
||||
result= userMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -239,16 +212,12 @@ public class UserService {
|
||||
try{
|
||||
result= userMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int validateUser(String username, String password) throws JshException {
|
||||
try {
|
||||
public int validateUser(String username, String password){
|
||||
/**默认是可以登录的*/
|
||||
List<User> list = null;
|
||||
try {
|
||||
@@ -275,9 +244,6 @@ public class UserService {
|
||||
return ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR;
|
||||
}
|
||||
return ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT;
|
||||
} catch (Exception e) {
|
||||
throw new JshException("unknown exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
public User getUserByUserName(String username)throws Exception {
|
||||
@@ -287,10 +253,7 @@ public class UserService {
|
||||
try{
|
||||
list= userMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
User user =null;
|
||||
if(list!=null&&list.size()>0){
|
||||
@@ -309,10 +272,7 @@ public class UserService {
|
||||
try{
|
||||
list= userMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
@@ -334,10 +294,7 @@ public class UserService {
|
||||
try{
|
||||
list= userMapperEx.getUserList(parameterMap);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -406,10 +363,7 @@ public class UserService {
|
||||
try{
|
||||
result= userMapperEx.addUser(ue);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result>0){
|
||||
return ue;
|
||||
@@ -480,10 +434,7 @@ public class UserService {
|
||||
try{
|
||||
userMapper.updateByPrimaryKeySelective(user);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,10 +493,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapperEx.updateUser(ue);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result>0){
|
||||
return ue;
|
||||
@@ -645,10 +593,7 @@ public class UserService {
|
||||
try{
|
||||
list=userMapperEx.getUserListByUserNameAndTenantId(userName,tenantId);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -661,10 +606,7 @@ public class UserService {
|
||||
try{
|
||||
list=userMapperEx.getUserListByLoginName(loginName);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -699,10 +641,7 @@ public class UserService {
|
||||
try{
|
||||
result=userMapperEx.batDeleteOrUpdateUser(idsArray,BusinessConstants.USER_STATUS_DELETE);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
if(result<1){
|
||||
logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]",
|
||||
@@ -717,10 +656,7 @@ public class UserService {
|
||||
try{
|
||||
list=userMapperEx.getNodeTree();
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.mappers.UserBusinessMapper;
|
||||
import com.jsh.erp.datasource.mappers.UserBusinessMapperEx;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.CommonQueryManager;
|
||||
import com.jsh.erp.service.app.AppService;
|
||||
import com.jsh.erp.service.functions.FunctionsService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
@@ -41,9 +41,6 @@ public class UserBusinessService {
|
||||
@Resource
|
||||
private FunctionsService functionsService;
|
||||
|
||||
@Resource
|
||||
private AppService appService;
|
||||
|
||||
@Resource
|
||||
private CommonQueryManager configResourceManager;
|
||||
|
||||
@@ -52,10 +49,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result=userBusinessMapper.selectByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -67,10 +61,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
list=userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -82,14 +73,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result=userBusinessMapper.insertSelective(userBusiness);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
// 更新应用权限
|
||||
if (BusinessConstants.TYPE_NAME_ROLE_FUNCTIONS.equals(userBusiness.getType()) && result > 0) {
|
||||
result = insertOrUpdateAppValue(BusinessConstants.TYPE_NAME_ROLE_APP, userBusiness.getKeyid(), userBusiness.getValue());
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -102,14 +86,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result=userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
// 更新应用权限
|
||||
if (BusinessConstants.TYPE_NAME_ROLE_FUNCTIONS.equals(userBusiness.getType()) && result > 0) {
|
||||
result = insertOrUpdateAppValue(BusinessConstants.TYPE_NAME_ROLE_APP, userBusiness.getKeyid(), userBusiness.getValue());
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -120,10 +97,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result=userBusinessMapper.deleteByPrimaryKey(id);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -137,10 +111,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result=userBusinessMapper.deleteByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -157,10 +128,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -173,10 +141,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
Long id = null;
|
||||
if(list!=null&&list.size() > 0) {
|
||||
@@ -199,10 +164,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(list!=null&&list.size() > 0) {
|
||||
return true;
|
||||
@@ -224,10 +186,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result= userBusinessMapper.updateByExampleSelective(userBusiness, example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -240,10 +199,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -257,10 +213,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -276,60 +229,7 @@ public class UserBusinessService {
|
||||
try{
|
||||
result= userBusinessMapperEx.batchDeleteUserBusinessByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过功能(RoleFunctions)权限更新应用(RoleApp)权限
|
||||
* @param type
|
||||
* @param keyId
|
||||
* @param functionIds
|
||||
* @return
|
||||
*/
|
||||
public int insertOrUpdateAppValue(String type, String keyId, String functionIds) throws Exception{
|
||||
int result=0;
|
||||
functionIds = functionIds.replaceAll("\\]\\[", ",").
|
||||
replaceAll("\\[","").replaceAll("\\]","");
|
||||
List<Functions> functionsList = functionsService.findByIds(functionIds);
|
||||
if (!CollectionUtils.isEmpty(functionsList)) {
|
||||
Set<String> appNumbers = new HashSet<>();
|
||||
String appNumber;
|
||||
for (Functions functions : functionsList) {
|
||||
appNumber = functions.getNumber().substring(0, 2);
|
||||
appNumbers.add(appNumber);
|
||||
}
|
||||
List<String> appNumberList = new ArrayList<>(appNumbers);
|
||||
List<App> appList = appService.findAppByNumber(appNumberList);
|
||||
StringBuilder appIdSb = new StringBuilder();
|
||||
if (!CollectionUtils.isEmpty(appList)) {
|
||||
for (App app : appList) {
|
||||
appIdSb.append("[" + app.getId() + "]");
|
||||
}
|
||||
List<UserBusiness> userBusinessList = getBasicData(keyId, type);
|
||||
try{
|
||||
if(userBusinessList.size() > 0) {
|
||||
UserBusiness userBusiness = userBusinessList.get(0);
|
||||
userBusiness.setValue(appIdSb.toString());
|
||||
result = userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
|
||||
} else {
|
||||
UserBusiness userBusiness = new UserBusiness();
|
||||
userBusiness.setType(type);
|
||||
userBusiness.setKeyid(keyId);
|
||||
userBusiness.setValue(appIdSb.toString());
|
||||
result = userBusinessMapper.insertSelective(userBusiness);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||
}
|
||||
}
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -138,58 +138,4 @@ public class ExtJsonUtils {
|
||||
public interface ExtExtractor {
|
||||
String getExt(Object bean);
|
||||
}
|
||||
|
||||
private static class MetaInfo {
|
||||
private final static ParserConfig INSTANCE = ParserConfig.getGlobalInstance();
|
||||
|
||||
private final Object object;
|
||||
private final Map<String, FieldDeserializer> map;
|
||||
private final JSONObject ext = new JSONObject();
|
||||
|
||||
private MetaInfo(Object object) {
|
||||
this.object = object;
|
||||
this.map = INSTANCE.getFieldDeserializers(object.getClass());
|
||||
}
|
||||
|
||||
void gather(String key, Object value) {
|
||||
if (!map.containsKey(key)) {
|
||||
ext.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(ExtExtractor extractor) {
|
||||
JSONObject old = JSON.parseObject(extractor.getExt(object));
|
||||
if (old == null) {
|
||||
old = new JSONObject();
|
||||
}
|
||||
old.putAll(ext);
|
||||
map.get(EXT_NAME).setValue(object, old.toJSONString());
|
||||
}
|
||||
|
||||
static boolean hasExt(Class<?> clazz) {
|
||||
return INSTANCE.getFieldDeserializers(clazz).containsKey(EXT_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T parseObject(String text, final Class<T> clazz, ExtExtractor extractor) {
|
||||
final Map<Object, MetaInfo> map = new HashMap<>();
|
||||
|
||||
T object = JSON.parseObject(text, clazz, new ExtraProcessor() {
|
||||
@Override
|
||||
public void processExtra(Object object, String key, Object value) {
|
||||
if (!map.containsKey(object) && MetaInfo.hasExt(object.getClass())) {
|
||||
map.put(object, new MetaInfo(object));
|
||||
}
|
||||
if (map.containsKey(object)) {
|
||||
map.get(object).gather(key, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (Map.Entry<Object, MetaInfo> entry : map.entrySet()) {
|
||||
entry.getValue().update(extractor);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.jsh.erp.utils;
|
||||
|
||||
/**
|
||||
* @author jishenghua
|
||||
* @title: 平台异常基类
|
||||
* @description: 用于包装一些异常信息,打印日志等服务
|
||||
* @qq 7 5 2 7 1 8 9 2 0
|
||||
* @since: 2014-02-24
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JshException extends Exception {
|
||||
public long errorCode = -1;
|
||||
|
||||
public String message;
|
||||
|
||||
public JshException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public JshException(String message) {
|
||||
super(message);
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public JshException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public JshException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public JshException(long errorCode) {
|
||||
super();
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public JshException(String message, long errorCode) {
|
||||
super(message);
|
||||
this.errorCode = errorCode;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public JshException(String message, long errorCode, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.errorCode = errorCode;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public JshException(long errorCode, Throwable cause) {
|
||||
super(cause);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public long getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -215,4 +215,16 @@ public class StringUtil {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static String toNull(String value) {
|
||||
if(("").equals(value)) {
|
||||
value = null;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int i = 10/3;
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,41 @@ public class Tools {
|
||||
return new SimpleDateFormat("yyyy-MM").format(cal.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前月份的前6个月(含当前月)
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getSixMonth(String date) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
int month = Integer.parseInt(date.substring(5, 7));
|
||||
int year = Integer.parseInt(date.substring(0, 4));
|
||||
for (int i = 5; i >= 0; i--) {
|
||||
if (month > 6) {
|
||||
if (month - i >= 10) {
|
||||
list.add(year + "-" + String.valueOf(month - i));
|
||||
} else {
|
||||
list.add(year + "-0" + String.valueOf(month - i));
|
||||
}
|
||||
} else {
|
||||
if (month - i <= 0) {
|
||||
if (month - i + 12 >= 10) {
|
||||
list.add(String.valueOf(year - 1) + "-" + String.valueOf(month - i + 12));
|
||||
} else {
|
||||
list.add(String.valueOf(year - 1) + "-0" + String.valueOf(month - i + 12));
|
||||
}
|
||||
} else {
|
||||
if (month - i >= 10) {
|
||||
list.add(String.valueOf(year) + "-" + String.valueOf(month - i));
|
||||
} else {
|
||||
list.add(String.valueOf(year) + "-0" + String.valueOf(month - i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 截取字符串长度
|
||||
*
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
server.port=8080
|
||||
#server.port=443
|
||||
#server.ssl.key-store=classpath:jishenghua.jks
|
||||
#server.ssl.key-alias=alias
|
||||
#server.ssl.key-store-password=M9z21aFp
|
||||
#server.ssl.key-store-type=JKS
|
||||
#ssl的开关
|
||||
server.ssl.enable=false
|
||||
#登录超时-秒
|
||||
server.servlet.session.timeout=36000
|
||||
#数据库连接
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/jsh_erp?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&defaultFetchSize=500&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
spring.datasource.username=root
|
||||
@@ -25,14 +35,10 @@ pagehelper.reasonable=false
|
||||
pagehelper.params=pageNum=pageHelperStart;pageSize=pageHelperRows;
|
||||
pagehelper.supportMethodsArguments=false
|
||||
#mybatis-plus配置
|
||||
#open开启 close关闭
|
||||
mybatis-plus.status=close
|
||||
mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml
|
||||
#跳过某些方法过滤配置
|
||||
mybatis-plus.global-config.sql-parser-cache=true
|
||||
#获取管理系统信息
|
||||
manage.ip=127.0.0.1
|
||||
manage.port=8090
|
||||
manage.roleId=10
|
||||
|
||||
|
||||
|
||||
BIN
src/main/resources/jishenghua.jks
Normal file
BIN
src/main/resources/jishenghua.jks
Normal file
Binary file not shown.
@@ -1,458 +0,0 @@
|
||||
<?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.AppMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.App">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="Id" jdbcType="BIGINT" property="id" />
|
||||
<result column="Number" jdbcType="VARCHAR" property="number" />
|
||||
<result column="Name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="Type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="Icon" jdbcType="VARCHAR" property="icon" />
|
||||
<result column="URL" jdbcType="VARCHAR" property="url" />
|
||||
<result column="Width" jdbcType="VARCHAR" property="width" />
|
||||
<result column="Height" jdbcType="VARCHAR" property="height" />
|
||||
<result column="ReSize" jdbcType="BIT" property="resize" />
|
||||
<result column="OpenMax" jdbcType="BIT" property="openmax" />
|
||||
<result column="Flash" jdbcType="BIT" property="flash" />
|
||||
<result column="ZL" jdbcType="VARCHAR" property="zl" />
|
||||
<result column="Sort" jdbcType="VARCHAR" property="sort" />
|
||||
<result column="Remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="Enabled" jdbcType="BIT" property="enabled" />
|
||||
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
Id, Number, Name, Type, Icon, URL, Width, Height, ReSize, OpenMax, Flash, ZL, Sort,
|
||||
Remark, Enabled, delete_Flag, tenant_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AppExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_app
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_app
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_app
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AppExample">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_app
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.App">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_app (Id, Number, Name,
|
||||
Type, Icon, URL, Width,
|
||||
Height, ReSize, OpenMax, Flash,
|
||||
ZL, Sort, Remark, Enabled,
|
||||
delete_Flag, tenant_id)
|
||||
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR},
|
||||
#{height,jdbcType=VARCHAR}, #{resize,jdbcType=BIT}, #{openmax,jdbcType=BIT}, #{flash,jdbcType=BIT},
|
||||
#{zl,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT},
|
||||
#{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.App">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_app
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
Id,
|
||||
</if>
|
||||
<if test="number != null">
|
||||
Number,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
Name,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
Type,
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
Icon,
|
||||
</if>
|
||||
<if test="url != null">
|
||||
URL,
|
||||
</if>
|
||||
<if test="width != null">
|
||||
Width,
|
||||
</if>
|
||||
<if test="height != null">
|
||||
Height,
|
||||
</if>
|
||||
<if test="resize != null">
|
||||
ReSize,
|
||||
</if>
|
||||
<if test="openmax != null">
|
||||
OpenMax,
|
||||
</if>
|
||||
<if test="flash != null">
|
||||
Flash,
|
||||
</if>
|
||||
<if test="zl != null">
|
||||
ZL,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
Sort,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
Remark,
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
Enabled,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_Flag,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
#{number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
#{icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="url != null">
|
||||
#{url,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="width != null">
|
||||
#{width,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="height != null">
|
||||
#{height,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="resize != null">
|
||||
#{resize,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="openmax != null">
|
||||
#{openmax,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="flash != null">
|
||||
#{flash,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="zl != null">
|
||||
#{zl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
#{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AppExample" resultType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_app
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_app
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
Id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.number != null">
|
||||
Number = #{record.number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
Name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
Type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.icon != null">
|
||||
Icon = #{record.icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.url != null">
|
||||
URL = #{record.url,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.width != null">
|
||||
Width = #{record.width,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.height != null">
|
||||
Height = #{record.height,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.resize != null">
|
||||
ReSize = #{record.resize,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.openmax != null">
|
||||
OpenMax = #{record.openmax,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.flash != null">
|
||||
Flash = #{record.flash,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.zl != null">
|
||||
ZL = #{record.zl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.sort != null">
|
||||
Sort = #{record.sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
Remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
Enabled = #{record.enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.deleteFlag != null">
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_app
|
||||
set Id = #{record.id,jdbcType=BIGINT},
|
||||
Number = #{record.number,jdbcType=VARCHAR},
|
||||
Name = #{record.name,jdbcType=VARCHAR},
|
||||
Type = #{record.type,jdbcType=VARCHAR},
|
||||
Icon = #{record.icon,jdbcType=VARCHAR},
|
||||
URL = #{record.url,jdbcType=VARCHAR},
|
||||
Width = #{record.width,jdbcType=VARCHAR},
|
||||
Height = #{record.height,jdbcType=VARCHAR},
|
||||
ReSize = #{record.resize,jdbcType=BIT},
|
||||
OpenMax = #{record.openmax,jdbcType=BIT},
|
||||
Flash = #{record.flash,jdbcType=BIT},
|
||||
ZL = #{record.zl,jdbcType=VARCHAR},
|
||||
Sort = #{record.sort,jdbcType=VARCHAR},
|
||||
Remark = #{record.remark,jdbcType=VARCHAR},
|
||||
Enabled = #{record.enabled,jdbcType=BIT},
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.App">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_app
|
||||
<set>
|
||||
<if test="number != null">
|
||||
Number = #{number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
Name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
Type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
Icon = #{icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="url != null">
|
||||
URL = #{url,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="width != null">
|
||||
Width = #{width,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="height != null">
|
||||
Height = #{height,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="resize != null">
|
||||
ReSize = #{resize,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="openmax != null">
|
||||
OpenMax = #{openmax,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="flash != null">
|
||||
Flash = #{flash,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="zl != null">
|
||||
ZL = #{zl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
Sort = #{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
Remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
Enabled = #{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.App">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_app
|
||||
set Number = #{number,jdbcType=VARCHAR},
|
||||
Name = #{name,jdbcType=VARCHAR},
|
||||
Type = #{type,jdbcType=VARCHAR},
|
||||
Icon = #{icon,jdbcType=VARCHAR},
|
||||
URL = #{url,jdbcType=VARCHAR},
|
||||
Width = #{width,jdbcType=VARCHAR},
|
||||
Height = #{height,jdbcType=VARCHAR},
|
||||
ReSize = #{resize,jdbcType=BIT},
|
||||
OpenMax = #{openmax,jdbcType=BIT},
|
||||
Flash = #{flash,jdbcType=BIT},
|
||||
ZL = #{zl,jdbcType=VARCHAR},
|
||||
Sort = #{sort,jdbcType=VARCHAR},
|
||||
Remark = #{remark,jdbcType=VARCHAR},
|
||||
Enabled = #{enabled,jdbcType=BIT},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT}
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,45 +0,0 @@
|
||||
<?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.AppMapperEx">
|
||||
<select id="selectByConditionApp" parameterType="com.jsh.erp.datasource.entities.AppExample" resultMap="com.jsh.erp.datasource.mappers.AppMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_app
|
||||
where 1=1
|
||||
<if test="name != null and name != ''">
|
||||
<bind name="name" value="'%' + _parameter.name + '%'"/>
|
||||
and name like #{name}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type=#{type}
|
||||
</if>
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
order by sort asc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByApp" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_app
|
||||
WHERE 1=1
|
||||
<if test="name != null and name != ''">
|
||||
<bind name="name" value="'%' + _parameter.name + '%'"/>
|
||||
and name like #{name}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type=#{type}
|
||||
</if>
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
</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>
|
||||
@@ -3,9 +3,11 @@
|
||||
<mapper namespace="com.jsh.erp.datasource.mappers.DepotHeadMapperEx">
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.vo.DepotHeadVo4List">
|
||||
<result column="ProjectName" jdbcType="VARCHAR" property="projectName" />
|
||||
<result column="OrganName" jdbcType="VARCHAR" property="organName" />
|
||||
<result column="HandsPersonName" jdbcType="VARCHAR" property="handsPersonName" />
|
||||
<result column="AccountName" jdbcType="VARCHAR" property="accountName" />
|
||||
<result column="AllocationProjectName" jdbcType="VARCHAR" property="allocationProjectName" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.DepotHeadVo4InDetail">
|
||||
@@ -45,6 +47,9 @@
|
||||
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 and ifnull(p.delete_Flag,'0') !='1'
|
||||
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 and ifnull(dd.delete_Flag,'0') !='1'
|
||||
left join jsh_depotitem di on dh.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
||||
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="type != null and type != ''">
|
||||
and dh.Type=#{type}
|
||||
@@ -130,7 +135,9 @@
|
||||
</if>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getMaxId" resultType="java.lang.Long">
|
||||
select max(Id) as Id from jsh_depothead
|
||||
</select>
|
||||
|
||||
<select id="findMaterialsListByHeaderId" resultType="java.lang.String">
|
||||
select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName
|
||||
@@ -242,7 +249,7 @@
|
||||
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
||||
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName
|
||||
from jsh_material
|
||||
INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
|
||||
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
|
||||
where ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
) m
|
||||
on m.Id=di.MaterialId where dh.type=#{type} and dh.OperTime >=#{beginTime} and dh.OperTime <=#{endTime}
|
||||
@@ -271,7 +278,7 @@
|
||||
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
||||
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName
|
||||
from jsh_material
|
||||
INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
|
||||
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
|
||||
where ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
) m on m.Id=di.MaterialId where dh.type=#{type} and dh.OperTime >=#{beginTime} and dh.OperTime <=#{endTime}
|
||||
<if test="oId != null">
|
||||
@@ -541,4 +548,29 @@
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getBuyAndSaleStatistics" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(DiscountLastMoney),0)
|
||||
FROM jsh_depothead
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and Type='${type}'
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and SubType='${subType}'
|
||||
</if>
|
||||
<if test="hasSupplier == 1">
|
||||
and OrganId is not null
|
||||
</if>
|
||||
<if test="hasSupplier == 0">
|
||||
and OrganId is null
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and OperTime >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and OperTime <= '${endTime}'
|
||||
</if>
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -37,8 +37,12 @@
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
|
||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||
<result column="UName" jdbcType="VARCHAR" property="UName" />
|
||||
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
||||
<result column="PresetPriceOne" jdbcType="DECIMAL" property="presetPriceOne" />
|
||||
<result column="PriceStrategy" jdbcType="VARCHAR" property="priceStrategy" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultStockWarningCount" type="com.jsh.erp.datasource.vo.DepotItemStockWarningCount">
|
||||
<result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" />
|
||||
<result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" />
|
||||
@@ -52,6 +56,11 @@
|
||||
<result column="BasicLinjieNumber" jdbcType="DECIMAL" property="BasicLinjieNumber" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="StockMap" type="com.jsh.erp.datasource.vo.DepotItemVo4Stock">
|
||||
<result column="in_stock" jdbcType="DECIMAL" property="inNum" />
|
||||
<result column="out_stock" jdbcType="DECIMAL" property="outNum" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_depotitem
|
||||
@@ -72,6 +81,7 @@
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countsByDepotItem" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
@@ -103,6 +113,17 @@
|
||||
else 0 end as b_num,
|
||||
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,
|
||||
depot.name as depotName,depotIn.name as depotInName
|
||||
case
|
||||
when type='入库' then ifnull(di.BasicNumber,0)
|
||||
when type='出库' then 0-di.BasicNumber
|
||||
when dh.SubType='组装单' and di.MType='组合件' then ifnull(di.BasicNumber,0)
|
||||
when dh.SubType='组装单' and di.MType='普通子件' then 0-di.BasicNumber
|
||||
when dh.SubType='拆卸单' and di.MType='普通子件' then ifnull(di.BasicNumber,0)
|
||||
when dh.SubType='拆卸单' and di.MType='组合件' then 0-di.BasicNumber
|
||||
else 0
|
||||
end
|
||||
as b_num,
|
||||
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 and ifnull(di.delete_Flag,'0') !='1'
|
||||
left join jsh_depot depot on depot.id=di.depotId and ifnull(depot.delete_Flag,'0') !='1'
|
||||
@@ -110,12 +131,17 @@
|
||||
where 1=1
|
||||
and dh.SubType not in('采购订单','销售订单')
|
||||
and di.MaterialId =#{mId}
|
||||
where ((dh.type!='其它' and dh.SubType!='调拨')
|
||||
or (dh.type='其它' and dh.SubType='组装单')
|
||||
or (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">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from jsh_depothead dh
|
||||
@@ -127,45 +153,6 @@
|
||||
and di.MaterialId =#{mId}
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
|
||||
<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 and ifnull(m.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="mId != null">
|
||||
and di.MaterialId=#{mId}
|
||||
</if>
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findStockNumByMaterialIdCounts" resultType="java.lang.Long">
|
||||
select count(*) from jsh_depotitem where 1=1
|
||||
<if test="mId != null">
|
||||
and MaterialId=#{mId}
|
||||
</if>
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByTypeAndMaterialIdIn" resultType="java.lang.Long">
|
||||
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
|
||||
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 id="findByTypeAndMaterialIdOut" resultType="java.lang.Long">
|
||||
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
|
||||
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 id="findByTypeAndDepotIdAndMaterialIdIn" 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 and ifnull(di.delete_Flag,'0') !='1'
|
||||
@@ -173,7 +160,6 @@
|
||||
and di.MaterialId = #{mId} and di.DepotId = #{depotId}
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByTypeAndDepotIdAndMaterialIdOut" 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 and ifnull(di.delete_Flag,'0') !='1'
|
||||
@@ -182,7 +168,6 @@
|
||||
and di.MaterialId = #{mId} and di.DepotId = #{depotId}
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<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,
|
||||
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
|
||||
@@ -201,6 +186,7 @@
|
||||
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
|
||||
from jsh_depotitem di
|
||||
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
|
||||
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="headIds != null and headIds != ''">
|
||||
and di.HeaderId in
|
||||
@@ -242,183 +228,19 @@
|
||||
group by m.id) cc
|
||||
</select>
|
||||
|
||||
<select id="findByTypeInIsPrev" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and
|
||||
((dh.type='入库' and di.DepotId=#{ProjectId})
|
||||
or
|
||||
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
|
||||
or
|
||||
(di.AnotherDepotId=#{ProjectId}))
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime < #{MonthTime}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByTypeInIsNotPrev" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and
|
||||
((dh.type='入库' and di.DepotId=#{ProjectId})
|
||||
or
|
||||
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
|
||||
or
|
||||
(di.AnotherDepotId=#{ProjectId}))
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime >= #{MonthTimeStart}
|
||||
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
|
||||
and dh.OperTime <= #{MonthTimeEnd}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByTypeOutIsPrev" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.type='出库'
|
||||
and di.DepotId= #{ProjectId}
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime < #{MonthTime}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByTypeOutIsNotPrev" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and dh.type='出库'
|
||||
and di.DepotId= #{ProjectId}
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime >= #{MonthTimeStart}
|
||||
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
|
||||
and dh.OperTime <= #{MonthTimeEnd}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findPriceByTypeInIsPrev" resultType="java.math.BigDecimal">
|
||||
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and
|
||||
((dh.type='入库' and di.DepotId=#{ProjectId})
|
||||
or
|
||||
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
|
||||
or
|
||||
(di.AnotherDepotId=#{ProjectId}))
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime < #{MonthTime}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findPriceByTypeInIsNotPrev" resultType="java.math.BigDecimal">
|
||||
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and
|
||||
((dh.type='入库' and di.DepotId=#{ProjectId})
|
||||
or
|
||||
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
|
||||
or
|
||||
(di.AnotherDepotId=#{ProjectId}))
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime >= #{MonthTimeStart}
|
||||
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
|
||||
and dh.OperTime <= #{MonthTimeEnd}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findPriceByTypeOutIsPrev" resultType="java.math.BigDecimal">
|
||||
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and dh.type='出库'
|
||||
and di.DepotId= #{ProjectId}
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime < #{MonthTime}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findPriceByTypeOutIsNotPrev" resultType="java.math.BigDecimal">
|
||||
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id and dh.type='出库'
|
||||
and di.DepotId= #{ProjectId}
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime >= #{MonthTimeStart}
|
||||
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
|
||||
and dh.OperTime <= #{MonthTimeEnd}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findAssembleIsPrev" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.SubType= #{subType}
|
||||
and di.MType= #{mType}
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime < #{MonthTime}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findAssembleIsNotPrev" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.SubType= #{subType}
|
||||
and di.MType= #{mType}
|
||||
and di.MaterialId = #{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime >= #{MonthTimeStart}
|
||||
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
|
||||
and dh.OperTime <= #{MonthTimeEnd}
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.type=#{type} and dh.subType=#{subType}
|
||||
and di.MaterialId =#{MId}
|
||||
<if test="MonthTime != null and MonthTime != ''">
|
||||
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
|
||||
and dh.OperTime >= #{MonthTimeStart}
|
||||
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
|
||||
and dh.OperTime <= #{MonthTimeEnd}
|
||||
</if>
|
||||
and dh.type='${type}' and dh.subType='${subType}'
|
||||
and di.MaterialId =${MId}
|
||||
and dh.OperTime >= '${MonthTime}-01 00:00:00'
|
||||
and dh.OperTime <= '${MonthTime}-31 23:59:59'
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="buyOrSalePrice" resultType="java.math.BigDecimal">
|
||||
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
|
||||
select ifnull(sum(AllPrice),0) as AllPrice from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.type=#{type} and dh.subType=#{subType}
|
||||
and di.MaterialId =#{MId}
|
||||
@@ -432,24 +254,42 @@
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findGiftByTypeIn" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.SubType=#{subType}
|
||||
and di.AnotherDepotId=#{ProjectId}
|
||||
and di.MaterialId =#{MId}
|
||||
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(DiscountLastMoney),0) as allMoney from jsh_depothead dh
|
||||
where 1=1
|
||||
and dh.type='${type}' and dh.subType='${subType}'
|
||||
and dh.OperTime >= '${MonthTime}-01 00:00:00'
|
||||
and dh.OperTime <= '${MonthTime}-31 23:59:59'
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findGiftByTypeOut" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
|
||||
where di.HeaderId = dh.id
|
||||
and dh.SubType=#{subType}
|
||||
and di.DepotId=#{ProjectId}
|
||||
and di.MaterialId =#{MId}
|
||||
<select id="getStockByParam" resultMap="StockMap">
|
||||
select ifnull((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal),0) as in_stock,
|
||||
ifnull((curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal),0) out_stock
|
||||
from
|
||||
(select sum(if(dh.type='入库' <if test="depotId != null">and di.DepotId=#{depotId}</if>, di.BasicNumber,0)) as inTotal,
|
||||
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.AnotherDepotId=#{depotId}</if>,di.BasicNumber,0)) as transfInTotal,
|
||||
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as transfOutTotal,
|
||||
sum(if(dh.type='出库' and dh.SubType!='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as outTotal,
|
||||
sum(if(dh.SubType='组装单' and di.MType='组合件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemInTotal,
|
||||
sum(if(dh.SubType='组装单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemOutTotal,
|
||||
sum(if(dh.SubType='拆卸单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemInTotal,
|
||||
sum(if(dh.SubType='拆卸单' and di.MType='组合件' <if test="depotId != null"> and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemOutTotal
|
||||
from
|
||||
jsh_depothead dh,jsh_depotitem di
|
||||
where 1=1
|
||||
and dh.id=di.HeaderId
|
||||
and di.MaterialId=#{mId}
|
||||
<if test="beginTime != null">
|
||||
and dh.OperTime >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.OperTime <= '${endTime}'
|
||||
</if>
|
||||
and dh.tenant_id=#{tenantId}
|
||||
and di.tenant_id=#{tenantId}
|
||||
and ifnull(dh.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1'
|
||||
and ifnull(di.delete_Flag,'0') !='1') as curep
|
||||
</select>
|
||||
|
||||
<select id="findDepotItemListBydepotheadId" resultType="com.jsh.erp.datasource.entities.DepotItem">
|
||||
@@ -471,6 +311,7 @@
|
||||
and ifnull(dep.delete_Flag,'0') !='1'
|
||||
and ifnull(mat.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<delete id="deleteDepotItemByDepotHeadIds">
|
||||
delete from jsh_depotitem
|
||||
where 1=1
|
||||
@@ -481,6 +322,7 @@
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
|
||||
<update id="batchDeleteDepotItemByDepotHeadIds">
|
||||
update jsh_depotitem
|
||||
set delete_Flag='1'
|
||||
@@ -492,6 +334,7 @@
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<update id="batchDeleteDepotItemByIds">
|
||||
update jsh_depotitem
|
||||
set delete_Flag='1'
|
||||
@@ -502,6 +345,7 @@
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<select id="getDepotItemListListByDepotIds" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
|
||||
select
|
||||
<include refid="com.jsh.erp.datasource.mappers.DepotItemMapper.Base_Column_List" />
|
||||
@@ -514,6 +358,7 @@
|
||||
)
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getDepotItemListListByMaterialIds" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
|
||||
select
|
||||
<include refid="com.jsh.erp.datasource.mappers.DepotItemMapper.Base_Column_List" />
|
||||
@@ -527,8 +372,6 @@
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findStockWarningCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStockWarningCount">
|
||||
SELECT
|
||||
m. NAME MaterialName,
|
||||
@@ -642,4 +485,9 @@
|
||||
and ifnull(di.delete_Flag,'0') !='1') as curep
|
||||
</select>
|
||||
|
||||
<select id="getFinishNumber" resultType="java.math.BigDecimal">
|
||||
select sum(BasicNumber) from jsh_depotitem
|
||||
where MaterialId=${mid} and headerId
|
||||
in (select id from jsh_depothead where LinkNumber='${linkNumber}')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?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">
|
||||
<?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.FunctionsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Functions">
|
||||
<!--
|
||||
@@ -16,6 +16,7 @@
|
||||
<result column="Enabled" jdbcType="BIT" property="enabled" />
|
||||
<result column="Type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="PushBtn" jdbcType="VARCHAR" property="pushbtn" />
|
||||
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
||||
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
</resultMap>
|
||||
@@ -90,7 +91,7 @@
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, delete_Flag,
|
||||
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, icon,delete_Flag,
|
||||
tenant_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultMap="BaseResultMap">
|
||||
@@ -147,11 +148,11 @@
|
||||
insert into jsh_functions (Id, Number, Name,
|
||||
PNumber, URL, State, Sort,
|
||||
Enabled, Type, PushBtn,
|
||||
delete_Flag, tenant_id)
|
||||
delete_Flag, icon,tenant_id)
|
||||
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{pnumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR},
|
||||
#{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR},
|
||||
#{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
|
||||
#{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR},
|
||||
#{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Functions">
|
||||
<!--
|
||||
@@ -190,6 +191,9 @@
|
||||
<if test="pushbtn != null">
|
||||
PushBtn,
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
icon,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_Flag,
|
||||
</if>
|
||||
@@ -228,6 +232,9 @@
|
||||
<if test="pushbtn != null">
|
||||
#{pushbtn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
#{icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -283,6 +290,9 @@
|
||||
<if test="record.pushbtn != null">
|
||||
PushBtn = #{record.pushbtn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.icon != null">
|
||||
icon = #{record.icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.deleteFlag != null">
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -310,8 +320,9 @@
|
||||
Enabled = #{record.enabled,jdbcType=BIT},
|
||||
Type = #{record.type,jdbcType=VARCHAR},
|
||||
PushBtn = #{record.pushbtn,jdbcType=VARCHAR},
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT}
|
||||
icon = #{record.icon,jdbcType=VARCHAR},
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
@@ -350,6 +361,9 @@
|
||||
<if test="pushbtn != null">
|
||||
PushBtn = #{pushbtn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
icon = #{icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -374,8 +388,9 @@
|
||||
Enabled = #{enabled,jdbcType=BIT},
|
||||
Type = #{type,jdbcType=VARCHAR},
|
||||
PushBtn = #{pushbtn,jdbcType=VARCHAR},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT}
|
||||
icon = #{icon,jdbcType=VARCHAR},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -31,7 +31,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_Flag,'0') !='1'
|
||||
order by m.id asc
|
||||
order by m.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
@@ -80,7 +80,7 @@
|
||||
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
|
||||
ORDER BY Id desc
|
||||
</select>
|
||||
|
||||
<update id="updatePriceNullByPrimaryKey" parameterType="java.lang.Long">
|
||||
@@ -121,7 +121,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_Flag,'0') !='1'
|
||||
order by m.id asc
|
||||
order by m.id desc
|
||||
</select>
|
||||
<select id="findByMaterialName" resultType="com.jsh.erp.datasource.entities.Material">
|
||||
select m.*
|
||||
|
||||
318
src/main/resources/mapper_xml/MsgMapper.xml
Normal file
318
src/main/resources/mapper_xml/MsgMapper.xml
Normal file
@@ -0,0 +1,318 @@
|
||||
<?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.MsgMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="msg_title" property="msgTitle" jdbcType="VARCHAR" />
|
||||
<result column="msg_content" property="msgContent" jdbcType="VARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="type" property="type" jdbcType="VARCHAR" />
|
||||
<result column="status" property="status" jdbcType="VARCHAR" />
|
||||
<result column="tenant_id" property="tenantId" jdbcType="BIGINT" />
|
||||
<result column="delete_Flag" property="deleteFlag" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where >
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where >
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, msg_title, msg_content, create_time, type, status, tenant_id, delete_Flag
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<if test="distinct" >
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_msg
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_msg
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_msg
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_msg
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_msg (id, msg_title, msg_content,
|
||||
create_time, type, status,
|
||||
tenant_id, delete_Flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_msg
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="msgTitle != null" >
|
||||
msg_title,
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
msg_content,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type,
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status,
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="deleteFlag != null" >
|
||||
delete_Flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="msgTitle != null" >
|
||||
#{msgTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
#{msgContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="deleteFlag != null" >
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" resultType="java.lang.Integer" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_msg
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_msg
|
||||
<set >
|
||||
<if test="record.id != null" >
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.msgTitle != null" >
|
||||
msg_title = #{record.msgTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.msgContent != null" >
|
||||
msg_content = #{record.msgContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null" >
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.type != null" >
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null" >
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tenantId != null" >
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.deleteFlag != null" >
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_msg
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
msg_title = #{record.msgTitle,jdbcType=VARCHAR},
|
||||
msg_content = #{record.msgContent,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_msg
|
||||
<set >
|
||||
<if test="msgTitle != null" >
|
||||
msg_title = #{msgTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
msg_content = #{msgContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="deleteFlag != null" >
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_msg
|
||||
set msg_title = #{msgTitle,jdbcType=VARCHAR},
|
||||
msg_content = #{msgContent,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
60
src/main/resources/mapper_xml/MsgMapperEx.xml
Normal file
60
src/main/resources/mapper_xml/MsgMapperEx.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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.MsgMapperEx">
|
||||
<select id="selectByConditionMsg" resultMap="com.jsh.erp.datasource.mappers.MsgMapper.BaseResultMap">
|
||||
SELECT *
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and msg_title like '%${name}%'
|
||||
</if>
|
||||
order by create_time desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>;
|
||||
</select>
|
||||
<select id="countsByMsg" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and msg_title like '%${name}%'
|
||||
</if>
|
||||
</select>
|
||||
<update id="batchDeleteMsgByIds">
|
||||
update jsh_msg
|
||||
set delete_Flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<insert id="insertSelectiveByTask" parameterType="com.jsh.erp.datasource.entities.Msg">
|
||||
insert into jsh_msg(msg_title,msg_content,create_time,type,status,tenant_id)
|
||||
values (
|
||||
#{msgTitle,jdbcType=VARCHAR},
|
||||
#{msgContent,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{type,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="checkIsNameExistByTask" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="msgTitle != null">
|
||||
and msg_title = '${msgTitle}'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -25,6 +25,7 @@
|
||||
and description like #{description}
|
||||
</if>
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
order by id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<result column="company_tel" jdbcType="VARCHAR" property="companyTel" />
|
||||
<result column="company_fax" jdbcType="VARCHAR" property="companyFax" />
|
||||
<result column="company_post_code" jdbcType="VARCHAR" property="companyPostCode" />
|
||||
<result column="depot_flag" jdbcType="VARCHAR" property="depotFlag" />
|
||||
<result column="customer_flag" jdbcType="VARCHAR" property="customerFlag" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||
</resultMap>
|
||||
@@ -88,7 +90,7 @@
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
|
||||
tenant_id, delete_Flag
|
||||
depot_flag, customer_flag, tenant_id, delete_Flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
@@ -143,12 +145,12 @@
|
||||
-->
|
||||
insert into jsh_systemconfig (id, company_name, company_contacts,
|
||||
company_address, company_tel, company_fax,
|
||||
company_post_code, tenant_id, delete_Flag
|
||||
)
|
||||
company_post_code, depot_flag, customer_flag,
|
||||
tenant_id, delete_Flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR},
|
||||
#{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR},
|
||||
#{companyPostCode,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
#{companyPostCode,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, #{customerFlag,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
|
||||
<!--
|
||||
@@ -178,6 +180,12 @@
|
||||
<if test="companyPostCode != null">
|
||||
company_post_code,
|
||||
</if>
|
||||
<if test="depotFlag != null">
|
||||
depot_flag,
|
||||
</if>
|
||||
<if test="customerFlag != null">
|
||||
customer_flag,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
@@ -207,6 +215,12 @@
|
||||
<if test="companyPostCode != null">
|
||||
#{companyPostCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="depotFlag != null">
|
||||
#{depotFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="customerFlag != null">
|
||||
#{customerFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
@@ -253,6 +267,12 @@
|
||||
<if test="record.companyPostCode != null">
|
||||
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.depotFlag != null">
|
||||
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.customerFlag != null">
|
||||
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
@@ -277,6 +297,8 @@
|
||||
company_tel = #{record.companyTel,jdbcType=VARCHAR},
|
||||
company_fax = #{record.companyFax,jdbcType=VARCHAR},
|
||||
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
|
||||
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
|
||||
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
@@ -308,6 +330,12 @@
|
||||
<if test="companyPostCode != null">
|
||||
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="depotFlag != null">
|
||||
depot_flag = #{depotFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="customerFlag != null">
|
||||
customer_flag = #{customerFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
@@ -329,6 +357,8 @@
|
||||
company_tel = #{companyTel,jdbcType=VARCHAR},
|
||||
company_fax = #{companyFax,jdbcType=VARCHAR},
|
||||
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
|
||||
depot_flag = #{depotFlag,jdbcType=VARCHAR},
|
||||
customer_flag = #{customerFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
|
||||
288
src/main/resources/mapper_xml/TenantMapper.xml
Normal file
288
src/main/resources/mapper_xml/TenantMapper.xml
Normal file
@@ -0,0 +1,288 @@
|
||||
<?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.TenantMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="tenant_id" property="tenantId" jdbcType="BIGINT" />
|
||||
<result column="login_name" property="loginName" jdbcType="VARCHAR" />
|
||||
<result column="user_num_limit" property="userNumLimit" jdbcType="INTEGER" />
|
||||
<result column="bills_num_limit" property="billsNumLimit" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where >
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where >
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, tenant_id, login_name, user_num_limit, bills_num_limit, create_time
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.jsh.erp.datasource.entities.TenantExample" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<if test="distinct" >
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_tenant
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_tenant
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_tenant
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.TenantExample" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_tenant
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_tenant (id, tenant_id, login_name,
|
||||
user_num_limit, bills_num_limit, create_time
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR},
|
||||
#{userNumLimit,jdbcType=INTEGER}, #{billsNumLimit,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_tenant
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="loginName != null" >
|
||||
login_name,
|
||||
</if>
|
||||
<if test="userNumLimit != null" >
|
||||
user_num_limit,
|
||||
</if>
|
||||
<if test="billsNumLimit != null" >
|
||||
bills_num_limit,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="loginName != null" >
|
||||
#{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userNumLimit != null" >
|
||||
#{userNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="billsNumLimit != null" >
|
||||
#{billsNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.TenantExample" resultType="java.lang.Integer" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_tenant
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_tenant
|
||||
<set >
|
||||
<if test="record.id != null" >
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.tenantId != null" >
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.loginName != null" >
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userNumLimit != null" >
|
||||
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.billsNumLimit != null" >
|
||||
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.createTime != null" >
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_tenant
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
|
||||
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_tenant
|
||||
<set >
|
||||
<if test="tenantId != null" >
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="loginName != null" >
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userNumLimit != null" >
|
||||
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="billsNumLimit != null" >
|
||||
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_tenant
|
||||
set tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
|
||||
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
24
src/main/resources/mapper_xml/TenantMapperEx.xml
Normal file
24
src/main/resources/mapper_xml/TenantMapperEx.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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.TenantMapperEx">
|
||||
<select id="selectByConditionTenant" parameterType="com.jsh.erp.datasource.entities.TenantExample" resultMap="com.jsh.erp.datasource.mappers.TenantMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_tenant
|
||||
where 1=1
|
||||
<if test="loginName != null">
|
||||
and loginame like '%${loginName}%'
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByTenant" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_tenant
|
||||
WHERE 1=1
|
||||
<if test="loginName != null">
|
||||
and loginame like '%${loginName}%'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
30
src/test/java/com/jsh/erp/DepotItemTest.java
Normal file
30
src/test/java/com/jsh/erp/DepotItemTest.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.jsh.erp;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DepotItemTest {
|
||||
|
||||
@Resource
|
||||
private DepotItemService depotItemService;
|
||||
|
||||
@Test
|
||||
public void getFinishNumber() throws Exception{
|
||||
BigDecimal num = depotItemService.getFinishNumber(568l,238l);
|
||||
log.info("depot result:" + JSON.toJSONString(num));
|
||||
}
|
||||
}
|
||||
35
src/test/java/com/jsh/erp/DepotTest.java
Normal file
35
src/test/java/com/jsh/erp/DepotTest.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.jsh.erp;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DepotTest {
|
||||
|
||||
@Resource
|
||||
private DepotService depotService;
|
||||
|
||||
@Test
|
||||
public void getDepot() throws Exception{
|
||||
Depot result = depotService.getDepot(1l);
|
||||
log.info("depot result:" + JSON.toJSONString(result));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAllList() throws Exception{
|
||||
List<Depot> depotList =depotService.getAllList();
|
||||
log.info("depot result:" + JSON.toJSONString(depotList));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -44,10 +44,6 @@
|
||||
<!-- <table tableName="jsh_account" domainObjectName="Account"></table>
|
||||
<table tableName="jsh_accounthead" domainObjectName="AccountHead"></table>
|
||||
<table tableName="jsh_accountitem" domainObjectName="AccountItem"></table>
|
||||
<table tableName="jsh_app" domainObjectName="App"></table>
|
||||
<table tableName="jsh_asset" domainObjectName="Asset"></table>
|
||||
<table tableName="jsh_assetcategory" domainObjectName="AssetCategory"></table>
|
||||
<table tableName="jsh_assetname" domainObjectName="AssetName"></table>
|
||||
<table tableName="jsh_depot" domainObjectName="Depot"></table>
|
||||
<table tableName="jsh_depothead" domainObjectName="DepotHead"></table>
|
||||
<table tableName="jsh_depotitem" domainObjectName="DepotItem"></table>
|
||||
@@ -66,7 +62,8 @@
|
||||
<table tableName="jsh_userbusiness" domainObjectName="UserBusiness"></table>
|
||||
<table tableName="jsh_serial_number" domainObjectName="SerialNumber"></table>
|
||||
<table tableName="jsh_organization" domainObjectName="Organization"></table>
|
||||
<table tableName="jsh_orga_user_rel" domainObjectName="OrgaUserRel"></table> -->
|
||||
<table tableName="jsh_userbusiness" domainObjectName="UserBusiness"></table>
|
||||
<table tableName="jsh_orga_user_rel" domainObjectName="OrgaUserRel"></table>
|
||||
<table tableName="jsh_tenant" domainObjectName="Tenant"></table>
|
||||
<table tableName="jsh_msg" domainObjectName="Msg"></table> -->
|
||||
</context>
|
||||
</generatorConfiguration>
|
||||
|
||||
Reference in New Issue
Block a user