Browse Source

Merge branch 'master' into test

anderx 3 years ago
parent
commit
87ba17dcf2

+ 15 - 1
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -2,7 +2,10 @@ package com.goafanti.admin.service.impl;
 
 import java.util.*;
 
+import com.goafanti.common.dao.AmbSystemMapper;
+import com.goafanti.common.model.AmbSystem;
 import com.goafanti.common.model.Role;
+import com.goafanti.common.utils.AsyncUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -29,6 +32,8 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 	private UserRoleMapper		userRoleMapper;
 	@Autowired
 	private AdminLocationMapper	adminLocationMapper;
+	@Autowired
+	private AmbSystemMapper	ambSystemMapper;
 
 	@Override
 	public Pagination<AdminListBo> listAdmin(AdminListBo alb, String rid,String roleName,Integer pageNo, Integer pageSize) {
@@ -43,7 +48,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		if(StringUtils.isNotBlank(alb.getMobile())) params.put("mobile", alb.getMobile());
 		if(StringUtils.isNotBlank(alb.getSuperiorId())) params.put("superiorId", alb.getSuperiorId());
 		Pagination<AdminListBo> p=(Pagination<AdminListBo>)findPage("selectAdminListByPage","selectAdminCount",params,pageNo,pageSize);
-		List<AdminListBo> list=(List<AdminListBo>)p.getList();
+		List<AdminListBo> list= (List<AdminListBo>) p.getList();
 		for(AdminListBo i:list){
 			i.setRoles(adminMapper.selectRolesByUid(i.getId()));
 			i.setRolesId(adminMapper.selectRolesIdByUid(i.getId()));
@@ -86,6 +91,15 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		}
 		ad.setType(sumType(roleIds));
 		int count=adminMapper.updateByPrimaryKeySelective(ad);
+		if (count>0&&ad.getAmbId()!=null){
+			//进行巴人数计算
+//			AmbSystem ambSystem = ambSystemMapper.selectByPrimaryKey(Long.valueOf(ad.getAmbId()));
+//			if (ambSystem.getAncestors()!=null){
+//				List<String> list = Arrays.asList(ambSystem.getAncestors().split(","));
+//
+//			}
+
+		}
 		List<Admin> Nos =adminMapper.selectIDNBySuperiorId(ad.getId());
 		return count;
 	}

+ 1 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -150,4 +150,5 @@ public interface AdminMapper {
     List<String> getLowerFinanceDep(String aid);
 
 
+    int selectByAmbIdCount(String id);
 }

+ 15 - 13
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -24,12 +24,12 @@
     <result column="open_id" jdbcType="VARCHAR" property="openId" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="reviewer" jdbcType="VARCHAR" property="reviewer" />
-    <result column="ambId" jdbcType="VARCHAR" property="ambid" />
+    <result column="amb_id" jdbcType="VARCHAR" property="ambId" />
   </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, ambId
+    contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select
@@ -49,7 +49,7 @@
       user_no, duty, district,
       head_portrait_url, contact_mobile, last_login_time,
       open_id, `type`, reviewer,
-      ambId)
+      amb_id)
     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},
@@ -57,7 +57,7 @@
       #{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})
+      #{ambId,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
     insert into admin
@@ -125,8 +125,8 @@
       <if test="reviewer != null">
         reviewer,
       </if>
-      <if test="ambid != null">
-        ambId,
+      <if test="ambId != null">
+        amb_id,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -193,8 +193,8 @@
       <if test="reviewer != null">
         #{reviewer,jdbcType=VARCHAR},
       </if>
-      <if test="ambid != null">
-        #{ambid,jdbcType=VARCHAR},
+      <if test="ambId != null">
+        #{ambId,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -264,8 +264,8 @@
       <if test="reviewer != null">
         reviewer = #{reviewer,jdbcType=VARCHAR},
       </if>
-      <if test="ambid != null">
-        ambId = #{ambid,jdbcType=VARCHAR},
+      <if test="ambId != null">
+        amb_id = #{ambId,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
@@ -293,11 +293,10 @@
       open_id = #{openId,jdbcType=VARCHAR},
       `type` = #{type,jdbcType=INTEGER},
       reviewer = #{reviewer,jdbcType=VARCHAR},
-      ambId = #{ambid,jdbcType=VARCHAR}
+      amb_id = #{ambId,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 
-
   <select id="selectAllAdmin" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />
@@ -649,7 +648,7 @@
            a.province, a.`position`,a.reviewer , a.superior_id as superiorId,
            a.department_id as departmentId, a.status,a.user_no as userNo,a.duty,a.district,
            a.head_portrait_url as headPortraitUrl, a.contact_mobile as contactMobile,
-           b.name superior,c.name reviewerName,a.type
+           b.name superior,c.name reviewerName,a.type,a.amb_id ambId
     from admin a left join admin b on a.superior_id =b.id left join admin c on a.reviewer =c.id
     where a.id= #{id,jdbcType=VARCHAR}
   </select>
@@ -1078,4 +1077,7 @@
     select b.id from admin a left join department b on a.id=b.finance_id
     where a.superior_id = #{aid}
   </select>
+  <select id="selectByAmbIdCount" resultType="java.lang.Integer">
+    SELECT count(*) from admin where amb_id= #{ambId}
+  </select>
 </mapper>

+ 29 - 6
src/main/java/com/goafanti/common/mapper/AmbSystemMapper.xml

@@ -18,10 +18,13 @@
     <result column="ancestors_names" jdbcType="VARCHAR" property="ancestorsNames" />
     <result column="accountant" jdbcType="VARCHAR" property="accountant" />
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
+    <result column="members_count" jdbcType="INTEGER" property="membersCount" />
   </resultMap>
   <sql id="Base_Column_List">
     id, parent_id, ancestors, `name`, order_num, leader, `status`, create_by, create_time,
-    update_by, update_time, lvl, finance_id, ancestors_names, accountant, remarks
+    update_by, update_time, lvl, finance_id, ancestors_names, accountant, remarks, total_amount,
+    members_count
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select
@@ -38,14 +41,14 @@
       order_num, leader, `status`,
       create_by, create_time, update_by,
       update_time, lvl, finance_id,
-      ancestors_names, accountant, remarks
-      )
+      ancestors_names, accountant, remarks,
+      total_amount, members_count)
     values (#{parentId,jdbcType=BIGINT}, #{ancestors,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
       #{orderNum,jdbcType=INTEGER}, #{leader,jdbcType=VARCHAR}, #{status,jdbcType=CHAR},
       #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
       #{updateTime,jdbcType=TIMESTAMP}, #{lvl,jdbcType=INTEGER}, #{financeId,jdbcType=VARCHAR},
-      #{ancestorsNames,jdbcType=VARCHAR}, #{accountant,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}
-      )
+      #{ancestorsNames,jdbcType=VARCHAR}, #{accountant,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
+      #{totalAmount,jdbcType=DECIMAL}, #{membersCount,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbSystem" useGeneratedKeys="true">
     insert into amb_system
@@ -95,6 +98,12 @@
       <if test="remarks != null">
         remarks,
       </if>
+      <if test="totalAmount != null">
+        total_amount,
+      </if>
+      <if test="membersCount != null">
+        members_count,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="parentId != null">
@@ -142,6 +151,12 @@
       <if test="remarks != null">
         #{remarks,jdbcType=VARCHAR},
       </if>
+      <if test="totalAmount != null">
+        #{totalAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="membersCount != null">
+        #{membersCount,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbSystem">
@@ -192,6 +207,12 @@
       <if test="remarks != null">
         remarks = #{remarks,jdbcType=VARCHAR},
       </if>
+      <if test="totalAmount != null">
+        total_amount = #{totalAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="membersCount != null">
+        members_count = #{membersCount,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -211,7 +232,9 @@
       finance_id = #{financeId,jdbcType=VARCHAR},
       ancestors_names = #{ancestorsNames,jdbcType=VARCHAR},
       accountant = #{accountant,jdbcType=VARCHAR},
-      remarks = #{remarks,jdbcType=VARCHAR}
+      remarks = #{remarks,jdbcType=VARCHAR},
+      total_amount = #{totalAmount,jdbcType=DECIMAL},
+      members_count = #{membersCount,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateAncestorsNames">

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

@@ -120,8 +120,7 @@ public class Admin extends BaseModel implements AftUser {
     /**
      * 阿米巴编号
      */
-    private String ambid;
-
+    private String ambId;
 
     /**
      * 上级管理用户名称
@@ -130,13 +129,6 @@ public class Admin extends BaseModel implements AftUser {
     private String reviewerName;
 
 
-    public String getAmbid() {
-        return ambid;
-    }
-
-    public void setAmbid(String ambid) {
-        this.ambid = ambid;
-    }
 
     public String getReviewerName() {
         return reviewerName;
@@ -342,4 +334,12 @@ public class Admin extends BaseModel implements AftUser {
     public void setReviewer(String reviewer) {
         this.reviewer = reviewer;
     }
+
+    public String getAmbId() {
+        return ambId;
+    }
+
+    public void setAmbId(String ambId) {
+        this.ambId = ambId;
+    }
 }

+ 27 - 0
src/main/java/com/goafanti/common/model/AmbSystem.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.model;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -88,6 +89,16 @@ public class AmbSystem implements Serializable {
      */
     private String remarks;
 
+    /**
+     * 总金额
+     */
+    private BigDecimal totalAmount;
+
+    /**
+     * 成员数
+     */
+    private Integer membersCount;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -217,4 +228,20 @@ public class AmbSystem implements Serializable {
     public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Integer getMembersCount() {
+        return membersCount;
+    }
+
+    public void setMembersCount(Integer membersCount) {
+        this.membersCount = membersCount;
+    }
 }

+ 1 - 1
src/main/java/com/goafanti/core/mybatis/page/Pagination.java

@@ -18,7 +18,7 @@ public class Pagination<T> extends SimplePage implements java.io.Serializable, P
 		super(pageNo, pageSize, totalCount);
 	}
 
-	public Pagination(int pageNo, int pageSize, int totalCount, List<?> list) {
+	public Pagination(int pageNo, int pageSize, int totalCount, List<T> list) {
 		super(pageNo, pageSize, totalCount);
 		this.list = list;
 	}

+ 0 - 1
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -73,7 +73,6 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 	public int updateServiceOrder(TOrderInvoice o) {
 		sendNoticeAndEmail(o);
 		addInvoiceLog(o.getId(),5);
-		o.setApproval(1);
 		o.setStatus(1);
 		return tOrderInvoiceMapper.updateByPrimaryKeySelective(o);
 	}