Просмотр исходного кода

报销开发子报销列表新增字段

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

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

@@ -54,4 +54,6 @@ public interface ExpenseAccountMapper {
     List<ExpenseAccount> selectListByMainId(Integer id);
 
     int selectCountByIdsAndType(@Param("list") List<String> list, @Param("type") Integer type);
+
+    List<ExpenseAccount> selectAllMain();
 }

+ 14 - 5
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -766,14 +766,14 @@
   </select>
 
   <sql id="mainAllSql">
-    select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,b.real_amount,
+    select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,b.real_amount,b.type_other ,
            date_format(b.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,b.examine_name, dep.name applyDepName,dep2.name payDepName,
            b.remarks,b.eaaid ,eap.name ,eap.bank ,eap.accounts ,b.status,b.process_status,
-           c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end ,
+           c.id sonId,c.total_amount sonAmount,c.`type` sonType,c.type_other sonTypeOther,c.user_names ,c.release_start ,c.release_end ,
            c.district_name districtName,c.user_names userNames,c.secondary_type ,c.secondary_type_other,c.attachment_url,
            c.duration,pr.plan,pro.contract_no sonContractNo,
            d.id detId,d.`type` detType,d.amount,d.real_amount realAmount ,d.start_district ,d.end_district,d.vehicle,d.vehicle_other,
-           d.pay_type ,d.invoice_type ,d.invoice_no,d.payer_name ,d.open_bank ,d.bank_accounts ,d.open_bank_address,
+           d.pay_type ,d.invoice_type ,d.invoice_no,d.payer_name ,d.open_bank ,d.bank_accounts ,d.open_bank_address,d.type_other detTypeOther,
            date_format(d.start_time,'%Y-%m-%d %H:%i:%S')startTime,date_format(d.end_time,'%Y-%m-%d %H:%i:%S')endTime,
            date_format(d.agree_time,'%Y-%m-%d')agreeTime
     from expense_relationship a left join expense_account b on a.id =b.id
@@ -792,6 +792,7 @@
   <resultMap id="MainMap" type="com.goafanti.expenseAccount.bo.MainExpenseAccount">
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="check_no" jdbcType="VARCHAR" property="checkNo" />
+    <result column="type_other" jdbcType="VARCHAR" property="typeOther" />
     <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
     <result column="real_amount" jdbcType="DECIMAL" property="realAmount" />
     <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
@@ -816,8 +817,8 @@
   <resultMap id="SonExpenseAccountMap" type="com.goafanti.expenseAccount.bo.SonExpenseAccount">
     <id column="sonId" jdbcType="INTEGER" property="id" />
     <result column="sonAmount" jdbcType="DECIMAL" property="totalAmount" />
-    <result column="type" jdbcType="INTEGER" property="type" />
-    <result column="type_other" jdbcType="VARCHAR" property="typeOther" />
+    <result column="sonType" jdbcType="INTEGER" property="type" />
+    <result column="sonTypeOther" jdbcType="VARCHAR" property="typeOther" />
     <result column="secondary_type" jdbcType="INTEGER" property="secondaryType" />
     <result column="secondary_type_other" jdbcType="INTEGER" property="secondaryTypeOther" />
     <result column="attachment_url" jdbcType="INTEGER" property="attachmentUrl" />
@@ -834,6 +835,7 @@
   <resultMap id="ExpenseAccountDetailsMap" type="com.goafanti.expenseAccount.bo.SonExpenseAccountDetails">
     <id column="detId" jdbcType="INTEGER" property="id" />
     <result column="detType" jdbcType="INTEGER" property="type" />
+    <result column="detTypeOther" jdbcType="INTEGER" property="typeOther" />
     <result column="amount" jdbcType="DECIMAL" property="amount" />
     <result column="start_district" jdbcType="VARCHAR" property="startDistrict" />
     <result column="end_district" jdbcType="VARCHAR" property="endDistrict" />
@@ -915,6 +917,7 @@
       <foreach collection="deps" item="dep" open="(" close=")" separator=",">
         #{dep}
       </foreach>
+      order by a.status ,a.create_time desc
     </if>
     ${page_sql}
   </select>
@@ -1050,5 +1053,11 @@
       #{id}
     </foreach>
   </select>
+  <select id="selectAllMain" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from expense_account
+    where expense_main=1
+  </select>
 
 </mapper>

+ 1 - 1
src/main/java/com/goafanti/expenseAccount/Enums/EAsecondaryTypes.java

@@ -26,7 +26,7 @@ public enum EAsecondaryTypes {
         }
     }
     public static String getDescByCode(Integer code){
-        for (EATypes value : EATypes.values()) {
+        for (EAsecondaryTypes value : EAsecondaryTypes.values()) {
             if (value.getCode() == code)return value.getDesc();
         }
         return "";

+ 9 - 0
src/main/java/com/goafanti/expenseAccount/bo/MainExpenseAccount.java

@@ -8,6 +8,7 @@ public class MainExpenseAccount  {
 
     private Integer id;
     private Integer status;
+    private String typeOther;
     private Integer processStatus;
     private String checkNo;
     private BigDecimal totalAmount;
@@ -32,6 +33,14 @@ public class MainExpenseAccount  {
      */
     private Integer examine;
 
+    public String getTypeOther() {
+        return typeOther;
+    }
+
+    public void setTypeOther(String typeOther) {
+        this.typeOther = typeOther;
+    }
+
     public Integer getExamine() {
         return examine;
     }

+ 9 - 0
src/main/java/com/goafanti/expenseAccount/bo/SonExpenseAccountDetails.java

@@ -6,6 +6,7 @@ public class SonExpenseAccountDetails {
 
     private Integer id;
     private Integer type;
+    private String typeOther;
     private BigDecimal amount;
     private BigDecimal realAmount;
     private String  startDistrict;
@@ -51,6 +52,14 @@ public class SonExpenseAccountDetails {
      */
     private String openBankAddress;
 
+    public String getTypeOther() {
+        return typeOther;
+    }
+
+    public void setTypeOther(String typeOther) {
+        this.typeOther = typeOther;
+    }
+
     public String getStartTime() {
         return startTime;
     }

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

@@ -369,4 +369,14 @@ public class ExpenseAccountController extends CertifyApiController {
         return res.data(expenseAccountService.updateRealAmount( type , id, amount));
     }
 
+    /**
+     * 主类分类说明
+     * @return
+     */
+    @RequestMapping(value = "/pushAll",method = RequestMethod.GET)
+    public Result pushAll(){
+        expenseAccountService.pushAll();
+        return null;
+    }
+
 }

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

@@ -57,4 +57,6 @@ public interface ExpenseAccountService {
     int selectCountByIdsAndType(List<String> list, Integer i);
 
     Object updateRealAmount(Integer type, Integer id, BigDecimal amount);
+
+    void pushAll();
 }

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

@@ -720,11 +720,12 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             }else {
                 types=types.append(e.getTypeOther());
             }
-            if (e.getSecondaryType()!=0){
-                if (e.getSecondaryType()==13){
-                    types=types.append(e.getSecondaryTypeOther());
+            if (e.getType()==2){
+                if (e.getSecondaryType()==0){
+                    types=types.append("-").append(e.getSecondaryTypeOther());
                 }else{
-                    types=types.append("-").append(EAsecondaryTypes.getDescByCode(e.getSecondaryType()));
+                    String descByCode = EAsecondaryTypes.getDescByCode(e.getSecondaryType());
+                    types=types.append("-").append(descByCode);
                 }
             }
             if (!typeList.contains(types.toString()))typeList.add(types.toString());
@@ -863,6 +864,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     }
 
 
+
+
     /**
      * 计算当前报销显示抵扣金额
      * @param useEa
@@ -1090,6 +1093,36 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         return 0;
     }
 
+    @Override
+    public void pushAll() {
+        List<ExpenseAccount> list = expenseAccountMapper.selectAllMain();
+        for (ExpenseAccount ea : list) {
+            List<ExpenseAccount> expenseAccounts = expenseAccountMapper.selectListByMainId(ea.getId());
+            List<String> typeList=new ArrayList<>();
+            for (ExpenseAccount e : expenseAccounts) {
+                StringBuffer types=new StringBuffer();
+                if (e.getType()!=0){
+                    types=types.append(EATypes.getDescByCode(e.getType()));
+                }else {
+                    types=types.append(e.getTypeOther());
+                }
+                if (e.getType()==2){
+                    if (e.getSecondaryType()==0){
+                        types=types.append("-").append(e.getSecondaryTypeOther());
+                    }else{
+                        String descByCode = EAsecondaryTypes.getDescByCode(e.getSecondaryType());
+                        types=types.append("-").append(descByCode);
+                    }
+                }
+                if (!typeList.contains(types.toString()))typeList.add(types.toString());
+            }
+            String typeStr = String.join(",", typeList);
+            ExpenseAccount update=new ExpenseAccount();
+            update.setId(ea.getId());
+            update.setTypeOther(typeStr);
+            expenseAccountMapper.updateByPrimaryKeySelective(update);
+        }
 
+    }
 
 }

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -52,11 +52,11 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-#static.host=//static.jishutao.com/1.2.98
+static.host=//static.jishutao.com/1.2.98
 rd.static.host=//static.jishutao.com/RD/1.0.03
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.62
-static.host=//172.16.1.187/1.2.98
+#static.host=//172.16.1.187/1.2.98
 
 #\u5FAE\u4FE1\u6253\u5361\u5C0F\u7A0B\u5E8F
 wx.appId=wxff2f5720ed7d7f63