作者 雷海东

  1 +package org.jeecg.modules.erp.bidding_info.controller;
  2 +
  3 +import java.util.Arrays;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +import java.util.stream.Collectors;
  7 +import java.io.IOException;
  8 +import java.io.UnsupportedEncodingException;
  9 +import java.net.URLDecoder;
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import org.jeecg.common.api.vo.Result;
  13 +import org.jeecg.common.system.query.QueryGenerator;
  14 +import org.jeecg.common.util.oConvertUtils;
  15 +
  16 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  17 +import com.baomidou.mybatisplus.core.metadata.IPage;
  18 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  19 +import lombok.extern.slf4j.Slf4j;
  20 +
  21 +import org.jeecg.modules.erp.bidding_info.entity.TblBiddingShenq;
  22 +import org.jeecg.modules.erp.bidding_info.service.ITblBiddingShenqService;
  23 +import org.jeecgframework.poi.excel.ExcelImportUtil;
  24 +import org.jeecgframework.poi.excel.def.NormalExcelConstants;
  25 +import org.jeecgframework.poi.excel.entity.ExportParams;
  26 +import org.jeecgframework.poi.excel.entity.ImportParams;
  27 +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
  28 +import org.jeecg.common.system.base.controller.JeecgController;
  29 +import org.springframework.beans.factory.annotation.Autowired;
  30 +import org.springframework.web.bind.annotation.*;
  31 +import org.springframework.web.multipart.MultipartFile;
  32 +import org.springframework.web.multipart.MultipartHttpServletRequest;
  33 +import org.springframework.web.servlet.ModelAndView;
  34 +import com.alibaba.fastjson.JSON;
  35 +import io.swagger.annotations.Api;
  36 +import io.swagger.annotations.ApiOperation;
  37 +import org.jeecg.common.aspect.annotation.AutoLog;
  38 +
  39 + /**
  40 + * @Description: tbl_bidding_shenq
  41 + * @Author: jeecg-boot
  42 + * @Date: 2024-04-22
  43 + * @Version: V1.0
  44 + */
  45 +@Api(tags="tbl_bidding_shenq")
  46 +@RestController
  47 +@RequestMapping("/trad/tblBiddingShenq")
  48 +@Slf4j
  49 +public class TblBiddingShenqController extends JeecgController<TblBiddingShenq, ITblBiddingShenqService> {
  50 + @Autowired
  51 + private ITblBiddingShenqService tblBiddingShenqService;
  52 +
  53 + /**
  54 + * 分页列表查询
  55 + *
  56 + * @param tblBiddingShenq
  57 + * @param pageNo
  58 + * @param pageSize
  59 + * @param req
  60 + * @return
  61 + */
  62 + //@AutoLog(value = "tbl_bidding_shenq-分页列表查询")
  63 + @ApiOperation(value="tbl_bidding_shenq-分页列表查询", notes="tbl_bidding_shenq-分页列表查询")
  64 + @GetMapping(value = "/list")
  65 + public Result<IPage<TblBiddingShenq>> queryPageList(TblBiddingShenq tblBiddingShenq,
  66 + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
  67 + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
  68 + HttpServletRequest req) {
  69 + QueryWrapper<TblBiddingShenq> queryWrapper = QueryGenerator.initQueryWrapper(tblBiddingShenq, req.getParameterMap());
  70 + Page<TblBiddingShenq> page = new Page<TblBiddingShenq>(pageNo, pageSize);
  71 + IPage<TblBiddingShenq> pageList = tblBiddingShenqService.page(page, queryWrapper);
  72 + return Result.OK(pageList);
  73 + }
  74 +
  75 + /**
  76 + * 添加
  77 + *
  78 + * @param tblBiddingShenq
  79 + * @return
  80 + */
  81 + @AutoLog(value = "tbl_bidding_shenq-添加")
  82 + @ApiOperation(value="tbl_bidding_shenq-添加", notes="tbl_bidding_shenq-添加")
  83 + @PostMapping(value = "/add")
  84 + public Result<String> add(@RequestBody TblBiddingShenq tblBiddingShenq) {
  85 + tblBiddingShenqService.save(tblBiddingShenq);
  86 + return Result.OK("添加成功!");
  87 + }
  88 +
  89 + /**
  90 + * 编辑
  91 + *
  92 + * @param tblBiddingShenq
  93 + * @return
  94 + */
  95 + @AutoLog(value = "tbl_bidding_shenq-编辑")
  96 + @ApiOperation(value="tbl_bidding_shenq-编辑", notes="tbl_bidding_shenq-编辑")
  97 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
  98 + public Result<String> edit(@RequestBody TblBiddingShenq tblBiddingShenq) {
  99 + tblBiddingShenqService.updateById(tblBiddingShenq);
  100 + return Result.OK("编辑成功!");
  101 + }
  102 +
  103 + /**
  104 + * 通过id删除
  105 + *
  106 + * @param id
  107 + * @return
  108 + */
  109 + @AutoLog(value = "tbl_bidding_shenq-通过id删除")
  110 + @ApiOperation(value="tbl_bidding_shenq-通过id删除", notes="tbl_bidding_shenq-通过id删除")
  111 + @DeleteMapping(value = "/delete")
  112 + public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  113 + tblBiddingShenqService.removeById(id);
  114 + return Result.OK("删除成功!");
  115 + }
  116 +
  117 + /**
  118 + * 批量删除
  119 + *
  120 + * @param ids
  121 + * @return
  122 + */
  123 + @AutoLog(value = "tbl_bidding_shenq-批量删除")
  124 + @ApiOperation(value="tbl_bidding_shenq-批量删除", notes="tbl_bidding_shenq-批量删除")
  125 + @DeleteMapping(value = "/deleteBatch")
  126 + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  127 + this.tblBiddingShenqService.removeByIds(Arrays.asList(ids.split(",")));
  128 + return Result.OK("批量删除成功!");
  129 + }
  130 +
  131 + /**
  132 + * 通过id查询
  133 + *
  134 + * @param id
  135 + * @return
  136 + */
  137 + //@AutoLog(value = "tbl_bidding_shenq-通过id查询")
  138 + @ApiOperation(value="tbl_bidding_shenq-通过id查询", notes="tbl_bidding_shenq-通过id查询")
  139 + @GetMapping(value = "/queryById")
  140 + public Result<TblBiddingShenq> queryById(@RequestParam(name="id",required=true) String id) {
  141 + TblBiddingShenq tblBiddingShenq = tblBiddingShenqService.getById(id);
  142 + if(tblBiddingShenq==null) {
  143 + return Result.error("未找到对应数据");
  144 + }
  145 + return Result.OK(tblBiddingShenq);
  146 + }
  147 +
  148 + /**
  149 + * 导出excel
  150 + *
  151 + * @param request
  152 + * @param tblBiddingShenq
  153 + */
  154 + @RequestMapping(value = "/exportXls")
  155 + public ModelAndView exportXls(HttpServletRequest request, TblBiddingShenq tblBiddingShenq) {
  156 + return super.exportXls(request, tblBiddingShenq, TblBiddingShenq.class, "tbl_bidding_shenq");
  157 + }
  158 +
  159 + /**
  160 + * 通过excel导入数据
  161 + *
  162 + * @param request
  163 + * @param response
  164 + * @return
  165 + */
  166 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  167 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  168 + return super.importExcel(request, response, TblBiddingShenq.class);
  169 + }
  170 +
  171 +}
  1 +package org.jeecg.modules.erp.bidding_info.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import java.io.UnsupportedEncodingException;
  5 +import java.util.Date;
  6 +import java.math.BigDecimal;
  7 +import com.baomidou.mybatisplus.annotation.IdType;
  8 +import com.baomidou.mybatisplus.annotation.TableId;
  9 +import com.baomidou.mybatisplus.annotation.TableName;
  10 +import lombok.Data;
  11 +import com.fasterxml.jackson.annotation.JsonFormat;
  12 +import org.springframework.format.annotation.DateTimeFormat;
  13 +import org.jeecgframework.poi.excel.annotation.Excel;
  14 +import org.jeecg.common.aspect.annotation.Dict;
  15 +import io.swagger.annotations.ApiModel;
  16 +import io.swagger.annotations.ApiModelProperty;
  17 +import lombok.EqualsAndHashCode;
  18 +import lombok.experimental.Accessors;
  19 +
  20 +/**
  21 + * @Description: tbl_bidding_shenq
  22 + * @Author: jeecg-boot
  23 + * @Date: 2024-04-22
  24 + * @Version: V1.0
  25 + */
  26 +@Data
  27 +@TableName("tbl_bidding_shenq")
  28 +@Accessors(chain = true)
  29 +@EqualsAndHashCode(callSuper = false)
  30 +@ApiModel(value="tbl_bidding_shenq对象", description="tbl_bidding_shenq")
  31 +public class TblBiddingShenq implements Serializable {
  32 + private static final long serialVersionUID = 1L;
  33 +
  34 + /**id*/
  35 + @TableId(type = IdType.ASSIGN_ID)
  36 + @ApiModelProperty(value = "id")
  37 + private Integer id;
  38 + /**品名*/
  39 + @Excel(name = "品名", width = 15)
  40 + @ApiModelProperty(value = "品名")
  41 + private String productName;
  42 + /**规格*/
  43 + @Excel(name = "规格", width = 15)
  44 + @ApiModelProperty(value = "规格")
  45 + private String specifications;
  46 + /**数量*/
  47 + @Excel(name = "数量", width = 15)
  48 + @ApiModelProperty(value = "数量")
  49 + private Integer num;
  50 + /**数量*/
  51 + @Excel(name = "单位", width = 15)
  52 + @ApiModelProperty(value = "单位")
  53 + private String danwei;
  54 + /**到货日期*/
  55 + @Excel(name = "到货日期", width = 15)
  56 + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  57 + @DateTimeFormat(pattern="yyyy-MM-dd")
  58 + @ApiModelProperty(value = "到货日期")
  59 + private Date deliveryTime;
  60 + /**品牌*/
  61 + @Excel(name = "品牌", width = 15)
  62 + @ApiModelProperty(value = "品牌")
  63 + private String brand;
  64 + /**备注*/
  65 + @Excel(name = "备注", width = 15)
  66 + @ApiModelProperty(value = "备注")
  67 + private String notes;
  68 + /**申请人*/
  69 + @Excel(name = "申请人", width = 15)
  70 + @ApiModelProperty(value = "申请人")
  71 + private String applicant;
  72 + /**一级审批人*/
  73 + @Excel(name = "一级审批人", width = 15)
  74 + @ApiModelProperty(value = "一级审批人")
  75 + private String spOne;
  76 + /**二级审批人*/
  77 + @Excel(name = "二级审批人", width = 15)
  78 + @ApiModelProperty(value = "二级审批人")
  79 + private String spTwo;
  80 + /**备注*/
  81 + @Excel(name = "不同意备注", width = 15)
  82 + @ApiModelProperty(value = "不同意备注")
  83 + private String noNotes;
  84 + /**创建人*/
  85 + @ApiModelProperty(value = "创建人")
  86 + private String createBy;
  87 + /**创建日期*/
  88 + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  89 + @DateTimeFormat(pattern="yyyy-MM-dd")
  90 + @ApiModelProperty(value = "创建日期")
  91 + private Date createTime;
  92 + /**更新人*/
  93 + @ApiModelProperty(value = "更新人")
  94 + private String updateBy;
  95 + /**更新日期*/
  96 + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  97 + @DateTimeFormat(pattern="yyyy-MM-dd")
  98 + @ApiModelProperty(value = "更新日期")
  99 + private Date updateTime;
  100 +}
  1 +package org.jeecg.modules.erp.bidding_info.mapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  7 +import org.jeecg.modules.erp.bidding_info.entity.TblBiddingShenq;
  8 +
  9 +/**
  10 + * @Description: tbl_bidding_shenq
  11 + * @Author: jeecg-boot
  12 + * @Date: 2024-04-22
  13 + * @Version: V1.0
  14 + */
  15 +public interface TblBiddingShenqMapper extends BaseMapper<TblBiddingShenq> {
  16 +
  17 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.erp.bidding_info.mapper.TblBiddingShenqMapper">
  4 +
  5 +</mapper>
  1 +package org.jeecg.modules.erp.bidding_info.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import org.jeecg.modules.erp.bidding_info.entity.TblBiddingShenq;
  5 +
  6 +/**
  7 + * @Description: tbl_bidding_shenq
  8 + * @Author: jeecg-boot
  9 + * @Date: 2024-04-22
  10 + * @Version: V1.0
  11 + */
  12 +public interface ITblBiddingShenqService extends IService<TblBiddingShenq> {
  13 +
  14 +}
  1 +package org.jeecg.modules.erp.bidding_info.service.impl;
  2 +
  3 +import org.jeecg.modules.erp.bidding_info.entity.TblBiddingShenq;
  4 +import org.jeecg.modules.erp.bidding_info.mapper.TblBiddingShenqMapper;
  5 +import org.jeecg.modules.erp.bidding_info.service.ITblBiddingShenqService;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  9 +
  10 +/**
  11 + * @Description: tbl_bidding_shenq
  12 + * @Author: jeecg-boot
  13 + * @Date: 2024-04-22
  14 + * @Version: V1.0
  15 + */
  16 +@Service
  17 +public class TblBiddingShenqServiceImpl extends ServiceImpl<TblBiddingShenqMapper, TblBiddingShenq> implements ITblBiddingShenqService {
  18 +
  19 +}
@@ -136,9 +136,9 @@ spring: @@ -136,9 +136,9 @@ spring:
136 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 136 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
137 datasource: 137 datasource:
138 master: 138 master:
139 - url: jdbc:mysql://rm-2zeiuncjm75qti641ho.mysql.rds.aliyuncs.com:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai  
140 - username: ntsd_root  
141 - password: L3bHRJwg6lJ2SC4WFfGA 139 + url: jdbc:mysql://localhost:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
  140 + username: root
  141 + password: root
142 driver-class-name: com.mysql.cj.jdbc.Driver 142 driver-class-name: com.mysql.cj.jdbc.Driver
143 # 192.168.110.10 pass#word1 url: jdbc:mysql://rm-2zeiuncjm75qti641ho.mysql.rds.aliyuncs.com:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai 143 # 192.168.110.10 pass#word1 url: jdbc:mysql://rm-2zeiuncjm75qti641ho.mysql.rds.aliyuncs.com:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
144 # username: ntsd_root 144 # username: ntsd_root
@@ -153,7 +153,7 @@ spring: @@ -153,7 +153,7 @@ spring:
153 #redis 配置 153 #redis 配置
154 redis: 154 redis:
155 database: 0 155 database: 0
156 - host: 172.18.0.4 156 + host: 127.0.0.1
157 lettuce: 157 lettuce:
158 pool: 158 pool:
159 max-active: 8 #最大连接数据库连接数,设 -1 为没有限制 159 max-active: 8 #最大连接数据库连接数,设 -1 为没有限制
@@ -264,7 +264,7 @@ jeecg: @@ -264,7 +264,7 @@ jeecg:
264 data-type: database 264 data-type: database
265 #分布式锁配置 265 #分布式锁配置
266 redisson: 266 redisson:
267 - address: 172.18.0.4:6379 267 + address: 127.0.0.1:6379
268 password: 268 password:
269 type: STANDALONE 269 type: STANDALONE
270 enabled: true 270 enabled: true