基于javaweb的SpringBoot农业物资管理系统(java+springboot+easyui+html+maven+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

200023282402

210023282402

220023282402

230023282402

250023282402

260023282402

基于javaweb的SpringBoot农业物资管理系统(java+springboot+easyui+html+maven+mysql)

项目介绍

农业物资管理系统,管理员可以对角色进行配置,分配用户角色; 主要功能包含:登录、注册、修改密码、零售出库、零售退货、采购订单管理、采购入库管理、采购退货管理、销售管理、财务管理、报表管理、物资管理、基本资料管理。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7版本;

技术栈

  1. 后端:springboot MyBatis

  2. 前端:HTML+css+javascript+jQuery+easyui

使用说明
运行成功后,访问http://localhost:8080/ 到登录页面
管理员用户名:admin 密码:123456

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name,
@RequestParam("model") String model, @RequestParam("color") String color,
@RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs,
@RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2,
@RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int exist = materialService.checkIsExist(id, name, model, color, standard, mfrs,
otherField1, otherField2, otherField3, unit, unitId);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}

/**
* 批量设置状态-启用或者禁用
* @param enabled
* @param materialIDs
* @param request
* @return
*/
@PostMapping(value = "/batchSetEnable")
public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
@RequestParam("materialIDs") String materialIDs,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int res = materialService.batchSetEnable(enabled, materialIDs);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}

/**
* 根据id来查询商品名称
* @param id
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                JSONObject item = new JSONObject();
item.put("id", supplier.getId());
//供应商名称
item.put("supplier", supplier.getSupplier());
dataArray.add(item);
}
}
arr = dataArray;
} catch(Exception e){
e.printStackTrace();
}
return arr;
}

/**
* 查找会员信息-下拉框
* @param request
* @return
*/
@PostMapping(value = "/findBySelect_retail")
public JSONArray findBySelectRetail(HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray();
try {
List<Supplier> supplierList = supplierService.findBySelectRetail();
JSONArray dataArray = new JSONArray();
if (null != supplierList) {
for (Supplier supplier : supplierList) {
JSONObject item = new JSONObject();
item.put("id", supplier.getId());
//客户名称
item.put("supplier", supplier.getSupplier());
item.put("advanceIn", supplier.getAdvancein()); //预付款金额
dataArray.add(item);
}
}
arr = dataArray;
} catch(Exception e){
e.printStackTrace();
}
return arr;
}

/**
* 根据id查找信息
* @param supplierId
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    //数据状态新增时默认设置为启用
mc.setStatus(BusinessConstants.MATERIAL_CATEGORY_STATUS_ENABLE);
Date date=new Date();
User userInfo=userService.getCurrentUser();
//创建时间
mc.setCreateTime(date);
//创建人
mc.setCreator(userInfo==null?null:userInfo.getId());
//更新时间
mc.setUpdateTime(date);
//更新人
mc.setUpdater(userInfo==null?null:userInfo.getId());
int result=0;
try{
result=materialCategoryMapperEx.addMaterialCategory(mc);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteMaterialCategoryByIds(String ids) throws Exception {
logService.insertLog("商品类型",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
//更新时间
Date updateDate =new Date();
//更新人
User userInfo=userService.getCurrentUser();
Long updater=userInfo==null?null:userInfo.getId();
String strArray[]=ids.split(",");
if(strArray.length<1){
return 0;
}
int result=0;
try{
result=materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray);
}catch(Exception e){
JshException.writeFail(logger, e);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * @param endTime
* @param supType
* @param request
* @return
*/
@GetMapping(value = "/findTotalPay")
public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId,
@RequestParam("endTime") String endTime,
@RequestParam("supType") String supType,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
JSONObject outer = new JSONObject();
BigDecimal sum = depotHeadService.findTotalPay(supplierId, endTime, supType);
outer.put("getAllMoney", sum);
map.put("rows", outer);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}

/**
* 根据编号查询单据信息
* @param number
* @param request
* @return
*/
@GetMapping(value = "/getDetailByNumber")
public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
DepotHeadVo4List dhl = new DepotHeadVo4List();
try {
List<DepotHeadVo4List> list = depotHeadService.getDetailByNumber(number);
if(list.size() == 1) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* 查询计量单位信息
*
* @return
*/
public String findUnitName(Long mId) throws Exception{
String unitName = "";
try {
unitName = materialService.findUnitName(mId);
if (unitName != null) {
unitName = unitName.substring(1, unitName.length() - 1);
if (unitName.equals("null")) {
unitName = "";
}
}
} catch (Exception e) {
e.printStackTrace();
}
return unitName;
}

@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteDepotItemByIds(String ids)throws Exception {
logService.insertLog("单据明细",
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 =depotItemMapperEx.batchDeleteDepotItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
}

@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public List<DepotItemStockWarningCount> findStockWarningCount(int offset, Integer rows, Integer pid) {

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42


/**
* Description
*
*/
@Service
public class SerialNumberService {
private Logger logger = LoggerFactory.getLogger(SerialNumberService.class);

@Resource
private SerialNumberMapper serialNumberMapper;
@Resource
private SerialNumberMapperEx serialNumberMapperEx;
@Resource
private MaterialMapperEx materialMapperEx;
@Resource
private MaterialMapper materialMapper;
@Resource
private UserService userService;
@Resource
private LogService logService;


public SerialNumber getSerialNumber(long id)throws Exception {
SerialNumber result=null;
try{
result=serialNumberMapper.selectByPrimaryKey(id);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}

public List<SerialNumber> getSerialNumber()throws Exception {
SerialNumberExample example = new SerialNumberExample();
List<SerialNumber> list=null;
try{
list=serialNumberMapper.selectByExample(example);
}catch(Exception e){
JshException.readFail(logger, e);
}


项目链接:
https://javayms.github.io?id=541422302105200hd
https://javayms.pages.dev?id=541422302105200hd