no message

main
HUOJIN\92525 2025-11-02 22:39:48 +08:00
parent 010f5c0e6e
commit 88297c8ce5
6 changed files with 263 additions and 204 deletions

View File

@ -54,7 +54,7 @@ public class DictAspect {
*/ */
@Pointcut("(@within(org.springframework.web.bind.annotation.RestController) || " + @Pointcut("(@within(org.springframework.web.bind.annotation.RestController) || " +
"@within(org.springframework.stereotype.Controller) || @annotation(org.jeecg.common.aspect.annotation.AutoDict)) " + "@within(org.springframework.stereotype.Controller) || @annotation(org.jeecg.common.aspect.annotation.AutoDict)) " +
"&& execution(public org.jeecg.common.api.vo.Result org.jeecg..*.*(..))") "&& execution(public org.jeecg.common.api.vo.Result org.jeecg..*.*(..)) || execution(public * org.cpte..*.*Controller.*(..))")
public void excudeService() { public void excudeService() {
} }

View File

@ -2,49 +2,35 @@ package org.cpte.modules.base.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum; import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.cpte.modules.base.entity.Area; import org.cpte.modules.base.entity.Area;
import org.cpte.modules.base.service.IAreaService; import org.cpte.modules.base.service.IAreaService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; 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.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; 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 org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
/**
* @Description: * @Description:
* @author: cpte * @author: cpte
* @Date: 2025-10-29 * @Date: 2025-10-29
* @Version: V1.0 * @Version: V1.0
*/ */
@Tag(name="库区") @Tag(name = "库区")
@RestController @RestController
@RequestMapping("/base/area") @RequestMapping("/base/area")
@Slf4j @Slf4j
@ -62,18 +48,22 @@ public class AreaController extends JeecgController<Area, IAreaService> {
* @return * @return
*/ */
//@AutoLog(value = "库区-分页列表查询") //@AutoLog(value = "库区-分页列表查询")
@Operation(summary="库区-分页列表查询") @Operation(summary = "库区-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<Area>> queryPageList(Area area, public Result<IPage<Area>> queryPageList(Area area,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "keyword", required = false) String keyword,
HttpServletRequest req) { HttpServletRequest req) {
// 自定义查询规则 // 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>(); Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为LIKE_WITH_OR
customeRuleMap.put("areaCode", QueryRuleEnum.RIGHT_LIKE); customeRuleMap.put("areaCode", QueryRuleEnum.RIGHT_LIKE);
customeRuleMap.put("areaName", QueryRuleEnum.RIGHT_LIKE); customeRuleMap.put("areaName", QueryRuleEnum.RIGHT_LIKE);
QueryWrapper<Area> queryWrapper = QueryGenerator.initQueryWrapper(area, req.getParameterMap(),customeRuleMap); QueryWrapper<Area> queryWrapper = QueryGenerator.initQueryWrapper(area, req.getParameterMap(), customeRuleMap);
// 如果提供了 keyword则同时对 areaCode 和 areaName 进行模糊搜索
if (keyword != null && !keyword.trim().isEmpty()) {
queryWrapper.and(wrapper -> wrapper.likeRight("area_code", keyword).or().likeRight("area_name", keyword));
}
Page<Area> page = new Page<Area>(pageNo, pageSize); Page<Area> page = new Page<Area>(pageNo, pageSize);
IPage<Area> pageList = areaService.page(page, queryWrapper); IPage<Area> pageList = areaService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
@ -86,7 +76,7 @@ public class AreaController extends JeecgController<Area, IAreaService> {
* @return * @return
*/ */
@AutoLog(value = "库区-添加") @AutoLog(value = "库区-添加")
@Operation(summary="库区-添加") @Operation(summary = "库区-添加")
@RequiresPermissions("base:base_area:add") @RequiresPermissions("base:base_area:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Area area) { public Result<String> add(@RequestBody Area area) {
@ -102,9 +92,9 @@ public class AreaController extends JeecgController<Area, IAreaService> {
* @return * @return
*/ */
@AutoLog(value = "库区-编辑") @AutoLog(value = "库区-编辑")
@Operation(summary="库区-编辑") @Operation(summary = "库区-编辑")
@RequiresPermissions("base:base_area:edit") @RequiresPermissions("base:base_area:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody Area area) { public Result<String> edit(@RequestBody Area area) {
areaService.updateById(area); areaService.updateById(area);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
@ -117,10 +107,10 @@ public class AreaController extends JeecgController<Area, IAreaService> {
* @return * @return
*/ */
@AutoLog(value = "库区-通过id删除") @AutoLog(value = "库区-通过id删除")
@Operation(summary="库区-通过id删除") @Operation(summary = "库区-通过id删除")
@RequiresPermissions("base:base_area:delete") @RequiresPermissions("base:base_area:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) { public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
areaService.removeById(id); areaService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
@ -132,10 +122,10 @@ public class AreaController extends JeecgController<Area, IAreaService> {
* @return * @return
*/ */
@AutoLog(value = "库区-批量删除") @AutoLog(value = "库区-批量删除")
@Operation(summary="库区-批量删除") @Operation(summary = "库区-批量删除")
@RequiresPermissions("base:base_area:deleteBatch") @RequiresPermissions("base:base_area:deleteBatch")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.areaService.removeByIds(Arrays.asList(ids.split(","))); this.areaService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
@ -147,11 +137,11 @@ public class AreaController extends JeecgController<Area, IAreaService> {
* @return * @return
*/ */
//@AutoLog(value = "库区-通过id查询") //@AutoLog(value = "库区-通过id查询")
@Operation(summary="库区-通过id查询") @Operation(summary = "库区-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<Area> queryById(@RequestParam(name="id",required=true) String id) { public Result<Area> queryById(@RequestParam(name = "id", required = true) String id) {
Area area = areaService.getById(id); Area area = areaService.getById(id);
if(area==null) { if (area == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(area); return Result.OK(area);
@ -181,5 +171,4 @@ public class AreaController extends JeecgController<Area, IAreaService> {
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, Area.class); return super.importExcel(request, response, Area.class);
} }
} }

View File

@ -11,6 +11,7 @@ import java.net.URLDecoder;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoDict;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum; import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@ -29,51 +30,79 @@ import lombok.experimental.Accessors;
@TableName("base_area") @TableName("base_area")
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Schema(description="库区") @Schema(description = "库区")
public class Area implements Serializable { public class Area implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**
*
*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键") @Schema(description = "主键")
private java.lang.String id; private java.lang.String id;
/**库区编码*/ /**
*
*/
@Excel(name = "库区编码", width = 15) @Excel(name = "库区编码", width = 15)
@Schema(description = "库区编码") @Schema(description = "库区编码")
private java.lang.String areaCode; private java.lang.String areaCode;
/**库区名称*/ /**
*
*/
@Excel(name = "库区名称", width = 15) @Excel(name = "库区名称", width = 15)
@Schema(description = "库区名称") @Schema(description = "库区名称")
private java.lang.String areaName; private java.lang.String areaName;
/**描述*/ /**
*
*/
@Excel(name = "描述", width = 15) @Excel(name = "描述", width = 15)
@Schema(description = "描述") @Schema(description = "描述")
private java.lang.String description; private java.lang.String description;
/**删除状态*/ /**
@Excel(name = "删除状态", width = 15) *
@Schema(description = "删除状态") */
@Excel(name = "是否删除", width = 15)
@Schema(description = "是否删除")
@TableLogic @TableLogic
private java.lang.String delFlag; private java.lang.Integer delFlag;
/**所属部门*/ /**
*
*/
@Excel(name = "是否启用", width = 15)
@Schema(description = "是否启用")
private java.lang.Integer izActive;
/**
*
*/
@Schema(description = "所属部门") @Schema(description = "所属部门")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
/**租户ID*/ /**
* ID
*/
@Excel(name = "租户ID", width = 15) @Excel(name = "租户ID", width = 15)
@Schema(description = "租户ID") @Schema(description = "租户ID")
private java.lang.Integer tenantId; private java.lang.Integer tenantId;
/**创建人*/ /**
*
*/
@Schema(description = "创建人") @Schema(description = "创建人")
private java.lang.String createBy; private java.lang.String createBy;
/**创建日期*/ /**
*
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime; private java.util.Date createTime;
/**更新人*/ /**
*
*/
@Schema(description = "更新人") @Schema(description = "更新人")
private java.lang.String updateBy; private java.lang.String updateBy;
/**更新日期*/ /**
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") *
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期") @Schema(description = "更新日期")
private java.util.Date updateTime; private java.util.Date updateTime;
} }

View File

@ -1,20 +1,17 @@
package org.cpte.modules.base.entity; package org.cpte.modules.base.entity;
import java.io.Serializable; 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.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.common.aspect.annotation.AutoDict;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@ -29,64 +26,106 @@ import lombok.experimental.Accessors;
@TableName("base_point") @TableName("base_point")
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Schema(description="库位") @Schema(description = "库位")
public class Point implements Serializable { public class Point implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**
*
*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键") @Schema(description = "主键")
private java.lang.String id; private java.lang.String id;
/**库位编码*/ /**
* ID
*/
@Excel(name = "库区ID", width = 15)
@Schema(description = "库区ID")
@Dict(dictTable = "base_area", dicCode = "id", dicText = "area_name")
private java.lang.String areaId;
/**
*
*/
@Excel(name = "库位编码", width = 15) @Excel(name = "库位编码", width = 15)
@Schema(description = "库位编码") @Schema(description = "库位编码")
private java.lang.String pointCode; private java.lang.String pointCode;
/**排*/ /**
*
*/
@Excel(name = "库位状态", width = 15)
@Schema(description = "库位状态")
@Dict(dicCode = "common_status")
private java.lang.Integer status;
/**
*
*/
@Excel(name = "排", width = 15) @Excel(name = "排", width = 15)
@Schema(description = "排") @Schema(description = "排")
private java.lang.String row; private java.lang.String row;
/**列*/ /**
*
*/
@Excel(name = "列", width = 15) @Excel(name = "列", width = 15)
@Schema(description = "列") @Schema(description = "列")
private java.lang.String col; private java.lang.String col;
/**层*/ /**
*
*/
@Excel(name = "层", width = 15) @Excel(name = "层", width = 15)
@Schema(description = "层") @Schema(description = "层")
private java.lang.String layer; private java.lang.String layer;
/**描述*/ /**
*
*/
@Excel(name = "描述", width = 15) @Excel(name = "描述", width = 15)
@Schema(description = "描述") @Schema(description = "描述")
private java.lang.String description; private java.lang.String description;
/**删除状态*/ /**
@Excel(name = "删除状态", width = 15) *
@Schema(description = "删除状态") */
@Excel(name = "是否删除", width = 15)
@Schema(description = "是否删除")
@TableLogic @TableLogic
private java.lang.Integer delFlag; private java.lang.Integer delFlag;
/**库区ID*/ /**
@Excel(name = "库区ID", width = 15) *
@Schema(description = "库区ID") */
private java.lang.Integer areaId; @Excel(name = "是否启用", width = 15)
/**租户ID*/ @Schema(description = "是否启用")
private java.lang.Integer izActive;
/**
*
*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**
* ID
*/
@Excel(name = "租户ID", width = 15) @Excel(name = "租户ID", width = 15)
@Schema(description = "租户ID") @Schema(description = "租户ID")
private java.lang.Integer tenantId; private java.lang.Integer tenantId;
/**所属部门*/ /**
@Schema(description = "所属部门") *
private java.lang.String sysOrgCode; */
/**创建人*/
@Schema(description = "创建人") @Schema(description = "创建人")
private java.lang.String createBy; private java.lang.String createBy;
/**创建日期*/ /**
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") *
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期") @Schema(description = "创建日期")
private java.util.Date createTime; private java.util.Date createTime;
/**更新人*/ /**
*
*/
@Schema(description = "更新人") @Schema(description = "更新人")
private java.lang.String updateBy; private java.lang.String updateBy;
/**更新日期*/ /**
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") *
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期") @Schema(description = "更新日期")
private java.util.Date updateTime; private java.util.Date updateTime;
} }

View File

@ -145,8 +145,9 @@ spring:
selectWhereAlwayTrueCheck: false selectWhereAlwayTrueCheck: false
# 打开mergeSql功能慢SQL记录 # 打开mergeSql功能慢SQL记录
stat: stat:
merge-sql: false log-slow-sql: true
slow-sql-millis: 5000 slow-sql-millis: 5000
merge-sql: true
datasource: datasource:
master: master:
url: jdbc:mysql://47.103.100.52:53306/cpte-wms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai url: jdbc:mysql://47.103.100.52:53306/cpte-wms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
@ -177,7 +178,7 @@ mybatis-plus:
table-underline: true table-underline: true
configuration: configuration:
# # 这个配置会将执行的sql打印出来在开发或测试的时候可以用 # # 这个配置会将执行的sql打印出来在开发或测试的时候可以用
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段 # 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true call-setters-on-nulls: true
#jeecg专用配置 #jeecg专用配置