bug修复
This commit is contained in:
parent
cf7c1a112c
commit
a468215fef
@ -8,6 +8,7 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionariesRecord;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionariesRecordService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.ReflectionUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -52,14 +53,15 @@ public class DictionariesRecordController {
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<DictionariesRecord>> result = new Result<IPage<DictionariesRecord>>();
|
||||
QueryWrapper<DictionariesRecord> queryWrapper = QueryGenerator.initQueryWrapper(dictionariesRecord, req.getParameterMap());
|
||||
Page<DictionariesRecord> page = new Page<DictionariesRecord>(pageNo, pageSize);
|
||||
IPage<DictionariesRecord> pageList = dictionariesRecordService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
Result<IPage<DictionariesRecord>> result = new Result<>();
|
||||
QueryWrapper<DictionariesRecord> queryWrapper = QueryGenerator.initQueryWrapper(dictionariesRecord, req.getParameterMap(), null,
|
||||
ReflectionUtil.getFieldNameList(DictionariesRecord::getDictionaryName));
|
||||
Page<DictionariesRecord> page = new Page<>(pageNo, pageSize);
|
||||
IPage<DictionariesRecord> pageList = dictionariesRecordService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation(value = " 查询职务类型和职务列表", notes = "查询职务类型和职务列表", httpMethod="GET")
|
||||
@GetMapping(value = "/selectJobList")
|
||||
@ -102,31 +104,23 @@ public class DictionariesRecordController {
|
||||
return Result.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param dictionariesRecord
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 添加
|
||||
* @param dictionariesRecord
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 添加基础字典信息", notes = "添加基础字典信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<DictionariesRecord> add(@RequestBody DictionariesRecord dictionariesRecord) {
|
||||
Result<DictionariesRecord> result = new Result<DictionariesRecord>();
|
||||
try {
|
||||
dictionariesRecordService.save(dictionariesRecord);
|
||||
result.successMsg("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info(e.getMessage());
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
dictionariesRecordService.add(dictionariesRecord);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dictionariesRecord
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 编辑
|
||||
* @param dictionariesRecord
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑基础字典信息", notes = "编辑基础字典信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<DictionariesRecord> edit(@RequestBody DictionariesRecord dictionariesRecord) {
|
||||
@ -142,14 +136,14 @@ public class DictionariesRecordController {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除基础字典信息", notes = "删除基础字典信息" , httpMethod="POST")
|
||||
@ApiImplicitParam(name = "id", value = "基础字典ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
@ -165,12 +159,11 @@ public class DictionariesRecordController {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param
|
||||
* @return
|
||||
|
||||
@ -0,0 +1,287 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Dictionary;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryService;
|
||||
import com.zhgd.xmgl.util.ReflectionUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.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 javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 字典
|
||||
* @author: pds
|
||||
* @date: 2023-07-24
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/dictionary")
|
||||
@Slf4j
|
||||
@Api(tags = "DictionaryController相关Api")
|
||||
public class DictionaryController {
|
||||
@Autowired
|
||||
private IDictionaryService dictionaryService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param dictionary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 分页列表查询字典信息", notes = "分页列表查询字典信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<Dictionary>> queryPageList(Dictionary dictionary,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<Dictionary>> result = new Result<IPage<Dictionary>>();
|
||||
QueryWrapper<Dictionary> queryWrapper = QueryGenerator.initQueryWrapper(dictionary, req.getParameterMap());
|
||||
Page<Dictionary> page = new Page<Dictionary>(pageNo, pageSize);
|
||||
IPage<Dictionary> pageList = dictionaryService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param dictionary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 列表查询字典信息", notes = "列表查询字典信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<Dictionary>> queryList(Dictionary dictionary,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<Dictionary> queryWrapper = QueryGenerator.initQueryWrapper(dictionary, req.getParameterMap(), null,
|
||||
ReflectionUtil.getFieldNameList(Dictionary::getKeyName, Dictionary::getDictionaryValue));
|
||||
return Result.success(dictionaryService.list(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param dictionary
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 添加字典信息", notes = "添加字典信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Dictionary> add(@RequestBody Dictionary dictionary) {
|
||||
Result<Dictionary> result = new Result<Dictionary>();
|
||||
try {
|
||||
dictionaryService.save(dictionary);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info(e.getMessage());
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dictionary
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑字典信息", notes = "编辑字典信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<Dictionary> edit(@RequestBody Dictionary dictionary) {
|
||||
Result<Dictionary> result = new Result<Dictionary>();
|
||||
Dictionary dictionaryEntity = dictionaryService.getById(dictionary.getId());
|
||||
if (dictionaryEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
dictionaryService.updateById(dictionary);
|
||||
result.success("修改成功!");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除字典信息", notes = "删除字典信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<Dictionary> delete(@RequestBody String id) {
|
||||
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
|
||||
id = String.valueOf(jsonObject.get("id"));
|
||||
Result<Dictionary> result = new Result<Dictionary>();
|
||||
Dictionary dictionary = dictionaryService.getById(id);
|
||||
if (dictionary == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = dictionaryService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "物理删除字典信息", notes = "物理删除字典信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/deletePhysic")
|
||||
public Result deletePhysic(@RequestBody String id) {
|
||||
dictionaryService.deletePhysic(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "恢复逻辑删除的字典信息", notes = "恢复逻辑删除的字典信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/back")
|
||||
public Result back(@RequestBody String id) {
|
||||
dictionaryService.back(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除字典信息", notes = "批量删除字典信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "字典ID字符串", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<Dictionary> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
Result<Dictionary> result = new Result<Dictionary>();
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
this.dictionaryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询字典信息", notes = "通过id查询字典信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "字典ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<Dictionary> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<Dictionary> result = new Result<Dictionary>();
|
||||
Dictionary dictionary = dictionaryService.getById(id);
|
||||
if (dictionary == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(dictionary);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel字典信息", notes = "导出excel字典信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<Dictionary> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
Dictionary dictionary = JSON.parseObject(deString, Dictionary.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(dictionary, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<Dictionary> pageList = dictionaryService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "字典列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, Dictionary.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("字典列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过excel导入字典信息", notes = "通过excel导入字典信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<Dictionary> listDictionarys = ExcelImportUtil.importExcel(file.getInputStream(), Dictionary.class, params);
|
||||
for (Dictionary dictionaryExcel : listDictionarys) {
|
||||
dictionaryService.save(dictionaryExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listDictionarys.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.error("文件导入失败!");
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,62 +1,81 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 基础字典
|
||||
* @author: pds
|
||||
* @date: 2020-11-06
|
||||
* @date: 2020-11-06
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("dictionaries_record")
|
||||
@ApiModel(value="DictionariesRecord实体类",description="DictionariesRecord")
|
||||
@ApiModel(value = "DictionariesRecord实体类", description = "DictionariesRecord")
|
||||
public class DictionariesRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
private java.lang.Long id ;
|
||||
/**类型*/
|
||||
@Excel(name = "类型", width = 15)
|
||||
@ApiModelProperty(value="类型")
|
||||
private java.lang.Integer type ;
|
||||
/**字典key值*/
|
||||
@Excel(name = "字典key值", width = 15)
|
||||
@ApiModelProperty(value="字典key值")
|
||||
private java.lang.String keyName ;
|
||||
/**字典值*/
|
||||
@Excel(name = "字典值", width = 15)
|
||||
@ApiModelProperty(value="字典值")
|
||||
private java.lang.String dictionaryValue ;
|
||||
/**字典名*/
|
||||
@Excel(name = "字典名", width = 15)
|
||||
@ApiModelProperty(value="字典名")
|
||||
private java.lang.String dictionaryName ;
|
||||
/**父Id(父级Id 为0时为父)*/
|
||||
@Excel(name = "父Id(父级Id 为0时为父)", width = 15)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
@ApiModelProperty(value = "dictionary的id")
|
||||
private java.lang.Long dictionaryId;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型", width = 15)
|
||||
@ApiModelProperty(value = "类型")
|
||||
private java.lang.Integer type;
|
||||
/**
|
||||
* 字典key值
|
||||
*/
|
||||
@Excel(name = "字典key值", width = 15)
|
||||
@ApiModelProperty(value = "字典key值")
|
||||
private java.lang.String keyName;
|
||||
/**
|
||||
* 字典值
|
||||
*/
|
||||
@Excel(name = "字典值", width = 15)
|
||||
@ApiModelProperty(value = "字典值")
|
||||
private java.lang.String dictionaryValue;
|
||||
/**
|
||||
* 字典名
|
||||
*/
|
||||
@Excel(name = "字典名", width = 15)
|
||||
@ApiModelProperty(value = "字典名")
|
||||
private java.lang.String dictionaryName;
|
||||
/**
|
||||
* 父Id(父级Id 为0时为父)
|
||||
*/
|
||||
@Excel(name = "父Id(父级Id 为0时为父)", width = 15)
|
||||
|
||||
@ApiModelProperty(value="父Id(父级Id 为0时为父)")
|
||||
private java.lang.Long parentId ;
|
||||
/**手动排序字段*/
|
||||
@Excel(name = "手动排序字段", width = 15)
|
||||
@ApiModelProperty(value="手动排序字段")
|
||||
private java.lang.Integer orderNum ;
|
||||
/**描述*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value="描述")
|
||||
private java.lang.String remarks ;
|
||||
@ApiModelProperty(value = "父Id(父级Id 为0时为父)")
|
||||
private java.lang.Long parentId;
|
||||
/**
|
||||
* 手动排序字段
|
||||
*/
|
||||
@Excel(name = "手动排序字段", width = 15)
|
||||
@ApiModelProperty(value = "手动排序字段")
|
||||
private java.lang.Integer orderNum;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value = "描述")
|
||||
private java.lang.String remarks;
|
||||
|
||||
@ApiModelProperty(value="接口路径")
|
||||
@ApiModelProperty(value = "接口路径")
|
||||
private java.lang.String serviceUrl;
|
||||
@ApiModelProperty(value = "是否启用,1是,0否")
|
||||
private java.lang.Integer isEnable;
|
||||
}
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 字典
|
||||
* @author: pds
|
||||
* @date: 2023-07-24
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("dictionary")
|
||||
@ApiModel(value = "Dictionary实体类", description = "Dictionary")
|
||||
public class Dictionary implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@Excel(name = "字典名称", width = 15)
|
||||
@ApiModelProperty(value = "字典名称")
|
||||
private java.lang.String keyName;
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
@Excel(name = "字典编码", width = 15)
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
private java.lang.String dictionaryValue;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value = "描述")
|
||||
private java.lang.String remarks;
|
||||
/**
|
||||
* 删除状态
|
||||
*/
|
||||
@Excel(name = "删除状态", width = 15)
|
||||
@ApiModelProperty(value = "删除状态(0 删除 1正常默认)")
|
||||
@TableLogic(value = "1", delval = "0")
|
||||
private java.lang.Integer delFlag;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "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")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "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")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Dictionary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 字典
|
||||
* @author: pds
|
||||
* @date: 2023-07-24
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictionaryMapper extends BaseMapper<Dictionary> {
|
||||
|
||||
void deletePhysic(String id);
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<?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.zhgd.xmgl.modules.basicdata.mapper.DictionaryMapper">
|
||||
<delete id="deletePhysic">
|
||||
DELETE FROM dictionary where id=#{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IDictionariesRecordService extends IService<DictionariesRecord> {
|
||||
|
||||
void add(DictionariesRecord dictionariesRecord);
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Dictionary;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 字典
|
||||
* @author: pds
|
||||
* @date: 2023-07-24
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IDictionaryService extends IService<Dictionary> {
|
||||
|
||||
void deletePhysic(String id);
|
||||
|
||||
void back(String id);
|
||||
}
|
||||
@ -1,19 +1,36 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionariesRecord;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.DictionariesRecordMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionariesRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionariesRecord;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Dictionary;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.DictionariesRecordMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.DictionaryMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionariesRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 基础字典
|
||||
* @author: pds
|
||||
* @date: 2020-11-06
|
||||
* @date: 2020-11-06
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DictionariesRecordServiceImpl extends ServiceImpl<DictionariesRecordMapper, DictionariesRecord> implements IDictionariesRecordService {
|
||||
@Autowired
|
||||
DictionariesRecordMapper dictionariesRecordMapper;
|
||||
@Autowired
|
||||
DictionaryMapper dictionaryMapper;
|
||||
|
||||
@Override
|
||||
public void add(DictionariesRecord dictionariesRecord) {
|
||||
Long dictionaryId = dictionariesRecord.getDictionaryId();
|
||||
if (dictionaryId == null) {
|
||||
throw new OpenAlertException("dictionary的id不能为空");
|
||||
}
|
||||
Dictionary dictionary = dictionaryMapper.selectById(dictionaryId);
|
||||
dictionariesRecord.setKeyName(dictionary.getKeyName());
|
||||
dictionariesRecordMapper.insert(dictionariesRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionariesRecord;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Dictionary;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.DictionariesRecordMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.DictionaryMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 字典
|
||||
* @author: pds
|
||||
* @date: 2023-07-24
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary> implements IDictionaryService {
|
||||
@Autowired
|
||||
DictionaryMapper dictionaryMapper;
|
||||
@Autowired
|
||||
DictionariesRecordMapper dictionariesRecordMapper;
|
||||
|
||||
@Override
|
||||
public void deletePhysic(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
throw new OpenAlertException("id不能为空");
|
||||
}
|
||||
dictionaryMapper.deletePhysic(id);
|
||||
dictionariesRecordMapper.delete(new LambdaQueryWrapper<DictionariesRecord>().eq(DictionariesRecord::getDictionaryId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void back(String id) {
|
||||
Dictionary dictionary = new Dictionary();
|
||||
dictionary.setDelFlag(0);
|
||||
dictionaryMapper.updateById(dictionary);
|
||||
}
|
||||
}
|
||||
@ -809,7 +809,7 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
||||
resultMap.put("msg", "操作成功");
|
||||
resultMap.put("status", "1");
|
||||
} else {
|
||||
resultMap.put("msg", "未找到对应人员");
|
||||
resultMap.put("msg", "未找到对应人员或人员已离职");
|
||||
resultMap.put("status", "0");
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 云联万物的中间库的controller,手动调用接口同步
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ylww/middle")
|
||||
@RequestMapping("/xmgl/ylww/middle")
|
||||
@Slf4j
|
||||
public class MiddleController {
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ public class MiddleService {
|
||||
* 同步项目结构化数据到北京市政局
|
||||
*/
|
||||
public void syncProject() {
|
||||
if (profileJudgeUtil.isJlwProd()) {
|
||||
if (profileJudgeUtil.isYlwwProd()) {
|
||||
//从中间库接口获取所有项目
|
||||
String url = ipPort + "/middle/middleGcxx/list";
|
||||
log.info("getMiddleProject:{}", url);
|
||||
|
||||
@ -12,8 +12,8 @@ import java.util.stream.Stream;
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ProfileJudgeUtil {
|
||||
@Value("${spring.profiles.active}")
|
||||
private String activeProfile;
|
||||
@Value("${active.environment.name}")
|
||||
private String activeEnvironment;
|
||||
|
||||
/**
|
||||
* 是否金林湾生产环境
|
||||
@ -21,7 +21,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isJlwProd() {
|
||||
return "ljw".equals(activeProfile);
|
||||
return "ljw-prod".equals(activeEnvironment);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isJlw() {
|
||||
return Stream.of("ljw", "ljw-gsx").anyMatch(s -> s.equals(activeProfile));
|
||||
return Stream.of("ljw-prod", "ljw-dev").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -39,7 +39,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isSjjtGsxDev() {
|
||||
return "sjjt-gsx".equals(activeProfile);
|
||||
return "sjjt-dev".equals(activeEnvironment);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -48,7 +48,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isSjjt() {
|
||||
return Stream.of("sjjt-gsx", "sjjt-prod").anyMatch(s -> s.equals(activeProfile));
|
||||
return Stream.of("sjjt-dev", "sjjt-prod").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -57,7 +57,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isZjsjProd() {
|
||||
return "zjsj".equals(activeProfile);
|
||||
return "zjsj-prod".equals(activeEnvironment);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -66,7 +66,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isZjsj() {
|
||||
return Stream.of("zjsj-gsx", "zjsj").anyMatch(s -> s.equals(activeProfile));
|
||||
return Stream.of("zjsj-dev", "zjsj-prod").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,7 +75,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isShahu() {
|
||||
return Stream.of("shahu-gsx", "shahu").anyMatch(s -> s.equals(activeProfile));
|
||||
return Stream.of("shahu-dev", "shahu-prod").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,7 +84,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isYlwwProd() {
|
||||
return "ylww".equals(activeProfile);
|
||||
return "ylww-prod".equals(activeEnvironment);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,7 +93,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isGxltProd() {
|
||||
return "gxlt".equals(activeProfile);
|
||||
return "gxlt-prod".equals(activeEnvironment);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,7 +102,7 @@ public class ProfileJudgeUtil {
|
||||
* @return
|
||||
*/
|
||||
public boolean isGxlt() {
|
||||
return Stream.of("gxlt", "gxlt-gsx").anyMatch(s -> s.equals(activeProfile));
|
||||
return Stream.of("gxlt-prod", "gxlt-dev").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -72,3 +72,4 @@ license.licensePath=C:/jxj/prod/backEnd/license/license.lic
|
||||
license.publicKeysStorePath=C:/jxj/prod/backEnd/license/publicCerts.keystore
|
||||
#\u9AD8\u652F\u6A21\u7684tcp\u670D\u52A1\u7AEF\u7684\u7AEF\u53E3\u53F7
|
||||
high_formwork.netty.port=15333
|
||||
active.environment.name=dev
|
||||
@ -94,4 +94,4 @@ sj.business.gateway.url=http://116.169.63.183:30867/
|
||||
sj.business.gateway.api.key=nDmkHCxlQzCqE-xfYteXMw
|
||||
#\u4E09\u6C5F\u56FE\u7247\u8BBF\u95EE\u8DEF\u5F84\uFF08\u7528\u4E8E\u63A8\u9001\u4E1A\u52A1\u4E2D\u53F0\uFF09
|
||||
sj.upload.image.url.prefix=http://192.168.34.221:11111/image/
|
||||
|
||||
active.environment.name=gsx-other-env-show-dev
|
||||
|
||||
@ -84,3 +84,4 @@ spring.boot.admin.client.instance.name=zjsj
|
||||
# \u6C34\u7535\u6570\u636E\u63A8\u9001\u5730\u5740
|
||||
double-carbon.water-data-url=http://test.cesms.net
|
||||
double-carbon.ammeter-data-url=http://test.cesms.net
|
||||
active.environment.name=ljw-dev
|
||||
Loading…
x
Reference in New Issue
Block a user