소스 검색

fix 履职加分

Administrator 1 년 전
부모
커밋
c933f00fb0

+ 102 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bonus/ZxBonusController.java

@@ -0,0 +1,102 @@
+package com.ruoyi.web.controller.bonus;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.bonus.ZxBonus;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.service.IZxBonusService;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 政协履职加分Controller
+ *
+ * @author boman
+ * @date 2024-03-11
+ */
+@RestController
+@RequestMapping("/zxBonus/bonus")
+public class ZxBonusController extends BaseController
+{
+    @Autowired
+    private IZxBonusService zxBonusService;
+
+/**
+ * 查询政协履职加分列表
+ */
+@PreAuthorize("@ss.hasPermi('zxBonus:bonus:list')")
+@GetMapping("/list")
+    public TableDataInfo list(ZxBonus zxBonus)
+    {
+        startPage();
+        List<ZxBonus> list = zxBonusService.selectZxBonusList(zxBonus);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出政协履职加分列表
+     */
+    @PreAuthorize("@ss.hasPermi('zxBonus:bonus:export')")
+    @Log(title = "政协履职加分", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ZxBonus zxBonus)
+    {
+        List<ZxBonus> list = zxBonusService.selectZxBonusList(zxBonus);
+        ExcelUtil<ZxBonus> util = new ExcelUtil<ZxBonus>(ZxBonus.class);
+        util.exportExcel(response, list, "政协履职加分数据");
+    }
+
+    /**
+     * 获取政协履职加分详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('zxBonus:bonus:query')")
+    @GetMapping(value = "/{bonusId}")
+    public AjaxResult getInfo(@PathVariable("bonusId") Long bonusId)
+    {
+        return success(zxBonusService.selectZxBonusByBonusId(bonusId));
+    }
+
+    /**
+     * 新增政协履职加分
+     */
+    @PreAuthorize("@ss.hasPermi('zxBonus:bonus:add')")
+    @Log(title = "政协履职加分", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZxBonus zxBonus)
+    {
+        return toAjax(zxBonusService.insertZxBonus(zxBonus));
+    }
+
+    /**
+     * 修改政协履职加分
+     */
+    @PreAuthorize("@ss.hasPermi('zxBonus:bonus:edit')")
+    @Log(title = "政协履职加分", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ZxBonus zxBonus)
+    {
+        return toAjax(zxBonusService.updateZxBonus(zxBonus));
+    }
+
+    /**
+     * 删除政协履职加分
+     */
+    @PreAuthorize("@ss.hasPermi('zxBonus:bonus:remove')")
+    @Log(title = "政协履职加分", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{bonusIds}")
+    public AjaxResult remove(@PathVariable Long[] bonusIds)
+    {
+        return toAjax(zxBonusService.deleteZxBonusByBonusIds(bonusIds));
+    }
+}

+ 3 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java

@@ -169,6 +169,9 @@ public class SysLoginService {
             if (code.equals(cacheObject)) {
                 //根据用户名查询用户信息
                 SysUser sysUser = userService.selectUserByUserName(username);
+                if (sysUser == null){
+                    throw new UserPasswordNotMatchException();
+                }
                 password = sysUser.getPlaintext();
             }
         }

+ 143 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/bonus/ZxBonus.java

@@ -0,0 +1,143 @@
+package com.ruoyi.system.domain.bonus;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 政协履职加分对象 zx_bonus
+ * 
+ * @author boman
+ * @date 2024-03-11
+ */
+public class ZxBonus extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 履职加分ID */
+    private Long bonusId;
+
+    /** 委员账号id */
+    @Excel(name = "委员账号id")
+    private Long userId;
+
+    /** 考核界次 */
+    @Excel(name = "考核界次")
+    private String boundary;
+
+    /** 考核类型 */
+    @Excel(name = "考核类型")
+    private String checkType;
+
+    /** 加分类型 */
+    @Excel(name = "加分类型")
+    private String bonusType;
+
+    /** 加分事由 */
+    @Excel(name = "加分事由")
+    private String bonusReason;
+
+    /** 加分时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "加分时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date bonusTime;
+
+    /** 分数 */
+    @Excel(name = "分数")
+    private String score;
+
+    public void setBonusId(Long bonusId) 
+    {
+        this.bonusId = bonusId;
+    }
+
+    public Long getBonusId() 
+    {
+        return bonusId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setBoundary(String boundary) 
+    {
+        this.boundary = boundary;
+    }
+
+    public String getBoundary() 
+    {
+        return boundary;
+    }
+    public void setCheckType(String checkType) 
+    {
+        this.checkType = checkType;
+    }
+
+    public String getCheckType() 
+    {
+        return checkType;
+    }
+    public void setBonusType(String bonusType) 
+    {
+        this.bonusType = bonusType;
+    }
+
+    public String getBonusType() 
+    {
+        return bonusType;
+    }
+    public void setBonusReason(String bonusReason) 
+    {
+        this.bonusReason = bonusReason;
+    }
+
+    public String getBonusReason() 
+    {
+        return bonusReason;
+    }
+    public void setBonusTime(Date bonusTime) 
+    {
+        this.bonusTime = bonusTime;
+    }
+
+    public Date getBonusTime() 
+    {
+        return bonusTime;
+    }
+    public void setScore(String score) 
+    {
+        this.score = score;
+    }
+
+    public String getScore() 
+    {
+        return score;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("bonusId", getBonusId())
+            .append("userId", getUserId())
+            .append("boundary", getBoundary())
+            .append("checkType", getCheckType())
+            .append("bonusType", getBonusType())
+            .append("bonusReason", getBonusReason())
+            .append("bonusTime", getBonusTime())
+            .append("score", getScore())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZxBonusMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+
+import com.ruoyi.system.domain.bonus.ZxBonus;
+
+import java.util.List;
+
+/**
+ * 政协履职加分Mapper接口
+ * 
+ * @author boman
+ * @date 2024-03-11
+ */
+public interface ZxBonusMapper 
+{
+    /**
+     * 查询政协履职加分
+     * 
+     * @param bonusId 政协履职加分主键
+     * @return 政协履职加分
+     */
+    public ZxBonus selectZxBonusByBonusId(Long bonusId);
+
+    /**
+     * 查询政协履职加分列表
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 政协履职加分集合
+     */
+    public List<ZxBonus> selectZxBonusList(ZxBonus zxBonus);
+
+    /**
+     * 新增政协履职加分
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 结果
+     */
+    public int insertZxBonus(ZxBonus zxBonus);
+
+    /**
+     * 修改政协履职加分
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 结果
+     */
+    public int updateZxBonus(ZxBonus zxBonus);
+
+    /**
+     * 删除政协履职加分
+     * 
+     * @param bonusId 政协履职加分主键
+     * @return 结果
+     */
+    public int deleteZxBonusByBonusId(Long bonusId);
+
+    /**
+     * 批量删除政协履职加分
+     * 
+     * @param bonusIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteZxBonusByBonusIds(Long[] bonusIds);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IZxBonusService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+
+import com.ruoyi.system.domain.bonus.ZxBonus;
+
+import java.util.List;
+
+/**
+ * 政协履职加分Service接口
+ * 
+ * @author boman
+ * @date 2024-03-11
+ */
+public interface IZxBonusService 
+{
+    /**
+     * 查询政协履职加分
+     * 
+     * @param bonusId 政协履职加分主键
+     * @return 政协履职加分
+     */
+    public ZxBonus selectZxBonusByBonusId(Long bonusId);
+
+    /**
+     * 查询政协履职加分列表
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 政协履职加分集合
+     */
+    public List<ZxBonus> selectZxBonusList(ZxBonus zxBonus);
+
+    /**
+     * 新增政协履职加分
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 结果
+     */
+    public int insertZxBonus(ZxBonus zxBonus);
+
+    /**
+     * 修改政协履职加分
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 结果
+     */
+    public int updateZxBonus(ZxBonus zxBonus);
+
+    /**
+     * 批量删除政协履职加分
+     * 
+     * @param bonusIds 需要删除的政协履职加分主键集合
+     * @return 结果
+     */
+    public int deleteZxBonusByBonusIds(Long[] bonusIds);
+
+    /**
+     * 删除政协履职加分信息
+     * 
+     * @param bonusId 政协履职加分主键
+     * @return 结果
+     */
+    public int deleteZxBonusByBonusId(Long bonusId);
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZxBonusServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.system.service.impl;
+
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.bonus.ZxBonus;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.ZxBonusMapper;
+import com.ruoyi.system.service.IZxBonusService;
+import java.util.List;
+
+/**
+ * 政协履职加分Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-03-11
+ */
+@Service
+public class ZxBonusServiceImpl implements IZxBonusService 
+{
+    @Autowired
+    private ZxBonusMapper zxBonusMapper;
+
+    /**
+     * 查询政协履职加分
+     * 
+     * @param bonusId 政协履职加分主键
+     * @return 政协履职加分
+     */
+    @Override
+    public ZxBonus selectZxBonusByBonusId(Long bonusId)
+    {
+        return zxBonusMapper.selectZxBonusByBonusId(bonusId);
+    }
+
+    /**
+     * 查询政协履职加分列表
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 政协履职加分
+     */
+    @Override
+    public List<ZxBonus> selectZxBonusList(ZxBonus zxBonus)
+    {
+        return zxBonusMapper.selectZxBonusList(zxBonus);
+    }
+
+    /**
+     * 新增政协履职加分
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 结果
+     */
+    @Override
+    public int insertZxBonus(ZxBonus zxBonus)
+    {
+        zxBonus.setCreateTime(DateUtils.getNowDate());
+        return zxBonusMapper.insertZxBonus(zxBonus);
+    }
+
+    /**
+     * 修改政协履职加分
+     * 
+     * @param zxBonus 政协履职加分
+     * @return 结果
+     */
+    @Override
+    public int updateZxBonus(ZxBonus zxBonus)
+    {
+        zxBonus.setUpdateTime(DateUtils.getNowDate());
+        return zxBonusMapper.updateZxBonus(zxBonus);
+    }
+
+    /**
+     * 批量删除政协履职加分
+     * 
+     * @param bonusIds 需要删除的政协履职加分主键
+     * @return 结果
+     */
+    @Override
+    public int deleteZxBonusByBonusIds(Long[] bonusIds)
+    {
+        return zxBonusMapper.deleteZxBonusByBonusIds(bonusIds);
+    }
+
+    /**
+     * 删除政协履职加分信息
+     * 
+     * @param bonusId 政协履职加分主键
+     * @return 结果
+     */
+    @Override
+    public int deleteZxBonusByBonusId(Long bonusId)
+    {
+        return zxBonusMapper.deleteZxBonusByBonusId(bonusId);
+    }
+}

+ 106 - 0
ruoyi-system/src/main/resources/mapper/system/ZxBonusMapper.xml

@@ -0,0 +1,106 @@
+<?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.ruoyi.system.mapper.ZxBonusMapper">
+    
+    <resultMap type="ZxBonus" id="ZxBonusResult">
+        <result property="bonusId"    column="bonus_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="boundary"    column="boundary"    />
+        <result property="checkType"    column="check_type"    />
+        <result property="bonusType"    column="bonus_type"    />
+        <result property="bonusReason"    column="bonus_reason"    />
+        <result property="bonusTime"    column="bonus_time"    />
+        <result property="score"    column="score"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectZxBonusVo">
+        select bonus_id, user_id, boundary, check_type, bonus_type, bonus_reason, bonus_time, score, create_by, create_time, update_by, update_time, remark from zx_bonus
+    </sql>
+
+    <select id="selectZxBonusList" parameterType="ZxBonus" resultMap="ZxBonusResult">
+        <include refid="selectZxBonusVo"/>
+        <where>  
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="boundary != null  and boundary != ''"> and boundary = #{boundary}</if>
+            <if test="checkType != null  and checkType != ''"> and check_type = #{checkType}</if>
+            <if test="bonusType != null  and bonusType != ''"> and bonus_type = #{bonusType}</if>
+            <if test="bonusReason != null  and bonusReason != ''"> and bonus_reason = #{bonusReason}</if>
+            <if test="bonusTime != null "> and bonus_time = #{bonusTime}</if>
+            <if test="score != null  and score != ''"> and score = #{score}</if>
+        </where>
+    </select>
+    
+    <select id="selectZxBonusByBonusId" parameterType="Long" resultMap="ZxBonusResult">
+        <include refid="selectZxBonusVo"/>
+        where bonus_id = #{bonusId}
+    </select>
+        
+    <insert id="insertZxBonus" parameterType="ZxBonus" useGeneratedKeys="true" keyProperty="bonusId">
+        insert into zx_bonus
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="boundary != null">boundary,</if>
+            <if test="checkType != null">check_type,</if>
+            <if test="bonusType != null">bonus_type,</if>
+            <if test="bonusReason != null">bonus_reason,</if>
+            <if test="bonusTime != null">bonus_time,</if>
+            <if test="score != null">score,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="boundary != null">#{boundary},</if>
+            <if test="checkType != null">#{checkType},</if>
+            <if test="bonusType != null">#{bonusType},</if>
+            <if test="bonusReason != null">#{bonusReason},</if>
+            <if test="bonusTime != null">#{bonusTime},</if>
+            <if test="score != null">#{score},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateZxBonus" parameterType="ZxBonus">
+        update zx_bonus
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="boundary != null">boundary = #{boundary},</if>
+            <if test="checkType != null">check_type = #{checkType},</if>
+            <if test="bonusType != null">bonus_type = #{bonusType},</if>
+            <if test="bonusReason != null">bonus_reason = #{bonusReason},</if>
+            <if test="bonusTime != null">bonus_time = #{bonusTime},</if>
+            <if test="score != null">score = #{score},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where bonus_id = #{bonusId}
+    </update>
+
+    <delete id="deleteZxBonusByBonusId" parameterType="Long">
+        delete from zx_bonus where bonus_id = #{bonusId}
+    </delete>
+
+    <delete id="deleteZxBonusByBonusIds" parameterType="String">
+        delete from zx_bonus where bonus_id in 
+        <foreach item="bonusId" collection="array" open="(" separator="," close=")">
+            #{bonusId}
+        </foreach>
+    </delete>
+</mapper>