فهرست منبع

代理id保存错误

mingfu 1 ماه پیش
والد
کامیت
d8fa5e3a6c

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

@@ -155,9 +155,9 @@ public class DzCardsController extends BaseController
             if (!sysUser.getDeptId().equals(agent.getDeptId())) {
                 throw new ValidationException("只能分配给下级代理");
             }
-            dzCardsService.assignCard(!NumberUtils.isPositive(agent.getParentId()) ? agentId : agent.getParentId(), agentId, begin, end, location, examType, schoolId);
+            dzCardsService.assignCard(NumberUtils.isPositive(agent.getParentId()) ? agent.getParentId() : agentId, agentId, begin, end, location, examType, schoolId);
         } else { // 平台指定, TODO 暂只支持二级代理
-            dzCardsService.assignCard(!NumberUtils.isPositive(agent.getParentId()) ? agentId : agent.getParentId(), agentId, begin, end, location, examType, schoolId);
+            dzCardsService.assignCard(NumberUtils.isPositive(agent.getParentId()) ? agent.getParentId() : agentId, agentId, begin, end, location, examType, schoolId);
         }
         return AjaxResult.success();
     }

+ 2 - 2
ie-common/src/main/java/com/ruoyi/common/utils/NumberUtils.java

@@ -31,8 +31,8 @@ public class NumberUtils {
         return true;
     }
 
-    public static boolean isPositive(Number v) {
-        return null != v && !v.equals(0);
+    public static boolean isPositive(Long v) {
+        return null != v && v > 0L;
     }
 
     public static void main(String[] args) {

+ 2 - 1
ie-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -221,7 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<update id="updateUser" parameterType="SysUser">
  		update sys_user
  		<set>
- 			<if test="deptId != 0">dept_id = #{deptId},</if>
+ 			<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
  			<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
  			<if test="userName != null and userName != ''">user_name = #{userName},</if>
  			<if test="email != null ">email = #{email},</if>
@@ -244,6 +244,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="remark != null">remark = #{remark},</if>
+			<if test="userTypeId != null">user_type_id = #{userTypeId},</if>
  			update_time = sysdate()
  		</set>
  		where user_id = #{userId}