Bladeren bron

设置可投资列表

anderx 3 jaren geleden
bovenliggende
commit
702bd28ca6

+ 3 - 0
src/main/java/com/goafanti/ambSystem/controller/AmbInvestApiController.java

@@ -132,6 +132,9 @@ public class AmbInvestApiController extends CertifyApiController {
 	@RequestMapping(value="/getInvestAmbList",method = RequestMethod.GET)
 	public Result getInvestAmbList(Long id){
 		Result res =new Result();
+		if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_AUDITOR)){
+			if (id==null)id=1L;
+		}
 		if (id==null){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"当前阿米巴","当前阿米巴"));
 			return res;

+ 1 - 4
src/main/java/com/goafanti/ambSystem/service/Impl/AmbServiceImpl.java

@@ -105,9 +105,6 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
                 userRoleMapper.insert(userRole);
             }
             for (AmbSystem ambSystem : list) {
-                if (ambSystem.getLvl()==5||ambSystem.getLvl()==6){
-                    a.setAmbManage(1);
-                }
                 str.append(ambSystem.getLvl()).append(",");
 
             }
@@ -115,7 +112,7 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
         }
         a.setId(leader);
         if (StringUtils.isNotBlank(str)) a.setAmbRole(str.substring(0,str.length()-1));
-        if (a.getAmbManage()!=null||a.getAmbRole()!=null){
+        if (a.getAmbRole()!=null){
             adminMapper.updateByPrimaryKeySelective(a);
         }
     }

+ 11 - 28
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -26,12 +26,11 @@
     <result column="reviewer" jdbcType="VARCHAR" property="reviewer" />
     <result column="amb_id" jdbcType="VARCHAR" property="ambId" />
     <result column="amb_role" jdbcType="VARCHAR" property="ambRole" />
-    <result column="amb_manage" jdbcType="INTEGER" property="ambManage" />
   </resultMap>
   <sql id="Base_Column_List">
     id, mobile, `name`, `password`, email, create_time, `number`, province, `position`,
     superior_id, city, department_id, `status`, user_no, duty, district, head_portrait_url,
-    contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role, amb_manage
+    contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select
@@ -44,31 +43,26 @@
     where id = #{id,jdbcType=VARCHAR}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
-    insert into admin (id,mobile, `name`, `password`,
+    insert into admin (mobile, `name`, `password`,
       email, create_time, `number`,
       province, `position`, superior_id,
       city, department_id, `status`,
       user_no, duty, district,
       head_portrait_url, contact_mobile, last_login_time,
       open_id, `type`, reviewer,
-      amb_id, amb_role, amb_manage
-      )
-    values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
+      amb_id, amb_role)
+    values (#{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
       #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{number,jdbcType=INTEGER},
       #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{superiorId,jdbcType=VARCHAR},
       #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
       #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR},
       #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
       #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{reviewer,jdbcType=VARCHAR},
-      #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR}, #{ambManage,jdbcType=INTEGER}
-      )
+      #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
     insert into admin
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
       <if test="mobile != null">
         mobile,
       </if>
@@ -138,14 +132,8 @@
       <if test="ambRole != null">
         amb_role,
       </if>
-      <if test="ambManage != null">
-        amb_manage,
-      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=VARCHAR},
-      </if>
       <if test="mobile != null">
         #{mobile,jdbcType=VARCHAR},
       </if>
@@ -215,9 +203,6 @@
       <if test="ambRole != null">
         #{ambRole,jdbcType=VARCHAR},
       </if>
-      <if test="ambManage != null">
-        #{ambManage,jdbcType=INTEGER},
-      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
@@ -292,9 +277,6 @@
       <if test="ambRole != null">
         amb_role = #{ambRole,jdbcType=VARCHAR},
       </if>
-      <if test="ambManage != null">
-        amb_manage = #{ambManage,jdbcType=INTEGER},
-      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -322,10 +304,11 @@
       `type` = #{type,jdbcType=INTEGER},
       reviewer = #{reviewer,jdbcType=VARCHAR},
       amb_id = #{ambId,jdbcType=VARCHAR},
-      amb_role = #{ambRole,jdbcType=VARCHAR},
-      amb_manage = #{ambManage,jdbcType=INTEGER}
+      amb_role = #{ambRole,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+
+
   <select id="selectAllAdmin" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />
@@ -596,7 +579,7 @@
       and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
     </if>
     <if test="ambManage !=null">
-      and a.amb_manage= #{ambManage}
+      and a.ts= #{ambManage}
     </if>
     order by a.last_login_time desc
     <if test="page_sql!=null">
@@ -646,7 +629,7 @@
       and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
     </if>
     <if test="ambManage !=null">
-      and a.amb_manage= #{ambManage}
+      and a.ts= #{ambManage}
     </if>
   </select>
   <insert id="insertn" parameterType="com.goafanti.common.model.Admin">
@@ -1072,7 +1055,7 @@
 
   <select id="listAdminBydepIdAndRoleType" resultType="com.goafanti.common.model.Admin">
     select a.id,a.name,a.email  from admin a left join user_role b on a.id =b.uid
-                                     left join `role` c on b.rid=c.id
+                                             left join `role` c on b.rid=c.id
     where department_id= #{depId}
       and c.role_type= #{roleType}
   </select>

+ 7 - 5
src/main/java/com/goafanti/common/mapper/AmbInvestMapper.xml

@@ -140,11 +140,12 @@
     left join amb_system c on a.accept_amb_id =c.id
     left join admin d on a.operator =d.id
     where 1=1
-    <if test="roleType==1">
+    <if test="roleType==0">
       and a.operator= #{aid}
     </if>
-    <if test="roleType==2">
+    <if test="roleType==1">
       and a.status in (1,2,3)
+      and b.accountant =#{aid}
     </if>
     <if test="startTime!=null and endTime !=null">
       and a.create_time between #{startTime} and #{endTime}
@@ -163,13 +164,14 @@
 
   <select id="selectInvestCount" resultType="integer">
     select count(*)
-    from amb_invest a
+    from amb_invest a left join amb_system b on a.initiate_amb_id =b.id
     where 1=1
-    <if test="roleType==1">
+    <if test="roleType==0">
       and a.operator= #{aid}
     </if>
-    <if test="roleType==2">
+    <if test="roleType==1">
       and a.status in (1,2,3)
+      and b.accountant =#{aid}
     </if>
     <if test="startTime!=null and endTime !=null">
       and a.create_time between #{startTime} and #{endTime}

+ 0 - 13
src/main/java/com/goafanti/common/model/Admin.java

@@ -125,11 +125,6 @@ public class Admin extends BaseModel implements AftUser {
      */
     private String ambRole;
 
-    /**
-     * 阿米巴管理者 0巴员 1巴主
-     */
-    private Integer ambManage;
-
     private static final long serialVersionUID = 1L;
 
 
@@ -362,12 +357,4 @@ public class Admin extends BaseModel implements AftUser {
     public void setAmbRole(String ambRole) {
         this.ambRole = ambRole;
     }
-
-    public Integer getAmbManage() {
-        return ambManage;
-    }
-
-    public void setAmbManage(Integer ambManage) {
-        this.ambManage = ambManage;
-    }
 }