Browse Source

阿米巴发起划拨开发

anderx 3 years ago
parent
commit
b9725f3245

+ 52 - 0
src/main/java/com/goafanti/ambSystem/bo/InputAmbInvest.java

@@ -0,0 +1,52 @@
+package com.goafanti.ambSystem.bo;
+
+import java.math.BigDecimal;
+
+public class InputAmbInvest {
+    private Long myAmbId;
+    private Long otherAmbId;
+    private BigDecimal amount;
+    private String comment;
+    private Integer status;
+
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getMyAmbId() {
+        return myAmbId;
+    }
+
+    public void setMyAmbId(Long myAmbId) {
+        this.myAmbId = myAmbId;
+    }
+
+    public Long getOtherAmbId() {
+        return otherAmbId;
+    }
+
+    public void setOtherAmbId(Long otherAmbId) {
+        this.otherAmbId = otherAmbId;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+}

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

@@ -0,0 +1,46 @@
+package com.goafanti.ambSystem.controller;
+
+import com.goafanti.ambSystem.bo.InputAmb;
+import com.goafanti.ambSystem.bo.InputAmbInvest;
+import com.goafanti.ambSystem.service.AmbService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.utils.ParamUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+
+
+@RestController
+@RequestMapping(value = "/api/admin/amb/Invest")
+public class AmbInvestApiController extends CertifyApiController {
+	@Autowired
+	private AmbService ambService;
+
+	/**
+	 * 划拨金额
+	 * @return
+	 */
+	@RequestMapping(value="/transfer",method = RequestMethod.POST)
+	public Result transfer(InputAmbInvest in){
+		Result res =new Result();
+		if (in.getMyAmbId()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"阿米巴编号"));
+			return res;
+		}
+		if (in.getAmount()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"金额"));
+			return res;
+		}
+		res.data(ambService.pushInvestTransfer(in));
+		return res;
+	}
+
+
+}

+ 1 - 1
src/main/java/com/goafanti/ambSystem/controller/AmbPaymentApiController.java

@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 @RestController
-@RequestMapping(value = "/api/admin/ambPayment")
+@RequestMapping(value = "/api/admin/amb/payment")
 public class AmbPaymentApiController extends CertifyApiController {
 	@Autowired
 	private AmbPaymentService ambPaymentService;

+ 6 - 0
src/main/java/com/goafanti/ambSystem/service/AmbService.java

@@ -1,8 +1,10 @@
 package com.goafanti.ambSystem.service;
 
 import com.goafanti.ambSystem.bo.InputAmb;
+import com.goafanti.ambSystem.bo.InputAmbInvest;
 import com.goafanti.core.mybatis.page.Pagination;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 public interface AmbService {
@@ -25,4 +27,8 @@ public interface AmbService {
     int checkAmb(InputAmb in,Integer type);
 
     Object detailsAmb(InputAmb in);
+
+
+
+    int pushInvestTransfer(InputAmbInvest in);
 }

+ 39 - 0
src/main/java/com/goafanti/ambSystem/service/Impl/AmbServiceImpl.java

@@ -2,12 +2,17 @@ package com.goafanti.ambSystem.service.Impl;
 
 import com.goafanti.ambSystem.bo.AmbAll;
 import com.goafanti.ambSystem.bo.InputAmb;
+import com.goafanti.ambSystem.bo.InputAmbInvest;
 import com.goafanti.ambSystem.bo.OutAmb;
 import com.goafanti.ambSystem.service.AmbService;
 import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.AmbInvestLogMapper;
+import com.goafanti.common.dao.AmbInvestMapper;
 import com.goafanti.common.dao.AmbSystemMapper;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.AmbInvest;
+import com.goafanti.common.model.AmbInvestLog;
 import com.goafanti.common.model.AmbSystem;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -16,7 +21,9 @@ import com.goafanti.core.shiro.token.TokenManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.*;
 
 @Service
@@ -27,6 +34,11 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
     private AmbSystemMapper ambSystemMapper;
     @Autowired
     private AdminMapper adminMapper;
+    @Autowired
+    private AmbInvestLogMapper ambInvestLogMapper;
+    @Autowired
+    private AmbInvestMapper ambInvestMapper;
+
 
     @Override
     public int addAmb(InputAmb in) {
@@ -167,6 +179,8 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
         return ambSystemMapper.selectDtailsAmb(in.getId());
     }
 
+
+
     private void pushLvl(AmbAll a , List<AmbAll> list) {
         if (a.getLvl()<7){
             List<AmbAll> all=new ArrayList<>();
@@ -201,4 +215,29 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
         if (sb.length()>1)str=sb.substring(0,sb.length()-1);
         return str;
     }
+
+
+    @Override
+    @Transactional
+    public int pushInvestTransfer(InputAmbInvest in) {
+        AmbSystem myAmb = ambSystemMapper.selectByPrimaryKey(in.getMyAmbId());
+        if (!myAmb.getLeader().equals(TokenManager.getAdminId())){
+            throw new BusinessException("只有当前部门负责人可以发起投资划拨");
+        }
+        AmbInvest ambInvest=new AmbInvest();
+        ambInvest.setInitiateAmbId(in.getMyAmbId());
+        ambInvest.setAcceptAmbId(in.getOtherAmbId());
+        ambInvest.setAmount(in.getAmount());
+        ambInvest.setStatus(in.getStatus()==null?1:in.getStatus());
+        ambInvest.setOperator(TokenManager.getAdminId());
+        ambInvest.setComment(in.getComment());
+        ambInvestMapper.insertSelective(ambInvest);
+        AmbInvestLog log=new AmbInvestLog();
+        log.setAmbInvestId(ambInvest.getId());
+        log.setComment(in.getComment());
+        log.setOperator(TokenManager.getAdminId());
+        log.setStatus(1);
+        ambInvestLogMapper.insertSelective(log);
+        return 1;
+    }
 }

+ 17 - 0
src/main/java/com/goafanti/common/dao/AmbInvestLogMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.AmbInvestLog;
+
+public interface AmbInvestLogMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(AmbInvestLog record);
+
+    int insertSelective(AmbInvestLog record);
+
+    AmbInvestLog selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(AmbInvestLog record);
+
+    int updateByPrimaryKey(AmbInvestLog record);
+}

+ 17 - 0
src/main/java/com/goafanti/common/dao/AmbInvestMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.AmbInvest;
+
+public interface AmbInvestMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(AmbInvest record);
+
+    int insertSelective(AmbInvest record);
+
+    AmbInvest selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(AmbInvest record);
+
+    int updateByPrimaryKey(AmbInvest record);
+}

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

@@ -31,5 +31,5 @@ public interface AmbSystemMapper {
 
     int updateAncestorsNames(@Param(value = "id") Long id, @Param(value = "name")String name, @Param(value = "useName")String useName);
 
-    
+
 }

+ 98 - 0
src/main/java/com/goafanti/common/mapper/AmbInvestLogMapper.xml

@@ -0,0 +1,98 @@
+<?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.goafanti.common.dao.AmbInvestLogMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.AmbInvestLog">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="amb_invest_id" jdbcType="BIGINT" property="ambInvestId" />
+    <result column="amount" jdbcType="DECIMAL" property="amount" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="comment" jdbcType="VARCHAR" property="comment" />
+    <result column="operator" jdbcType="VARCHAR" property="operator" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, amb_invest_id, amount, `status`, `comment`, `operator`
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from amb_invest_log
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from amb_invest_log
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvestLog" useGeneratedKeys="true">
+    insert into amb_invest_log (amb_invest_id, amount, `status`, 
+      `comment`, `operator`)
+    values (#{ambInvestId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, 
+      #{comment,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvestLog" useGeneratedKeys="true">
+    insert into amb_invest_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="ambInvestId != null">
+        amb_invest_id,
+      </if>
+      <if test="amount != null">
+        amount,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="comment != null">
+        `comment`,
+      </if>
+      <if test="operator != null">
+        `operator`,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="ambInvestId != null">
+        #{ambInvestId,jdbcType=BIGINT},
+      </if>
+      <if test="amount != null">
+        #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="comment != null">
+        #{comment,jdbcType=VARCHAR},
+      </if>
+      <if test="operator != null">
+        #{operator,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbInvestLog">
+    update amb_invest_log
+    <set>
+      <if test="ambInvestId != null">
+        amb_invest_id = #{ambInvestId,jdbcType=BIGINT},
+      </if>
+      <if test="amount != null">
+        amount = #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="comment != null">
+        `comment` = #{comment,jdbcType=VARCHAR},
+      </if>
+      <if test="operator != null">
+        `operator` = #{operator,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AmbInvestLog">
+    update amb_invest_log
+    set amb_invest_id = #{ambInvestId,jdbcType=BIGINT},
+      amount = #{amount,jdbcType=DECIMAL},
+      `status` = #{status,jdbcType=INTEGER},
+      `comment` = #{comment,jdbcType=VARCHAR},
+      `operator` = #{operator,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 111 - 0
src/main/java/com/goafanti/common/mapper/AmbInvestMapper.xml

@@ -0,0 +1,111 @@
+<?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.goafanti.common.dao.AmbInvestMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.AmbInvest">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="initiate_amb_id" jdbcType="BIGINT" property="initiateAmbId" />
+    <result column="accept_amb_id" jdbcType="BIGINT" property="acceptAmbId" />
+    <result column="amount" jdbcType="DECIMAL" property="amount" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="operator" jdbcType="VARCHAR" property="operator" />
+    <result column="comment" jdbcType="VARCHAR" property="comment" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, initiate_amb_id, accept_amb_id, amount, `status`, `operator`, `comment`
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from amb_invest
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from amb_invest
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvest" useGeneratedKeys="true">
+    insert into amb_invest (initiate_amb_id, accept_amb_id, amount, 
+      `status`, `operator`, `comment`
+      )
+    values (#{initiateAmbId,jdbcType=BIGINT}, #{acceptAmbId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL}, 
+      #{status,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvest" useGeneratedKeys="true">
+    insert into amb_invest
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="initiateAmbId != null">
+        initiate_amb_id,
+      </if>
+      <if test="acceptAmbId != null">
+        accept_amb_id,
+      </if>
+      <if test="amount != null">
+        amount,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="operator != null">
+        `operator`,
+      </if>
+      <if test="comment != null">
+        `comment`,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="initiateAmbId != null">
+        #{initiateAmbId,jdbcType=BIGINT},
+      </if>
+      <if test="acceptAmbId != null">
+        #{acceptAmbId,jdbcType=BIGINT},
+      </if>
+      <if test="amount != null">
+        #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="operator != null">
+        #{operator,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null">
+        #{comment,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbInvest">
+    update amb_invest
+    <set>
+      <if test="initiateAmbId != null">
+        initiate_amb_id = #{initiateAmbId,jdbcType=BIGINT},
+      </if>
+      <if test="acceptAmbId != null">
+        accept_amb_id = #{acceptAmbId,jdbcType=BIGINT},
+      </if>
+      <if test="amount != null">
+        amount = #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="operator != null">
+        `operator` = #{operator,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null">
+        `comment` = #{comment,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AmbInvest">
+    update amb_invest
+    set initiate_amb_id = #{initiateAmbId,jdbcType=BIGINT},
+      accept_amb_id = #{acceptAmbId,jdbcType=BIGINT},
+      amount = #{amount,jdbcType=DECIMAL},
+      `status` = #{status,jdbcType=INTEGER},
+      `operator` = #{operator,jdbcType=VARCHAR},
+      `comment` = #{comment,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 39 - 4
src/main/java/com/goafanti/common/mapper/AmbSystemMapper.xml

@@ -20,11 +20,14 @@
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
     <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
     <result column="members_count" jdbcType="INTEGER" property="membersCount" />
+    <result column="received" jdbcType="DECIMAL" property="received" />
+    <result column="foreign" jdbcType="DECIMAL" property="foreign" />
+    <result column="surplus" jdbcType="DECIMAL" property="surplus" />
   </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, total_amount,
-    members_count
+    members_count, received, `foreign`, surplus
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select
@@ -42,13 +45,15 @@
       create_by, create_time, update_by,
       update_time, lvl, finance_id,
       ancestors_names, accountant, remarks,
-      total_amount, members_count)
+      total_amount, members_count, received,
+      `foreign`, surplus)
     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},
-      #{totalAmount,jdbcType=DECIMAL}, #{membersCount,jdbcType=INTEGER})
+      #{totalAmount,jdbcType=DECIMAL}, #{membersCount,jdbcType=INTEGER}, #{received,jdbcType=DECIMAL},
+      #{foreign,jdbcType=DECIMAL}, #{surplus,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbSystem" useGeneratedKeys="true">
     insert into amb_system
@@ -104,6 +109,15 @@
       <if test="membersCount != null">
         members_count,
       </if>
+      <if test="received != null">
+        received,
+      </if>
+      <if test="foreign != null">
+        `foreign`,
+      </if>
+      <if test="surplus != null">
+        surplus,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="parentId != null">
@@ -157,6 +171,15 @@
       <if test="membersCount != null">
         #{membersCount,jdbcType=INTEGER},
       </if>
+      <if test="received != null">
+        #{received,jdbcType=DECIMAL},
+      </if>
+      <if test="foreign != null">
+        #{foreign,jdbcType=DECIMAL},
+      </if>
+      <if test="surplus != null">
+        #{surplus,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbSystem">
@@ -213,6 +236,15 @@
       <if test="membersCount != null">
         members_count = #{membersCount,jdbcType=INTEGER},
       </if>
+      <if test="received != null">
+        received = #{received,jdbcType=DECIMAL},
+      </if>
+      <if test="foreign != null">
+        `foreign` = #{foreign,jdbcType=DECIMAL},
+      </if>
+      <if test="surplus != null">
+        surplus = #{surplus,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -234,7 +266,10 @@
       accountant = #{accountant,jdbcType=VARCHAR},
       remarks = #{remarks,jdbcType=VARCHAR},
       total_amount = #{totalAmount,jdbcType=DECIMAL},
-      members_count = #{membersCount,jdbcType=INTEGER}
+      members_count = #{membersCount,jdbcType=INTEGER},
+      received = #{received,jdbcType=DECIMAL},
+      `foreign` = #{foreign,jdbcType=DECIMAL},
+      surplus = #{surplus,jdbcType=DECIMAL}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateAncestorsNames">

+ 100 - 0
src/main/java/com/goafanti/common/model/AmbInvest.java

@@ -0,0 +1,100 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * amb_invest
+ * @author 
+ */
+public class AmbInvest implements Serializable {
+    private Long id;
+
+    /**
+     * 发起阿米巴
+     */
+    private Long initiateAmbId;
+
+    /**
+     * 接受阿米巴
+     */
+    private Long acceptAmbId;
+
+    /**
+     * 金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 状态 0=草稿,1=待审核,2=同意,3=驳回
+     */
+    private Integer status;
+
+    /**
+     * 操作人
+     */
+    private String operator;
+
+    /**
+     * 备注
+     */
+    private String comment;
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getInitiateAmbId() {
+        return initiateAmbId;
+    }
+
+    public void setInitiateAmbId(Long initiateAmbId) {
+        this.initiateAmbId = initiateAmbId;
+    }
+
+    public Long getAcceptAmbId() {
+        return acceptAmbId;
+    }
+
+    public void setAcceptAmbId(Long acceptAmbId) {
+        this.acceptAmbId = acceptAmbId;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+}

+ 84 - 0
src/main/java/com/goafanti/common/model/AmbInvestLog.java

@@ -0,0 +1,84 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * amb_invest_log
+ * @author 
+ */
+public class AmbInvestLog implements Serializable {
+    private Long id;
+
+    private Long ambInvestId;
+
+    /**
+     * 金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 状态 0=草稿,1=待审核,2=同意,3=驳回
+     */
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    private String comment;
+
+    /**
+     * 操作人
+     */
+    private String operator;
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getAmbInvestId() {
+        return ambInvestId;
+    }
+
+    public void setAmbInvestId(Long ambInvestId) {
+        this.ambInvestId = ambInvestId;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+}

+ 48 - 2
src/main/java/com/goafanti/common/model/AmbSystem.java

@@ -6,7 +6,7 @@ import java.util.Date;
 
 /**
  * amb_system
- * @author 
+ * @author
  */
 public class AmbSystem implements Serializable {
     /**
@@ -99,6 +99,21 @@ public class AmbSystem implements Serializable {
      */
     private Integer membersCount;
 
+    /**
+     * 我收到的投资款
+     */
+    private BigDecimal received;
+
+    /**
+     * 我对外的投资款
+     */
+    private BigDecimal foreign;
+
+    /**
+     * 我剩余的投资款
+     */
+    private BigDecimal surplus;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -244,4 +259,35 @@ public class AmbSystem implements Serializable {
     public void setMembersCount(Integer membersCount) {
         this.membersCount = membersCount;
     }
-}
+
+    public BigDecimal getReceived() {
+        return received;
+    }
+
+    public void setReceived(BigDecimal received) {
+        this.received = received;
+    }
+
+    public BigDecimal getForeign() {
+        return foreign;
+    }
+
+    public void setForeign(BigDecimal foreign) {
+        this.foreign = foreign;
+    }
+
+    public BigDecimal getSurplus() {
+        return surplus;
+    }
+
+    public void setSurplus(BigDecimal surplus) {
+        this.surplus = surplus;
+    }
+
+    public AmbSystem(String leader) {
+        this.leader = leader;
+    }
+
+    public AmbSystem() {
+    }
+}

+ 76 - 0
src/main/resources/com/goafanti/common/mapper/AmbInvestLogMapper.xml

@@ -0,0 +1,76 @@
+<?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.goafanti.common.dao.AmbInvestLogMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.AmbInvestLog">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="amount" jdbcType="DECIMAL" property="amount" />
+    <result column="comment" jdbcType="VARCHAR" property="comment" />
+    <result column="operator" jdbcType="VARCHAR" property="operator" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, amount, `comment`, `operator`
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from amb_invest_log
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from amb_invest_log
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvestLog" useGeneratedKeys="true">
+    insert into amb_invest_log (amount, `comment`, `operator`
+      )
+    values (#{amount,jdbcType=DECIMAL}, #{comment,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvestLog" useGeneratedKeys="true">
+    insert into amb_invest_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="amount != null">
+        amount,
+      </if>
+      <if test="comment != null">
+        `comment`,
+      </if>
+      <if test="operator != null">
+        `operator`,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="amount != null">
+        #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="comment != null">
+        #{comment,jdbcType=VARCHAR},
+      </if>
+      <if test="operator != null">
+        #{operator,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbInvestLog">
+    update amb_invest_log
+    <set>
+      <if test="amount != null">
+        amount = #{amount,jdbcType=DECIMAL},
+      </if>
+      <if test="comment != null">
+        `comment` = #{comment,jdbcType=VARCHAR},
+      </if>
+      <if test="operator != null">
+        `operator` = #{operator,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AmbInvestLog">
+    update amb_invest_log
+    set amount = #{amount,jdbcType=DECIMAL},
+      `comment` = #{comment,jdbcType=VARCHAR},
+      `operator` = #{operator,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>