Browse Source

借支列表新增部门筛选与条件

anderx 2 years ago
parent
commit
73a8b2330a

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

@@ -24,7 +24,7 @@ public interface ExpenseAccountMapper {
 
     OutExpenseAccount selectByaidAndPrid(InputExpenseAccount in);
 
-    List<OutExpenseAccount> selectByaidAndType(@Param("aid") String aid, @Param("type")Integer type);
+    List<OutExpenseAccount> selectByaidAndType(@Param("aid") String aid,@Param("depId")String depId, @Param("type")Integer type);
 
     List<OutExpenseAccount> selectStatistics(@Param("name") String name, @Param("depId") String depId,
                                              @Param("startTime") String startTime, @Param("endTime") String endTime);

+ 19 - 6
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -23,11 +23,12 @@
     <result column="release_end" jdbcType="TIMESTAMP" property="releaseEnd" />
     <result column="duration" jdbcType="DOUBLE" property="duration" />
     <result column="examine_name" jdbcType="VARCHAR" property="examineName" />
+    <result column="settlement_amount" jdbcType="DECIMAL" property="settlementAmount" />
   </resultMap>
   <sql id="Base_Column_List">
     id, prid, order_no, aid, aname, `type`, type_other, `status`, process_status, total_amount,
     attachment_url, apply_dep, pay_dep, eaaid, create_time, district_name, user_names,
-    release_start, release_end, duration, examine_name
+    release_start, release_end, duration, examine_name, settlement_amount
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -46,14 +47,16 @@
       attachment_url, apply_dep, pay_dep,
       eaaid, create_time, district_name,
       user_names, release_start, release_end,
-      duration, examine_name)
+      duration, examine_name, settlement_amount
+      )
     values (#{prid,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
       #{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{typeOther,jdbcType=VARCHAR},
       #{status,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL},
       #{attachmentUrl,jdbcType=VARCHAR}, #{applyDep,jdbcType=VARCHAR}, #{payDep,jdbcType=VARCHAR},
       #{eaaid,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{districtName,jdbcType=VARCHAR},
       #{userNames,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP},
-      #{duration,jdbcType=DOUBLE}, #{examineName,jdbcType=VARCHAR})
+      #{duration,jdbcType=DOUBLE}, #{examineName,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL}
+      )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccount" useGeneratedKeys="true">
     insert into expense_account
@@ -118,6 +121,9 @@
       <if test="examineName != null">
         examine_name,
       </if>
+      <if test="settlementAmount != null">
+        settlement_amount,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="prid != null">
@@ -180,6 +186,9 @@
       <if test="examineName != null">
         #{examineName,jdbcType=VARCHAR},
       </if>
+      <if test="settlementAmount != null">
+        #{settlementAmount,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseAccount">
@@ -245,6 +254,9 @@
       <if test="examineName != null">
         examine_name = #{examineName,jdbcType=VARCHAR},
       </if>
+      <if test="settlementAmount != null">
+        settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -269,7 +281,8 @@
       release_start = #{releaseStart,jdbcType=TIMESTAMP},
       release_end = #{releaseEnd,jdbcType=TIMESTAMP},
       duration = #{duration,jdbcType=DOUBLE},
-      examine_name = #{examineName,jdbcType=VARCHAR}
+      examine_name = #{examineName,jdbcType=VARCHAR},
+      settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -278,7 +291,7 @@
         a.type_other typeOther , a.status,a.process_status processStatus,a.total_amount totalAmount,
         a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,
         a.user_names userNames,a.create_time, a.release_start,a.release_end, a.duration,b.name appDepName,
-        c.name payDepName,d.name ,d.bank ,d.accounts ,
+        c.name payDepName,d.name ,d.bank ,d.accounts ,a.settlement_amount settlementAmount,
            date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,
             date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStartStr,
             date_format(a.release_end,'%Y-%m-%d %H:%i:%S')releaseEndStr
@@ -386,7 +399,7 @@
       left join expense_account_private d on a.eaaid=d.id left join t_order_new o on a.order_no =o.order_no
       left join t_order_mid tm on a.order_no =tm.order_no
       WHERE a.status=2
-      and a.aid= #{aid} and a.type= #{type}
+      and a.aid= #{aid} and a.type= #{type} and a.pay_dep= #{depId}
     </select>
   <select id="selectStatistics" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
     SELECT

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

@@ -111,6 +111,11 @@ public class ExpenseAccount implements Serializable {
      */
     private String examineName;
 
+    /**
+     * 已付金额(申请借支)
+     */
+    private BigDecimal settlementAmount;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -280,4 +285,12 @@ public class ExpenseAccount implements Serializable {
     public void setExamineName(String examineName) {
         this.examineName = examineName;
     }
+
+    public BigDecimal getSettlementAmount() {
+        return settlementAmount;
+    }
+
+    public void setSettlementAmount(BigDecimal settlementAmount) {
+        this.settlementAmount = settlementAmount;
+    }
 }

+ 6 - 2
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -188,9 +188,13 @@ public class ExpenseAccountController extends CertifyApiController {
      * @return
      */
     @RequestMapping(value = "/selectDebitOrder",method = RequestMethod.GET)
-    public Result selectDebitOrder(){
+    public Result selectDebitOrder(String depId){
         Result res=new Result();
-        res.setData(expenseAccountService.selectDebitOrder());
+        if (depId==null){
+            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"抵扣部门"));
+            return  res;
+        }
+        res.setData(expenseAccountService.selectDebitOrder(depId));
         return res;
     }
 

+ 1 - 1
src/main/java/com/goafanti/expenseAccount/service/ExpenseAccountService.java

@@ -30,7 +30,7 @@ public interface ExpenseAccountService {
 
     Object updateType(InputExpenseAccount in);
 
-    List<OutExpenseAccount> selectDebitOrder();
+    List<OutExpenseAccount> selectDebitOrder(String depId);
 
     Object statistics(String name,String depId,String startTime,String endTime);
 }

+ 2 - 2
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -288,9 +288,9 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     }
 
     @Override
-    public List<OutExpenseAccount> selectDebitOrder() {
+    public List<OutExpenseAccount> selectDebitOrder(String depId) {
         String aid= TokenManager.getAdminId();
-        return expenseAccountMapper.selectByaidAndType(aid,4);
+        return expenseAccountMapper.selectByaidAndType(aid,depId,4);
     }