虚拟清单基础页
This commit is contained in:
+2
-1
@@ -29,6 +29,7 @@ import com.jero.modules.utils.HanYuPinYinUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -394,7 +395,7 @@ public class SysDictController {
|
||||
if (count > 0) {
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
if(sysDict.getIsTagDict() == 1){
|
||||
if(ObjectUtils.isNotEmpty(sysDict.getIsTagDict()) && sysDict.getIsTagDict() == 1){
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName());
|
||||
sysDict.setDictCode(pinYin.replace(" ","_"));
|
||||
}
|
||||
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.jero.modules.dummy.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.service.IDummyInventoryBaseEOService;
|
||||
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 com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 虚拟清单基础表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="虚拟清单基础表")
|
||||
@RestController
|
||||
@RequestMapping("/dummy/dummyInventoryBaseEO")
|
||||
@Slf4j
|
||||
public class DummyInventoryBaseEOController extends JeroController<DummyInventoryBaseEO, IDummyInventoryBaseEOService> {
|
||||
@Autowired
|
||||
private IDummyInventoryBaseEOService dummyInventoryBaseEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "虚拟清单基础表-分页列表查询")
|
||||
@ApiOperation(value="虚拟清单基础表-分页列表查询", notes="虚拟清单基础表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(DummyInventoryBaseEO dummyInventoryBaseEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<DummyInventoryBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(dummyInventoryBaseEO, req.getParameterMap());
|
||||
Page<DummyInventoryBaseEO> page = new Page<DummyInventoryBaseEO>(pageNo, pageSize);
|
||||
IPage<DummyInventoryBaseEO> pageList = dummyInventoryBaseEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "虚拟清单基础表-列表查询")
|
||||
@ApiOperation(value="虚拟清单基础表-列表查询", notes="虚拟清单基础表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<DummyInventoryBaseEO>> queryList() {
|
||||
List<DummyInventoryBaseEO> list = dummyInventoryBaseEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "虚拟清单基础表-添加")
|
||||
@ApiOperation(value="虚拟清单基础表-添加", notes="虚拟清单基础表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody DummyInventoryBaseEO dummyInventoryBaseEO) {
|
||||
dummyInventoryBaseEOService.add(dummyInventoryBaseEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "虚拟清单基础表-编辑")
|
||||
@ApiOperation(value="虚拟清单基础表-编辑", notes="虚拟清单基础表-编辑")
|
||||
@GetMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody DummyInventoryBaseEO dummyInventoryBaseEO) {
|
||||
dummyInventoryBaseEOService.editById(dummyInventoryBaseEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "虚拟清单基础表-通过id删除")
|
||||
@ApiOperation(value="虚拟清单基础表-通过id删除", notes="虚拟清单基础表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
dummyInventoryBaseEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "虚拟清单基础表-批量删除")
|
||||
@ApiOperation(value="虚拟清单基础表-批量删除", notes="虚拟清单基础表-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.dummyInventoryBaseEOService.deleteByIds(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) {
|
||||
DummyInventoryBaseEO dummyInventoryBaseEO = dummyInventoryBaseEOService.queryById(id);
|
||||
if(dummyInventoryBaseEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(dummyInventoryBaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param dummyInventoryBaseEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DummyInventoryBaseEO dummyInventoryBaseEO) {
|
||||
return super.exportXls(request, dummyInventoryBaseEO, DummyInventoryBaseEO.class, "虚拟清单基础表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DummyInventoryBaseEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.jero.modules.dummy.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 虚拟清单基础表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("dummy_inventory_base")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="dummy_inventory_base对象", description="虚拟清单基础表")
|
||||
public class DummyInventoryBaseEO 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 useExplain;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15)
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Dict(dicCode ="dummy_inventory_state")
|
||||
private java.lang.String state;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.dummy.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 虚拟清单基础表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DummyInventoryBaseEOMapper extends BaseMapper<DummyInventoryBaseEO> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.dummy.mapper.DummyInventoryBaseEOMapper">
|
||||
<resultMap id="DummyInventoryBaseEOResultMap" type="com.jero.modules.dummy.entity.DummyInventoryBaseEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="name" property="name" />
|
||||
<result column="use_explain" property="useExplain" />
|
||||
<result column="state" property="state" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.dummy.service;
|
||||
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 虚拟清单基础表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDummyInventoryBaseEOService extends IService<DummyInventoryBaseEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @return
|
||||
*/
|
||||
void add(DummyInventoryBaseEO dummyInventoryBaseEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @return
|
||||
*/
|
||||
void editById(DummyInventoryBaseEO dummyInventoryBaseEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
DummyInventoryBaseEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DummyInventoryBaseEO> queryList();
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.jero.modules.dummy.service.impl;
|
||||
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.mapper.DummyInventoryBaseEOMapper;
|
||||
import com.jero.modules.dummy.service.IDummyInventoryBaseEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 虚拟清单基础表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryBaseEOMapper, DummyInventoryBaseEO> implements IDummyInventoryBaseEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(DummyInventoryBaseEO dummyInventoryBaseEO) {
|
||||
Date now = new Date();
|
||||
dummyInventoryBaseEO.setCreateTime(now);
|
||||
dummyInventoryBaseEO.setUpdateTime(now);
|
||||
save(dummyInventoryBaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(DummyInventoryBaseEO dummyInventoryBaseEO) {
|
||||
Date now = new Date();
|
||||
dummyInventoryBaseEO.setUpdateTime(now);
|
||||
saveOrUpdate(dummyInventoryBaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DummyInventoryBaseEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DummyInventoryBaseEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user