仓库ERP管理系统(springboot)
2021-03-22 19:24
标签:for ejs direct 报表 cat validate success info ogg 基于SpringBoot框架和SaaS模式,非常好用的ERP软件,目前专注进销存+财务功能。主要模块有零售管理、采购管理、销售管理、仓库管理、财务管理、报表查询、系统管理等。支持预付款、收入支出、仓库调拨、组装拆卸、订单等特色功能。拥有库存状况、出入库统计等报表。权限控制更加精确 springboot + mybatis + easyui 关注公众号【C you again】,回复“springboot 仓库ERP管理系统”免费领取。 仓库ERP管理系统(springboot) 标签:for ejs direct 报表 cat validate success info ogg 原文地址:https://www.cnblogs.com/cyouagain/p/13872206.html查看更多系统:系统大全,课程设计、毕业设计,请点击这里查看
01 系统概述
02 技术
03 运行环境
04 技术架构
05 功能模块
06 项目结构
07 运行截图
零售关系-》零售出库
采购管理-》采购入库
财务管理-》收入单
商品管理-》商品信息
08 主要代码
用户管理
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.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;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author
*/
@RestController
@RequestMapping(value = "/user")
public class UserController {
private Logger logger = LoggerFactory.getLogger(UserController.class);
@Value("${manage.roleId}")
private Integer 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";
@PostMapping(value = "/login")
public BaseResponseInfo login(@RequestParam(value = "loginName", required = false) String loginName,
@RequestParam(value = "password", required = false) String password,
HttpServletRequest request)throws Exception {
logger.info("============用户登录 login 方法调用开始==============");
String msgTip = "";
User user=null;
BaseResponseInfo res = new BaseResponseInfo();
try {
String username = loginName.trim();
password = password.trim();
//判断用户是否已经登录过,登录过不再处理
Object userInfo = request.getSession().getAttribute("user");
User sessionUser = new User();
if (userInfo != null) {
sessionUser = (User) userInfo;
}
if (sessionUser != null && username.equalsIgnoreCase(sessionUser.getLoginame())) {
logger.info("====用户 " + username + "已经登录过, login 方法调用结束====");
msgTip = "user already login";
}
//获取用户状态
int userStatus = -1;
try {
request.getSession().removeAttribute("tenantId");
userStatus = userService.validateUser(username, password);
} catch (Exception e) {
e.printStackTrace();
logger.error(">>>>>>>>>>>>>用户 " + username + " 登录 login 方法 访问服务层异常====", e);
msgTip = "access service exception";
}
switch (userStatus) {
case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST:
msgTip = "user is not exist";
break;
case ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR:
msgTip = "user password error";
break;
case ExceptionCodeConstants.UserExceptionCode.BLACK_USER:
msgTip = "user is black";
break;
case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION:
msgTip = "access service error";
break;
default:
try {
msgTip = "user can login";
//验证通过 ,可以登录,放入session,记录登录日志
user = userService.getUserByUserName(username);
request.getSession().setAttribute("user",user);
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); //单据限制数
}
}
}
logService.insertLog("用户",
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;
}
Map
账户管理
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Account;
import com.jsh.erp.datasource.vo.AccountVo4InOutList;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.account.AccountService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
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.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author jishenghua 75271*8920
*/
@RestController
@RequestMapping(value = "/account")
public class AccountController {
private Logger logger = LoggerFactory.getLogger(AccountController.class);
@Resource
private AccountService accountService;
/**
* 查找结算账户信息-下拉框
* @param request
* @return
*/
@GetMapping(value = "/findBySelect")
public String findBySelect(HttpServletRequest request) throws Exception {
String res = null;
try {
List dataList = accountService.findBySelect();
//存放数据json数组
JSONArray dataArray = new JSONArray();
if (null != dataList) {
for (Account account : dataList) {
JSONObject item = new JSONObject();
item.put("Id", account.getId());
//结算账户名称
item.put("AccountName", account.getName());
dataArray.add(item);
}
}
res = dataArray.toJSONString();
} catch(Exception e){
e.printStackTrace();
res = "获取数据失败";
}
return res;
}
/**
* 获取所有结算账户
* @param request
* @return
*/
@GetMapping(value = "/getAccount")
public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map
09 源码下载
亦可直接扫描主页二维码关注,回复“springboot 仓库ERP管理系统”免费领取,点此打开个人主页10 如何使用
说明:此源码来源于网络,若有侵权,请联系删除!!
文章标题:仓库ERP管理系统(springboot)
文章链接:http://soscw.com/index.php/essay/67643.html