anderx лет назад: 2
Родитель
Сommit
f67a8b0fc0

+ 4 - 0
src/main/java/com/goafanti/common/dao/ExpenseAccountDetailsMapper.java

@@ -1,8 +1,10 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.ExpenseAccountDetails;
+import com.goafanti.expenseAccount.bo.OutExpenseAccountDetails;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 public interface ExpenseAccountDetailsMapper {
     int deleteByPrimaryKey(Integer id);
@@ -18,4 +20,6 @@ public interface ExpenseAccountDetailsMapper {
     int updateByPrimaryKey(ExpenseAccountDetails record);
 
     BigDecimal selectAmountCountByEAid(Integer id);
+
+    List<OutExpenseAccountDetails> selectByEAid(Integer eaid);
 }

+ 45 - 15
src/main/java/com/goafanti/common/mapper/ExpenseAccountDetailsMapper.xml

@@ -7,6 +7,8 @@
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
     <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
+    <result column="start_district" jdbcType="VARCHAR" property="startDistrict" />
+    <result column="end_district" jdbcType="VARCHAR" property="endDistrict" />
     <result column="amount" jdbcType="DECIMAL" property="amount" />
     <result column="vehicle" jdbcType="INTEGER" property="vehicle" />
     <result column="vehicle_other" jdbcType="VARCHAR" property="vehicleOther" />
@@ -23,9 +25,9 @@
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, eaid, `type`, start_time, end_time, amount, vehicle, vehicle_other, remarks,
-    agree_time, pay_type, invoice_type, invoice_no, payer_name, open_bank, bank_accounts,
-    open_bank_address, lend_id, create_time
+    id, eaid, `type`, start_time, end_time, start_district, end_district, amount, vehicle,
+    vehicle_other, remarks, agree_time, pay_type, invoice_type, invoice_no, payer_name,
+    open_bank, bank_accounts, open_bank_address, lend_id, create_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -39,19 +41,19 @@
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountDetails" useGeneratedKeys="true">
     insert into expense_account_details (eaid, `type`, start_time,
-      end_time, amount, vehicle,
-      vehicle_other, remarks, agree_time,
-      pay_type, invoice_type, invoice_no,
-      payer_name, open_bank, bank_accounts,
-      open_bank_address, lend_id, create_time
-      )
+      end_time, start_district, end_district,
+      amount, vehicle, vehicle_other,
+      remarks, agree_time, pay_type,
+      invoice_type, invoice_no, payer_name,
+      open_bank, bank_accounts, open_bank_address,
+      lend_id, create_time)
     values (#{eaid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP},
-      #{endTime,jdbcType=TIMESTAMP}, #{amount,jdbcType=DECIMAL}, #{vehicle,jdbcType=INTEGER},
-      #{vehicleOther,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{agreeTime,jdbcType=TIMESTAMP},
-      #{payType,jdbcType=INTEGER}, #{invoiceType,jdbcType=INTEGER}, #{invoiceNo,jdbcType=VARCHAR},
-      #{payerName,jdbcType=VARCHAR}, #{openBank,jdbcType=VARCHAR}, #{bankAccounts,jdbcType=VARCHAR},
-      #{openBankAddress,jdbcType=VARCHAR}, #{lendId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
-      )
+      #{endTime,jdbcType=TIMESTAMP}, #{startDistrict,jdbcType=VARCHAR}, #{endDistrict,jdbcType=VARCHAR},
+      #{amount,jdbcType=DECIMAL}, #{vehicle,jdbcType=INTEGER}, #{vehicleOther,jdbcType=VARCHAR},
+      #{remarks,jdbcType=VARCHAR}, #{agreeTime,jdbcType=TIMESTAMP}, #{payType,jdbcType=INTEGER},
+      #{invoiceType,jdbcType=INTEGER}, #{invoiceNo,jdbcType=VARCHAR}, #{payerName,jdbcType=VARCHAR},
+      #{openBank,jdbcType=VARCHAR}, #{bankAccounts,jdbcType=VARCHAR}, #{openBankAddress,jdbcType=VARCHAR},
+      #{lendId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountDetails" useGeneratedKeys="true">
     insert into expense_account_details
@@ -68,6 +70,12 @@
       <if test="endTime != null">
         end_time,
       </if>
+      <if test="startDistrict != null">
+        start_district,
+      </if>
+      <if test="endDistrict != null">
+        end_district,
+      </if>
       <if test="amount != null">
         amount,
       </if>
@@ -124,6 +132,12 @@
       <if test="endTime != null">
         #{endTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="startDistrict != null">
+        #{startDistrict,jdbcType=VARCHAR},
+      </if>
+      <if test="endDistrict != null">
+        #{endDistrict,jdbcType=VARCHAR},
+      </if>
       <if test="amount != null">
         #{amount,jdbcType=DECIMAL},
       </if>
@@ -183,6 +197,12 @@
       <if test="endTime != null">
         end_time = #{endTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="startDistrict != null">
+        start_district = #{startDistrict,jdbcType=VARCHAR},
+      </if>
+      <if test="endDistrict != null">
+        end_district = #{endDistrict,jdbcType=VARCHAR},
+      </if>
       <if test="amount != null">
         amount = #{amount,jdbcType=DECIMAL},
       </if>
@@ -234,6 +254,8 @@
       `type` = #{type,jdbcType=INTEGER},
       start_time = #{startTime,jdbcType=TIMESTAMP},
       end_time = #{endTime,jdbcType=TIMESTAMP},
+      start_district = #{startDistrict,jdbcType=VARCHAR},
+      end_district = #{endDistrict,jdbcType=VARCHAR},
       amount = #{amount,jdbcType=DECIMAL},
       vehicle = #{vehicle,jdbcType=INTEGER},
       vehicle_other = #{vehicleOther,jdbcType=VARCHAR},
@@ -256,4 +278,12 @@
     select ifnull(sum(amount),0)amount  from expense_account_details
     where eaid = #{id}
   </select>
+  <select id="selectByEAid" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountDetails">
+    SELECT id, eaid, `type`, date_format(a.start_time,'%Y-%m-%d %H:%i:%S')startTimeStr, date_format(a.end_time,'%Y-%m-%d %H:%i:%S')endTimeStr,
+           start_district startDistrict, end_district endDistrict, amount, vehicle, vehicle_other vehicleOther, remarks,
+           date_format(a.agree_time,'%Y-%m-%d %H:%i:%S')agreeTimeStr, pay_type payType,invoice_type invoiceType, invoice_no invoiceNo,
+           payer_name payerName, open_bank openBank, bank_accounts bankAccounts, open_bank_address openBankAddress, lend_id lendId,
+           date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr
+    FROM expense_account_details a WHERE eaid= #{eaid}
+  </select>
 </mapper>

+ 27 - 1
src/main/java/com/goafanti/common/model/ExpenseAccountDetails.java

@@ -32,6 +32,16 @@ public class ExpenseAccountDetails implements Serializable {
     private Date endTime;
 
     /**
+     * 始发地
+     */
+    private String startDistrict;
+
+    /**
+     * 终点站
+     */
+    private String endDistrict;
+
+    /**
      * 金额
      */
     private BigDecimal amount;
@@ -52,7 +62,7 @@ public class ExpenseAccountDetails implements Serializable {
     private String remarks;
 
     /**
-     * 开始时间
+     * 约定时间
      */
     private Date agreeTime;
 
@@ -143,6 +153,22 @@ public class ExpenseAccountDetails implements Serializable {
         this.endTime = endTime;
     }
 
+    public String getStartDistrict() {
+        return startDistrict;
+    }
+
+    public void setStartDistrict(String startDistrict) {
+        this.startDistrict = startDistrict;
+    }
+
+    public String getEndDistrict() {
+        return endDistrict;
+    }
+
+    public void setEndDistrict(String endDistrict) {
+        this.endDistrict = endDistrict;
+    }
+
     public BigDecimal getAmount() {
         return amount;
     }

+ 42 - 0
src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountDetails.java

@@ -0,0 +1,42 @@
+package com.goafanti.expenseAccount.bo;
+
+import com.goafanti.common.model.ExpenseAccountDetails;
+
+public class OutExpenseAccountDetails extends ExpenseAccountDetails {
+    private String startTimeStr;
+    private String endTimeStr;
+    private String createTimeStr;
+    private String agreeTimeStr;
+
+    public String getAgreeTimeStr() {
+        return agreeTimeStr;
+    }
+
+    public void setAgreeTimeStr(String agreeTimeStr) {
+        this.agreeTimeStr = agreeTimeStr;
+    }
+
+    public String getStartTimeStr() {
+        return startTimeStr;
+    }
+
+    public void setStartTimeStr(String startTimeStr) {
+        this.startTimeStr = startTimeStr;
+    }
+
+    public String getEndTimeStr() {
+        return endTimeStr;
+    }
+
+    public void setEndTimeStr(String endTimeStr) {
+        this.endTimeStr = endTimeStr;
+    }
+
+    public String getCreateTimeStr() {
+        return createTimeStr;
+    }
+
+    public void setCreateTimeStr(String createTimeStr) {
+        this.createTimeStr = createTimeStr;
+    }
+}

+ 12 - 0
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -88,5 +88,17 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+    /**
+     * 删除报销详情
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/details/list",method = RequestMethod.GET)
+    public Result detailsList(Integer eaid){
+        Result res =new Result();
+        res.setData(expenseAccountService.detailsList(eaid));
+        return res;
+    }
+
 
 }

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

@@ -3,6 +3,9 @@ package com.goafanti.expenseAccount.service;
 import com.goafanti.expenseAccount.bo.InputExpenseAccount;
 import com.goafanti.expenseAccount.bo.InputExpenseAccountDetails;
 import com.goafanti.expenseAccount.bo.OutExpenseAccount;
+import com.goafanti.expenseAccount.bo.OutExpenseAccountDetails;
+
+import java.util.List;
 
 public interface ExpenseAccountService {
 
@@ -13,4 +16,6 @@ public interface ExpenseAccountService {
     int addDetails(InputExpenseAccountDetails in);
 
     int deleteDetails(Integer id);
+
+    List<OutExpenseAccountDetails> detailsList(Integer eaid);
 }

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

@@ -12,11 +12,13 @@ import com.goafanti.common.utils.DateUtils;
 import com.goafanti.expenseAccount.bo.InputExpenseAccount;
 import com.goafanti.expenseAccount.bo.InputExpenseAccountDetails;
 import com.goafanti.expenseAccount.bo.OutExpenseAccount;
+import com.goafanti.expenseAccount.bo.OutExpenseAccountDetails;
 import com.goafanti.expenseAccount.service.ExpenseAccountService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 @Service
 public class ExpenseAccountServiceImpl implements ExpenseAccountService {
@@ -76,4 +78,10 @@ public class ExpenseAccountServiceImpl implements ExpenseAccountService {
     public int deleteDetails(Integer id) {
         return expenseAccountDetailsMapper.deleteByPrimaryKey(id);
     }
+
+    @Override
+    public List<OutExpenseAccountDetails> detailsList(Integer eaid) {
+
+        return expenseAccountDetailsMapper.selectByEAid(eaid);
+    }
 }