浏览代码

修正分配卡名称错误

mingfu 1 月之前
父节点
当前提交
1d25d81d68

+ 5 - 5
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzCardsController.java

@@ -125,7 +125,7 @@ public class DzCardsController extends BaseController
     @Log(title = "分配卡", businessType = BusinessType.INSERT)
     @PostMapping("/assignCard")
     @ApiOperation("分配卡")
-    public AjaxResult assignCard(@ApiParam("代理商") Long agentId, @ApiParam("开始号") String begin, @ApiParam("结束号") String end,
+    public AjaxResult assignCard(@ApiParam("代理商") @RequestParam Long agentId, @ApiParam("开始号") @RequestParam String begin, @ApiParam("结束号") @RequestParam String end,
                                  @ApiParam("省份") @RequestParam(required = false) String location,
                                  @ApiParam("考生类型") @RequestParam(required = false) ExamType examType,
                                  @ApiParam("学校") @RequestParam(required = false) Long schoolId)
@@ -141,16 +141,16 @@ public class DzCardsController extends BaseController
             if (!sysUser.getDeptId().equals(agent.getDeptId())) {
                 throw new ValidationException("只能分配给下级代理");
             }
-            dzCardsService.assignCard(agentId, agentId, begin, end, location, examType, schoolId);
-        } else { // 平台指定, TODO 暂只支持二级代理
-            dzCardsService.assignCard(agent.getParentId(), agentId, begin, end, location, examType, schoolId);
+            dzCardsService.assignCard(null == agent.getParentId() ? agentId : agent.getParentId(), agentId, begin, end, location, examType, schoolId);
+        } else if(null == agent.getParentId()) { // 平台指定, TODO 暂只支持二级代理
+            dzCardsService.assignCard(null == agent.getParentId() ? agentId : agent.getParentId(), agentId, begin, end, location, examType, schoolId);
         }
         return AjaxResult.success();
     }
 
     @Log(title = "直接开卡", businessType = BusinessType.INSERT)
     @PostMapping("/openCard")
-    @ApiOperation("分配卡")
+    @ApiOperation("直接开卡")
     public AjaxResult openCard(@ApiParam("学校") Long schoolId, @ApiParam("开始号") String begin, @ApiParam("结束号") String end)
     {
         Long agentId = 0L;

+ 1 - 1
ie-system/src/main/java/com/ruoyi/dz/domain/DzCards.java

@@ -268,7 +268,7 @@ public class DzCards extends BaseEntity
         return agentId;
     }
 
-    public void setLeafAgentId(Long leftAgentId)
+    public void setLeafAgentId(Long leafAgentId)
     {
         this.leafAgentId = leafAgentId;
     }

+ 2 - 2
ie-system/src/main/resources/mapper/dz/DzCardsMapper.xml

@@ -199,8 +199,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectListByCond" parameterType="com.ruoyi.criteria.CardCriteria" resultMap="DzCardsResult">
         <include refid="selectDzCardsVo"/>
         <where>
-            <if test="startNo != null  and startNo != ''"> and card_no &gt; #{cardNo}</if>
-            <if test="endNo != null  and endNo != ''"> and card_no &lt; #{cardNo}</if>
+            <if test="startNo != null  and startNo != ''"> and card_no &gt;= #{startNo}</if>
+            <if test="endNo != null  and endNo != ''"> and card_no &lt;= #{endNo}</if>
             <if test="cardNo != null  and cardNo != ''"> and card_no = #{cardNo}</if>
             <if test="password != null  and password != ''"> and password = #{password}</if>
             <if test="type != null "> and type = #{type}</if>