diff --git a/db/purchase_order_confirmation.sql b/db/purchase_order_confirmation.sql new file mode 100644 index 0000000..008cfb4 --- /dev/null +++ b/db/purchase_order_confirmation.sql @@ -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 */; diff --git a/db/purchase_request.sql b/db/purchase_request.sql new file mode 100644 index 0000000..031f824 --- /dev/null +++ b/db/purchase_request.sql @@ -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 */; diff --git a/db/purchase_supplier.sql b/db/purchase_supplier.sql new file mode 100644 index 0000000..8358248 --- /dev/null +++ b/db/purchase_supplier.sql @@ -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 */; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java index e9a5feb..1664684 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java @@ -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: 登录代码验证用户是否注销bug,if条件永远为false LambdaQueryWrapper 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 for:vue3前端,支持自定义首页-------------- - + 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 for:issues#391 //result.setResult(captcha); //update-end--Author:scott Date:20190812 for:issues#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 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); } -} \ No newline at end of file +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/ProcurementProgressController.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/ProcurementProgressController.java new file mode 100644 index 0000000..a3b1737 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/ProcurementProgressController.java @@ -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 { + @Autowired + private IProcurementProgressService procurementProgressService; + + /** + * 分页列表查询 + * + * @param procurementProgress + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "采购进度-分页列表查询") + @ApiOperation(value = "采购进度-分页列表查询", notes = "采购进度-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(ProcurementProgress procurementProgress, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(procurementProgress, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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 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 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 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 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 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); + } + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseOrderConfirmationController.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseOrderConfirmationController.java index 4ef6094..8a6be31 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseOrderConfirmationController.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseOrderConfirmationController.java @@ -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> queryAllList(PurchaseAndOrder purchaseAndOrder, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(purchaseAndOrder, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); +// IPage pageList = purchaseOrderConfirmationService.page(page, queryWrapper); + IPage pageList = purchaseOrderConfirmationService.queryPageList(page); + return Result.OK(pageList); + } + /** * 添加 * @@ -103,12 +134,15 @@ public class PurchaseOrderConfirmationController extends JeecgController edit(@RequestBody PurchaseOrderConfirmation purchaseOrderConfirmation) { - purchaseOrderConfirmationService.updateById(purchaseOrderConfirmation); + LambdaUpdateWrapper 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 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 cancelReceiving(@RequestBody PurchaseRequest purchaseRequest) { + String requireNo = purchaseRequest.getRequirementNumber(); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(PurchaseRequest::getRequirementNumber, requireNo) + .set(PurchaseRequest::getIsReceiving, "0"); + purchaseRequestService.update(updateWrapper); + //删除订单确认表中的数据 + LambdaUpdateWrapper deleteWrapper = new LambdaUpdateWrapper<>(); + deleteWrapper.eq(PurchaseOrderConfirmation::getAssociationNumber, requireNo); + purchaseOrderConfirmationService.remove(deleteWrapper); return Result.OK("已取消接收!"); } -// public Result 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 finish(@RequestBody Map requestMap) { + LambdaUpdateWrapper 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 unFinish(@RequestBody Map requestMap) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(PurchaseOrderConfirmation::getAssociationNumber, requestMap.get("requirementNumber")) + .set(PurchaseOrderConfirmation::getIsDone, "0"); + purchaseOrderConfirmationService.update(updateWrapper); + procurementProgressService.remove(new LambdaQueryWrapper().eq(ProcurementProgress::getReqirementNumber, requestMap.get("requirementNumber"))); + return Result.OK("已更改处理状态!"); + } /** * 通过id删除 @@ -215,4 +285,50 @@ public class PurchaseOrderConfirmationController extends JeecgController exportWord(@RequestBody String jsonData) { + synchronized (lock) { + System.out.println("jsonData:" + jsonData); + if (jsonData == null || jsonData.length() == 0) { + return new ResponseEntity(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(buffer, headers, HttpStatus.OK); + } else + return new ResponseEntity(HttpStatus.NOT_FOUND); + } + } + } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseRequestController.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseRequestController.java index fbd1b76..2debe84 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseRequestController.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseRequestController.java @@ -232,4 +232,26 @@ public class PurchaseRequestController extends JeecgController 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> receivedList(PurchaseRequest purchaseRequest, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(purchaseRequest, req.getParameterMap()); + //is_receiving=0表示未接单,demand_status=1表示已审核通过 + //添加条件查询,只查询已审核通过并且未接单的采购需求 + queryWrapper.eq("demand_status", 2); + queryWrapper.eq("is_receiving", 1); + Page page = new Page(pageNo, pageSize); + IPage pageList = purchaseRequestService.page(page, queryWrapper); + return Result.OK(pageList); + } } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseSupplierController.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseSupplierController.java new file mode 100644 index 0000000..4d5682b --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/controller/PurchaseSupplierController.java @@ -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 { + @Autowired + private IPurchaseSupplierService purchaseSupplierService; + + /** + * 分页列表查询 + * + * @param purchaseSupplier + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "采购供应商管理-分页列表查询") + @ApiOperation(value="采购供应商管理-分页列表查询", notes="采购供应商管理-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(PurchaseSupplier purchaseSupplier, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(purchaseSupplier, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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 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 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 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 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 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); + } + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/ProcurementProgress.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/ProcurementProgress.java new file mode 100644 index 0000000..075fac0 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/ProcurementProgress.java @@ -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; +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseAndOrder.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseAndOrder.java new file mode 100644 index 0000000..7f7c827 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseAndOrder.java @@ -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; +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseOrderConfirmation.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseOrderConfirmation.java index 3324691..396147d 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseOrderConfirmation.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseOrderConfirmation.java @@ -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; } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseSupplier.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseSupplier.java new file mode 100644 index 0000000..73ef8c6 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/entity/PurchaseSupplier.java @@ -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; +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/ProcurementProgressMapper.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/ProcurementProgressMapper.java new file mode 100644 index 0000000..3c3c8d0 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/ProcurementProgressMapper.java @@ -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 { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseOrderConfirmationMapper.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseOrderConfirmationMapper.java index 2fb1638..d880b94 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseOrderConfirmationMapper.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseOrderConfirmationMapper.java @@ -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 { - + IPage getAllData(IPage page); } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseRequestMapper.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseRequestMapper.java index ffdf1ba..2a480d4 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseRequestMapper.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseRequestMapper.java @@ -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 { + } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseSupplierMapper.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseSupplierMapper.java new file mode 100644 index 0000000..705535e --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/PurchaseSupplierMapper.java @@ -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 { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/ProcurementProgressMapper.xml b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/ProcurementProgressMapper.xml new file mode 100644 index 0000000..4690c1e --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/ProcurementProgressMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseOrderConfirmationMapper.xml b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseOrderConfirmationMapper.xml index dadb5c8..390b3a7 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseOrderConfirmationMapper.xml +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseOrderConfirmationMapper.xml @@ -2,4 +2,54 @@ - \ No newline at end of file + + + + + diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseSupplierMapper.xml b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseSupplierMapper.xml new file mode 100644 index 0000000..6a58b35 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/mapper/xml/PurchaseSupplierMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IProcurementProgressService.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IProcurementProgressService.java new file mode 100644 index 0000000..e967e99 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IProcurementProgressService.java @@ -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 { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseOrderConfirmationService.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseOrderConfirmationService.java index d47f3b3..17e21df 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseOrderConfirmationService.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseOrderConfirmationService.java @@ -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 queryPageList(IPage page); + } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseSupplierService.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseSupplierService.java new file mode 100644 index 0000000..262b12a --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/IPurchaseSupplierService.java @@ -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 { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/WordGeneratorService.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/WordGeneratorService.java new file mode 100644 index 0000000..0d3ce3a --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/WordGeneratorService.java @@ -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); + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/ProcurementProgressServiceImpl.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/ProcurementProgressServiceImpl.java new file mode 100644 index 0000000..d792697 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/ProcurementProgressServiceImpl.java @@ -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 implements IProcurementProgressService { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseOrderConfirmationServiceImpl.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseOrderConfirmationServiceImpl.java index f564896..24fc302 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseOrderConfirmationServiceImpl.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseOrderConfirmationServiceImpl.java @@ -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 queryPageList(IPage page) { + return purchaseOrderConfirmationMapper.getAllData(page); + } } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseSupplierServiceImpl.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseSupplierServiceImpl.java new file mode 100644 index 0000000..08016bd --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/PurchaseSupplierServiceImpl.java @@ -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 implements IPurchaseSupplierService { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/WordGeneratorServiceImpl.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/WordGeneratorServiceImpl.java new file mode 100644 index 0000000..bd92d20 --- /dev/null +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/demo/Try/service/impl/WordGeneratorServiceImpl.java @@ -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 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> list = (List>) map.get("procurementContent"); + for (Map 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"; + } +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml b/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml index c1e4afb..74fcfdc 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml +++ b/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml @@ -1,5 +1,5 @@ server: - port: 8080 + port: 8888 tomcat: max-swallow-size: -1 error: diff --git a/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml b/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml index e510f91..bd88dcb 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml +++ b/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml @@ -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: ?? \ No newline at end of file + agent-id: ?? diff --git a/jeecg-module-system/jeecg-system-start/src/main/resources/jeecg/wordtemplate/template.docx b/jeecg-module-system/jeecg-system-start/src/main/resources/jeecg/wordtemplate/template.docx new file mode 100644 index 0000000..0836edf Binary files /dev/null and b/jeecg-module-system/jeecg-system-start/src/main/resources/jeecg/wordtemplate/template.docx differ