Pu Zhibing
2025-02-25 a7dc3517b3c028eab02cdde35a57389278217ed2
新增加后台职位接口
6个文件已添加
6个文件已修改
199 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/ServiceSangeshenbianApplication.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/DepartmentController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/MessageNotificationController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/ProblemTypeController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemPostController.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemRoleController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemPostMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/SystemPost.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/ISystemPostService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/SystemPostServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/SystemPostMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/ServiceSangeshenbianApplication.java
@@ -1,6 +1,5 @@
package com.panzhihua.sangeshenbian;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
@@ -20,7 +19,6 @@
@EnableEurekaClient
@EnableCircuitBreaker
@ComponentScan({"com.panzhihua.sangeshenbian", "com.panzhihua.common"})
@MapperScan("com.panzhihua.sangeshenbian.dao")
@EnableScheduling
public class ServiceSangeshenbianApplication
{
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/DepartmentController.java
@@ -63,7 +63,7 @@
        if(null == department.getPid()){
            department.setPid(0);
        }
        int count = departmentService.count(new LambdaQueryWrapper<Department>().eq(Department::getPid, department.getPid()).eq(Department::getName, department.getName()));
        long count = departmentService.count(new LambdaQueryWrapper<Department>().eq(Department::getPid, department.getPid()).eq(Department::getName, department.getName()));
        if(0 < count){
            return R.fail("单位名称重复。");
        }
@@ -84,7 +84,7 @@
        if(null == department.getPid()){
            department.setPid(0);
        }
        int count = departmentService.count(new LambdaQueryWrapper<Department>().eq(Department::getPid, department.getPid())
        long count = departmentService.count(new LambdaQueryWrapper<Department>().eq(Department::getPid, department.getPid())
                .eq(Department::getName, department.getName()).ne(Department::getId, department.getId()));
        if(0 < count){
            return R.fail("单位名称重复。");
@@ -104,7 +104,7 @@
    @ApiOperation(value = "删除单位信息", tags = {"三个身边后台-用户管理"})
    @OperLog(operModul = "三个身边后台",operType = 3, businessType = "删除单位信息")
    public R delete(@PathVariable("id") Integer id){
        int count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getOneDepartmentId, id).or().eq(SystemUser::getTwoDepartmentId, id)
        long count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getOneDepartmentId, id).or().eq(SystemUser::getTwoDepartmentId, id)
                .or().eq(SystemUser::getThreeDepartmentId, id).or().eq(SystemUser::getFourDepartmentId, id).ne(SystemUser::getStatus, 3));
        if(0 < count){
            return R.fail("该单位已被使用,删除失败。");
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/MessageNotificationController.java
@@ -100,7 +100,7 @@
                userId = id.toString();
                break;
        }
        Integer count = messageNotificationService.lambdaQuery()
        long count = messageNotificationService.lambdaQuery()
                .eq(MessageNotification::getReadStatus, 0)
                .eq(MessageNotification::getUndertakerType, systemUser.getAccountLevel())
                .eq(MessageNotification::getUndertakerUserId, userId)
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/ProblemTypeController.java
@@ -59,7 +59,7 @@
        if(systemUser.getAccountLevel() != 1){
            return R.fail("添加失败");
        }
        int count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0));
        long count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0));
        if(0 < count){
            return R.fail("该问题类型已存在");
        }
@@ -79,7 +79,7 @@
        if(systemUser.getAccountLevel() != 1){
            return R.fail("编辑失败");
        }
        int count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0).ne(ProblemType::getId, problemType.getId()));
        long count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0).ne(ProblemType::getId, problemType.getId()));
        if(0 < count){
            return R.fail("该问题类型已存在");
        }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemPostController.java
New file
@@ -0,0 +1,59 @@
package com.panzhihua.sangeshenbian.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.sangeshenbian.model.entity.SystemPost;
import com.panzhihua.sangeshenbian.service.ISystemPostService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
 * @author zhibing.pu
 * @Date 2025/2/25 19:44
 */
@Api
@RestController
@RequestMapping("/systemPost")
public class SystemPostController {
    @Resource
    private ISystemPostService systemPostService;
    @PostMapping("/add")
    @ApiOperation(value = "添加职位", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 1,businessType = "添加职位")
    public R add(@RequestBody SystemPost systemPost) {
        systemPostService.save(systemPost);
        return R.ok();
    }
    @PostMapping("/edit")
    @ApiOperation(value = "编辑职位", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 2,businessType = "编辑职位")
    public R edit(@RequestBody SystemPost systemPost) {
        systemPostService.updateById(systemPost);
        return R.ok();
    }
    @DeleteMapping("/delete/{id}")
    @ApiOperation(value = "删除职位", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 3,businessType = "删除职位")
    public R delete(@PathVariable("id") Integer id) {
        systemPostService.removeById(id);
        return R.ok();
    }
    @GetMapping("/list")
    @ApiOperation(value = "获取列表数据", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 0,businessType = "获取职位列表数据")
    public R<IPage<SystemPost>> list(String name, Integer pageNum, Integer pageSize) {
        return R.ok(systemPostService.list(name, pageNum, pageSize));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemRoleController.java
@@ -50,7 +50,7 @@
    @ApiOperation(value = "添加角色", tags = {"三个身边后台-角色管理"})
    @OperLog(operModul = "三个身边后台",operType = 1,businessType = "添加角色")
    public R add(@RequestBody AddSystemRole addSystemRole){
        int count = systemRoleService.count(new LambdaQueryWrapper<SystemRole>().eq(SystemRole::getDel, 0).eq(SystemRole::getName, addSystemRole.getName()));
        long count = systemRoleService.count(new LambdaQueryWrapper<SystemRole>().eq(SystemRole::getDel, 0).eq(SystemRole::getName, addSystemRole.getName()));
        if(0 < count){
            return R.fail("该角色名称已存在");
        }
@@ -74,7 +74,7 @@
    @ApiOperation(value = "编辑角色", tags = {"三个身边后台-角色管理"})
    @OperLog(operModul = "三个身边后台",operType = 2,businessType = "编辑角色")
    public R edit(@RequestBody EditSystemRole editSystemRole){
        int count = systemRoleService.count(new LambdaQueryWrapper<SystemRole>().eq(SystemRole::getDel, 0)
        long count = systemRoleService.count(new LambdaQueryWrapper<SystemRole>().eq(SystemRole::getDel, 0)
                .eq(SystemRole::getName, editSystemRole.getName()).ne(SystemRole::getId, editSystemRole.getId()));
        if(0 < count){
            return R.fail("该角色名称已存在");
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
@@ -148,7 +148,7 @@
        if(4 == user.getAccountLevel() && 4 < systemUser.getAccountLevel()){
            return R.fail("不能添加街道、区县和市级账号");
        }
        int count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getPhone, systemUser.getPhone()).ne(SystemUser::getStatus, 3));
        long count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getPhone, systemUser.getPhone()).ne(SystemUser::getStatus, 3));
        if(0 < count){
            return R.fail("手机号重复。");
        }
@@ -163,7 +163,7 @@
    @ApiOperation(value = "编辑人员", tags = {"三个身边后台-人员管理"})
    @OperLog(operModul = "三个身边后台",operType = 2,businessType = "编辑人员")
    public R edit(@RequestBody SystemUser systemUser){
        int count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getPhone, systemUser.getPhone())
        long count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getPhone, systemUser.getPhone())
                .ne(SystemUser::getStatus, 3).ne(SystemUser::getId, systemUser.getId()));
        if(0 < count){
            return R.fail("手机号重复。");
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemPostMapper.java
New file
@@ -0,0 +1,20 @@
package com.panzhihua.sangeshenbian.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.sangeshenbian.model.entity.SystemPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author zhibing.pu
 * @Date 2025/2/25 19:41
 */
@Mapper
public interface SystemPostMapper extends BaseMapper<SystemPost> {
    IPage<SystemPost> list(Page page, @Param("name") String name);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/SystemPost.java
New file
@@ -0,0 +1,38 @@
package com.panzhihua.sangeshenbian.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
/**
 * @author zhibing.pu
 * @Date 2025/2/25 19:39
 */
@Data
@TableName("sgsb_system_post")
public class SystemPost {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 名称
     */
    @TableField("name")
    private String name;
    /**
     * 删除标识(0=否,1=是)
     */
    @TableField("del")
    private Integer del;
    /**
     * 添加时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/ISystemPostService.java
New file
@@ -0,0 +1,15 @@
package com.panzhihua.sangeshenbian.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.sangeshenbian.model.entity.SystemPost;
/**
 * @author zhibing.pu
 * @Date 2025/2/25 19:42
 */
public interface ISystemPostService extends IService<SystemPost> {
    IPage<SystemPost> list(String name, Integer pageNum, Integer pageSize);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/SystemPostServiceImpl.java
New file
@@ -0,0 +1,25 @@
package com.panzhihua.sangeshenbian.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.sangeshenbian.dao.SystemPostMapper;
import com.panzhihua.sangeshenbian.model.entity.SystemPost;
import com.panzhihua.sangeshenbian.service.ISystemPostService;
import org.springframework.stereotype.Service;
/**
 * @author zhibing.pu
 * @Date 2025/2/25 19:43
 */
@Service
public class SystemPostServiceImpl extends ServiceImpl<SystemPostMapper, SystemPost> implements ISystemPostService {
    @Override
    public IPage<SystemPost> list(String name, Integer pageNum, Integer pageSize) {
        Page page = new Page<>();
        page.setCurrent(pageNum);
        page.setSize(pageSize);
        return this.baseMapper.list(page, name);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/SystemPostMapper.xml
New file
@@ -0,0 +1,20 @@
<?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.panzhihua.sangeshenbian.dao.SystemPostMapper">
    <select id="list" resultType="com.panzhihua.sangeshenbian.model.entity.SystemPost">
        select
        id,
        name,
        del,
        create_time
        from sgsb_system_post
        where del = 0
        <if test="name != null and name != ''">
            and name like concat('%',#{name},'%')
        </if>
        order by create_time desc
    </select>
</mapper>