diff --git a/db/20230905标准法规库.sql b/db/20230905标准法规库.sql index 3e0c1990..f53ad816 100644 --- a/db/20230905标准法规库.sql +++ b/db/20230905标准法规库.sql @@ -226,15 +226,35 @@ alter table laws_problem_library DROP TABLE IF EXISTS `laws_answer_library`; CREATE TABLE `laws_answer_library` ( - `id` varchar(36) NOT NULL PRIMARY KEY COMMENT '主键ID', - `create_time` datetime(0) COMMENT '创建时间', - `org_code` varchar(64) COMMENT '所属部门', + `id` varchar(36) NOT NULL PRIMARY KEY COMMENT '主键ID', + `create_time` datetime(0) COMMENT '创建时间', + `org_code` varchar(64) COMMENT '所属部门', `problem_id` varchar(50) COMMENT '问题id', `answer_description` varchar(500) COMMENT '答案描述', - `is_top` int(1) DEFAULT 0 COMMENT '是否置顶(0否,1是)', - `user_id` varchar(50) COMMENT '回答人id' + `is_top` int(1) DEFAULT 0 COMMENT '是否置顶(0否,1是)', + `user_id` varchar(50) COMMENT '回答人id' ) COMMENT = '问答库-回答'; alter table laws_answer_library comment '问答库-回答'; +DROP TABLE IF EXISTS `laws_contact_manage`; +CREATE TABLE `laws_contact_manage` +( + `id` varchar(36) NOT NULL PRIMARY KEY COMMENT '主键ID', + `create_by` varchar(36) COMMENT '创建人', + `create_time` datetime(0) COMMENT '创建时间', + `update_by` varchar(36) COMMENT '更新人', + `update_time` datetime(0) COMMENT '更新时间', + `org_code` varchar(64) COMMENT '所属部门', + `del_flag` int(1) DEFAULT 0 COMMENT '0表示未删除,1表示删除', + + `depart_name` varchar(200) COMMENT '部门名称', + `depart_id` varchar(50) COMMENT '部门id', + `engineer_id` varchar(50) COMMENT '标准化工程师id', + `contact_id` varchar(50) COMMENT '联络人id', + `leader_id` varchar(50) COMMENT '部门联络人主管级领导id' +) COMMENT = '联络人管理'; +alter table laws_contact_manage + comment '联络人管理'; + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/controller/LawsContactManageController.java b/laws-modules/src/main/java/com/jero/modules/laws/system/controller/LawsContactManageController.java new file mode 100644 index 00000000..b8283771 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/controller/LawsContactManageController.java @@ -0,0 +1,153 @@ +package com.jero.modules.laws.system.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import com.jero.common.api.vo.Result; +import com.jero.common.util.MessageUtils; +import com.jero.modules.laws.common.constant.ResultCommon; +import com.jero.modules.laws.system.entity.LawsContactManage; +import com.jero.modules.laws.system.service.ILawsContactManageService; +import com.baomidou.mybatisplus.core.metadata.IPage; +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 io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.jero.common.aspect.annotation.AutoLog; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.formula.functions.T; + + + /** + * @Description: 联络人管理 + * @Author: jero-boot + * @Date: 2023-10-13 + * @Version: V1.0 + */ +@Api(tags="联络人管理") +@RestController +@RequestMapping("/laws/system/lawsContactManage") +@Slf4j +public class LawsContactManageController extends JeroController { + @Autowired + private ILawsContactManageService lawsContactManageService; + + /** + * 分页列表查询 + * + * @param lawsContactManage + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "联络人管理-分页列表查询") + @ApiOperation(value="联络人管理-分页列表查询", notes="联络人管理-分页列表查询") + @GetMapping(value = "/page") + public Result> queryPageList(LawsContactManage lawsContactManage, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + IPage pageList = lawsContactManageService.queryPage(lawsContactManage, pageNo, pageSize, req); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @param lawsContactManage + * @param req + * @return + */ + @AutoLog(value = "联络人管理-列表查询") + @ApiOperation(value="联络人管理-列表查询", notes="联络人管理-列表查询") + @GetMapping(value = "/list") + public Result> queryList(LawsContactManage lawsContactManage, HttpServletRequest req) { + List list = lawsContactManageService.queryList(lawsContactManage, req); + return Result.OK(list); + } + + /** + * 添加 + * + * @param lawsContactManage + * @return + */ + @AutoLog(value = "联络人管理-添加") + @ApiOperation(value="联络人管理-添加", notes="联络人管理-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody LawsContactManage lawsContactManage) { + lawsContactManageService.add(lawsContactManage); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 编辑 + * + * @param lawsContactManage + * @return + */ + @AutoLog(value = "联络人管理-编辑") + @ApiOperation(value="联络人管理-编辑", notes="联络人管理-编辑") + @PostMapping(value = "/edit") + public Result edit(@Validated @RequestBody LawsContactManage lawsContactManage) { + lawsContactManageService.editById(lawsContactManage); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 通过id删除 + * + * @param map + * @return + */ + @AutoLog(value = "联络人管理-通过id删除") + @ApiOperation(value="联络人管理-通过id删除", notes="联络人管理-通过id删除") + @PostMapping(value = "/delete") + public Result delete(@RequestBody Map map) { + if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ + return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA)); + } + lawsContactManageService.deleteById(map.get("id")); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 批量删除 + * + * @param map + * @return + */ + @AutoLog(value = "联络人管理-批量删除") + @ApiOperation(value="联络人管理-批量删除", notes="联络人管理-批量删除") + @PostMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestBody Map map) { + if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){ + return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA)); + } + this.lawsContactManageService.deleteByIds(Arrays.asList(map.get("ids").split(","))); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "联络人管理-通过id查询") + @ApiOperation(value="联络人管理-通过id查询", notes="联络人管理-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id") String id) { + LawsContactManage lawsContactManage = lawsContactManageService.queryById(id); + if(lawsContactManage==null) { + return Result.error(MessageUtils.getMessage(ResultCommon.NO_CORRESPONDING_DATA_FOUND)); + } + return Result.OK(lawsContactManage); + } + +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/entity/LawsContactManage.java b/laws-modules/src/main/java/com/jero/modules/laws/system/entity/LawsContactManage.java new file mode 100644 index 00000000..dcc96409 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/entity/LawsContactManage.java @@ -0,0 +1,88 @@ +package com.jero.modules.laws.system.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 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: 2023-10-13 + * @Version: V1.0 + */ +@Data +@TableName("laws_contact_manage") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="laws_contact_manage对象", description="联络人管理") +public class LawsContactManage implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键ID*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键ID") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "创建时间") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "更新时间") + private java.util.Date updateTime; + /**所属部门*/ + @Excel(name = "所属部门", width = 15) + @ApiModelProperty(value = "所属部门") + private java.lang.String orgCode; + /**0表示未删除,1表示删除*/ + @Excel(name = "0表示未删除,1表示删除", width = 15) + @ApiModelProperty(value = "0表示未删除,1表示删除") + private java.lang.Integer delFlag; + /**部门名称*/ + @Excel(name = "部门名称", width = 15) + @ApiModelProperty(value = "部门名称") + private java.lang.String departName; + /**部门id*/ + @Excel(name = "部门id", width = 15) + @ApiModelProperty(value = "部门id") + @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name") + private java.lang.String departId; + /**标准化工程师id*/ + @Excel(name = "标准化工程师id", width = 15) + @ApiModelProperty(value = "标准化工程师id") + @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") + private java.lang.String engineerId; + /**联络人id*/ + @Excel(name = "联络人id", width = 15) + @ApiModelProperty(value = "联络人id") + @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") + private java.lang.String contactId; + /**部门联络人主管级领导id*/ + @Excel(name = "部门联络人主管级领导id", width = 15) + @ApiModelProperty(value = "部门联络人主管级领导id") + @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") + private java.lang.String leaderId; +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/mapper/LawsContactManageMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/system/mapper/LawsContactManageMapper.java new file mode 100644 index 00000000..0fa6975b --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/mapper/LawsContactManageMapper.java @@ -0,0 +1,17 @@ +package com.jero.modules.laws.system.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import com.jero.modules.laws.system.entity.LawsContactManage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 联络人管理 + * @Author: jero-boot + * @Date: 2023-10-13 + * @Version: V1.0 + */ +public interface LawsContactManageMapper extends BaseMapper { + +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/mapper/xml/LawsContactManageMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/system/mapper/xml/LawsContactManageMapper.xml new file mode 100644 index 00000000..e8f3ea5e --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/mapper/xml/LawsContactManageMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/service/ILawsContactManageService.java b/laws-modules/src/main/java/com/jero/modules/laws/system/service/ILawsContactManageService.java new file mode 100644 index 00000000..ec8c1cb1 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/service/ILawsContactManageService.java @@ -0,0 +1,76 @@ +package com.jero.modules.laws.system.service; + +import com.jero.modules.laws.system.entity.LawsContactManage; +import com.baomidou.mybatisplus.extension.service.IService; +import javax.servlet.http.HttpServletRequest; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * @Description: 联络人管理 + * @Author: jero-boot + * @Date: 2023-10-13 + * @Version: V1.0 + */ +public interface ILawsContactManageService extends IService { + + /** + * 分页查询 + * + * @param lawsContactManage + * @param pageNo + * @param pageSize + * @param req + * @return + */ + IPage queryPage(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize, HttpServletRequest req); + + /** + * 列表查询 + * + * @param lawsContactManage + * @param req + * @return + */ + List queryList(LawsContactManage lawsContactManage, HttpServletRequest req); + + /** + * 保存 + * + * @param lawsContactManage + * @return + */ + void add(LawsContactManage lawsContactManage); + + /** + * 更新 + * + * @param lawsContactManage + * @return + */ + void editById(LawsContactManage lawsContactManage); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + LawsContactManage queryById(String id); +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java new file mode 100644 index 00000000..6846cb40 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java @@ -0,0 +1,118 @@ +package com.jero.modules.laws.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jero.modules.laws.system.entity.LawsContactManage; +import com.jero.modules.laws.system.mapper.LawsContactManageMapper; +import com.jero.modules.laws.system.service.ILawsContactManageService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.jero.common.exception.JeroBootException; +import java.util.List; +import java.util.Date; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.system.query.QueryGenerator; +import javax.servlet.http.HttpServletRequest; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + + +/** + * @Description: 联络人管理 + * @Author: jero-boot + * @Date: 2023-10-13 + * @Version: V1.0 + */ +@Service +@Transactional(rollbackFor = JeroBootException.class) +public class LawsContactManageServiceImpl extends ServiceImpl implements ILawsContactManageService { + + + /** + * 分页查询 + * + * @param lawsContactManage + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @Override + public IPage queryPage(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap()); + Page page = new Page<>(pageNo, pageSize); + return page(page, queryWrapper); + } + + /** + * 列表查询 + * + * @param lawsContactManage + * @param req + * @return + */ + @Override + public List queryList(LawsContactManage lawsContactManage, HttpServletRequest req) { + return list(QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap())); + } + + /** + * 保存 + * + * @param lawsContactManage + * @return + */ + @Override + public void add(LawsContactManage lawsContactManage) { + Date now = new Date(); + lawsContactManage.setCreateTime(now); + lawsContactManage.setUpdateTime(now); + save(lawsContactManage); + } + + /** + * 更新 + * + * @param lawsContactManage + * @return + */ + @Override + public void editById(LawsContactManage lawsContactManage) { + Date now = new Date(); + lawsContactManage.setUpdateTime(now); + saveOrUpdate(lawsContactManage); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override + public void deleteById(String id) { + removeById(id); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override + public void deleteByIds(List ids) { + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public LawsContactManage queryById(String id) { + return getById(id); + } +}