Ver código fonte

Merge branch 'test' of jishutao/kede-server into prod

anderx 2 anos atrás
pai
commit
b267686a65

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

@@ -71,7 +71,5 @@ public interface ExpenseAccountMapper {
 
     Integer selectDeleteIdBySonId(Integer integer);
 
-    void updateByOrderRemarks(Integer id);
-
     void updateSonTypeOther(@Param("id") Integer id, @Param("types") String types);
 }

+ 30 - 24
src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml

@@ -50,33 +50,36 @@
     delete from department
     where id = #{id,jdbcType=VARCHAR}
   </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Department" useGeneratedKeys="true">
-    insert into department (create_id, create_time, update_time,
-      deleted_sign, `name`, `type`,
-      manager_id, dep_no, super_id,
-      remarks, `status`, abbreviation,
-      finance_id, province, working_hours_type,
-      hide_sign, lvl, current_amount,
-      subordinate_amount, total_amount, retrial_finance_id,
-      approval, approval_aid, expense_finance_id,
-      expense_retrial_finance_examine, ceo_examine,
-      cfo_examine, vice_ceo_examine, cashier_examine
-      )
-    values (#{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
-      #{deletedSign,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
-      #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR}, #{superId,jdbcType=VARCHAR},
-      #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{abbreviation,jdbcType=VARCHAR},
-      #{financeId,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{workingHoursType,jdbcType=INTEGER},
-      #{hideSign,jdbcType=INTEGER}, #{lvl,jdbcType=INTEGER}, #{currentAmount,jdbcType=DECIMAL},
-      #{subordinateAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{retrialFinanceId,jdbcType=VARCHAR},
-      #{approval,jdbcType=INTEGER}, #{approvalAid,jdbcType=VARCHAR}, #{expenseFinanceId,jdbcType=VARCHAR},
-      #{expenseRetrialFinanceExamine,jdbcType=INTEGER}, #{ceoExamine,jdbcType=INTEGER},
-      #{cfoExamine,jdbcType=INTEGER}, #{viceCeoExamine,jdbcType=INTEGER}, #{cashierExamine,jdbcType=INTEGER}
-      )
+  <insert id="insert" parameterType="com.goafanti.common.model.Department">
+    insert into department (id, create_id, create_time,
+      update_time, deleted_sign, `name`,
+      `type`, manager_id, dep_no,
+      super_id, remarks, `status`,
+      abbreviation, finance_id, province,
+      working_hours_type, hide_sign, lvl,
+      current_amount, subordinate_amount, total_amount,
+      retrial_finance_id, approval, approval_aid,
+      expense_finance_id, expense_retrial_finance_examine,
+      ceo_examine, cfo_examine, vice_ceo_examine,
+      cashier_examine)
+    values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
+      #{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR},
+      #{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
+      #{abbreviation,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER},
+      #{workingHoursType,jdbcType=INTEGER}, #{hideSign,jdbcType=INTEGER}, #{lvl,jdbcType=INTEGER},
+      #{currentAmount,jdbcType=DECIMAL}, #{subordinateAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL},
+      #{retrialFinanceId,jdbcType=VARCHAR}, #{approval,jdbcType=INTEGER}, #{approvalAid,jdbcType=VARCHAR},
+      #{expenseFinanceId,jdbcType=VARCHAR}, #{expenseRetrialFinanceExamine,jdbcType=INTEGER},
+      #{ceoExamine,jdbcType=INTEGER}, #{cfoExamine,jdbcType=INTEGER}, #{viceCeoExamine,jdbcType=INTEGER},
+      #{cashierExamine,jdbcType=INTEGER})
   </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Department" useGeneratedKeys="true">
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.Department">
     insert into department
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
       <if test="createId != null">
         create_id,
       </if>
@@ -166,6 +169,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
       <if test="createId != null">
         #{createId,jdbcType=VARCHAR},
       </if>

+ 21 - 12
src/main/java/com/goafanti/common/mapper/ExpenseAccountLogMapper.xml

@@ -9,9 +9,10 @@
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
     <result column="auditor" jdbcType="VARCHAR" property="auditor" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="show_status" jdbcType="INTEGER" property="showStatus" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, eaid, process_status, `status`, remarks, auditor, create_time
+    id, eaid, process_status, `status`, remarks, auditor, create_time, show_status
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -23,14 +24,13 @@
     delete from expense_account_log
     where id = #{id,jdbcType=INTEGER}
   </delete>
-
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountLog" useGeneratedKeys="true">
     insert into expense_account_log (eaid, process_status, `status`,
-      remarks, auditor, create_time
-      )
+      remarks, auditor, create_time,
+      show_status)
     values (#{eaid,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
-      #{remarks,jdbcType=VARCHAR}, #{auditor,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
-      )
+      #{remarks,jdbcType=VARCHAR}, #{auditor,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{showStatus,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountLog" useGeneratedKeys="true">
     insert into expense_account_log
@@ -53,6 +53,9 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="showStatus != null">
+        show_status,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="eaid != null">
@@ -73,9 +76,11 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="showStatus != null">
+        #{showStatus,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
-
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseAccountLog">
     update expense_account_log
     <set>
@@ -97,6 +102,9 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="showStatus != null">
+        show_status = #{showStatus,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -107,14 +115,15 @@
       `status` = #{status,jdbcType=INTEGER},
       remarks = #{remarks,jdbcType=VARCHAR},
       auditor = #{auditor,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      show_status = #{showStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
 
     <select id="selectByEaid" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountLog">
     select a.id,a.eaid ,a.status ,a.remarks ,a.auditor ,b.name auditorName,a.process_status processStatus,
-           date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.create_time createTime
+           date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.create_time createTime,a.show_status showStatus
     from expense_account_log a left join admin b on a.auditor =b.id
     where a.eaid= #{eaid}
     order by a.create_time,process_status
@@ -132,13 +141,13 @@
 
   <insert id="insertBatch" >
     insert into expense_account_log (eaid, process_status, `status`,
-                                     remarks, auditor, create_time
+                                     remarks, auditor, create_time,show_status
     )
     values
         <foreach collection="list" item="item" index="index" separator=",">
         (#{item.eaid,jdbcType=INTEGER}, #{item.processStatus,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER},
-            #{item.remarks,jdbcType=VARCHAR}, #{item.auditor,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}
-           )
+            #{item.remarks,jdbcType=VARCHAR}, #{item.auditor,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
+          #{item.showStatus,jdbcType=INTEGER})
         </foreach>
   </insert>
 </mapper>

+ 3 - 12
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -457,7 +457,7 @@
 
     </if>
     <if test="expenseMain ==1">
-       a.examine_name examineName,a.check_no checkNo,a.target_type targetType,a.order_remarks orderRemarks,
+       a.examine_name examineName,a.check_no checkNo,a.target_type targetType,
     </if>
     f.name depName,d2.name financeName, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.aname,
     b.name applyDepName, c.name payDepName
@@ -852,15 +852,6 @@
         set c.status =b.status ,c.process_status =b.process_status
       where a.id= #{id}
     </update>
-  <update id="updateByOrderRemarks">
-    update expense_account x ,(select a.id,GROUP_CONCAT('【',e.buyer_name ,',',d.contract_no,'】') orderRemarks
-      from expense_account a left join expense_relationship b on a.id=b.id
-      left join expense_account c on b.ea_id =c.id left join t_order_new d on c.order_no =d.order_no
-      left join t_order_mid e on c.order_no =e.order_no  and a.id= #{id}
-      group by a.id)y
-    set x.order_remarks=y.orderRemarks
-    where x.id=y.id
-  </update>
 
 
 
@@ -945,11 +936,11 @@
     select mea.check_no checkNo ,ead.`type`,ead.type_other typeOther,
            ead.amount ,ead.real_amount realAmount ,o.contract_no contractNo ,dep.name applyDepName,
     a.id sonId,a.type sonType ,a.type_other sonTypeOther ,
-    dep2.name payDepName ,a.aname ,ad2.name financeName,a.status ,mea.process_status processStatus ,mea.id mainId,mea.target_type targetType,
+    dep2.name payDepName ,a.aname ,ad2.name financeName,mea.status ,mea.process_status processStatus ,mea.id mainId,mea.target_type targetType,
     tm.buyer_name buyerName ,date_format(mea.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr
     from expense_account_details  ead left join expense_account a on ead.eaid =a.id
     left join expense_relationship er on a.id=er.ea_id  left join expense_account mea on  er.id=mea.id
-    left join t_order_new o on mea.order_no =o.order_no left join t_order_mid tm on o.order_no =tm.order_no
+    left join t_order_new o on a.order_no =o.order_no left join t_order_mid tm on o.order_no =tm.order_no
     left join department dep on mea.apply_dep =dep.id
     left join department dep2 on mea.pay_dep =dep2.id  left join  admin ad on a.aid=ad.id
     left join department dep3 on ad.department_id =dep3.id left join admin ad2 on dep.expense_finance_id =ad2.id

+ 15 - 2
src/main/java/com/goafanti/common/model/ExpenseAccountLog.java

@@ -19,12 +19,12 @@ public class ExpenseAccountLog implements Serializable {
     private Integer eaid;
 
     /**
-     * 流程状态 0=巴员发起,1=巴主发起或审核,2=总经理审核,3=财务审核,4=董事长审核
+     * 流程状态 0=成员发起,1=上级审核,2=部门负责人审核,3=财务审核,4=财务复审,5=董事长,6=财务管理员,7=公司副总,8=出纳
      */
     private Integer processStatus;
 
     /**
-     * 状态 0发起 1通过 2完成 3驳回
+     * 状态 0发起 1通过 2完成 3驳回 4撤销 5修改
      */
     private Integer status;
 
@@ -43,6 +43,11 @@ public class ExpenseAccountLog implements Serializable {
      */
     private Date createTime;
 
+    /**
+     * 0=正常,1=旧日志,2=跳过日志
+     */
+    private Integer showStatus;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -100,4 +105,12 @@ public class ExpenseAccountLog implements Serializable {
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
+
+    public Integer getShowStatus() {
+        return showStatus;
+    }
+
+    public void setShowStatus(Integer showStatus) {
+        this.showStatus = showStatus;
+    }
 }

+ 5 - 3
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -298,7 +298,9 @@ public class ExpenseAccountController extends CertifyApiController {
     public Result statistics(String name,String depId,String startTime,String endTime) {
         Result res = new Result();
         String lander = null;
-        if (TokenManager.hasRole(AFTConstants.FINANCE)) {
+        if (TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
+            lander=null;
+        }else if (TokenManager.hasRole(AFTConstants.FINANCE)) {
             lander = TokenManager.getAdminId();
         }
         res.setData(expenseAccountService.statistics(name, depId, startTime, endTime, lander));
@@ -429,13 +431,13 @@ public class ExpenseAccountController extends CertifyApiController {
      * @return
      */
     @RequestMapping(value = "/updateTypeOther",method = RequestMethod.POST)
-    public Result updateTypeOther(Integer id ,String typeOther){
+    public Result updateTypeOther(Integer id ,String typeOther,String remarks){
         Result res =new Result();
         if (id==null){
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
             return  res;
         }
-        return res.data(expenseAccountService.updateTypeOther(   id, typeOther));
+        return res.data(expenseAccountService.updateTypeOther(   id, typeOther,remarks));
     }
 
     /**

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

@@ -71,5 +71,5 @@ public interface ExpenseAccountService {
 
     Object getDepDetails(Integer id);
 
-    Object updateTypeOther(Integer id, String typeOther);
+    Object updateTypeOther(Integer id, String typeOther,String remarks);
 }

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

@@ -108,6 +108,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
      */
     private void addExpenseAccountExamine(Integer id,ExpenseAccount ea) {
         List<ExpenseAccountExamine> list=new ArrayList<>();
+        expenseAccountExamineMapper.deleteByEaid(ea.getId());
         String aid = TokenManager.getAdminId();
         OrganizationListOut dep = departmentMapper.selectAllById(ea.getApplyDep());
         AdminNoticeBo a = adminMapper.selectMyAndSuperBySuperId(aid);
@@ -158,20 +159,27 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private void addExpenseAccountLog(Integer eaid, Integer status,Integer processStatus,String aid, String str) {
         addExpenseAccountLog(eaid,status,processStatus,aid,str,null);
     }
-
+    private void addExpenseAccountLog(Integer eaid, Integer status,Integer processStatus,String aid, String str,Date date){
+        addExpenseAccountLog(eaid,status,processStatus,aid,str,date,null);
+    }
     /**
      * 新增报销日志
      * @param eaid 报销编号
      * @param status 状态 0发起 1通过 2完成 3驳回 4修改
      * @param str 备注
      */
-    private void addExpenseAccountLog(Integer eaid, Integer status,Integer processStatus,String aid, String str,Date date) {
+    private void addExpenseAccountLog(Integer eaid, Integer status,Integer processStatus,String aid, String str,Date date,Integer showStatus) {
         ExpenseAccountLog eaLog=new ExpenseAccountLog();
         eaLog.setEaid(eaid);
         eaLog.setStatus(status);
         eaLog.setRemarks(str);
         eaLog.setProcessStatus(processStatus);
         eaLog.setAuditor(aid);
+        if (showStatus!=null){
+            eaLog.setShowStatus(showStatus);
+        }else {
+            eaLog.setShowStatus(0);
+        }
         if (date !=null)eaLog.setCreateTime(date);
         expenseAccountLogMapper.insertSelective(eaLog);
     }
@@ -188,14 +196,14 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             String str2=String.format("未设置[%s]审核。",EAProcessStatus.getDesc(in.getProcessStatus()));
             Date date=new Date();
             date.setTime(date.getTime()+1000L);
-            addExpenseAccountLog(in.getId(),1,in.getProcessStatus(),aid,str2,date);
+            addExpenseAccountLog(in.getId(),1,in.getProcessStatus(),aid,str2,date,2);
             in.setProcessStatus(in.getProcessStatus()+1);
         }else {
             if (admin.getSuperiorId()==null||admin.getId().equals(admin.getSuperiorId())){
                 String str2=String.format("重复审核人跳过[%s]。",EAProcessStatus.getDesc(in.getProcessStatus()));
                 Date date=new Date();
                 date.setTime(date.getTime()+1000L);
-                addExpenseAccountLog(in.getId(),1,in.getProcessStatus(),aid,str2,date);
+                addExpenseAccountLog(in.getId(),1,in.getProcessStatus(),aid,str2,date,2);
                 in.setProcessStatus(in.getProcessStatus()+1);
             }
         }
@@ -368,30 +376,33 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     }
 
     @Override
-    public Object updateTypeOther(Integer id, String typeOther) {
+    public Object updateTypeOther(Integer id, String typeOther,String remarks) {
         ExpenseAccount ea = new ExpenseAccount();
         ea.setId(id);
-        ea.setTypeOther(typeOther);
+        if (StringUtils.isNotEmpty(typeOther))ea.setTypeOther(typeOther);
+        if (StringUtils.isNotEmpty(remarks))ea.setRemarks(remarks);
         expenseAccountMapper.updateByPrimaryKeySelective(ea);
-        MainExpenseAccount mainExpenseAccount = expenseAccountMapper.selectbySonId(id);
-        StringBuffer types=new StringBuffer();
-        for (SonExpenseAccount e : mainExpenseAccount.getSonList()) {
-            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 (StringUtils.isNotEmpty(typeOther)){
+            MainExpenseAccount mainExpenseAccount = expenseAccountMapper.selectbySonId(id);
+            StringBuffer types=new StringBuffer();
+            for (SonExpenseAccount e : mainExpenseAccount.getSonList()) {
+                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);
+                    }
+                }
+                types=types.append(",");
             }
-            types=types.append(",");
+            expenseAccountMapper.updateSonTypeOther(id,types.substring(0,types.length()-1));
         }
-        expenseAccountMapper.updateSonTypeOther(id,types.substring(0,types.length()-1));
         return 1;
     }
 
@@ -491,15 +502,16 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                     if (processStatus <3){
                         List<OutExpenseAccountLog> outExpenseAccountLogs = expenseAccountExamineMapper.selectNotExamineByEaidAndProcessStatus(eaid, processStatus);
                         list.addAll(outExpenseAccountLogs);
-                    }
-                    List<ExpenseAccountExamine> expenseAccountExamines = expenseAccountExamineMapper.selectByEaidAndProcessStatus(eaid, processStatus);
-                    for (ExpenseAccountExamine e : expenseAccountExamines) {
-                        if (e.getStatus()==0){
-                            OutExpenseAccountLog out =new OutExpenseAccountLog();
-                            out.setEaid(eaid);
-                            out.setProcessStatus(e.getProcessStatus());
-                            out.setAuditorName(e.getAuditorname());
-                            list.add(out);
+                    }else {
+                        List<ExpenseAccountExamine> expenseAccountExamines = expenseAccountExamineMapper.selectByEaidAndProcessStatus(eaid, processStatus);
+                        for (ExpenseAccountExamine e : expenseAccountExamines) {
+                            if (e.getStatus()==0){
+                                OutExpenseAccountLog out =new OutExpenseAccountLog();
+                                out.setEaid(eaid);
+                                out.setProcessStatus(e.getProcessStatus());
+                                out.setAuditorName(e.getAuditorname());
+                                list.add(out);
+                            }
                         }
                     }
                     if (processStatus<8)addDetailsLog(list, expenseAccount,processStatus);
@@ -711,7 +723,6 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                     newEa.setExamineName(aname.substring(0,aname.length()-1));
                 }
                 addExpenseAccountLog(in.getId(),status,useEa.getProcessStatus(),TokenManager.getAdminId(),in.getReason());
-
             }else {
                 addExpenseAccountLog(in.getId(),status,useEa.getProcessStatus(),TokenManager.getAdminId(),in.getReason());
                 newEa.setStatus(1);
@@ -824,7 +835,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 String str=String.format("重复审核人跳过[%s]。",EAProcessStatus.getDesc(newEa.getProcessStatus()));
                 Date date=new Date();
                 date.setTime(date.getTime()+1000l);
-                addExpenseAccountLog(newEa.getId(),1,newEa.getProcessStatus(),aid,str,date);
+                addExpenseAccountLog(newEa.getId(),1,newEa.getProcessStatus(),aid,str,date,2);
                 if (newEa.getProcessStatus()==EAProcessStatus.BMFZRSH.getCode()){
                     addFinanceCount(admin.getDepFinance(),newEa.getCreateTime());
                 }
@@ -902,12 +913,12 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 if (str==null)str=String.format("未设置[%s]审核,跳过此流程",tip);
                 if (newEa.getProcessStatus()<EAProcessStatus.CNSH.getCode()){
                     date2.setTime(date2.getTime()+100);
-                    addExpenseAccountLog(newEa.getId(),1,newEa.getProcessStatus(),aid,str,date2);
+                    addExpenseAccountLog(newEa.getId(),1,newEa.getProcessStatus(),aid,str,date2,2);
                     newEa.setProcessStatus(newEa.getProcessStatus()+1);
                     examineByprocess(newEa,admin,dep,list);
                 }else {
                     date2.setTime(date2.getTime()+100);
-                    addExpenseAccountLog(newEa.getId(),2,newEa.getProcessStatus(),aid,str,date2);
+                    addExpenseAccountLog(newEa.getId(),2,newEa.getProcessStatus(),aid,str,date2,2);
                     newEa.setProcessStatus(newEa.getProcessStatus());
                     newEa.setStatus(2);
                 }
@@ -1099,6 +1110,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             for (OutExpenseAccountLog log : listLog) {
                 if (!newLog.contains(log)){
                     log.setEaid(in.getId());
+                    log.setShowStatus(1);
                     newLog.add(log);
                 }
             }
@@ -1112,6 +1124,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     @Override
     public MainExpenseAccount mainExpense(Integer id) {
         MainExpenseAccount res = expenseAccountMapper.selectByMainId(id);
+        pushData(res);
         res.setExamine(0);
         if (res.getAid().equals(TokenManager.getAdminId())){
             res.setExamine(2);
@@ -1121,6 +1134,30 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         return res;
     }
 
+    private void pushData(MainExpenseAccount res) {
+        List<SonExpenseAccount> sonList = res.getSonList();
+        sonList.stream().forEach(e->{
+            if (StringUtils.isNotEmpty(e.getUserNames())){
+                String userNames = e.getUserNames();
+                String  districtName = e.getDistrictName();
+                int start=userNames.indexOf("[");
+                if (start>0){
+                    userNames = userNames.substring(0,start);
+                    districtName=districtName.replace(userNames,"");
+                    e.setUserNames(userNames);
+                    e.setDistrictName(districtName);
+                }else {
+                    districtName=districtName.replace(userNames,"");
+                    e.setDistrictName(districtName);
+                }
+            }
+
+        });
+
+    }
+
+
+
     @Override
     public Object updateMain(MainExpenseAccount in) {
         OutExpenseAccount outExpenseAccount = expenseAccountMapper.selectByid(in.getId());
@@ -1186,19 +1223,19 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         //1-3s是不同人的审核
         if (in.getProcessStatus()!=null&&in.getProcessStatus()==1){
             // 财务审核,复审,出纳都是财务与经理
-             if (TokenManager.hasRole(AFTConstants.FINANCE)||TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)){
-                 in.setProcessStatus(3);
-             }else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
-                 in.setProcessStatus(1);
-             }else if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
-                 in.setProcessStatus(2);
+            if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
+                in.setProcessStatus(6);
             }else if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_ASSISTANT)){
                 in.setProcessStatus(5);
             }else if(TokenManager.hasRole(AFTConstants.VICE_CEO)){
                 //先不做财务查看权限
                 in.setProcessStatus(7);
-            }else if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
-                in.setProcessStatus(6);
+            }else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
+                 in.setProcessStatus(1);
+             }else if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
+                 in.setProcessStatus(2);
+            }else if (TokenManager.hasRole(AFTConstants.FINANCE)||TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)){
+                in.setProcessStatus(3);
             }
         }else {
                 in.setProcessStatus(0);
@@ -1243,7 +1280,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         if (in.getEndTime()!=null)params.put("endTime",in.getEndTime());
         if (in.getCheckNo()!=null)params.put("checkNo",in.getCheckNo());
         //0=自己 1=财务 2=财务经理 3=超管
-        if (TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
             params.put("roleType",3);
         }else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)){
             params.put("roleType",2);

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

@@ -51,12 +51,12 @@ yxjl_max=100
 
 amb.maxLvl=6
 
-avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.3.03
-rd.static.host=//static.jishutao.com/RD/1.0.03
+static.host=//static.jishutao.com/1.3.04
+#static.host=//172.16.1.187/1.3.04
 #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
+avatar.host=//static.jishutao.com
+rd.static.host=//static.jishutao.com/RD/1.0.03
 
 #\u5FAE\u4FE1\u6253\u5361\u5C0F\u7A0B\u5E8F
 wx.appId=wxff2f5720ed7d7f63

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -52,7 +52,7 @@ amb.maxLvl=6
 
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.3.03
+static.host=//static.jishutao.com/1.3.04
 rd.static.host=//static.jishutao.com/RD/1.0.03
 avatar.upload.host=//static.jishutao.com/upload