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) || " +
"@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() {
}

View File

@ -2,167 +2,157 @@ package org.cpte.modules.base.controller;
import java.util.Arrays;
import java.util.HashMap;
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 jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
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.service.IAreaService;
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.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
/**
* @Description:
* @author: cpte
* @Date: 2025-10-29
* @Date: 2025-10-29
* @Version: V1.0
*/
@Tag(name="库区")
@Tag(name = "库区")
@RestController
@RequestMapping("/base/area")
@Slf4j
public class AreaController extends JeecgController<Area, IAreaService> {
@Autowired
private IAreaService areaService;
/**
*
*
* @param area
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "库区-分页列表查询")
@Operation(summary="库区-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<Area>> queryPageList(Area area,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为LIKE_WITH_OR
customeRuleMap.put("areaCode", QueryRuleEnum.RIGHT_LIKE);
customeRuleMap.put("areaName", QueryRuleEnum.RIGHT_LIKE);
QueryWrapper<Area> queryWrapper = QueryGenerator.initQueryWrapper(area, req.getParameterMap(),customeRuleMap);
Page<Area> page = new Page<Area>(pageNo, pageSize);
IPage<Area> pageList = areaService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param area
* @return
*/
@AutoLog(value = "库区-添加")
@Operation(summary="库区-添加")
@RequiresPermissions("base:base_area:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody Area area) {
areaService.save(area);
return Result.OK("添加成功!");
}
/**
*
*
* @param area
* @return
*/
@AutoLog(value = "库区-编辑")
@Operation(summary="库区-编辑")
@RequiresPermissions("base:base_area:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody Area area) {
areaService.updateById(area);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "库区-通过id删除")
@Operation(summary="库区-通过id删除")
@RequiresPermissions("base:base_area:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
areaService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "库区-批量删除")
@Operation(summary="库区-批量删除")
@RequiresPermissions("base:base_area:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.areaService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "库区-通过id查询")
@Operation(summary="库区-通过id查询")
@GetMapping(value = "/queryById")
public Result<Area> queryById(@RequestParam(name="id",required=true) String id) {
Area area = areaService.getById(id);
if(area==null) {
return Result.error("未找到对应数据");
}
return Result.OK(area);
}
@Autowired
private IAreaService areaService;
/**
* excel
*
* @param request
* @param area
*/
*
*
* @param area
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "库区-分页列表查询")
@Operation(summary = "库区-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<Area>> queryPageList(Area area,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "keyword", required = false) String keyword,
HttpServletRequest req) {
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
customeRuleMap.put("areaCode", QueryRuleEnum.RIGHT_LIKE);
customeRuleMap.put("areaName", QueryRuleEnum.RIGHT_LIKE);
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);
IPage<Area> pageList = areaService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param area
* @return
*/
@AutoLog(value = "库区-添加")
@Operation(summary = "库区-添加")
@RequiresPermissions("base:base_area:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody Area area) {
areaService.save(area);
return Result.OK("添加成功!");
}
/**
*
*
* @param area
* @return
*/
@AutoLog(value = "库区-编辑")
@Operation(summary = "库区-编辑")
@RequiresPermissions("base:base_area:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody Area area) {
areaService.updateById(area);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "库区-通过id删除")
@Operation(summary = "库区-通过id删除")
@RequiresPermissions("base:base_area:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
areaService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "库区-批量删除")
@Operation(summary = "库区-批量删除")
@RequiresPermissions("base:base_area:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.areaService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "库区-通过id查询")
@Operation(summary = "库区-通过id查询")
@GetMapping(value = "/queryById")
public Result<Area> queryById(@RequestParam(name = "id", required = true) String id) {
Area area = areaService.getById(id);
if (area == null) {
return Result.error("未找到对应数据");
}
return Result.OK(area);
}
/**
* excel
*
* @param request
* @param area
*/
@RequiresPermissions("base:base_area:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Area area) {
@ -170,16 +160,15 @@ public class AreaController extends JeecgController<Area, IAreaService> {
}
/**
* excel
*
* @param request
* @param response
* @return
*/
* excel
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("base:base_area:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
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.HttpServletResponse;
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.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;

View File

@ -4,6 +4,7 @@ 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;
@ -22,58 +23,86 @@ import lombok.experimental.Accessors;
/**
* @Description:
* @author: cpte
* @Date: 2025-10-29
* @Date: 2025-10-29
* @Version: V1.0
*/
@Data
@TableName("base_area")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="库区")
@Schema(description = "库区")
public class Area implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**库区编码*/
@Excel(name = "库区编码", width = 15)
/**
*
*/
@Excel(name = "库区编码", width = 15)
@Schema(description = "库区编码")
private java.lang.String areaCode;
/**库区名称*/
@Excel(name = "库区名称", width = 15)
/**
*
*/
@Excel(name = "库区名称", width = 15)
@Schema(description = "库区名称")
private java.lang.String areaName;
/**描述*/
@Excel(name = "描述", width = 15)
/**
*
*/
@Excel(name = "描述", width = 15)
@Schema(description = "描述")
private java.lang.String description;
/**删除状态*/
@Excel(name = "删除状态", width = 15)
@Schema(description = "删除状态")
/**
*
*/
@Excel(name = "是否删除", width = 15)
@Schema(description = "是否删除")
@TableLogic
private java.lang.String delFlag;
/**所属部门*/
private java.lang.Integer delFlag;
/**
*
*/
@Excel(name = "是否启用", width = 15)
@Schema(description = "是否启用")
private java.lang.Integer izActive;
/**
*
*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**租户ID*/
@Excel(name = "租户ID", width = 15)
/**
* ID
*/
@Excel(name = "租户ID", width = 15)
@Schema(description = "租户ID")
private java.lang.Integer tenantId;
/**创建人*/
/**
*
*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
/**
*
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**更新人*/
/**
*
*/
@Schema(description = "更新人")
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 = "更新日期")
private java.util.Date updateTime;
}

View File

@ -1,20 +1,17 @@
package org.cpte.modules.base.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 org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
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.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@ -22,71 +19,113 @@ import lombok.experimental.Accessors;
/**
* @Description:
* @author: cpte
* @Date: 2025-10-28
* @Date: 2025-10-28
* @Version: V1.0
*/
@Data
@TableName("base_point")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="库位")
@Schema(description = "库位")
public class Point implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**库位编码*/
@Excel(name = "库位编码", width = 15)
/**
* 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)
@Schema(description = "库位编码")
private java.lang.String pointCode;
/**排*/
@Excel(name = "排", width = 15)
/**
*
*/
@Excel(name = "库位状态", width = 15)
@Schema(description = "库位状态")
@Dict(dicCode = "common_status")
private java.lang.Integer status;
/**
*
*/
@Excel(name = "排", width = 15)
@Schema(description = "排")
private java.lang.String row;
/**列*/
@Excel(name = "列", width = 15)
/**
*
*/
@Excel(name = "列", width = 15)
@Schema(description = "列")
private java.lang.String col;
/**层*/
@Excel(name = "层", width = 15)
/**
*
*/
@Excel(name = "层", width = 15)
@Schema(description = "层")
private java.lang.String layer;
/**描述*/
@Excel(name = "描述", width = 15)
/**
*
*/
@Excel(name = "描述", width = 15)
@Schema(description = "描述")
private java.lang.String description;
/**删除状态*/
@Excel(name = "删除状态", width = 15)
@Schema(description = "删除状态")
/**
*
*/
@Excel(name = "是否删除", width = 15)
@Schema(description = "是否删除")
@TableLogic
private java.lang.Integer delFlag;
/**库区ID*/
@Excel(name = "库区ID", width = 15)
@Schema(description = "库区ID")
private java.lang.Integer areaId;
/**租户ID*/
@Excel(name = "租户ID", width = 15)
@Schema(description = "租户ID")
private java.lang.Integer tenantId;
/**所属部门*/
/**
*
*/
@Excel(name = "是否启用", width = 15)
@Schema(description = "是否启用")
private java.lang.Integer izActive;
/**
*
*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**创建人*/
/**
* ID
*/
@Excel(name = "租户ID", width = 15)
@Schema(description = "租户ID")
private java.lang.Integer tenantId;
/**
*
*/
@Schema(description = "创建人")
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 = "创建日期")
private java.util.Date createTime;
/**更新人*/
/**
*
*/
@Schema(description = "更新人")
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 = "更新日期")
private java.util.Date updateTime;
}

View File

@ -145,8 +145,9 @@ spring:
selectWhereAlwayTrueCheck: false
# 打开mergeSql功能慢SQL记录
stat:
merge-sql: false
log-slow-sql: true
slow-sql-millis: 5000
merge-sql: true
datasource:
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
@ -177,7 +178,7 @@ mybatis-plus:
table-underline: true
configuration:
# # 这个配置会将执行的sql打印出来在开发或测试的时候可以用
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true
#jeecg专用配置