Merge pull request 'test' (#3) from lq/Glass-ERP:test into test

Reviewed-on: http://hrbnu.club:3000/Big-Data-Lab/Glass-ERP/pulls/3
This commit is contained in:
lq 2023-08-17 00:58:29 +08:00
commit 06a3988b34
30 changed files with 1370 additions and 67 deletions

View File

@ -0,0 +1,68 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- 主机 localhost
-- 生成日期 2023-08-16 17:41:52
-- 服务器版本 5.7.40-log
-- PHP 版本 7.4.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- 数据库 `jeecg-boot`
--
-- --------------------------------------------------------
--
-- 表的结构 `purchase_order_confirmation`
--
CREATE TABLE `purchase_order_confirmation` (
`id` varchar(36) NOT NULL,
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`association_number` varchar(32) DEFAULT NULL COMMENT '关联编号',
`supplier_selection` text COMMENT '供应商选择',
`receiver` varchar(32) DEFAULT NULL COMMENT '接单人',
`receiving_time` date DEFAULT NULL COMMENT '接单时间',
`notes` varchar(200) DEFAULT NULL COMMENT '备注',
`is_done` int(1) NOT NULL DEFAULT '0' COMMENT '是否处理完成'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `purchase_order_confirmation`
--
INSERT INTO `purchase_order_confirmation` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `association_number`, `supplier_selection`, `receiver`, `receiving_time`, `notes`, `is_done`) VALUES
('1691363659080638466', 'admin', '2023-08-15 16:18:15', NULL, NULL, 'A01A03', '1003', '[{\"supplierID\":\"1690444013968150530\",\"supplier\":\"黄晖有限公司\",\"goods\":[{\"name\":\"测试\",\"number\":\"测试\",\"unit\":\"测试\"}]},{\"supplierID\":\"1691365161122471937\",\"supplier\":\"测试流程\",\"goods\":[{\"name\":\"1\",\"number\":\"321\",\"unit\":\"123\"}]},{\"supplierID\":\"1690736576735887362\",\"supplier\":\"super军用火炬有限公司\",\"goods\":[{\"name\":\"123\",\"number\":\"123\",\"unit\":\"123\"},{\"name\":\"物品1\",\"number\":\"1\",\"unit\":\"\"}]}]', 'admin', '2023-08-15', '', 0),
('1691478908510806018', NULL, '2023-08-15 23:56:13', NULL, NULL, NULL, '1004', '[{\"supplierID\":\"1690444013968150530\",\"supplier\":\"黄晖有限公司\",\"goods\":[{\"name\":\"测试\",\"number\":\"测试\",\"unit\":\"测试\"}]}]', 'admin', '2023-08-15', '', 0),
('1691728833130037249', 'admin', '2023-08-16 16:29:19', NULL, NULL, 'A01A03', '1005', NULL, 'admin', '2023-08-16', '', 0),
('1691736322919645185', NULL, '2023-08-16 16:59:05', NULL, NULL, NULL, '1006', NULL, 'admin', '2023-08-16', '', 0);
--
-- 转储表的索引
--
--
-- 表的索引 `purchase_order_confirmation`
--
ALTER TABLE `purchase_order_confirmation`
ADD PRIMARY KEY (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

72
db/purchase_request.sql Normal file
View File

@ -0,0 +1,72 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- 主机 localhost
-- 生成日期 2023-08-16 17:41:31
-- 服务器版本 5.7.40-log
-- PHP 版本 7.4.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- 数据库 `jeecg-boot`
--
-- --------------------------------------------------------
--
-- 表的结构 `purchase_request`
--
CREATE TABLE `purchase_request` (
`id` varchar(36) NOT NULL,
`create_by` varchar(50) DEFAULT NULL COMMENT '申请人',
`create_time` datetime DEFAULT NULL COMMENT '申请日期',
`requirement_number` varchar(32) DEFAULT NULL COMMENT '需求编号',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '申请部门',
`demand_status` int(1) DEFAULT '1' COMMENT '需求状态',
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`procurement_category` int(10) DEFAULT NULL COMMENT '采购类别',
`procurement_direction` varchar(32) DEFAULT NULL COMMENT '采购方向',
`procurement_content` text COMMENT '采购内容',
`procurement_budget` varchar(32) DEFAULT NULL COMMENT '采购预算',
`annex` varchar(256) DEFAULT NULL COMMENT '附件',
`audit_results` text COMMENT '审核结果',
`approved_by` varchar(32) DEFAULT NULL COMMENT '审批人',
`is_receiving` int(2) DEFAULT '0' COMMENT '是否被接单'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `purchase_request`
--
INSERT INTO `purchase_request` (`id`, `create_by`, `create_time`, `requirement_number`, `sys_org_code`, `demand_status`, `update_by`, `update_time`, `procurement_category`, `procurement_direction`, `procurement_content`, `procurement_budget`, `annex`, `audit_results`, `approved_by`, `is_receiving`) VALUES
('1690723877939462146', 'admin', '2023-08-15 15:39:12', '1003', 'A01A03', 2, 'admin', '2023-08-15 16:18:15', 1, '这是采购方向', '[{\"name\":\"物品1\",\"number\":\"1\",\"unit\":\"\"},{\"name\":\"测试\",\"number\":\"测试\",\"unit\":\"测试\"}]', '这是预算', 'temp/对第一模块的测评_1691938213370.docx,temp/OIP-C_1691939942204.jpg', '通过', 'admin', 1),
('1691355237765455874', 'admin', '2023-08-15 15:44:47', '1004', 'A01A03', 2, NULL, '2023-08-15 23:56:13', 1, '123', '[{\"name\":\"\",\"number\":\"\",\"unit\":\"\"}]', '123', NULL, '通过', 'admin', 1),
('1691621109553799169', 'admin', '2023-08-16 09:21:16', '1005', 'A01A03', 2, 'admin', '2023-08-16 16:29:19', 2, 'w', '[{\"name\":\"w\",\"number\":\"w\",\"unit\":\"w\"},{\"name\":\"q \",\"number\":\"n\",\"unit\":\"u\"}]', 'w', NULL, '通过', 'admin', 1),
('1691736041100165122', 'admin', '2023-08-16 16:57:58', '1006', 'A01A03', 2, NULL, '2023-08-16 16:59:05', 1, '请求', '[{\"name\":\"qq\",\"number\":\"1\",\"unit\":\"t\"}]', '1223', NULL, '通过', 'admin', 1);
--
-- 转储表的索引
--
--
-- 表的索引 `purchase_request`
--
ALTER TABLE `purchase_request`
ADD PRIMARY KEY (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

68
db/purchase_supplier.sql Normal file
View File

@ -0,0 +1,68 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- 主机 localhost
-- 生成日期 2023-08-16 17:41:46
-- 服务器版本 5.7.40-log
-- PHP 版本 7.4.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- 数据库 `jeecg-boot`
--
-- --------------------------------------------------------
--
-- 表的结构 `purchase_supplier`
--
CREATE TABLE `purchase_supplier` (
`id` varchar(36) NOT NULL,
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
`name` varchar(32) DEFAULT NULL COMMENT '供应商名称 ',
`address` varchar(100) DEFAULT NULL COMMENT '地址',
`phone` varchar(20) DEFAULT NULL COMMENT '联系人电话',
`business_scope` varchar(100) DEFAULT NULL COMMENT '业务范围',
`collaborations_number` int(11) DEFAULT '0' COMMENT '合作次数',
`flowing_water` double(10,2) DEFAULT '0.00' COMMENT '历史流水',
`evaluation` varchar(32) DEFAULT NULL COMMENT '综合评价'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `purchase_supplier`
--
INSERT INTO `purchase_supplier` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `name`, `address`, `phone`, `business_scope`, `collaborations_number`, `flowing_water`, `evaluation`) VALUES
('1690444013968150530', 'admin', '2023-08-13 03:23:54', 'admin', '2023-08-13 17:51:14', 'A01A03', '黄晖有限公司', '福建省厦门市思明区厦禾路', '15960801986', '1,2,3,4,5', 3, 20100000.00, '价格过高'),
('1690736576735887362', 'admin', '2023-08-13 22:46:27', 'admin', '2023-08-14 14:36:35', 'A01A03', 'super军用火炬有限公司', '美国德克萨斯州欧几里得街道火炬开发区', '+1 60366666', '6', 2, 73790000.00, 'Nice Weapon'),
('1691365161122471937', 'admin', '2023-08-15 16:24:13', NULL, NULL, 'A01A03', '测试流程', 'CRUD', 'aaaaaa?为什么可以输入中文', '1,3,5', 0, 0.00, NULL);
--
-- 转储表的索引
--
--
-- 表的索引 `purchase_supplier`
--
ALTER TABLE `purchase_supplier`
ADD PRIMARY KEY (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -88,28 +88,28 @@ public class LoginController {
//update-begin--Author:scott Date:20190805 for暂时注释掉密码加密逻辑有点问题
//update-begin-author:taoyan date:20190828 for:校验验证码
String captcha = sysLoginModel.getCaptcha();
if(captcha==null){
result.error500("验证码无效");
return result;
}
String lowerCaseCaptcha = captcha.toLowerCase();
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
// 加入密钥作为混淆避免简单的拼接被外部利用用户自定义该密钥即可
String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
String realKey = Md5Util.md5Encode(origin, "utf-8");
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
Object checkCode = redisUtil.get(realKey);
//当进入登录页时有一定几率出现验证码错误 #1714
if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
log.warn("验证码错误key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode);
result.error500("验证码错误");
// 改成特殊的code 便于前端判断
result.setCode(HttpStatus.PRECONDITION_FAILED.value());
return result;
}
// String captcha = sysLoginModel.getCaptcha();
// if(captcha==null){
// result.error500("验证码无效");
// return result;
// }
// String lowerCaseCaptcha = captcha.toLowerCase();
// //update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
// // 加入密钥作为混淆避免简单的拼接被外部利用用户自定义该密钥即可
// String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
// String realKey = Md5Util.md5Encode(origin, "utf-8");
// //update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
// Object checkCode = redisUtil.get(realKey);
// //当进入登录页时有一定几率出现验证码错误 #1714
// if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
// log.warn("验证码错误key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode);
// result.error500("验证码错误");
// // 改成特殊的code 便于前端判断
// result.setCode(HttpStatus.PRECONDITION_FAILED.value());
// return result;
// }
//update-end-author:taoyan date:20190828 for:校验验证码
//1. 校验用户是否有效
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bugif条件永远为false
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
@ -131,11 +131,11 @@ public class LoginController {
result.error500("用户名或密码错误");
return result;
}
//用户登录信息
userInfo(sysUser, result);
//update-begin--Author:liusq Date:20210126 for登录成功删除redis中的验证码
redisUtil.del(realKey);
// redisUtil.del(realKey);
//update-begin--Author:liusq Date:20210126 for登录成功删除redis中的验证码
redisUtil.del(CommonConstant.LOGIN_FAIL + username);
LoginUser loginUser = new LoginUser();
@ -171,7 +171,7 @@ public class LoginController {
}
//update-begin---author:liusq ---date:2022-06-29 for接口返回值修改同步修改这里的判断逻辑-----------
//update-end---author:scott ---date::2022-06-20 forvue3前端支持自定义首页--------------
obj.put("userInfo",sysUser);
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
result.setResult(obj);
@ -180,7 +180,7 @@ public class LoginController {
return result;
}
/**
* 退出登录
* @param request
@ -214,7 +214,7 @@ public class LoginController {
return Result.error("Token无效!");
}
}
/**
* 获取访问量
* @return
@ -245,7 +245,7 @@ public class LoginController {
result.success("登录成功");
return result;
}
/**
* 获取访问量
* @return
@ -266,8 +266,8 @@ public class LoginController {
result.setResult(oConvertUtils.toLowerCasePageList(list));
return result;
}
/**
* 登陆成功选择用户当前部门
* @param user
@ -281,7 +281,7 @@ public class LoginController {
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
username = sysUser.getUsername();
}
//获取登录部门
String orgCode= user.getOrgCode();
//获取登录租户
@ -296,7 +296,7 @@ public class LoginController {
/**
* 短信登录接口
*
*
* @param jsonObject
* @return
*/
@ -312,12 +312,12 @@ public class LoginController {
result.setSuccess(false);
return result;
}
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE+mobile;
Object object = redisUtil.get(redisKey);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
if (object != null) {
result.setMessage("验证码10分钟内仍然有效");
result.setSuccess(false);
@ -351,7 +351,7 @@ public class LoginController {
}
return result;
}
/**
* smsmode 短信模板方式 0 .登录模板1.注册模板2.忘记密码模板
*/
@ -369,12 +369,12 @@ public class LoginController {
result.setSuccess(false);
return result;
}
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
//验证码10分钟内有效
redisUtil.set(redisKey, captcha, 600);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
//update-begin--Author:scott Date:20190812 forissues#391
//result.setResult(captcha);
//update-end--Author:scott Date:20190812 forissues#391
@ -387,11 +387,11 @@ public class LoginController {
}
return result;
}
/**
* 手机号登录接口
*
*
* @param jsonObject
* @return
*/
@ -411,7 +411,7 @@ public class LoginController {
if(!result.isSuccess()) {
return result;
}
String smscode = jsonObject.getString("captcha");
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
@ -463,7 +463,7 @@ public class LoginController {
//3.设置登录用户信息
obj.put("userInfo", sysUser);
//4.设置登录部门
List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
obj.put("departs", departs);
@ -516,13 +516,13 @@ public class LoginController {
String code = RandomUtil.randomString(BASE_CHECK_CODES,4);
//存到redis中
String lowerCaseCode = code.toLowerCase();
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
// 加入密钥作为混淆避免简单的拼接被外部利用用户自定义该密钥即可
String origin = lowerCaseCode+key+jeecgBaseConfig.getSignatureSecret();
String realKey = Md5Util.md5Encode(origin, "utf-8");
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
redisUtil.set(realKey, lowerCaseCode, 60);
log.info("获取验证码Redis key = {}checkCode = {}", realKey, code);
//返回前端
@ -547,7 +547,7 @@ public class LoginController {
sysPermissionService.switchVue3Menu();
return res;
}
/**
* app登录
* @param sysLoginModel
@ -560,7 +560,7 @@ public class LoginController {
String username = sysLoginModel.getUsername();
String password = sysLoginModel.getPassword();
JSONObject obj = new JSONObject();
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
if(isLoginFailOvertimes(username)){
return result.error500("该用户登录失败次数过多请于10分钟后再次登录");
@ -572,7 +572,7 @@ public class LoginController {
if(!result.isSuccess()) {
return result;
}
//2. 校验用户名或密码是否正确
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
String syspassword = sysUser.getPassword();
@ -583,7 +583,7 @@ public class LoginController {
result.error500("用户名或密码错误");
return result;
}
//3.设置登录部门
String orgCode = sysUser.getOrgCode();
if(oConvertUtils.isEmpty(orgCode)) {
@ -609,7 +609,7 @@ public class LoginController {
//5. 设置登录用户信息
obj.put("userInfo", sysUser);
//6. 生成token
String token = JwtUtil.sign(username, syspassword);
// 设置超时时间
@ -731,4 +731,4 @@ public class LoginController {
redisUtil.set(key, ++val, 3600);
}
}
}

View File

@ -0,0 +1,179 @@
package org.jeecg.modules.demo.Try.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.Try.entity.ProcurementProgress;
import org.jeecg.modules.demo.Try.service.IProcurementProgressService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 采购进度
* @Author: jeecg-boot
* @Date: 2023-08-16
* @Version: V1.0
*/
@Api(tags = "采购进度")
@RestController
@RequestMapping("/Try/procurementProgress")
@Slf4j
public class ProcurementProgressController extends JeecgController<ProcurementProgress, IProcurementProgressService> {
@Autowired
private IProcurementProgressService procurementProgressService;
/**
* 分页列表查询
*
* @param procurementProgress
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "采购进度-分页列表查询")
@ApiOperation(value = "采购进度-分页列表查询", notes = "采购进度-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ProcurementProgress>> queryPageList(ProcurementProgress procurementProgress,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ProcurementProgress> queryWrapper = QueryGenerator.initQueryWrapper(procurementProgress, req.getParameterMap());
Page<ProcurementProgress> page = new Page<ProcurementProgress>(pageNo, pageSize);
IPage<ProcurementProgress> pageList = procurementProgressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param procurementProgress
* @return
*/
@AutoLog(value = "采购进度-添加")
@ApiOperation(value = "采购进度-添加", notes = "采购进度-添加")
@RequiresPermissions("Try:procurement_progress:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ProcurementProgress procurementProgress) {
procurementProgressService.save(procurementProgress);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param procurementProgress
* @return
*/
@AutoLog(value = "采购进度-编辑")
@ApiOperation(value = "采购进度-编辑", notes = "采购进度-编辑")
@RequiresPermissions("Try:procurement_progress:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ProcurementProgress procurementProgress) {
procurementProgressService.updateById(procurementProgress);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "采购进度-通过id删除")
@ApiOperation(value = "采购进度-通过id删除", notes = "采购进度-通过id删除")
@RequiresPermissions("Try:procurement_progress:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
procurementProgressService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "采购进度-批量删除")
@ApiOperation(value = "采购进度-批量删除", notes = "采购进度-批量删除")
@RequiresPermissions("Try:procurement_progress:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.procurementProgressService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "采购进度-通过id查询")
@ApiOperation(value = "采购进度-通过id查询", notes = "采购进度-通过id查询")
@GetMapping(value = "/queryById")
public Result<ProcurementProgress> queryById(@RequestParam(name = "id", required = true) String id) {
ProcurementProgress procurementProgress = procurementProgressService.getById(id);
if (procurementProgress == null) {
return Result.error("未找到对应数据");
}
return Result.OK(procurementProgress);
}
/**
* 导出excel
*
* @param request
* @param procurementProgress
*/
@RequiresPermissions("Try:procurement_progress:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProcurementProgress procurementProgress) {
return super.exportXls(request, procurementProgress, ProcurementProgress.class, "采购进度");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("Try:procurement_progress:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProcurementProgress.class);
}
}

View File

@ -1,20 +1,24 @@
package org.jeecg.modules.demo.Try.controller;
import java.io.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.Try.entity.ProcurementProgress;
import org.jeecg.modules.demo.Try.entity.PurchaseAndOrder;
import org.jeecg.modules.demo.Try.entity.PurchaseOrderConfirmation;
import org.jeecg.modules.demo.Try.entity.PurchaseRequest;
import org.jeecg.modules.demo.Try.service.IProcurementProgressService;
import org.jeecg.modules.demo.Try.service.IPurchaseOrderConfirmationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -23,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.Try.service.IPurchaseRequestService;
import org.jeecg.modules.demo.Try.service.WordGeneratorService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -30,6 +35,10 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -79,6 +88,28 @@ public class PurchaseOrderConfirmationController extends JeecgController<Purchas
return Result.OK(pageList);
}
/**
* 查询所有被接收的订单并连接
*
* @param purchaseOrderConfirmation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = "采购订单确认-连接查询", notes = "采购订单确认-连接查询")
@GetMapping(value = "/joinList")
public Result<IPage<PurchaseAndOrder>> queryAllList(PurchaseAndOrder purchaseAndOrder,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<PurchaseAndOrder> queryWrapper = QueryGenerator.initQueryWrapper(purchaseAndOrder, req.getParameterMap());
Page<PurchaseAndOrder> page = new Page<PurchaseAndOrder>(pageNo, pageSize);
// IPage<PurchaseAndOrder> pageList = purchaseOrderConfirmationService.page(page, queryWrapper);
IPage<PurchaseAndOrder> pageList = purchaseOrderConfirmationService.queryPageList(page);
return Result.OK(pageList);
}
/**
* 添加
*
@ -103,12 +134,15 @@ public class PurchaseOrderConfirmationController extends JeecgController<Purchas
@ApiOperation(value = "采购订单确认-编辑", notes = "采购订单确认-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody PurchaseOrderConfirmation purchaseOrderConfirmation) {
purchaseOrderConfirmationService.updateById(purchaseOrderConfirmation);
LambdaUpdateWrapper<PurchaseOrderConfirmation> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(PurchaseOrderConfirmation::getAssociationNumber, purchaseOrderConfirmation.getAssociationNumber())
.set(PurchaseOrderConfirmation::getSupplierSelection, purchaseOrderConfirmation.getSupplierSelection());
purchaseOrderConfirmationService.update(updateWrapper);
return Result.OK("编辑成功!");
}
/**
* 被接收 备用代码
* 被接收
*
* @param purchaseOrderConfirmation
* @return
@ -128,24 +162,60 @@ public class PurchaseOrderConfirmationController extends JeecgController<Purchas
/**
* 被接收
*
* @param purchaseOrderConfirmation
* @param purchaseRequest
* @return
*/
@AutoLog(value = "采购订单确认-取消")
@ApiOperation(value = "采购订单确认-取消", notes = "采购订单确认-取消")
@RequestMapping(value = "/cancelReceiving", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> cancelReceiving(@RequestBody PurchaseOrderConfirmation purchaseOrderConfirmation) {
String requireNo = purchaseOrderConfirmation.getAssociationNumber();
PurchaseRequest purchaseRequest = purchaseRequestService.queryByRequireNo(requireNo);
purchaseRequest.setIsReceiving("0");
purchaseRequestService.updateById(purchaseRequest);
purchaseOrderConfirmationService.removeById(purchaseOrderConfirmationService.queryByRequireNo(requireNo).getId());
public Result<String> cancelReceiving(@RequestBody PurchaseRequest purchaseRequest) {
String requireNo = purchaseRequest.getRequirementNumber();
LambdaUpdateWrapper<PurchaseRequest> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(PurchaseRequest::getRequirementNumber, requireNo)
.set(PurchaseRequest::getIsReceiving, "0");
purchaseRequestService.update(updateWrapper);
//删除订单确认表中的数据
LambdaUpdateWrapper<PurchaseOrderConfirmation> deleteWrapper = new LambdaUpdateWrapper<>();
deleteWrapper.eq(PurchaseOrderConfirmation::getAssociationNumber, requireNo);
purchaseOrderConfirmationService.remove(deleteWrapper);
return Result.OK("已取消接收!");
}
// public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
// purchaseOrderConfirmationService.removeById(id);
// return Result.OK("删除成功!");
/**
* 处理完成
*
* @param purchaseOrderConfirmation
* @return
*/
@Autowired
private IProcurementProgressService procurementProgressService;
@AutoLog(value = "订单确认-处理完成")
@ApiOperation(value = "订单确认-处理完成", notes = "订单确认-处理完成")
@RequestMapping(value = "/finish", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> finish(@RequestBody Map<String, String> requestMap) {
LambdaUpdateWrapper<PurchaseOrderConfirmation> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(PurchaseOrderConfirmation::getAssociationNumber, requestMap.get("requirementNumber"))
.set(PurchaseOrderConfirmation::getIsDone,"1");
purchaseOrderConfirmationService.update(updateWrapper);
ProcurementProgress procurementProgress = new ProcurementProgress();
procurementProgress.setReqirementNumber(Integer.valueOf(requestMap.get("requirementNumber")));
procurementProgress.setProcurementLog(requestMap.get("procurementLog"));
procurementProgressService.save(procurementProgress);
return Result.OK("已更改处理状态!");
}
@AutoLog(value = "订单确认-处理完成撤销")
@ApiOperation(value = "订单确认-处理完成撤销", notes = "订单确认-处理完成撤销")
@RequestMapping(value = "/unFinish", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> unFinish(@RequestBody Map<String, String> requestMap) {
LambdaUpdateWrapper<PurchaseOrderConfirmation> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(PurchaseOrderConfirmation::getAssociationNumber, requestMap.get("requirementNumber"))
.set(PurchaseOrderConfirmation::getIsDone, "0");
purchaseOrderConfirmationService.update(updateWrapper);
procurementProgressService.remove(new LambdaQueryWrapper<ProcurementProgress>().eq(ProcurementProgress::getReqirementNumber, requestMap.get("requirementNumber")));
return Result.OK("已更改处理状态!");
}
/**
* 通过id删除
@ -215,4 +285,50 @@ public class PurchaseOrderConfirmationController extends JeecgController<Purchas
return super.importExcel(request, response, PurchaseOrderConfirmation.class);
}
/**
* 生成word文档
*
* @param jsonData 前端的json数据
* @return 返回生成的word文档[二进制数组]
*/
private final Object lock = new Object(); // 用于同步的锁对象
@Autowired
private WordGeneratorService wordGeneratorService;
@PostMapping("/outWordDoc")
public ResponseEntity<byte[]> exportWord(@RequestBody String jsonData) {
synchronized (lock) {
System.out.println("jsonData:" + jsonData);
if (jsonData == null || jsonData.length() == 0) {
return new ResponseEntity<byte[]>(HttpStatus.NOT_FOUND);
}
File file = new File(wordGeneratorService.createWord(jsonData));
//将文件转换为二进制数组
byte[] buffer = null;
try {
FileInputStream fis = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] b = new byte[1024];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
fis.close();
bos.close();
buffer = bos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
if (buffer != null) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", "generated-file.docx");
return new ResponseEntity<byte[]>(buffer, headers, HttpStatus.OK);
} else
return new ResponseEntity<byte[]>(HttpStatus.NOT_FOUND);
}
}
}

View File

@ -232,4 +232,26 @@ public class PurchaseRequestController extends JeecgController<PurchaseRequest,
IPage<PurchaseRequest> pageList = purchaseRequestService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 已接单的采购需求展示(List)
*
* @param purchaseRequest
*/
@ApiOperation(value = "采购表-待接单", notes = "采购表-待接单")
@PermissionData(pageComponent = "purchase/processing/orderProcessing")
@GetMapping(value = "/receivedList")
public Result<IPage<PurchaseRequest>> receivedList(PurchaseRequest purchaseRequest,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PurchaseRequest> queryWrapper = QueryGenerator.initQueryWrapper(purchaseRequest, req.getParameterMap());
//is_receiving=0表示未接单,demand_status=1表示已审核通过
//添加条件查询只查询已审核通过并且未接单的采购需求
queryWrapper.eq("demand_status", 2);
queryWrapper.eq("is_receiving", 1);
Page<PurchaseRequest> page = new Page<PurchaseRequest>(pageNo, pageSize);
IPage<PurchaseRequest> pageList = purchaseRequestService.page(page, queryWrapper);
return Result.OK(pageList);
}
}

View File

@ -0,0 +1,178 @@
package org.jeecg.modules.demo.Try.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.Try.entity.PurchaseSupplier;
import org.jeecg.modules.demo.Try.service.IPurchaseSupplierService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 采购供应商管理
* @Author: jeecg-boot
* @Date: 2023-08-14
* @Version: V1.0
*/
@Api(tags="采购供应商管理")
@RestController
@RequestMapping("/Try/purchaseSupplier")
@Slf4j
public class PurchaseSupplierController extends JeecgController<PurchaseSupplier, IPurchaseSupplierService> {
@Autowired
private IPurchaseSupplierService purchaseSupplierService;
/**
* 分页列表查询
*
* @param purchaseSupplier
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "采购供应商管理-分页列表查询")
@ApiOperation(value="采购供应商管理-分页列表查询", notes="采购供应商管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<PurchaseSupplier>> queryPageList(PurchaseSupplier purchaseSupplier,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PurchaseSupplier> queryWrapper = QueryGenerator.initQueryWrapper(purchaseSupplier, req.getParameterMap());
Page<PurchaseSupplier> page = new Page<PurchaseSupplier>(pageNo, pageSize);
IPage<PurchaseSupplier> pageList = purchaseSupplierService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param purchaseSupplier
* @return
*/
@AutoLog(value = "采购供应商管理-添加")
@ApiOperation(value="采购供应商管理-添加", notes="采购供应商管理-添加")
@RequiresPermissions("Try:purchase_supplier:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody PurchaseSupplier purchaseSupplier) {
purchaseSupplierService.save(purchaseSupplier);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param purchaseSupplier
* @return
*/
@AutoLog(value = "采购供应商管理-编辑")
@ApiOperation(value="采购供应商管理-编辑", notes="采购供应商管理-编辑")
@RequiresPermissions("Try:purchase_supplier:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody PurchaseSupplier purchaseSupplier) {
purchaseSupplierService.updateById(purchaseSupplier);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "采购供应商管理-通过id删除")
@ApiOperation(value="采购供应商管理-通过id删除", notes="采购供应商管理-通过id删除")
@RequiresPermissions("Try:purchase_supplier:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
purchaseSupplierService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "采购供应商管理-批量删除")
@ApiOperation(value="采购供应商管理-批量删除", notes="采购供应商管理-批量删除")
@RequiresPermissions("Try:purchase_supplier:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.purchaseSupplierService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "采购供应商管理-通过id查询")
@ApiOperation(value="采购供应商管理-通过id查询", notes="采购供应商管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<PurchaseSupplier> queryById(@RequestParam(name="id",required=true) String id) {
PurchaseSupplier purchaseSupplier = purchaseSupplierService.getById(id);
if(purchaseSupplier==null) {
return Result.error("未找到对应数据");
}
return Result.OK(purchaseSupplier);
}
/**
* 导出excel
*
* @param request
* @param purchaseSupplier
*/
@RequiresPermissions("Try:purchase_supplier:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PurchaseSupplier purchaseSupplier) {
return super.exportXls(request, purchaseSupplier, PurchaseSupplier.class, "采购供应商管理");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("Try:purchase_supplier:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, PurchaseSupplier.class);
}
}

View File

@ -0,0 +1,75 @@
package org.jeecg.modules.demo.Try.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 采购进度
* @Author: jeecg-boot
* @Date: 2023-08-16
* @Version: V1.0
*/
@Data
@TableName("procurement_progress")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="procurement_progress对象", description="采购进度")
public class ProcurementProgress implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**需求编号*/
@Excel(name = "需求编号", width = 15)
@ApiModelProperty(value = "需求编号")
private java.lang.Integer reqirementNumber;
/**采购日志*/
@Excel(name = "采购日志", width = 15)
@ApiModelProperty(value = "采购日志")
private java.lang.String procurementLog;
/**是否完成*/
@Excel(name = "是否完成", width = 15)
@ApiModelProperty(value = "是否完成")
private java.lang.Integer isDone;
/**质检详情*/
@Excel(name = "质检详情", width = 15)
@ApiModelProperty(value = "质检详情")
private java.lang.String qualityInspectionDetails;
/**质检是否通过*/
@Excel(name = "质检是否通过", width = 15)
@ApiModelProperty(value = "质检是否通过")
private java.lang.Integer qualityIsPass;
}

View File

@ -0,0 +1,150 @@
package org.jeecg.modules.demo.Try.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 采购订单确认
* @Author: jeecg-boot
* @Date: 2023-08-13
* @Version: V1.0
*/
@Data
@TableName("purchase_order_confirmation")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "purchase_order_confirmation对象", description = "采购订单确认")
public class PurchaseAndOrder implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**
* 创建人
*/
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "申请人")
private java.lang.String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**
* 所属部门
*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**
* 关联编号
*/
@Excel(name = "需求编号", width = 15)
@ApiModelProperty(value = "需求编号")
private java.lang.String requirementNumber;
/**
* 供应商选择
*/
@Excel(name = "供应商选择", width = 15)
@ApiModelProperty(value = "供应商选择")
private java.lang.String supplierSelection;
/**
* 接单人
*/
@Excel(name = "接单人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "接单人")
private java.lang.String receiver;
/**
* 接单时间
*/
@Excel(name = "接单时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "接单时间")
private java.util.Date receivingTime;
/**
* 备注
*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String notes;
/**
* 审批人
*/
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "审批人")
private String approvedBy;
/**
* 采购类别
*/
@Excel(name = "采购类别", width = 15, dicCode = "purchasing_categories")
@Dict(dicCode = "purchasing_categories")
@ApiModelProperty(value = "采购类别")
private Integer procurementCategory;
/**
* 采购方向
*/
@Excel(name = "采购方向", width = 15)
@ApiModelProperty(value = "采购方向")
private String procurementDirection;
/**
* 采购内容
*/
@Excel(name = "采购内容", width = 15)
@ApiModelProperty(value = "采购内容")
private String procurementContent;
/**
* 采购预算
*/
@Excel(name = "采购预算", width = 15)
@ApiModelProperty(value = "采购预算")
private String procurementBudget;
/**
* 附件
*/
@Excel(name = "附件", width = 15)
@ApiModelProperty(value = "附件")
private String annex;
/**
* 审核结果
*/
@Excel(name = "审核结果", width = 15)
@ApiModelProperty(value = "审核结果")
private String auditResults;
/**
* 是否被接受
*/
@Excel(name = "是否被接受", width = 15)
@ApiModelProperty(value = "是否被接受")
private String isReceiving;
}

View File

@ -101,4 +101,11 @@ public class PurchaseOrderConfirmation implements Serializable {
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String notes;
/**
* 是否处理完成
*/
@Excel(name = "是否处理完成", width = 15)
@ApiModelProperty(value = "是否处理完成")
@Dict(dicCode = "deal_done")
private java.lang.Integer isDone;
}

View File

@ -0,0 +1,87 @@
package org.jeecg.modules.demo.Try.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 采购供应商管理
* @Author: jeecg-boot
* @Date: 2023-08-14
* @Version: V1.0
*/
@Data
@TableName("purchase_supplier")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="purchase_supplier对象", description="采购供应商管理")
public class PurchaseSupplier implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**供应商名称 */
@Excel(name = "供应商名称 ", width = 15)
@ApiModelProperty(value = "供应商名称 ")
private java.lang.String name;
/**地址*/
@Excel(name = "地址", width = 15)
@ApiModelProperty(value = "地址")
private java.lang.String address;
/**联系人电话*/
@Excel(name = "联系人电话", width = 15)
@ApiModelProperty(value = "联系人电话")
private java.lang.String phone;
/**业务范围*/
@Excel(name = "业务范围", width = 15, dicCode = "business_scope")
@Dict(dicCode = "business_scope")
@ApiModelProperty(value = "业务范围")
private java.lang.String businessScope;
/**合作次数*/
@Excel(name = "合作次数", width = 15)
@ApiModelProperty(value = "合作次数")
private java.lang.Integer collaborationsNumber;
/**历史流水*/
@Excel(name = "历史流水", width = 15)
@ApiModelProperty(value = "历史流水")
private java.lang.Double flowingWater;
/**综合评价*/
@Excel(name = "综合评价", width = 15)
@ApiModelProperty(value = "综合评价")
private java.lang.String evaluation;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.Try.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.Try.entity.ProcurementProgress;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 采购进度
* @Author: jeecg-boot
* @Date: 2023-08-16
* @Version: V1.0
*/
public interface ProcurementProgressMapper extends BaseMapper<ProcurementProgress> {
}

View File

@ -2,7 +2,10 @@ package org.jeecg.modules.demo.Try.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.Try.entity.PurchaseAndOrder;
import org.jeecg.modules.demo.Try.entity.PurchaseOrderConfirmation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -13,5 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @Version: V1.0
*/
public interface PurchaseOrderConfirmationMapper extends BaseMapper<PurchaseOrderConfirmation> {
IPage<PurchaseAndOrder> getAllData(IPage<PurchaseAndOrder> page);
}

View File

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.Try.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.Try.entity.PurchaseAndOrder;
import org.jeecg.modules.demo.Try.entity.PurchaseRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface PurchaseRequestMapper extends BaseMapper<PurchaseRequest> {
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.Try.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.Try.entity.PurchaseSupplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 采购供应商管理
* @Author: jeecg-boot
* @Date: 2023-08-14
* @Version: V1.0
*/
public interface PurchaseSupplierMapper extends BaseMapper<PurchaseSupplier> {
}

View File

@ -0,0 +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">
<mapper namespace="org.jeecg.modules.demo.Try.mapper.ProcurementProgressMapper">
</mapper>

View File

@ -2,4 +2,54 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.Try.mapper.PurchaseOrderConfirmationMapper">
</mapper>
<select id="getAllData" resultType="org.jeecg.modules.demo.Try.entity.PurchaseAndOrder">
select c.id,
r.create_by,
r.create_time,
r.update_time,
r.sys_org_code,
r.requirement_number,
c.supplier_selection,
c.receiver,
c.receiving_time,
c.notes,
r.approved_by,
r.procurement_category,
r.procurement_direction,
r.procurement_content,
r.procurement_budget,
r.annex,
r.audit_results,
r.is_receiving
from purchase_order_confirmation c,
purchase_request r
where r.requirement_number = c.association_number
and c.is_done = 0;
</select>
<select id="getAllData2" resultType="org.jeecg.modules.demo.Try.entity.PurchaseAndOrder">
select c.id,
r.create_by,
r.create_time,
r.update_time,
r.sys_org_code,
r.requirement_number,
c.supplier_selection,
c.receiver,
c.receiving_time,
c.notes,
r.approved_by,
r.procurement_category,
r.procurement_direction,
r.procurement_content,
r.procurement_budget,
r.annex,
r.audit_results,
r.is_receiving
from purchase_order_confirmation c,
purchase_request r
where r.requirement_number = c.association_number
and c.is_done = 1;
</select>
</mapper>

View File

@ -0,0 +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">
<mapper namespace="org.jeecg.modules.demo.Try.mapper.PurchaseSupplierMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.Try.service;
import org.jeecg.modules.demo.Try.entity.ProcurementProgress;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 采购进度
* @Author: jeecg-boot
* @Date: 2023-08-16
* @Version: V1.0
*/
public interface IProcurementProgressService extends IService<ProcurementProgress> {
}

View File

@ -1,9 +1,13 @@
package org.jeecg.modules.demo.Try.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.demo.Try.entity.PurchaseAndOrder;
import org.jeecg.modules.demo.Try.entity.PurchaseOrderConfirmation;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.Try.entity.PurchaseRequest;
import java.util.List;
/**
* @Description: 采购订单确认
* @Author: jeecg-boot
@ -15,4 +19,6 @@ public interface IPurchaseOrderConfirmationService extends IService<PurchaseOrde
PurchaseOrderConfirmation queryByRequireNo(String queryByRequireNo);
IPage<PurchaseAndOrder> queryPageList(IPage<PurchaseAndOrder> page);
}

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.Try.service;
import org.jeecg.modules.demo.Try.entity.PurchaseSupplier;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 采购供应商管理
* @Author: jeecg-boot
* @Date: 2023-08-14
* @Version: V1.0
*/
public interface IPurchaseSupplierService extends IService<PurchaseSupplier> {
}

View File

@ -0,0 +1,9 @@
package org.jeecg.modules.demo.Try.service;
import org.jeecg.modules.demo.Try.entity.PurchaseAndOrder;
public interface WordGeneratorService {
public String createWord(String jsonData);
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.Try.service.impl;
import org.jeecg.modules.demo.Try.entity.ProcurementProgress;
import org.jeecg.modules.demo.Try.mapper.ProcurementProgressMapper;
import org.jeecg.modules.demo.Try.service.IProcurementProgressService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 采购进度
* @Author: jeecg-boot
* @Date: 2023-08-16
* @Version: V1.0
*/
@Service
public class ProcurementProgressServiceImpl extends ServiceImpl<ProcurementProgressMapper, ProcurementProgress> implements IProcurementProgressService {
}

View File

@ -1,14 +1,19 @@
package org.jeecg.modules.demo.Try.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.demo.Try.entity.PurchaseAndOrder;
import org.jeecg.modules.demo.Try.entity.PurchaseOrderConfirmation;
import org.jeecg.modules.demo.Try.mapper.PurchaseOrderConfirmationMapper;
import org.jeecg.modules.demo.Try.mapper.PurchaseRequestMapper;
import org.jeecg.modules.demo.Try.service.IPurchaseOrderConfirmationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 采购订单确认
* @Author: jeecg-boot
@ -20,6 +25,9 @@ public class PurchaseOrderConfirmationServiceImpl extends ServiceImpl<PurchaseOr
@Autowired
private PurchaseOrderConfirmationMapper purchaseOrderConfirmationMapper;
@Autowired
private PurchaseRequestMapper purchaseRequestMapper;
@Override
public PurchaseOrderConfirmation queryByRequireNo(PurchaseOrderConfirmation queryByRequireNo) {
return queryByRequireNo(queryByRequireNo.getAssociationNumber());
@ -31,4 +39,11 @@ public class PurchaseOrderConfirmationServiceImpl extends ServiceImpl<PurchaseOr
PurchaseOrderConfirmation purchaseOrderConfirmation = purchaseOrderConfirmationMapper.selectOne(queryWrapper);
return purchaseOrderConfirmation;
}
@Override
public IPage<PurchaseAndOrder> queryPageList(IPage<PurchaseAndOrder> page) {
return purchaseOrderConfirmationMapper.getAllData(page);
}
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.Try.service.impl;
import org.jeecg.modules.demo.Try.entity.PurchaseSupplier;
import org.jeecg.modules.demo.Try.mapper.PurchaseSupplierMapper;
import org.jeecg.modules.demo.Try.service.IPurchaseSupplierService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 采购供应商管理
* @Author: jeecg-boot
* @Date: 2023-08-14
* @Version: V1.0
*/
@Service
public class PurchaseSupplierServiceImpl extends ServiceImpl<PurchaseSupplierMapper, PurchaseSupplier> implements IPurchaseSupplierService {
}

View File

@ -0,0 +1,85 @@
package org.jeecg.modules.demo.Try.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.jeecg.modules.demo.Try.service.WordGeneratorService;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.List;
import java.util.Map;
@Service
public class WordGeneratorServiceImpl implements WordGeneratorService {
@Override
public String createWord(String jsonData) {
try {
//将Json数据转换为Map处理
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> map = objectMapper.readValue(jsonData, Map.class);
//根据模板生成word文档
FileInputStream templateStream = new FileInputStream("jeecg-module-system/jeecg-system-start/src/main/resources/jeecg/wordtemplate/template.docx");
XWPFDocument document = new XWPFDocument(templateStream);
//填充第一行数据
XWPFParagraph paragraph1 = document.getParagraphs().get(0);
//转为String处理
String paragraph1Text = paragraph1.getText();
//根据:分割
String[] split = paragraph1Text.split(":");
System.out.println(split[0]);
//将每段:后面的内容替换为传入的数据
paragraph1Text = split[0].trim() + ":" + map.get("requirementNumber") +
split[1] + ":" + map.get("sysOrgCode") +
split[2] + ":" + map.get("procurementDirection");
System.out.println(paragraph1Text);
//删除原来的内容将新的内容写入
// 清除段落的所有 runs
for (int i = paragraph1.getRuns().size() - 1; i >= 0; i--) {
paragraph1.removeRun(i);
}
paragraph1.createRun().setText(paragraph1Text);
//获取表格
XWPFTable table = document.getTables().get(0);
//获取表格的行
XWPFTableRow row = table.getRows().get(0);
//设置第一行第二列的值
row.getCell(1).setText(map.get("createBy_dictText").toString());
//设置第一行第四列的值
row.getCell(3).setText(map.get("createTime").toString());
//设置第一行第六列的值
row.getCell(5).setText(map.get("sysOrgCode").toString());
//获取第二行
XWPFTableRow row1 = table.getRows().get(1);
//设置第二行第二列的值
row1.getCell(1).setText(map.get("procurementCategory_dictText").toString());
//设置第二行第四列的值
row1.getCell(3).setText(map.get("procurementBudget").toString());
//获取第三行
XWPFTableRow row2 = table.getRows().get(2);
//设置第三行第二列的值
row2.getCell(1).setText(map.get("approvedBy_dictText").toString());
//获取第四行并设置第四行第二列的值
XWPFTableRow row3 = table.getRows().get(3);
//将procurementContent从Map中获取出并解析Json将其转换为Map
List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("procurementContent");
for (Map<String, Object> stringObjectMap : list) {
row3.getCell(1).setText(row3.getCell(1).getText()+ "物品名:" + stringObjectMap.get("name")
+ " 数量:" + stringObjectMap.get("number") + stringObjectMap.get("unit")+
"\n");
}
String fileName = "/temp/"+System.currentTimeMillis() + "_" + map.get("requirementNumber") + ".docx";
document.write(new FileOutputStream(fileName));
return fileName;
} catch (Exception e) {
e.printStackTrace();
}
return "fail to create word";
}
}

View File

@ -1,5 +1,5 @@
server:
port: 8080
port: 8888
tomcat:
max-swallow-size: -1
error:

View File

@ -1,5 +1,5 @@
server:
port: 8080
port: 8888
tomcat:
max-swallow-size: -1
error:
@ -300,4 +300,4 @@ third-app:
client-id: ??
# appSecret
client-secret: ??
agent-id: ??
agent-id: ??