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

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

anderx лет назад: 2
Родитель
Сommit
c2768dcf6b
38 измененных файлов с 2086 добавлено и 672 удалено
  1. 12 4
      src/main/java/com/goafanti/admin/bo/AdminListBo.java
  2. 10 10
      src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java
  3. 4 1
      src/main/java/com/goafanti/common/dao/ExpenseAccountExamineMapper.java
  4. 2 0
      src/main/java/com/goafanti/common/dao/ExpenseAccountLogMapper.java
  5. 21 0
      src/main/java/com/goafanti/common/dao/ExpenseConfigDetailsMapper.java
  6. 5 1
      src/main/java/com/goafanti/common/dao/ExpenseRelationshipMapper.java
  7. 1 1
      src/main/java/com/goafanti/common/error/SystemExceptionResolver.java
  8. 104 98
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  9. 67 14
      src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml
  10. 18 0
      src/main/java/com/goafanti/common/mapper/ExpenseAccountExamineMapper.xml
  11. 17 3
      src/main/java/com/goafanti/common/mapper/ExpenseAccountLogMapper.xml
  12. 54 54
      src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml
  13. 107 0
      src/main/java/com/goafanti/common/mapper/ExpenseConfigDetailsMapper.xml
  14. 11 3
      src/main/java/com/goafanti/common/mapper/ExpenseRelationshipMapper.xml
  15. 13 0
      src/main/java/com/goafanti/common/model/Admin.java
  16. 58 6
      src/main/java/com/goafanti/common/model/Department.java
  17. 13 0
      src/main/java/com/goafanti/common/model/ExpenseAccount.java
  18. 93 0
      src/main/java/com/goafanti/common/model/ExpenseConfigDetails.java
  19. 4 4
      src/main/java/com/goafanti/common/utils/Param.java
  20. 10 1
      src/main/java/com/goafanti/expenseAccount/Enums/EAsecondaryTypes.java
  21. 9 0
      src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccount.java
  22. 30 7
      src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountBo.java
  23. 64 13
      src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountDetailsList.java
  24. 15 0
      src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountLog.java
  25. 27 0
      src/main/java/com/goafanti/expenseAccount/bo/SonExpenseAccount.java
  26. 54 1
      src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java
  27. 50 0
      src/main/java/com/goafanti/expenseAccount/controller/ExpenseConfigController.java
  28. 10 1
      src/main/java/com/goafanti/expenseAccount/service/ExpenseAccountService.java
  29. 12 0
      src/main/java/com/goafanti/expenseAccount/service/ExpenseConfigService.java
  30. 460 154
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java
  31. 35 0
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseConfigServiceImpl.java
  32. 223 0
      src/main/java/com/goafanti/organization/bo/InputDep.java
  33. 404 243
      src/main/java/com/goafanti/organization/bo/OrganizationListOut.java
  34. 12 13
      src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java
  35. 2 3
      src/main/java/com/goafanti/organization/service/OrganizationService.java
  36. 48 30
      src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java
  37. 6 6
      src/main/resources/props/config_local.properties
  38. 1 1
      src/main/resources/props/config_test.properties

+ 12 - 4
src/main/java/com/goafanti/admin/bo/AdminListBo.java

@@ -1,12 +1,11 @@
 package com.goafanti.admin.bo;
 
-import java.util.Date;
-import java.util.List;
-
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.model.Role;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
-import com.goafanti.common.constant.AFTConstants;
+import java.util.Date;
+import java.util.List;
 
 public class AdminListBo {
 
@@ -122,6 +121,7 @@ public class AdminListBo {
 	 *  公出权限 0正常 1全部
 	 */
 	private Integer publicPurview;
+	private Integer expenseSuperExamine;
 
 	private String ambId;
 	private String ancestors;
@@ -131,6 +131,14 @@ public class AdminListBo {
 	private String ancestorsNames;
 	private String ambRole;
 
+	public Integer getExpenseSuperExamine() {
+		return expenseSuperExamine;
+	}
+
+	public void setExpenseSuperExamine(Integer expenseSuperExamine) {
+		this.expenseSuperExamine = expenseSuperExamine;
+	}
+
 	public String getDepFinance() {
 		return depFinance;
 	}

+ 10 - 10
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -1,25 +1,24 @@
 package com.goafanti.admin.service.impl;
 
-import java.util.*;
-
-import com.goafanti.common.dao.*;
-import com.goafanti.common.model.AmbSystem;
-import com.goafanti.common.model.Role;
-import com.goafanti.common.utils.AsyncUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.NewAdminService;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.AmbSystem;
+import com.goafanti.common.model.Role;
 import com.goafanti.common.model.UserRole;
+import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
 
 @Service
 public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements NewAdminService {
@@ -107,6 +106,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 			TokenManager.clearUserAuthByUserId(ad.getId());
 		}
 		ad.setType(sumType(roleIds));
+		if (ad.getExpenseSuperExamine()==null)ad.setExpenseSuperExamine(0);
 		int count=adminMapper.updateByPrimaryKey(ad);
 		//
 		asyncUtils.pushRoleUpdateExamine(ad,useAdmin,roleIds,useRole);

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

@@ -21,7 +21,7 @@ public interface ExpenseAccountExamineMapper {
 
     void insertBatch(List<ExpenseAccountExamine> list);
 
-    void updateStatusByEaidAndAid(@Param("id") Integer id, @Param("aid") String aid,@Param("status") Integer status);
+    void updateStatusByEaidAndAid(@Param("id") Integer id, @Param("aid") String aid,@Param("status") Integer status,@Param("type") Integer type);
 
     /**
      * 获取当前审核信息
@@ -40,4 +40,7 @@ public interface ExpenseAccountExamineMapper {
     List<OutExpenseAccountLog> selectNotExamineByEaidAndProcessStatus(@Param("id") Integer id, @Param("processStatus") Integer processStatus);
 
 
+    void deleteByEaid(Integer id);
+
+    Integer selectYesByParam(@Param("id") Integer id, @Param("aid") String aid);
 }

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

@@ -25,4 +25,6 @@ public interface ExpenseAccountLogMapper {
     void updateUseLogByUseId(@Param("id") Integer id, @Param("useId") Integer useId);
 
     void deleteByeaid(Integer id);
+
+    void insertBatch(List<OutExpenseAccountLog> list);
 }

+ 21 - 0
src/main/java/com/goafanti/common/dao/ExpenseConfigDetailsMapper.java

@@ -0,0 +1,21 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.ExpenseConfigDetails;
+
+import java.util.List;
+
+public interface ExpenseConfigDetailsMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(ExpenseConfigDetails record);
+
+    int insertSelective(ExpenseConfigDetails record);
+
+    ExpenseConfigDetails selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(ExpenseConfigDetails record);
+
+    int updateByPrimaryKey(ExpenseConfigDetails record);
+
+    List<ExpenseConfigDetails> selectByDepId(String id);
+}

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

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.ExpenseRelationship;
 
+import java.util.List;
+
 public interface ExpenseRelationshipMapper {
     int deleteByPrimaryKey(Integer id);
 
@@ -14,4 +16,6 @@ public interface ExpenseRelationshipMapper {
     int updateByPrimaryKeySelective(ExpenseRelationship record);
 
     int updateByPrimaryKey(ExpenseRelationship record);
-}
+
+    List<ExpenseRelationship> selectById(Integer id);
+}

+ 1 - 1
src/main/java/com/goafanti/common/error/SystemExceptionResolver.java

@@ -91,7 +91,7 @@ public class SystemExceptionResolver extends SimpleMappingExceptionResolver{
 			LoggerUtils.fmtError(getClass(), ex, "数据异常。",ex.getClass().getName());
 		}
 		if (StringUtils.isEmpty(error.getMessage())) {
-			error.setMessage("系统异常,请联系管理员。");
+			error.setMessage("数据异常,请稍后再试,如再失败请联系管理员。");
 		}
 		return new BusinessException(error, ex.getCause());
 	}

+ 104 - 98
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -31,12 +31,13 @@
     <result column="senior_staff" jdbcType="INTEGER" property="seniorStaff" />
     <result column="public_purview" jdbcType="INTEGER" property="publicPurview" />
     <result column="expense_open_id" jdbcType="VARCHAR" property="expenseOpenId" />
+    <result column="expense_super_examine" jdbcType="INTEGER" property="expenseSuperExamine" />
   </resultMap>
   <sql id="Base_Column_List">
     id, mobile, `name`, `password`, email, create_time, `number`, province, `position`,
     superior_id, city, department_id, `status`, user_no, duty, district, head_portrait_url,
     contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role, amb_manage,
-    manager_id, senior_staff, public_purview, expense_open_id
+    manager_id, senior_staff, public_purview, expense_open_id, expense_super_examine
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select
@@ -48,34 +49,31 @@
     delete from admin
     where id = #{id,jdbcType=VARCHAR}
   </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.Admin">
-    insert into admin (id, mobile, `name`,
-      `password`, email, create_time,
-      `number`, province, `position`,
-      superior_id, city, department_id,
-      `status`, user_no, duty,
-      district, head_portrait_url, contact_mobile,
-      last_login_time, open_id, `type`,
-      reviewer, amb_id, amb_role,
-      amb_manage, manager_id, senior_staff,
-      public_purview, expense_open_id)
-    values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
-      #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
-      #{number,jdbcType=INTEGER}, #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
-      #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR},
-      #{status,jdbcType=VARCHAR}, #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR},
-      #{district,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
-      #{lastLoginTime,jdbcType=TIMESTAMP}, #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
-      #{reviewer,jdbcType=VARCHAR}, #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR},
-      #{ambManage,jdbcType=INTEGER}, #{managerId,jdbcType=VARCHAR}, #{seniorStaff,jdbcType=INTEGER},
-      #{publicPurview,jdbcType=INTEGER}, #{expenseOpenId,jdbcType=VARCHAR})
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
+    insert into admin (mobile, `name`, `password`,
+      email, create_time, `number`,
+      province, `position`, superior_id,
+      city, department_id, `status`,
+      user_no, duty, district,
+      head_portrait_url, contact_mobile, last_login_time,
+      open_id, `type`, reviewer,
+      amb_id, amb_role, amb_manage,
+      manager_id, senior_staff, public_purview,
+      expense_open_id, expense_super_examine)
+    values (#{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
+      #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{number,jdbcType=INTEGER},
+      #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{superiorId,jdbcType=VARCHAR},
+      #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
+      #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR},
+      #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
+      #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{reviewer,jdbcType=VARCHAR},
+      #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR}, #{ambManage,jdbcType=INTEGER},
+      #{managerId,jdbcType=VARCHAR}, #{seniorStaff,jdbcType=INTEGER}, #{publicPurview,jdbcType=INTEGER},
+      #{expenseOpenId,jdbcType=VARCHAR}, #{expenseSuperExamine,jdbcType=INTEGER})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.Admin">
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
     insert into admin
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
       <if test="mobile != null">
         mobile,
       </if>
@@ -160,11 +158,11 @@
       <if test="expenseOpenId != null">
         expense_open_id,
       </if>
+      <if test="expenseSuperExamine != null">
+        expense_super_examine,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=VARCHAR},
-      </if>
       <if test="mobile != null">
         #{mobile,jdbcType=VARCHAR},
       </if>
@@ -249,6 +247,9 @@
       <if test="expenseOpenId != null">
         #{expenseOpenId,jdbcType=VARCHAR},
       </if>
+      <if test="expenseSuperExamine != null">
+        #{expenseSuperExamine,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
@@ -338,6 +339,9 @@
       <if test="expenseOpenId != null">
         expense_open_id = #{expenseOpenId,jdbcType=VARCHAR},
       </if>
+      <if test="expenseSuperExamine != null">
+        expense_super_examine = #{expenseSuperExamine,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -370,7 +374,8 @@
       manager_id = #{managerId,jdbcType=VARCHAR},
       senior_staff = #{seniorStaff,jdbcType=INTEGER},
       public_purview = #{publicPurview,jdbcType=INTEGER},
-      expense_open_id = #{expenseOpenId,jdbcType=VARCHAR}
+      expense_open_id = #{expenseOpenId,jdbcType=VARCHAR},
+      expense_super_examine = #{expenseSuperExamine,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 
@@ -378,6 +383,7 @@
 
 
 
+
   <select id="selectAllAdmin" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />
@@ -755,7 +761,7 @@
   <select id="selectAllByid" parameterType="java.lang.String" resultType="com.goafanti.common.model.Admin">
     select a.id, a.mobile, a.name, a.`password`, a.email, a.create_time as createTime,
            a.province, a.`position`,a.reviewer , a.superior_id as superiorId,a.public_purview publicPurview,
-           a.department_id as departmentId, a.status,a.user_no as userNo,a.duty,a.district,
+           a.department_id as departmentId, a.status,a.user_no as userNo,a.duty,a.district,a.expense_super_examine expenseSuperExamine,
            a.head_portrait_url as headPortraitUrl, a.contact_mobile as contactMobile,a.senior_staff seniorStaff,
            b.name superior,c.name reviewerName,a.type,a.amb_id ambId,a.manager_id managerId ,d.name managerName
     from admin a left join admin b on a.superior_id =b.id left join admin c on a.reviewer =c.id
@@ -912,14 +918,14 @@
 
   <select id="getDeptNameByAid" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
     select a.id,a.name, d.name as departmentName,a.department_id departmentId,a.email,a.superior_id superiorId,a.open_id openId,
-           a.reviewer,d.manager_id depManager,d.finance_id depFinance,a.public_purview publicPurview
+           a.reviewer,d.manager_id depManager,d.finance_id depFinance,a.public_purview publicPurview,a.expense_super_examine expenseSuperExamine
     from admin a left join department d on a.department_id = d.id
     where a.id = #{_parameter,jdbcType=VARCHAR}
   </select>
 
   <insert id="addAdminContacts" parameterType="com.goafanti.admin.bo.AdminContacts">
     insert into admin_contacts (id,aid,contacts_id)values
-    (#{id,jdbcType=VARCHAR},#{aid,jdbcType=VARCHAR},#{contactsId,jdbcType=VARCHAR})
+      (#{id,jdbcType=VARCHAR},#{aid,jdbcType=VARCHAR},#{contactsId,jdbcType=VARCHAR})
   </insert>
 
 
@@ -1162,8 +1168,8 @@
 
   <select id="selectMyAndSuperBySuperId" parameterType="java.lang.String" resultType="com.goafanti.common.bo.AdminNoticeBo">
     select
-    a.id,a.name,a.email,a.open_id openId,a.expense_open_id expenseOpenId,
-    b.id superId,b.name superName,b.email superEmail,b.open_id superOpenId,b.expense_open_id superExpenseOpenId
+      a.id,a.name,a.email,a.open_id openId,a.expense_open_id expenseOpenId,
+      b.id superId,b.name superName,b.email superEmail,b.open_id superOpenId,b.expense_open_id superExpenseOpenId
     from admin a left join admin b on a.superior_id=b.id
     where  a.id=#{id}
   </select>
@@ -1246,7 +1252,7 @@
   <select id="selectFinanceAdminByAid" resultType="com.goafanti.common.model.Admin">
     select c.id,c.name,c.open_id openId,c.email
     from admin  a left join department b on a.department_id=b.id
-    left join admin c on b.finance_id=c.id
+                  left join admin c on b.finance_id=c.id
     where a.id= #{aid}
   </select>
   <select id="adminStatisticsInfo" resultType="com.goafanti.admin.bo.AdminStatisticsBo">
@@ -1254,19 +1260,19 @@
     from (select aid ,sum(private_count)privateSum ,sum(channel_count)channelSum ,sum(sign_count)signSum ,
                  sum(public_release_count)publicReleaseSum ,sum(follow_count) followSum,sum(order_count) orderSum
           from admin_user_count a where aid=#{aid} group by aid)x
-    left join(select a.salesman_id aid , sum(if( b.project_status =29,1,0))projectStopSum ,
-            sum(if(b.check_status=1,1,0))projectCheckSum from t_order_new a left join t_order_task b
-            on a.order_no =b.order_no where a.salesman_id =  #{aid})y on x.aid=y.aid
-    left join (  select salesman_id aid,  sum(1)orderSum, sum(if(delete_sign=2,1,0))changeSum
-            from t_order_new where delete_sign in (0,2,3) and process_status >0
-            and salesman_id =  #{aid})g on x.aid=g.aid
-    left join (  select salesman_id aid,  sum(if(order_status=3 or order_status=5,1,0))rejectSum
-            from t_order_new where delete_sign in (0,2,3)
-            and salesman_id =  #{aid})z on x.aid=z.aid
-    left join (  SELECT b.salesman_id aid ,sum(a.money)  receivables
-                 from new_order_dun a left join t_order_new b on a.order_no =b.order_no
-                 where a.status =1   and b.delete_sign in (0,2,3)
-                   and b.salesman_id = #{aid})t on x.aid=t.aid
+           left join(select a.salesman_id aid , sum(if( b.project_status =29,1,0))projectStopSum ,
+                            sum(if(b.check_status=1,1,0))projectCheckSum from t_order_new a left join t_order_task b
+                                                                                                      on a.order_no =b.order_no where a.salesman_id =  #{aid})y on x.aid=y.aid
+           left join (  select salesman_id aid,  sum(1)orderSum, sum(if(delete_sign=2,1,0))changeSum
+                        from t_order_new where delete_sign in (0,2,3) and process_status >0
+                                           and salesman_id =  #{aid})g on x.aid=g.aid
+           left join (  select salesman_id aid,  sum(if(order_status=3 or order_status=5,1,0))rejectSum
+                        from t_order_new where delete_sign in (0,2,3)
+                                           and salesman_id =  #{aid})z on x.aid=z.aid
+           left join (  SELECT b.salesman_id aid ,sum(a.money)  receivables
+                        from new_order_dun a left join t_order_new b on a.order_no =b.order_no
+                        where a.status =1   and b.delete_sign in (0,2,3)
+                          and b.salesman_id = #{aid})t on x.aid=t.aid
   </select>
 
   <select id="adminStatisticsInfoByTime" resultType="com.goafanti.admin.bo.AdminStatisticsBo">
@@ -1308,11 +1314,11 @@
   </select>
   <select id="adminStatisticsPublicReleaseByAidAndTime" resultType="java.lang.Integer">
     select sum(1) rangePublicReleaseSum
-     from public_release a left join public_release_details b on a.id=b.prid
-     where status =2 and a.aid =  #{aid}
-       and((a.release_start &gt;  #{startTime} and a.release_start &lt;  #{endTime})or
-           (a.release_end &gt;  #{startTime} and a.release_end &lt;  #{endTime})or
-           (a.release_start &lt;  #{startTime} and a.release_end &gt;  #{endTime}))
+    from public_release a left join public_release_details b on a.id=b.prid
+    where status =2 and a.aid =  #{aid}
+      and((a.release_start &gt;  #{startTime} and a.release_start &lt;  #{endTime})or
+          (a.release_end &gt;  #{startTime} and a.release_end &lt;  #{endTime})or
+          (a.release_start &lt;  #{startTime} and a.release_end &gt;  #{endTime}))
   </select>
   <select id="addAdminContactsRangeReceivables" resultType="java.math.BigDecimal">
     SELECT  ifnull(sum(a.money),0)  receivables
@@ -1324,14 +1330,14 @@
   <select id="consultantStatisticsInfo" resultType="com.goafanti.admin.bo.ConsultantStatisticsBo">
     SELECT x.aid,x.projectCount,x.inProgress,x.complete,x.notStarted,x.stop,y.countPublicRelease,y.countAssist,z.countChange,v.orderPayment
     from (select a.task_receiver aid,sum(commodity_quantity) projectCount, sum(if(a.project_status=1,commodity_quantity,0)) inProgress,
-         sum(if(a.project_status in (19,27) ,commodity_quantity,0)) complete, sum(if(a.project_status=0,commodity_quantity,0)) notStarted,
-         sum(if(a.project_status in (2,3,29),commodity_quantity,0)) stop
+    sum(if(a.project_status in (19,27) ,commodity_quantity,0)) complete, sum(if(a.project_status=0,commodity_quantity,0)) notStarted,
+    sum(if(a.project_status in (2,3,29),commodity_quantity,0)) stop
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
     where b.delete_sign in (0,2,3) and  a.split_status in (0,2) and a.task_receiver = #{aid} group by a.task_receiver)x
     left join (select aid,sum(if(a.`type` in (0,1,2),1,0)) countPublicRelease,sum(if(a.`type` in (3),1,0)) countAssist
-        from public_release a left join public_release_details b on a.id=b.prid where aid= #{aid})y on x.aid=y.aid
+    from public_release a left join public_release_details b on a.id=b.prid where aid= #{aid})y on x.aid=y.aid
     left join (SELECT b.aid,count(DISTINCT a.order_no) countChange from new_order_change a
-        left join order_examine b on a.order_no =b.order_no where 1=1
+    left join order_examine b on a.order_no =b.order_no where 1=1
     <if test="type==2">
       and a.process_state in (3,4)
     </if>
@@ -1343,53 +1349,53 @@
     </if>
     and b.aid=#{aid} and b.status =0  group by b.aid)z on x.aid=z.aid
     LEFT join (select b.task_receiver aid, count(*) orderPayment from t_order_payment a
-        left join t_order_task b on a.tid=b.id left join t_order_new c on b.order_no=c.order_no
-        where b.task_receiver= #{aid} and a.status in(0,1,2) group by b.task_receiver )v on x.aid=v.aid
+    left join t_order_task b on a.tid=b.id left join t_order_new c on b.order_no=c.order_no
+    where b.task_receiver= #{aid} and a.status in(0,1,2) group by b.task_receiver )v on x.aid=v.aid
   </select>
   <select id="consultantStatisticsInfoByTime" resultType="com.goafanti.admin.bo.ConsultantStatisticsBo">
     select a.id,x.projectCount,x.inProgress,x.notStarted,y.complete,y.stop,z.countPublicRelease,z.countAssist
     from admin a left join (select a.task_receiver aid,sum(commodity_quantity) projectCount,
-        sum(if(a.project_status=1,commodity_quantity,0)) inProgress,
-        sum(if(a.project_status=0,commodity_quantity,0)) notStarted from t_order_task a  where a.split_status in (0,2)
-        and a.task_receiver = #{aid} and a.task_distribution_time BETWEEN #{startTime} and #{endTime} group by a.task_receiver )x on a.id=x.aid
-    left join (SELECT a.task_receiver aid,sum(if(a.project_status in (19,27) ,commodity_quantity,0)) complete,
-        sum(if(a.project_status in (2,3,29),commodity_quantity,0)) stop from t_order_task a left join task_time b on a.id=b.tid
-        where a.split_status in (0,2) and b.project_status =a.project_status and a.task_receiver = #{aid}
-        and b.date_time  BETWEEN #{startTime} and #{endTime} group by a.task_receiver )y on a.id=y.aid
-    left join (select aid,sum(if(a.`type` in (0,1,2),1,0)) countPublicRelease,sum(if(a.`type` in (3),1,0)) countAssist
-        from public_release a left join public_release_details b on a.id=b.prid where aid=  #{aid} and a.status =2
-        and a.release_start BETWEEN #{startTime} and #{endTime} group by a.aid)z on a.id=z.aid
+                                   sum(if(a.project_status=1,commodity_quantity,0)) inProgress,
+                                   sum(if(a.project_status=0,commodity_quantity,0)) notStarted from t_order_task a  where a.split_status in (0,2)
+                                                                                                                      and a.task_receiver = #{aid} and a.task_distribution_time BETWEEN #{startTime} and #{endTime} group by a.task_receiver )x on a.id=x.aid
+                 left join (SELECT a.task_receiver aid,sum(if(a.project_status in (19,27) ,commodity_quantity,0)) complete,
+                                   sum(if(a.project_status in (2,3,29),commodity_quantity,0)) stop from t_order_task a left join task_time b on a.id=b.tid
+                            where a.split_status in (0,2) and b.project_status =a.project_status and a.task_receiver = #{aid}
+                              and b.date_time  BETWEEN #{startTime} and #{endTime} group by a.task_receiver )y on a.id=y.aid
+                 left join (select aid,sum(if(a.`type` in (0,1,2),1,0)) countPublicRelease,sum(if(a.`type` in (3),1,0)) countAssist
+                            from public_release a left join public_release_details b on a.id=b.prid where aid=  #{aid} and a.status =2
+                                                                                                      and a.release_start BETWEEN #{startTime} and #{endTime} group by a.aid)z on a.id=z.aid
     where a.id=#{aid}
   </select>
   <select id="consultantthisMonthUser" resultType="com.goafanti.admin.bo.ConsultantUserCount">
     select x.dates,sum(projectCount)projectCount,sum(inProgress)inProgress,sum(notStarted)notStarted
          ,0 complete,0 stop,0 countPublicRelease,0 countAssist
     from (select commodity_quantity projectCount, if(a.project_status=1,commodity_quantity,0)inProgress,
-        if(a.project_status=0,commodity_quantity,0)notStarted,DATE_FORMAT(a.task_distribution_time,'%Y-%m-%d') dates
-        from t_order_task a  where a.split_status in (0,2) and a.task_receiver = #{aid}
-        and a.task_distribution_time BETWEEN #{firstDay} and #{endDay})x
+                 if(a.project_status=0,commodity_quantity,0)notStarted,DATE_FORMAT(a.task_distribution_time,'%Y-%m-%d') dates
+          from t_order_task a  where a.split_status in (0,2) and a.task_receiver = #{aid}
+                                 and a.task_distribution_time BETWEEN #{firstDay} and #{endDay})x
     group by x.dates
     union
     select x.dates,0 projectCount,0 inProgress,0 notStarted,sum(complete)complete,sum(stop)stop,0,0
     from (SELECT if(a.project_status in (19,27) ,commodity_quantity,0) complete,
-        if(a.project_status in (2,3,29),commodity_quantity,0) stop ,DATE_FORMAT(b.date_time ,'%Y-%m-%d') dates
-        from t_order_task a left join task_time b on a.id=b.tid
-        where a.split_status in (0,2) and b.project_status =a.project_status
-        and a.task_receiver = #{aid} and b.date_time  BETWEEN #{firstDay} and #{endDay})x
+                 if(a.project_status in (2,3,29),commodity_quantity,0) stop ,DATE_FORMAT(b.date_time ,'%Y-%m-%d') dates
+          from t_order_task a left join task_time b on a.id=b.tid
+          where a.split_status in (0,2) and b.project_status =a.project_status
+            and a.task_receiver = #{aid} and b.date_time  BETWEEN #{firstDay} and #{endDay})x
     group by x.dates
     union
     select x.dates,0,0,0,0,0,sum(countPublicRelease)countPublicRelease,sum(countAssist)countAssist
     from ( select if(a.`type` in (0,1,2),1,0) countPublicRelease,if(a.`type` in (3),1,0) countAssist,
-        DATE_FORMAT(a.release_start ,'%Y-%m-%d') dates
-    from public_release a left join public_release_details b on a.id=b.prid where aid= #{aid}
-    and a.status =2
-    and a.release_start  BETWEEN #{firstDay} and #{endDay})x
+                  DATE_FORMAT(a.release_start ,'%Y-%m-%d') dates
+           from public_release a left join public_release_details b on a.id=b.prid where aid= #{aid}
+                                                                                     and a.status =2
+                                                                                     and a.release_start  BETWEEN #{firstDay} and #{endDay})x
     group by x.dates
   </select>
   <select id="selectOrderByFinanace" resultType="com.goafanti.common.model.Admin">
     select c.id,c.name
     from t_order_new a left join department b on a.order_dep=b.id
-    left join admin c on b.finance_id=c.id
+                       left join admin c on b.finance_id=c.id
     where a.order_no =#{orderNo};
   </select>
   <select id="selectAdminByRoleTypes" resultType="com.goafanti.common.model.Admin">
@@ -1402,24 +1408,24 @@
       #{e}
     </foreach>
   </select>
-    <select id="financeInfo" resultType="com.goafanti.admin.bo.OutFinanceCount">
-      select x.aid,x.orderCount,x.expenseCount,x.invoiceCount,x.memberCount,x.paymentCount,b.counts publicCount,y.orderUnauditedCount,
-             c.counts receivables,y.expenseUnauditedCount,y.invoiceUnauditedCount,y.memberUnauditedCount,y.paymentUnauditedCount
-      from ( select a.aid,sum(a.order_count)orderCount ,sum(a.expense_count)expenseCount ,SUM(a.invoice_count) invoiceCount,
-            sum(a.member_count) memberCount ,sum(a.payment_count)paymentCount from finance_count a where a.aid= #{aid} )x
-      left join(select aid,sum(if(a.`type` in (0,1,2),1,0)) counts from public_release a left join public_release_details b on a.id=b.prid
-          where a.status=2 and  a.aid= #{aid} )b  on x.aid=b.aid
-      left join (SELECT c.finance_id aid,sum(a.money) counts from new_order_dun a left join t_order_new b on a.order_no =b.order_no
-            left join department c on b.order_dep =c.id where a.status =1   and b.delete_sign in (0,2,3) and c.finance_id = #{aid} )c on x.aid=c.aid
-      left join (select a.aid,sum(a.order_unaudited_count)orderUnauditedCount , sum(a.expense_unaudited_count)expenseUnauditedCount ,
-            SUM(a.invoice_unaudited_count) invoiceUnauditedCount, sum(a.member_unaudited_count) memberUnauditedCount ,
-            sum(a.payment_unaudited_count)paymentUnauditedCount from finance_count a where a.aid= #{aid}
-            and a.date_time BETWEEN #{startTime}  and #{endTime} group by a.aid)y on x.aid=y.aid
-    </select>
+  <select id="financeInfo" resultType="com.goafanti.admin.bo.OutFinanceCount">
+    select x.aid,x.orderCount,x.expenseCount,x.invoiceCount,x.memberCount,x.paymentCount,b.counts publicCount,y.orderUnauditedCount,
+           c.counts receivables,y.expenseUnauditedCount,y.invoiceUnauditedCount,y.memberUnauditedCount,y.paymentUnauditedCount
+    from ( select a.aid,sum(a.order_count)orderCount ,sum(a.expense_count)expenseCount ,SUM(a.invoice_count) invoiceCount,
+                  sum(a.member_count) memberCount ,sum(a.payment_count)paymentCount from finance_count a where a.aid= #{aid} )x
+           left join(select aid,sum(if(a.`type` in (0,1,2),1,0)) counts from public_release a left join public_release_details b on a.id=b.prid
+                     where a.status=2 and  a.aid= #{aid} )b  on x.aid=b.aid
+           left join (SELECT c.finance_id aid,sum(a.money) counts from new_order_dun a left join t_order_new b on a.order_no =b.order_no
+                                                                                       left join department c on b.order_dep =c.id where a.status =1   and b.delete_sign in (0,2,3) and c.finance_id = #{aid} )c on x.aid=c.aid
+           left join (select a.aid,sum(a.order_unaudited_count)orderUnauditedCount , sum(a.expense_unaudited_count)expenseUnauditedCount ,
+                             SUM(a.invoice_unaudited_count) invoiceUnauditedCount, sum(a.member_unaudited_count) memberUnauditedCount ,
+                             sum(a.payment_unaudited_count)paymentUnauditedCount from finance_count a where a.aid= #{aid}
+                                                                                                        and a.date_time BETWEEN #{startTime}  and #{endTime} group by a.aid)y on x.aid=y.aid
+  </select>
   <select id="financeCountRangeReceivables" resultType="java.math.BigDecimal">
     SELECT  ifnull(sum(a.money),0)  receivables
     from new_order_dun a left join t_order_new b on a.order_no =b.order_no
-        left join department c on b.order_dep =c.id
+                         left join department c on b.order_dep =c.id
     where a.status =1   and b.delete_sign in (0,2,3)
       and c.finance_id = #{aid}
       and a.start_time  between #{startTime} and #{endTime}
@@ -1430,7 +1436,7 @@
     from new_order_change a left join t_order_new b on a.order_no =b.order_no
                             left join department c on b.order_dep =c.id
     where a.process_state in (6,8,9) and a.status in(1,2) and b.delete_sign in (0,2,3)
-    and  c.finance_id = #{aid}
+      and  c.finance_id = #{aid}
 
   </select>
   <select id="selectFinanceReceivablesCount" resultType="java.math.BigDecimal">

+ 67 - 14
src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml

@@ -27,13 +27,18 @@
     <result column="approval" jdbcType="INTEGER" property="approval" />
     <result column="approval_aid" jdbcType="VARCHAR" property="approvalAid" />
     <result column="expense_finance_id" jdbcType="VARCHAR" property="expenseFinanceId" />
-    <result column="expense_retrial_finance_id" jdbcType="VARCHAR" property="expenseRetrialFinanceId" />
+    <result column="expense_retrial_finance_examine" jdbcType="INTEGER" property="expenseRetrialFinanceExamine" />
+    <result column="ceo_examine" jdbcType="INTEGER" property="ceoExamine" />
+    <result column="cfo_examine" jdbcType="INTEGER" property="cfoExamine" />
+    <result column="vice_ceo_examine" jdbcType="INTEGER" property="viceCeoExamine" />
+    <result column="cashier_examine" jdbcType="INTEGER" property="cashierExamine" />
   </resultMap>
   <sql id="Base_Column_List">
     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_id
+    approval, approval_aid, expense_finance_id, expense_retrial_finance_examine, ceo_examine,
+    cfo_examine, vice_ceo_examine, cashier_examine
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select
@@ -54,7 +59,9 @@
       hide_sign, lvl, current_amount,
       subordinate_amount, total_amount, retrial_finance_id,
       approval, approval_aid, expense_finance_id,
-      expense_retrial_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},
@@ -63,7 +70,9 @@
       #{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},
-      #{expenseRetrialFinanceId,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 into department
@@ -140,8 +149,20 @@
       <if test="expenseFinanceId != null">
         expense_finance_id,
       </if>
-      <if test="expenseRetrialFinanceId != null">
-        expense_retrial_finance_id,
+      <if test="expenseRetrialFinanceExamine != null">
+        expense_retrial_finance_examine,
+      </if>
+      <if test="ceoExamine != null">
+        ceo_examine,
+      </if>
+      <if test="cfoExamine != null">
+        cfo_examine,
+      </if>
+      <if test="viceCeoExamine != null">
+        vice_ceo_examine,
+      </if>
+      <if test="cashierExamine != null">
+        cashier_examine,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -217,8 +238,20 @@
       <if test="expenseFinanceId != null">
         #{expenseFinanceId,jdbcType=VARCHAR},
       </if>
-      <if test="expenseRetrialFinanceId != null">
-        #{expenseRetrialFinanceId,jdbcType=VARCHAR},
+      <if test="expenseRetrialFinanceExamine != null">
+        #{expenseRetrialFinanceExamine,jdbcType=INTEGER},
+      </if>
+      <if test="ceoExamine != null">
+        #{ceoExamine,jdbcType=INTEGER},
+      </if>
+      <if test="cfoExamine != null">
+        #{cfoExamine,jdbcType=INTEGER},
+      </if>
+      <if test="viceCeoExamine != null">
+        #{viceCeoExamine,jdbcType=INTEGER},
+      </if>
+      <if test="cashierExamine != null">
+        #{cashierExamine,jdbcType=INTEGER},
       </if>
     </trim>
   </insert>
@@ -297,8 +330,20 @@
       <if test="expenseFinanceId != null">
         expense_finance_id = #{expenseFinanceId,jdbcType=VARCHAR},
       </if>
-      <if test="expenseRetrialFinanceId != null">
-        expense_retrial_finance_id = #{expenseRetrialFinanceId,jdbcType=VARCHAR},
+      <if test="expenseRetrialFinanceExamine != null">
+        expense_retrial_finance_examine = #{expenseRetrialFinanceExamine,jdbcType=INTEGER},
+      </if>
+      <if test="ceoExamine != null">
+        ceo_examine = #{ceoExamine,jdbcType=INTEGER},
+      </if>
+      <if test="cfoExamine != null">
+        cfo_examine = #{cfoExamine,jdbcType=INTEGER},
+      </if>
+      <if test="viceCeoExamine != null">
+        vice_ceo_examine = #{viceCeoExamine,jdbcType=INTEGER},
+      </if>
+      <if test="cashierExamine != null">
+        cashier_examine = #{cashierExamine,jdbcType=INTEGER},
       </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
@@ -329,9 +374,16 @@
       approval = #{approval,jdbcType=INTEGER},
       approval_aid = #{approvalAid,jdbcType=VARCHAR},
       expense_finance_id = #{expenseFinanceId,jdbcType=VARCHAR},
-      expense_retrial_finance_id = #{expenseRetrialFinanceId,jdbcType=VARCHAR}
+      expense_retrial_finance_examine = #{expenseRetrialFinanceExamine,jdbcType=INTEGER},
+      ceo_examine = #{ceoExamine,jdbcType=INTEGER},
+      cfo_examine = #{cfoExamine,jdbcType=INTEGER},
+      vice_ceo_examine = #{viceCeoExamine,jdbcType=INTEGER},
+      cashier_examine = #{cashierExamine,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+
+
+
   <select id="selectOrganizationList" parameterType="java.lang.String" resultType="com.goafanti.organization.bo.OrganizationListOut">
     select
     om.id,om.create_id as createId,om.create_time as createTime,
@@ -439,12 +491,13 @@
     select a.id, a.create_id as createId, a.create_time as createTime, a.update_time as updateTime,a.retrial_finance_id retrialFinanceId,
            d.name retrialFinanceName, a.deleted_sign as deletedSign, a.name, a.type, a.manager_id as managerId, a.dep_no as depNo,
            a.super_id as superId, a.remarks, a.status, a.abbreviation, a.finance_id financeId,a.hide_sign hideSign,
-           a.expense_finance_id expenseFinanceId,f.name expenseFinanceName,a.expense_retrial_finance_id expenseRetrialFinanceId,
-           g.name expenseRetrialFinanceName, a.province, c.name financeName, a.working_hours_type workingHoursType, b.name as managerName,
+           a.expense_finance_id expenseFinanceId,f.name expenseFinanceName,a.expense_retrial_finance_examine expenseRetrialFinanceExamine,
+           a.ceo_examine ceoExamine,a.cfo_examine cfoExamine ,a.vice_ceo_examine viceCeoExamine,a.cashier_examine cashierExamine,
+           a.province, c.name financeName, a.working_hours_type workingHoursType, b.name as managerName,
            a.retrial_finance_id retrialFinanceId, d.name retrialFinanceName,a.approval,a.approval_aid approvalAid,e.name approvalName
     from department a left join admin b on a.manager_id = b.id left join admin c on a.finance_id = c.id
                       left join admin d on a.retrial_finance_id=d.id left join admin e on a.approval_aid =e.id
-                      left join admin f on a.expense_finance_id=f.id left join admin g on a.expense_retrial_finance_id=g.id
+                      left join admin f on a.expense_finance_id=f.id
     where a.id=#{id,jdbcType=VARCHAR}
   </select>
   <delete id="deleteById" parameterType="java.lang.String">

+ 18 - 0
src/main/java/com/goafanti/common/mapper/ExpenseAccountExamineMapper.xml

@@ -23,6 +23,7 @@
     delete from expense_account_examine
     where id = #{id,jdbcType=INTEGER}
   </delete>
+
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountExamine" useGeneratedKeys="true">
     insert into expense_account_examine (eaid, process_status, `status`,
       auditor, auditorName, create_time
@@ -126,6 +127,12 @@
       <if test="aid != null">
         and auditor= #{aid}
       </if>
+    <if test="type==0">
+      and process_status &lt; 8
+    </if>
+    <if test="type==1">
+      and process_status = 8
+    </if>
   </update>
 
   <select id="selectByEaidAndProcessStatus" parameterType="java.lang.Integer" resultMap="BaseResultMap">
@@ -144,4 +151,15 @@
     group by process_status
   </select>
 
+    <delete id="deleteByEaid">
+    delete from expense_account_examine
+    where eaid = #{id,jdbcType=INTEGER}
+  </delete>
+
+  <select id="selectYesByParam" resultType="java.lang.Integer">
+    select count(*)
+    from expense_account_examine
+    where status =1 and auditor = #{aid}
+      and eaid = #{id}
+  </select>
 </mapper>

+ 17 - 3
src/main/java/com/goafanti/common/mapper/ExpenseAccountLogMapper.xml

@@ -75,6 +75,7 @@
       </if>
     </trim>
   </insert>
+
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseAccountLog">
     update expense_account_log
     <set>
@@ -113,11 +114,11 @@
 
     <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
+           date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,a.create_time createTime
     from expense_account_log a left join admin b on a.auditor =b.id
     where a.eaid= #{eaid}
-    order by a.create_time
-  </select>
+    order by a.create_time,process_status
+    </select>
   <update id="updateUseLogByUseId" parameterType="java.lang.Integer">
     update expense_account_log
     set eaid = #{id}
@@ -127,4 +128,17 @@
     delete from expense_account_log
     where eaid = #{id,jdbcType=INTEGER}
   </delete>
+
+
+  <insert id="insertBatch" >
+    insert into expense_account_log (eaid, process_status, `status`,
+                                     remarks, auditor, create_time
+    )
+    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}
+           )
+        </foreach>
+  </insert>
 </mapper>

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

@@ -34,13 +34,14 @@
     <result column="secondary_type" jdbcType="INTEGER" property="secondaryType" />
     <result column="secondary_type_other" jdbcType="VARCHAR" property="secondaryTypeOther" />
     <result column="amount" jdbcType="DECIMAL" property="amount" />
+    <result column="approval" jdbcType="INTEGER" property="approval" />
   </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, settlement_amount, debit_id,
     target_type, liquidation_status, remarks, check_no, expense_main, real_amount, secondary_type,
-    secondary_type_other, amount
+    secondary_type_other, amount, approval
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -63,7 +64,7 @@
       debit_id, target_type, liquidation_status,
       remarks, check_no, expense_main,
       real_amount, secondary_type, secondary_type_other,
-      amount)
+      amount, approval)
     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},
@@ -74,7 +75,7 @@
       #{debitId,jdbcType=INTEGER}, #{targetType,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
       #{remarks,jdbcType=VARCHAR}, #{checkNo,jdbcType=VARCHAR}, #{expenseMain,jdbcType=INTEGER},
       #{realAmount,jdbcType=DECIMAL}, #{secondaryType,jdbcType=INTEGER}, #{secondaryTypeOther,jdbcType=VARCHAR},
-      #{amount,jdbcType=DECIMAL})
+      #{amount,jdbcType=DECIMAL}, #{approval,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccount" useGeneratedKeys="true">
     insert into expense_account
@@ -172,6 +173,9 @@
       <if test="amount != null">
         amount,
       </if>
+      <if test="approval != null">
+        approval,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="prid != null">
@@ -267,6 +271,9 @@
       <if test="amount != null">
         #{amount,jdbcType=DECIMAL},
       </if>
+      <if test="approval != null">
+        #{approval,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseAccount">
@@ -365,6 +372,9 @@
       <if test="amount != null">
         amount = #{amount,jdbcType=DECIMAL},
       </if>
+      <if test="approval != null">
+        approval = #{approval,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -400,7 +410,8 @@
       real_amount = #{realAmount,jdbcType=DECIMAL},
       secondary_type = #{secondaryType,jdbcType=INTEGER},
       secondary_type_other = #{secondaryTypeOther,jdbcType=VARCHAR},
-      amount = #{amount,jdbcType=DECIMAL}
+      amount = #{amount,jdbcType=DECIMAL},
+      approval = #{approval,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -408,16 +419,16 @@
   <sql id="selectDtailsSql">
     a.id, a.prid, a.order_no orderNo, o.contract_no contractNo ,tm.buyer_name buyerName, a.aid, a.aname, a.`type`,
         a.type_other typeOther , a.status,a.process_status processStatus,a.total_amount totalAmount,a.debit_id debitId,
-        a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,
+        a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,a.approval,
         a.user_names userNames,a.create_time, a.release_start,a.release_end, a.duration,b.name applyDepName,a.amount,
         c.name payDepName,d.name ,d.bank ,d.accounts ,a.settlement_amount settlementAmount,a.secondary_type secondaryType,
         a.liquidation_status liquidationStatus, a.remarks,a.check_no checkNo,a.secondary_type_other secondaryTypeOther,
-        a.create_time createTime, 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,pr.type publicReleaseType,
         date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStartStr,
         date_format(a.release_end,'%Y-%m-%d %H:%i:%S')releaseEndStr
         FROM expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
     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
+    left join t_order_mid tm on a.order_no =tm.order_no left join public_release pr on a.prid=pr.id
   </sql>
   <select id="selectByid" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
     SELECT
@@ -481,7 +492,7 @@
     </if>
   </select>
   <sql id="selectExpenseAccountSql">
-    where 1=1 and a.status &lt; 4
+    where 1=1
     <if test="processStatus ==1">
       and a.process_status>0
       <if test="examineStatus ==1">
@@ -695,22 +706,21 @@
 
 
   <select id="selectByMainId" resultMap="MainMap">
-    select b.id,b.check_no,b.total_amount,b.amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,b.real_amount,b.type_other ,b.aid,
+    select b.id,b.check_no,b.total_amount,b.amount,b.aname,b.apply_dep,b.pay_dep,b.real_amount,b.type_other ,b.aid,
            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 sonTotalAmount,c.settlement_amount sonSettlementAmount,c.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,c.real_amount sonRealAmount,
+           c.duration,pr.plan,c.real_amount sonRealAmount,o.order_no,o.contract_no,pr.type publicReleaseType,
            c.debit_id debitId, debit.real_amount DebitRealAmount ,debit.settlement_amount DebitSettlementAmount,debit.liquidation_status DebitliquidationStatus,
            d.id detId,d.`type` detType,d.amount detAmount,d.real_amount detRealAmount ,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.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
+    from expense_relationship a left join expense_account b on a.id =b.id left join expense_account c on a.ea_id =c.id
     left join department dep on b.apply_dep =dep.id left join department dep2 on b.pay_dep =dep2.id
-    left join t_order_new o on b.order_no =o.order_no left join expense_account_private eap on b.eaaid =eap.id
-    left join expense_account c on a.ea_id =c.id left join expense_account_details d on c.id =d.eaid
-    left join public_release pr on c.prid=pr.id left join t_order_new pro on pr.order_no=pro.order_no
+     left join expense_account_private eap on b.eaaid =eap.id left join expense_account_details d on c.id =d.eaid
+    left join t_order_new o on c.order_no =o.order_no left join public_release pr on c.prid=pr.id left join t_order_new pro on pr.order_no=pro.order_no
     left join expense_account debit on c.debit_id=debit.id
     where a.id= #{id}
   </select>
@@ -731,8 +741,6 @@
     <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
     <result column="real_amount" jdbcType="DECIMAL" property="realAmount" />
     <result column="amount" jdbcType="DECIMAL" property="amount" />
-    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
-    <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
     <result column="aname" jdbcType="VARCHAR" property="aname" />
     <result column="apply_dep" jdbcType="VARCHAR" property="applyDep" />
     <result column="pay_dep" jdbcType="VARCHAR" property="payDep" />
@@ -752,6 +760,7 @@
 
   <resultMap id="SonExpenseAccountMap" type="com.goafanti.expenseAccount.bo.SonExpenseAccount">
     <id column="sonId" jdbcType="INTEGER" property="id" />
+    <result column="prid" jdbcType="INTEGER" property="prid" />
     <result column="sonTotalAmount" jdbcType="DECIMAL" property="totalAmount" />
     <result column="sonSettlementAmount" jdbcType="DECIMAL" property="settlementAmount" />
     <result column="sonRealAmount" jdbcType="DECIMAL" property="realAmount" />
@@ -767,11 +776,13 @@
     <result column="districtName" jdbcType="VARCHAR" property="districtName" />
     <result column="duration" jdbcType="VARCHAR" property="duration" />
     <result column="plan" jdbcType="VARCHAR" property="plan" />
-    <result column="sonContractNo" jdbcType="VARCHAR" property="contractNo" />
     <result column="debitId" jdbcType="INTEGER" property="debitId" />
     <result column="debitRealAmount" jdbcType="DECIMAL" property="debitRealAmount" />
     <result column="debitSettlementAmount" jdbcType="DECIMAL" property="debitSettlementAmount" />
     <result column="debitLiquidationStatus" jdbcType="INTEGER" property="debitLiquidationStatus" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
+    <result column="publicReleaseType" jdbcType="INTEGER" property="publicReleaseType" />
     <association property="detList" resultMap="ExpenseAccountDetailsMap"></association>
   </resultMap>
 
@@ -850,9 +861,12 @@
       left join department dep2 on b.pay_dep =dep2.id left join t_order_new o on b.order_no =o.order_no
       left join admin ad on b.aid=ad.id
       left join department adDep on ad.department_id=adDep.id
-    <if test="roleType == 1">
-      inner join (select eaid ,auditor,min(process_status)`type` from expense_account_examine
-      where auditor= #{aid} group by eaid) eae on b.id=eae.eaid
+    <if test="roleType > 0">
+      inner join (select eaid ,auditor,min(process_status)`type`,status from expense_account_examine
+      where auditor= #{aid}
+      <if test="listStatus ==0"> and status=0 </if>
+      <if test="listStatus ==1"> and status=1 </if>
+      group by eaid) eae on b.id=eae.eaid
     </if>
     <if test="username !=null">
       left join expense_relationship er on er.id=b.id
@@ -879,33 +893,15 @@
         and b.status =2
       </if>
     </if>
-    <if test="roleType == 1">
-      <if test="listStatus ==0">
-        and b.process_status =eae.type
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status &gt; eae.type
-      </if>
-    </if>
-    <if test="roleType == 3">
-      <if test="listStatus ==0">
-        and b.process_status =3
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status &gt; 3
-      </if>
-      and adDep.finance_id = #{aid}
-    </if>
-    <if test="roleType == 5">
-      <if test="listStatus ==0">
-        and b.process_status =5 and b.status=1
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status =5 and b.status=2
-      </if>
-    </if>
-    <if test="roleType == 5">
-      and adDep.finance_id  in (select id from admin where superior_id = #{aid})
+    <if test="roleType > 0">
+          <if test="listStatus ==0">
+            and b.process_status =eae.type
+            and eae.status=0
+          </if>
+          <if test="listStatus ==1">
+            and b.process_status &gt;= eae.type
+            and eae.status=1
+          </if>
     </if>
     <if test="startTime !=null and endTime !=null ">
       and b.create_time between #{startTime} and #{endTime}
@@ -922,9 +918,12 @@
     left join expense_account ea2 on ea2.id=er.ea_id
   </if>
     left join admin ad on b.aid=ad.id left join department adDep on ad.department_id=adDep.id
-    <if test="roleType == 1">
-      inner join (select eaid ,auditor,min(process_status)`type` from expense_account_examine
-      where auditor= #{aid} group by eaid) eae on b.id=eae.eaid
+    <if test="roleType > 0">
+      inner join (select eaid ,auditor,min(process_status)`type`,status from expense_account_examine
+      where auditor= #{aid}
+      <if test="listStatus ==0"> and status=0 </if>
+      <if test="listStatus ==1"> and status=1 </if>
+      group by eaid) eae on b.id=eae.eaid
     </if>
     <include refid="ExpenseMainSql"/>
   </select>
@@ -934,7 +933,8 @@
   <select id="ExpenseDetailsList" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountDetailsList">
     select mea.check_no checkNo ,ead.`type`,ead.type_other typeOther,
            ead.amount ,ead.real_amount realAmount ,o.contract_no contractNo ,dep.name applyDepName,
-    dep2.name payDepName ,mea.aname ,ad2.name financeName,a.status ,mea.process_status processStatus ,mea.id mainId,mea.target_type targetType,
+    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,
     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
@@ -957,10 +957,10 @@
       </foreach>
     </if>
     <if test="roleType ==1">
-      and dep3.finance_id = #{aid}
+      and dep.expense_finance_id = #{aid}
     </if>
     <if test="roleType ==2">
-      and dep3.finance_id in  (select id from admin where superior_id = #{aid})
+      and dep.expense_finance_id in  (select id from admin where superior_id = #{aid})
     </if>
     <if test=" contractNo != null">
       and o.contract_no like concat('%',#{contractNo},'%')
@@ -1019,7 +1019,7 @@
   <select id="selectSonByMainIds" resultMap="MainMap">
     select b.id,
            c.id sonId,c.total_amount sonTotalAmount,c.settlement_amount sonSettlementAmount,c.amount sonAmount,c.real_amount sonRealAmount,
-           c.`type` sonType,c.type_other sonTypeOTher, c.user_names ,c.release_start ,c.release_end,
+           c.`type` sonType,c.type_other sonTypeOTher, c.user_names ,c.release_start ,c.release_end,c.prid,
            c.attachment_url attachmentUrl,c.secondary_type,c.secondary_type_other
     from expense_relationship a
            left join expense_account b on a.id =b.id

+ 107 - 0
src/main/java/com/goafanti/common/mapper/ExpenseConfigDetailsMapper.xml

@@ -0,0 +1,107 @@
+<?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.ExpenseConfigDetailsMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ExpenseConfigDetails">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="dep_id" jdbcType="VARCHAR" property="depId" />
+    <result column="admin_name" jdbcType="VARCHAR" property="adminName" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, `type`, aid, dep_id, admin_name, create_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from expense_config_details
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from expense_config_details
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseConfigDetails" useGeneratedKeys="true">
+    insert into expense_config_details (`type`, aid, dep_id,
+      admin_name, create_time)
+    values (#{type,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{depId,jdbcType=VARCHAR},
+      #{adminName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseConfigDetails" useGeneratedKeys="true">
+    insert into expense_config_details
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="depId != null">
+        dep_id,
+      </if>
+      <if test="adminName != null">
+        admin_name,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="depId != null">
+        #{depId,jdbcType=VARCHAR},
+      </if>
+      <if test="adminName != null">
+        #{adminName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseConfigDetails">
+    update expense_config_details
+    <set>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="depId != null">
+        dep_id = #{depId,jdbcType=VARCHAR},
+      </if>
+      <if test="adminName != null">
+        admin_name = #{adminName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ExpenseConfigDetails">
+    update expense_config_details
+    set `type` = #{type,jdbcType=INTEGER},
+      aid = #{aid,jdbcType=VARCHAR},
+      dep_id = #{depId,jdbcType=VARCHAR},
+      admin_name = #{adminName,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+
+
+  <select id="selectByDepId"   resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from expense_config_details
+    where dep_id = #{id}
+  </select>
+</mapper>

+ 11 - 3
src/main/java/com/goafanti/common/mapper/ExpenseRelationshipMapper.xml

@@ -10,12 +10,13 @@
     id, ea_id, create_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from expense_relationship
     where id = #{id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from expense_relationship
     where id = #{id,jdbcType=INTEGER}
   </delete>
@@ -68,4 +69,11 @@
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
-</mapper>
+
+  <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from expense_relationship
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+</mapper>

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

@@ -150,6 +150,11 @@ public class Admin extends BaseModel implements AftUser {
      */
     private String expenseOpenId;
 
+    /**
+     * 报销上级审核 0-不需要 ,1-需要
+     */
+    private Integer expenseSuperExamine;
+
     private static final long serialVersionUID = 1L;
 
 
@@ -430,4 +435,12 @@ public class Admin extends BaseModel implements AftUser {
     public void setExpenseOpenId(String expenseOpenId) {
         this.expenseOpenId = expenseOpenId;
     }
+
+    public Integer getExpenseSuperExamine() {
+        return expenseSuperExamine;
+    }
+
+    public void setExpenseSuperExamine(Integer expenseSuperExamine) {
+        this.expenseSuperExamine = expenseSuperExamine;
+    }
 }

+ 58 - 6
src/main/java/com/goafanti/common/model/Department.java

@@ -135,9 +135,29 @@ public class Department implements Serializable {
     private String expenseFinanceId;
 
     /**
-     * 报销财务复审审核人
+     * 财务复审 0-不需要 ,1-需要
      */
-    private String expenseRetrialFinanceId;
+    private Integer expenseRetrialFinanceExamine;
+
+    /**
+     * 董事长审核 0-不需要 ,1-需要
+     */
+    private Integer ceoExamine;
+
+    /**
+     * 财务总监出纳状态 0-不需要 ,1-需要
+     */
+    private Integer cfoExamine;
+
+    /**
+     * 公司副总出纳状态 0-不需要 ,1-需要
+     */
+    private Integer viceCeoExamine;
+
+    /**
+     * 出纳审核 0-不需要 ,1-需要
+     */
+    private Integer cashierExamine;
 
     private static final long serialVersionUID = 1L;
 
@@ -341,11 +361,43 @@ public class Department implements Serializable {
         this.expenseFinanceId = expenseFinanceId;
     }
 
-    public String getExpenseRetrialFinanceId() {
-        return expenseRetrialFinanceId;
+    public Integer getExpenseRetrialFinanceExamine() {
+        return expenseRetrialFinanceExamine;
+    }
+
+    public void setExpenseRetrialFinanceExamine(Integer expenseRetrialFinanceExamine) {
+        this.expenseRetrialFinanceExamine = expenseRetrialFinanceExamine;
+    }
+
+    public Integer getCeoExamine() {
+        return ceoExamine;
+    }
+
+    public void setCeoExamine(Integer ceoExamine) {
+        this.ceoExamine = ceoExamine;
+    }
+
+    public Integer getCfoExamine() {
+        return cfoExamine;
+    }
+
+    public void setCfoExamine(Integer cfoExamine) {
+        this.cfoExamine = cfoExamine;
+    }
+
+    public Integer getViceCeoExamine() {
+        return viceCeoExamine;
+    }
+
+    public void setViceCeoExamine(Integer viceCeoExamine) {
+        this.viceCeoExamine = viceCeoExamine;
+    }
+
+    public Integer getCashierExamine() {
+        return cashierExamine;
     }
 
-    public void setExpenseRetrialFinanceId(String expenseRetrialFinanceId) {
-        this.expenseRetrialFinanceId = expenseRetrialFinanceId;
+    public void setCashierExamine(Integer cashierExamine) {
+        this.cashierExamine = cashierExamine;
     }
 }

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

@@ -166,6 +166,11 @@ public class ExpenseAccount implements Serializable {
      */
     private BigDecimal amount;
 
+    /**
+     * 特批状态 0-非特批 ,1-特批
+     */
+    private Integer approval;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -423,4 +428,12 @@ public class ExpenseAccount implements Serializable {
     public void setAmount(BigDecimal amount) {
         this.amount = amount;
     }
+
+    public Integer getApproval() {
+        return approval;
+    }
+
+    public void setApproval(Integer approval) {
+        this.approval = approval;
+    }
 }

+ 93 - 0
src/main/java/com/goafanti/common/model/ExpenseConfigDetails.java

@@ -0,0 +1,93 @@
+package com.goafanti.common.model;
+
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.utils.Param;
+import org.hibernate.validator.constraints.NotEmpty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * expense_config_details
+ * @author
+ */
+public class ExpenseConfigDetails implements Serializable {
+    private Integer id;
+
+    /**
+     * 1=财务复审,2=董事长审核,3=财务总监,4=集团副总,5=出纳
+     */
+    private Integer type;
+
+    /**
+     * 管理员编号
+     */
+    @NotEmpty(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    @Param(name = "管理员编号")
+    private String aid;
+
+    /**
+     * 部门编号
+     */
+    private String depId;
+
+    /**
+     * 管理员名称编号牌
+     */
+    private String adminName;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 4 - 4
src/main/java/com/goafanti/common/utils/Param.java

@@ -1,11 +1,11 @@
 package com.goafanti.common.utils;
 
 import com.goafanti.common.constant.ErrorConstants;
-import org.springframework.context.annotation.Import;
 
-import javax.validation.Payload;
-import javax.validation.constraints.NotNull;
-import java.lang.annotation.*;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.FIELD)

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

@@ -4,12 +4,21 @@ import java.util.HashMap;
 import java.util.Map;
 
 public enum EAsecondaryTypes {
+//    0=其他,1=交通费,2=住宿费,3=市内车费,4=餐费,5=出差补贴,6=预借支,7=油费
+//     * 8=招待费,9=办公费,10=福利费,11=物业水电费,12=打印费
+    JTF(1,"交通费"),
+    ZSF(2,"住宿费"),
+    SNCF(3,"市内车费"),
+    CF(4,"餐费"),
+    CCBT(5,"出差补贴"),
+    YJZ(6,"预借支"),
+    YF(7,"油费"),
     ZDF(8,"招待费"),
     BGF(9,"办公费"),
     FLF(10,"福利费"),
     WYSDF(11,"物业水电费"),
     DYF(12,"打印费"),
-    QT(13,"其他");
+    QT(0,"其他");
 
     private Integer code;
     private String desc;

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

@@ -19,6 +19,15 @@ public class OutExpenseAccount extends ExpenseAccount {
     private String bank;
     private String accounts;
     private Integer examine;
+    private Integer publicReleaseType;
+
+    public Integer getPublicReleaseType() {
+        return publicReleaseType;
+    }
+
+    public void setPublicReleaseType(Integer publicReleaseType) {
+        this.publicReleaseType = publicReleaseType;
+    }
 
     public Integer getExamine() {
         return examine;

+ 30 - 7
src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountBo.java

@@ -1,37 +1,60 @@
 package com.goafanti.expenseAccount.bo;
 
+import com.goafanti.common.utils.excel.Excel;
+
 import java.math.BigDecimal;
 
 public class OutExpenseAccountBo {
     private Integer id;
-    private BigDecimal totalAmount;
     private BigDecimal amount;
     private Integer type;
+    @Excel(name = "类型")
     private String typeOther;
+    @Excel(name = "报销金额", scale = 2)
+    private BigDecimal totalAmount;
+    @Excel(name = "实报金额", scale = 2)
+    private BigDecimal realAmount;
+    @Excel(name = "报销编号")
+    private String checkNo;
+    @Excel(name = "报销至订单")
+    private String targetName;
+    private String depName;
     private Integer secondaryType;
     private String secondaryTypeOther;
     private Integer processStatus;
     private Integer eaeType;
     private String examineName;
-    private String createTimeStr;
+    @Excel(name = "报销人")
     private String aname;
+    @Excel(name = "财务负责人")
+    private String financeName;
+    @Excel(name = "状态",readConverterExp = "0=草稿,1=审核中,2=完成,3=驳回,4=删除")
+    private Integer status;
+    @Excel(name = "申请公司")
     private String applyDepName;
+    @Excel(name = "支付公司")
     private String payDepName;
-    private Integer status;
+    @Excel(name = "报销时间")
+    private String createTimeStr;
     private Integer targetType;
     private String  releaseStartStr;
     private String releaseEndStr;
     private Integer mainId;
 
     private String contractNo;
-    private String checkNo;
     private String userNames;
     private String buyerName;
-    private String depName;
-    private String financeName;
+
     private String attachmentUrl;
     private Integer examine;
-    private BigDecimal realAmount;
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
 
     public BigDecimal getAmount() {
         return amount;

+ 64 - 13
src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountDetailsList.java

@@ -1,52 +1,70 @@
 package com.goafanti.expenseAccount.bo;
 
+import com.goafanti.common.utils.excel.Excel;
+
 import java.math.BigDecimal;
 
 public class OutExpenseAccountDetailsList {
 
-    /**
-     * 报销查询编号
-     */
-    private String checkNo;
+
     /**
      * 0=其他,1=交通费,2=住宿费,3=市内车费,4=餐费,5=出差补贴,6=预借支,7=油费
      * 8=招待费,9=办公费,10=福利费,11=物业水电费,12=打印费
      */
     private Integer type;
+    @Excel(name = "类型")
     private String  typeOther;
+    private Integer sonId;
+    private Integer sonType;
+    private String  sonTypeOther;
     /**
      * 金额
      */
+    @Excel(name = "报销金额", scale = 2)
     private BigDecimal amount;
     /**
      * 实付金额
      */
+    @Excel(name = "实报金额", scale = 2)
     private BigDecimal realAmount;
     /**
-     * 合同编号
-     */
-    private String contractNo;
-    /**
-     * 申请公司
+     * 报销查询编号
      */
-    private String applyDepName;
+    @Excel(name = "报销编号")
+    private String checkNo;
+    @Excel(name = "报销至订单")
+    private String targetName;
     /**
-     * 支付公司
+     * 合同编号
      */
-    private String payDepName;
+    private String contractNo;
+
     /**
      * 申请人
      */
+    @Excel(name = "报销人")
     private String aname;
     /**
      * 财富负责人
      */
+    @Excel(name = "财务负责人")
     private String financeName;
     /**
      * 状态 0=草稿,1=审核中,2=完成,3=驳回 ,4=撤销
      */
+    @Excel(name = "状态",readConverterExp = "0=草稿,1=审核中,2=完成,3=驳回,4=删除")
     private Integer status;
     /**
+     * 申请公司
+     */
+    @Excel(name = "申请公司")
+    private String applyDepName;
+    /**
+     * 支付公司
+     */
+    @Excel(name = "支付公司")
+    private String payDepName;
+    /**
      * 流程状态 0=巴员发起,1=上级审核,2=财务审核,3=总经理审核,4=董事长审核
      */
     private Integer processStatus;
@@ -61,10 +79,27 @@ public class OutExpenseAccountDetailsList {
     /**
      * 创建时间
      */
+    @Excel(name = "报销时间")
     private String createTimeStr;
     private Integer targetType;
 
-    public String  getTypeOther() {
+    public Integer getSonId() {
+        return sonId;
+    }
+
+    public void setSonId(Integer sonId) {
+        this.sonId = sonId;
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+
+    public String getTypeOther() {
         return typeOther;
     }
 
@@ -72,6 +107,22 @@ public class OutExpenseAccountDetailsList {
         this.typeOther = typeOther;
     }
 
+    public Integer getSonType() {
+        return sonType;
+    }
+
+    public void setSonType(Integer sonType) {
+        this.sonType = sonType;
+    }
+
+    public String getSonTypeOther() {
+        return sonTypeOther;
+    }
+
+    public void setSonTypeOther(String sonTypeOther) {
+        this.sonTypeOther = sonTypeOther;
+    }
+
     public Integer getTargetType() {
         return targetType;
     }

+ 15 - 0
src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountLog.java

@@ -22,4 +22,19 @@ public class OutExpenseAccountLog extends ExpenseAccountLog {
     public void setCreateTimeStr(String createTimeStr) {
         this.createTimeStr = createTimeStr;
     }
+
+    @Override
+    public boolean equals(Object obj) {
+        OutExpenseAccountLog log = new OutExpenseAccountLog();
+        if (obj instanceof OutExpenseAccountLog) {
+            log = (OutExpenseAccountLog) obj;
+        }
+        if (this.getProcessStatus()==log.getProcessStatus()
+            &&this.getStatus()==log.getStatus()
+            &&this.getAuditor().equals(log.getAuditor())
+            &&this.getCreateTime().getTime()==log.getCreateTime().getTime()) {
+            return true;
+        }
+        return false;
+    }
 }

+ 27 - 0
src/main/java/com/goafanti/expenseAccount/bo/SonExpenseAccount.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 public class SonExpenseAccount {
     private Integer id;
+    private Integer prid;
     private BigDecimal totalAmount;
     private BigDecimal settlementAmount;
     private BigDecimal amount;
@@ -21,12 +22,38 @@ public class SonExpenseAccount {
     private String duration;
     private String plan;
     private String contractNo;
+    private String orderNo;
     private Integer debitId;
+    private Integer publicReleaseType;
     private BigDecimal debitRealAmount;
     private BigDecimal debitSettlementAmount;
     private Integer debitLiquidationStatus;
     private List<SonExpenseAccountDetails> detList;
 
+    public Integer getPrid() {
+        return prid;
+    }
+
+    public void setPrid(Integer prid) {
+        this.prid = prid;
+    }
+
+    public Integer getPublicReleaseType() {
+        return publicReleaseType;
+    }
+
+    public void setPublicReleaseType(Integer publicReleaseType) {
+        this.publicReleaseType = publicReleaseType;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
     public Integer getDebitId() {
         return debitId;
     }

+ 54 - 1
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -10,6 +10,7 @@ import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.expenseAccount.bo.*;
 import com.goafanti.expenseAccount.service.ExpenseAccountService;
+import com.goafanti.organization.bo.OrganizationListOut;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.BindingResult;
@@ -52,6 +53,18 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+    /**
+     * 删除报销
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/delete",method = RequestMethod.POST)
+    public Result delete(String id){
+        Result res =new Result();
+        res.setData(expenseAccountService.delete(id));
+        return res;
+    }
+
 
     /**
      * 新增私有报销帐号
@@ -112,6 +125,19 @@ public class ExpenseAccountController extends CertifyApiController {
         res.setData(expenseAccountService.pageList(in));
         return res;
     }
+
+    /**
+     * 费用单列表导出
+     * @param in
+     * @return
+     */
+    @RequestMapping(value = "/pageListExport",method = RequestMethod.GET)
+    public Result pageListExport(InputPageListBo in ){
+        Result res =new Result();
+        in.setPageSize(999999);
+        res.setData(expenseAccountService.pageListExport(in));
+        return res;
+    }
     /**
      * 报销详情列表
      * @return
@@ -123,6 +149,18 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+    /**
+     * 费用详情列表导出
+     * @return
+     */
+    @RequestMapping(value = "/detailsListExport",method = RequestMethod.GET)
+    public Result detailsListExport(InputDetailsListBo in ){
+        Result res =new Result();
+        in.setPageSize(999999);
+        res.setData(expenseAccountService.detailsListExport(in));
+        return res;
+    }
+
 
 
 
@@ -350,12 +388,16 @@ public class ExpenseAccountController extends CertifyApiController {
      * @return
      */
     @RequestMapping(value = "/updateMain",method = RequestMethod.POST)
-    public Result updateMain(MainExpenseAccount in){
+    public Result updateMain( MainExpenseAccount in){
         Result res =new Result();
         if (in.getId()==null){
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
             return  res;
         }
+        if (in.getStatus()==1&&in.getEaaid()==null){
+            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"报销账号"));
+            return  res;
+        }
         return res.data(expenseAccountService.updateMain(in));
     }
 
@@ -390,4 +432,15 @@ public class ExpenseAccountController extends CertifyApiController {
         return null;
     }
 
+    /**
+     *  获取报销部门设置
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/getDepDetails",method = RequestMethod.GET)
+    public Result<OrganizationListOut> getDepDetails(Integer id){
+        Result res= new Result();
+        return res.data(expenseAccountService.getDepDetails(id));
+    }
+
 }

+ 50 - 0
src/main/java/com/goafanti/expenseAccount/controller/ExpenseConfigController.java

@@ -0,0 +1,50 @@
+package com.goafanti.expenseAccount.controller;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.ExpenseConfigDetails;
+import com.goafanti.common.utils.ParamUtils;
+import com.goafanti.expenseAccount.service.ExpenseConfigService;
+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;
+
+@RestController
+@RequestMapping("/api/admin/expenseConfig")
+public class ExpenseConfigController extends CertifyApiController {
+
+    @Autowired
+    private ExpenseConfigService expenseConfigService;
+
+    /**
+     * 新增报销配置人员
+     * @param details
+     * @return
+     */
+    @RequestMapping(value = "/addDeTails",method= RequestMethod.POST)
+    public Result add(@Validated ExpenseConfigDetails details, BindingResult bindingResult){
+        Result res =new Result();
+        if (bindingResult.hasErrors()) {
+            res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+                    ParamUtils.getParamName(details,bindingResult.getFieldError().getField())));
+            return res;
+        }
+        return  res.data(expenseConfigService.addDeTails(details));
+    }
+
+    /**
+     *  删除报销配置人员
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/deleteDeTails",method= RequestMethod.POST)
+    public Result deleteDeTails(Integer id){
+        Result res =new Result();
+        return res.data(expenseConfigService.deleteDeTails(id));
+    }
+
+
+}

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

@@ -1,6 +1,7 @@
 package com.goafanti.expenseAccount.service;
 
 import com.goafanti.common.model.ExpenseAccount;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.expenseAccount.bo.*;
 
 import java.math.BigDecimal;
@@ -23,7 +24,7 @@ public interface ExpenseAccountService {
 
     int updateExamine(InputExpenseAccount in);
 
-    Object pageList(InputPageListBo in);
+    Pagination<?> pageList(InputPageListBo in);
 
     Object selectByPrid(InputExpenseAccount in);
 
@@ -61,4 +62,12 @@ public interface ExpenseAccountService {
     void pushAll();
 
     Object updateDebitId(InputExpenseAccount in);
+
+    Object delete(String id);
+
+    Object pageListExport(InputPageListBo in);
+
+    Object detailsListExport(InputDetailsListBo in);
+
+    Object getDepDetails(Integer id);
 }

+ 12 - 0
src/main/java/com/goafanti/expenseAccount/service/ExpenseConfigService.java

@@ -0,0 +1,12 @@
+package com.goafanti.expenseAccount.service;
+
+import com.goafanti.common.model.ExpenseConfigDetails;
+
+public interface ExpenseConfigService {
+
+    Object addDeTails(ExpenseConfigDetails details);
+
+
+    Object deleteDeTails(Integer id);
+
+}

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

@@ -12,6 +12,7 @@ import com.goafanti.common.enums.NoticeTypes;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.*;
 import com.goafanti.common.utils.*;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -23,6 +24,7 @@ import com.goafanti.expenseAccount.bo.*;
 import com.goafanti.expenseAccount.service.ExpenseAccountService;
 import com.goafanti.organization.bo.OrganizationListOut;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
@@ -62,9 +64,13 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private DepartmentService departmentService;
     @Autowired
     private DepartmentMapper departmentMapper;
+    @Autowired
+    private ExpenseConfigDetailsMapper expenseConfigDetailsMapper;
 
 
 
+    @Value(value = "${upload.path}")
+    private final String	uploadPath			= null;
 
 
 
@@ -78,6 +84,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             in.setDistrictName(pr.getDistrictName());
             in.setUserNames(pr.getUserNames());
             in.setDuration(pr.getDuration());
+            if (in.getOrderNo()==null)in.setOrderNo(pr.getOrderNo());
         }
         //判断报销类型,0=固定费用,1=报销到订单
         if (in.getOrderNo()==null){
@@ -123,23 +130,21 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 eae.setAuditorname(examineName);
                 ea.setExamineName(examineName);
             }else if (i==2){
-                if (dep.getManagerId()==null|| StringUtils.isBlank(dep.getManagerId())){
-                    throw new BusinessException("报销申请部门管理员不存在。");
+                if (StringUtils.isBlank(dep.getManagerName())){
+                    throw new BusinessException("报销申请部门[管理员]不存在。");
                 }
                     eae.setAuditor(dep.getManagerId());
                     eae.setAuditorname(dep.getManagerName());
             }else if (i==3){
-                if (dep.getExpenseFinanceName()==null)throw new BusinessException("报销部门财务审核人不存在。");
+                if (StringUtils.isBlank(dep.getExpenseFinanceName()))throw new BusinessException("报销部门财务审核人不存在。");
                 eae.setAuditor(dep.getExpenseFinanceId());
                 eae.setAuditorname(dep.getExpenseFinanceName());
-            }else if (i==4){
-                eae.setAuditor(dep.getExpenseRetrialFinanceId());
-                eae.setAuditorname(dep.getExpenseRetrialFinanceName());
             }
-            if (eae.getAuditor().equals(aid))eae.setStatus(1);
-            else  eae.setStatus(0);
-            list.add(eae);
-
+            if (StringUtils.isNotEmpty(eae.getAuditor())){
+                if (eae.getAuditor().equals(aid))eae.setStatus(1);
+                else  eae.setStatus(0);
+                list.add(eae);
+            }
         }
         expenseAccountExamineMapper.insertBatch(list);
     }
@@ -161,7 +166,6 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
      * @param str 备注
      */
     private void addExpenseAccountLog(Integer eaid, Integer status,Integer processStatus,String aid, String str,Date date) {
-        if (aid==null)aid=TokenManager.getAdminId();
         ExpenseAccountLog eaLog=new ExpenseAccountLog();
         eaLog.setEaid(eaid);
         eaLog.setStatus(status);
@@ -180,12 +184,20 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         addExpenseAccountLog(in.getId(),status,in.getProcessStatus(),aid,str);
         if (status==0)in.setProcessStatus(1);
         Admin admin = adminMapper.selectByPrimaryKey(aid);
-        if (admin.getSuperiorId()==null||admin.getId().equals(admin.getSuperiorId())){
-            String str2=String.format("重复审核人跳过[%s]。",EAProcessStatus.getDesc(in.getProcessStatus()));
+        if (admin.getExpenseSuperExamine()==0){
+            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);
             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);
+                in.setProcessStatus(in.getProcessStatus()+1);
+            }
         }
         createExamineByProcess(in);
     }
@@ -197,7 +209,11 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private void createExamineByProcess(ExpenseAccount in) {
         //审核流程推送到最新
         AdminListBo admin = adminMapper.getDeptNameByAid(in.getAid());
-        List<ExpenseAccountExamine> list=examineByprocess(in,admin);
+        OrganizationListOut dep = departmentMapper.selectAllById(in.getApplyDep());
+        List<ExpenseConfigDetails>  configDetailsList = expenseConfigDetailsMapper.selectByDepId(in.getApplyDep());
+        if (in.getApproval()==null)in.setApproval(0);
+        examineByprocess(in,admin,dep,configDetailsList);
+        List<ExpenseAccountExamine> list=expenseAccountExamineMapper.selectByEaidAndProcessStatus(in.getId(), in.getProcessStatus());
         List<Admin> aids=new ArrayList<>();
         StringBuffer aname =new StringBuffer();
         for (ExpenseAccountExamine e : list) {
@@ -247,13 +263,12 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             }
         }
         if (in.getSettlementAmount()==null)in.setSettlementAmount(useEA.getSettlementAmount());
-        in.setAmount(in.getRealAmount().subtract(in.getSettlementAmount()));
-        in.setRealAmount(in.getAmount());
         in.setStatus(0);
         return expenseAccountMapper.updateByPrimaryKeySelective(in);
     }
 
     private void pushExpenseAccountAmount(ExpenseAccount in) {
+        OutExpenseAccount useEA = expenseAccountMapper.selectByid(in.getId());
         List<OutExpenseAccountDetails> list = expenseAccountDetailsMapper.selectByEAid(in.getId());
         BigDecimal totalAmount = BigDecimal.ZERO;
         BigDecimal realAmount = BigDecimal.ZERO;
@@ -262,7 +277,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             realAmount=realAmount.add(e.getRealAmount());
         }
         in.setTotalAmount(totalAmount);
-        in.setRealAmount(realAmount);
+        in.setAmount(realAmount.subtract(useEA.getSettlementAmount()));
+        in.setRealAmount(in.getAmount());
     }
 
     @Override
@@ -273,6 +289,86 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         return 1;
     }
 
+    @Override
+    public Object delete(String ids) {
+        String[] split = ids.split(",");
+        for (String s : split) {
+            Integer id=Integer.valueOf(s);
+            ExpenseAccount expenseAccount = expenseAccountMapper.selectByPrimaryKey(id);
+            if (expenseAccount.getStatus()!=0&&expenseAccount.getStatus()!=3){
+                throw new BusinessException("该费用单状态无法删除");
+            }
+            List<OutExpenseAccountLog> logs = expenseAccountLogMapper.selectByEaid(id);
+            if (logs.isEmpty()){
+                expenseAccountMapper.deleteByPrimaryKey(id);
+            }else {
+                ExpenseAccount update =new ExpenseAccount();
+                update.setId(id);
+                update.setStatus(4);
+                expenseAccountMapper.updateByPrimaryKeySelective(update);
+            }
+        }
+        return 1;
+    }
+
+    @Override
+    public Object pageListExport(InputPageListBo in) {
+        List<OutExpenseAccountBo> list = (List<OutExpenseAccountBo>) pageList(in).getList();
+        for (OutExpenseAccountBo e : list) {
+            if (e.getTargetType()!=null){
+                if (e.getTargetType()==0){
+                    e.setTargetName("固定费用");
+                }else {
+                    e.setTargetName(e.getContractNo()+"-"+e.getBuyerName());
+                }
+            }
+            if (e.getType()!=0){
+                e.setTypeOther(EATypes.getDescByCode(e.getType()));
+            }else{
+                e.setTypeOther(String.format("其他(%s)",e.getTypeOther()));
+            }
+        }
+        NewExcelUtil excelUtil=new NewExcelUtil(OutExpenseAccountBo.class);
+        return excelUtil.exportExcel(list,"费用单列表",uploadPath);
+    }
+
+    @Override
+    public Object detailsListExport(InputDetailsListBo in) {
+        List<OutExpenseAccountDetailsList> list = (List<OutExpenseAccountDetailsList>) detailsList(in).getList();
+        for (OutExpenseAccountDetailsList e : list) {
+            if (e.getTargetType()!=null){
+                if (e.getTargetType()==0){
+                    e.setTargetName("固定费用");
+                }else {
+                    e.setTargetName(e.getContractNo()+"-"+e.getBuyerName());
+                }
+            }
+            if (e.getType()!=0){
+                e.setTypeOther(EAsecondaryTypes.getDescByCode(e.getType()));
+            }else{
+                //如果是其他,又说明显示说明,没有说明显示费用类型
+                if (StringUtils.isBlank(e.getTypeOther())){
+                    if (e.getSonType()!=0){
+                        e.setTypeOther(EATypes.getDescByCode(e.getSonType()));
+                    }else{
+                        e.setTypeOther(String.format("其他(%s)",e.getSonTypeOther()));
+                    }
+                }else {
+                    e.setTypeOther(String.format("其他(%s)",e.getTypeOther()));
+                }
+            }
+        }
+        NewExcelUtil excelUtil=new NewExcelUtil(OutExpenseAccountDetailsList.class);
+        return excelUtil.exportExcel(list,"费用详细列表",uploadPath);
+    }
+
+    @Override
+    public Object getDepDetails(Integer id) {
+        OutExpenseAccount outExpenseAccount = expenseAccountMapper.selectByid(id);
+        OrganizationListOut organizationListOut = departmentMapper.selectAllById(outExpenseAccount.getApplyDep());
+        return organizationListOut;
+    }
+
 
     private void pushResettingDebit(InputExpenseAccount in, Integer debitId) {
         ExpenseAccount debit = expenseAccountMapper.selectByPrimaryKey(debitId);
@@ -361,16 +457,84 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     @Override
     public Object logList(Integer eaid) {
         List<OutExpenseAccountLog> list = expenseAccountLogMapper.selectByEaid(eaid);
-        if (!list.isEmpty()){
-        OutExpenseAccountLog lastout=list.get(list.size()-1);
-        if (lastout.getStatus()!=3){
-            List<OutExpenseAccountLog> eaelist = expenseAccountExamineMapper.selectNotExamineByEaidAndProcessStatus(eaid, lastout.getProcessStatus());
-            list.addAll(eaelist);
+        if (!list.isEmpty()) {
+            OutExpenseAccountLog lastout = list.get(list.size() - 1);
+            ExpenseAccount expenseAccount = expenseAccountMapper.selectByPrimaryKey(eaid);
+            Integer processStatus = lastout.getProcessStatus();
+                if (lastout.getStatus() < 2) {
+                    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);
+                        }
+                    }
+                    if (processStatus<8)addDetailsLog(list, expenseAccount,processStatus);
+                }
+        }
+            return list;
+    }
+
+
+
+    private void addDetailsLog(List<OutExpenseAccountLog> list, ExpenseAccount expenseAccount,Integer useStatus) {
+        OrganizationListOut dep = departmentMapper.selectAllById(expenseAccount.getApplyDep());
+        List<ExpenseConfigDetails> configDetails = expenseConfigDetailsMapper.selectByDepId(expenseAccount.getApplyDep());
+        for (int processStatus = useStatus; processStatus < 8; processStatus++) {
+            if (processStatus ==3){
+                if (dep.getExpenseRetrialFinanceExamine()==1){
+                    List<ExpenseConfigDetails> collect = configDetails.stream().filter(e -> e.getType() == 1).collect(Collectors.toList());
+                    for (ExpenseConfigDetails e : collect) {
+                        addDetailsTypeLog(list, expenseAccount, e);
+                    }
+                }
+            }else if (processStatus ==4){
+                if (expenseAccount.getApproval()==1&&dep.getCeoExamine()==1){
+                    List<ExpenseConfigDetails> collect = configDetails.stream().filter(e -> e.getType() == 2).collect(Collectors.toList());
+                    for (ExpenseConfigDetails e : collect) {
+                        addDetailsTypeLog(list, expenseAccount, e);
+                    }
+                }
+            }else if (processStatus ==5){
+                if (dep.getCfoExamine()==1){
+                    List<ExpenseConfigDetails> collect = configDetails.stream().filter(e -> e.getType() == 3).collect(Collectors.toList());
+                    for (ExpenseConfigDetails e : collect) {
+                        addDetailsTypeLog(list, expenseAccount, e);
+                    }
+                }
+            }else if (processStatus ==6){
+                if (dep.getViceCeoExamine()==1){
+                    List<ExpenseConfigDetails> collect = configDetails.stream().filter(e -> e.getType() == 4).collect(Collectors.toList());
+                    for (ExpenseConfigDetails e : collect) {
+                        addDetailsTypeLog(list, expenseAccount, e);
+                    }
+                }
+            }else if (processStatus ==7){
+                if (dep.getCashierExamine()==1){
+                    List<ExpenseConfigDetails> collect = configDetails.stream().filter(e -> e.getType() == 5).collect(Collectors.toList());
+                    for (ExpenseConfigDetails e : collect) {
+                        addDetailsTypeLog(list, expenseAccount, e);
+                    }
+                }
             }
         }
-        return list;
+
     }
 
+    private static void addDetailsTypeLog(List<OutExpenseAccountLog> list, ExpenseAccount expenseAccount, ExpenseConfigDetails e) {
+        OutExpenseAccountLog addLog=new OutExpenseAccountLog();
+        addLog.setEaid(expenseAccount.getId());
+        addLog.setAuditor(e.getAid());
+        addLog.setAuditorName(e.getAdminName());
+        list.add(addLog);
+    }
 
 
 
@@ -379,10 +543,12 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         ExpenseAccount useEa = expenseAccountMapper.selectByPrimaryKey(in.getId());
         ExpenseAccount newEa=new ExpenseAccount();
         newEa.setId(useEa.getId());
+        newEa.setApproval(in.getApproval());
         in.setCheckNo(useEa.getCheckNo());
         in.setProcessStatus(useEa.getProcessStatus());
         //审核通知 获取发送人
         AdminListBo admin = adminMapper.getDeptNameByAid(useEa.getAid());
+        //项目推送流程及添加日志
         addExamineExpenseAccountLog(admin,in, useEa, newEa);
         //完成申请
         if (newEa.getStatus()==2){
@@ -449,9 +615,9 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             }else if (newEa.getProcessStatus()>EAProcessStatus.CWSH.getCode()){
                 pushFinanceCount(admin.getDepFinance(),useEa.getCreateTime(),3);
             }
+            expenseAccountExamineMapper.updateStatusByEaidAndAid(in.getId(),null,0,0);
         }
-        //审核处理审核表
-        pushExpenseAccountExamine(in);
+
         expenseAccountMapper.updateByPrimaryKeySelective(newEa);
         expenseAccountMapper.updateSonByMainId(newEa.getId());
         return 1;
@@ -479,69 +645,100 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         }
     }
 
-    private void pushExpenseAccountExamine(InputExpenseAccount in) {
-        if (in.getStatus()==1){
-            expenseAccountExamineMapper.updateStatusByEaidAndAid(in.getId(),TokenManager.getAdminId(),1);
-        }else if (in.getStatus()==3){
-            expenseAccountExamineMapper.updateStatusByEaidAndAid(in.getId(),null,0);
-        }
-    }
+
 
     private void addExamineExpenseAccountLog(AdminListBo admin,InputExpenseAccount in, ExpenseAccount useEa, ExpenseAccount newEa) {
         List<Admin> aids=new ArrayList<>();
         StringBuffer str=new StringBuffer();
         Integer status=in.getStatus();
-
         if (status==1){
+            //审核处理审核表
+            expenseAccountExamineMapper.updateStatusByEaidAndAid(in.getId(),TokenManager.getAdminId(),1,0);
             str=str.append("编号[").append(in.getCheckNo()).append("]需要审核").append(",请查看并审核。");
-            //新的流程是当前流程+1
-            newEa.setProcessStatus(useEa.getProcessStatus()+1);
             newEa.setAid(useEa.getAid());
             newEa.setCreateTime(useEa.getCreateTime());
-            List<ExpenseAccountExamine> list=examineByprocess(newEa,admin);
-            if(newEa.getProcessStatus()==4){
-                //完成后的流程
-                status =2;
-//                Admin finaceAdmin = adminMapper.selectByPrimaryKey(admin.getDepFinance());
-//                //同事添加通知财务管理员与公司副总
-//                List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.FINANCE_ADMIN);
-//                aids.addAll(admins);
-//                List<Admin> viceCEO = adminMapper.selectAdminByRoleType(AFTConstants.VICE_CEO);
-//                aids.addAll(viceCEO);
-//                aids.add(finaceAdmin);
-//                str.setLength(0);
-//                str=str.append("报销编号[").append(in.getCheckNo()).append("]审核已通过,请注意查看。");
-//                addNoticeAndEmail(in,  status,str.toString(),admin.getName(),aids);
-//                aids.clear();
-                aids.add(adminMapper.selectByPrimaryKey(admin.getId()));
-                newEa.setStatus(status);
-                newEa.setExamineName("");
-            }else {
-                StringBuffer aname =new StringBuffer();
-                for (ExpenseAccountExamine e : list) {
-                    if (e.getProcessStatus()==newEa.getProcessStatus()&&e.getStatus()==0){
-                        Admin ad=adminMapper.selectByPrimaryKey(e.getAuditor());
-                        aids.add(ad);
-                        aname=aname.append(ad.getName()).append(",");
+            newEa.setApplyDep(useEa.getApplyDep());
+            //在跳入董事长审核的时候非特批直接跳过,原则上下个流程不可再跳过
+            OrganizationListOut dep = departmentMapper.selectAllById(newEa.getApplyDep());
+            List<ExpenseConfigDetails>  configDetailsList = expenseConfigDetailsMapper.selectByDepId(newEa.getApplyDep());
+            if(useEa.getProcessStatus()==EAProcessStatus.CNSH.getCode()){
+                expenseAccountExamineMapper.updateStatusByEaidAndAid(in.getId(),TokenManager.getAdminId(),1,1);
+                boolean expenseExamine = pushExpenseExamine(configDetailsList, newEa,  EAProcessStatus.CNSH.getCode());
+                if (expenseExamine){
+                    //完成后的流程
+                    status =2;
+                    aids.add(adminMapper.selectByPrimaryKey(admin.getId()));
+
+                    newEa.setStatus(status);
+                    newEa.setExamineName("");
+                }else {
+                    status =1;
+                    List<ExpenseAccountExamine> list=expenseAccountExamineMapper.selectByEaidAndProcessStatus(newEa.getId(), useEa.getProcessStatus());
+                    StringBuffer aname =new StringBuffer();
+                    for (ExpenseAccountExamine e : list) {
+                        if (e.getStatus()==0){
+                            Admin ad=adminMapper.selectByPrimaryKey(e.getAuditor());
+                            aids.add(ad);
+                            aname=aname.append(ad.getName()).append(",");
+                        }
+                    }
+                    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);
+                if (useEa.getProcessStatus()<EAProcessStatus.CWFS.getCode()){
+                    newEa.setProcessStatus(useEa.getProcessStatus()+1);
+                }else {
+                    newEa.setProcessStatus(useEa.getProcessStatus());
+                }
+                if (newEa.getApproval()==null)newEa.setApproval(useEa.getApproval());
+                //流程的推动
+                examineByprocess(newEa,admin,dep,configDetailsList);
+                //推动到出纳如果设置无需则完成不设置下个人,否则就要设置
+                if (newEa.getProcessStatus()==EAProcessStatus.CNSH.getCode()){
+                    if(dep.getCashierExamine()==1){
+                        pushExamineName(newEa, aids);
+                    }else {
+                        //完成后的流程
+                        status =2;
+                        aids.add(adminMapper.selectByPrimaryKey(admin.getId()));
+                        newEa.setStatus(status);
+                        newEa.setExamineName("");
                     }
+                }else {
+                    pushExamineName(newEa, aids);
                 }
-                newEa.setExamineName(aname.substring(0,aname.length()-1));
-            }
 
+            }
 
         }else {
             aids.add(adminMapper.selectByPrimaryKey(admin.getId()));
             newEa.setStatus(3);
             newEa.setProcessStatus(0);
             str.setLength(0);
+            addExpenseAccountLog(in.getId(),newEa.getStatus(),useEa.getProcessStatus(),TokenManager.getAdminId(),in.getReason());
             str=str.append("您的报销审核已驳回,报销编号[").append(in.getCheckNo()).append("],请注意查看。");
         }
         if (newEa.getStatus()==null)newEa.setStatus(1);
-        addExpenseAccountLog(in.getId(),status,useEa.getProcessStatus(),TokenManager.getAdminId(),in.getReason());
         addNoticeAndEmail(in,  status,str.toString(),admin.getName(),aids);
     }
 
+    private void pushExamineName(ExpenseAccount newEa, List<Admin> aids) {
+        List<ExpenseAccountExamine> list=expenseAccountExamineMapper.selectByEaidAndProcessStatus(newEa.getId(), newEa.getProcessStatus());
+        StringBuffer aname =new StringBuffer();
+        for (ExpenseAccountExamine e : list) {
+            if (e.getProcessStatus()== newEa.getProcessStatus()&&e.getStatus()==0){
+                Admin ad=adminMapper.selectByPrimaryKey(e.getAuditor());
+                aids.add(ad);
+                aname=aname.append(ad.getName()).append(",");
+            }
+        }
+        newEa.setExamineName(aname.substring(0,aname.length()-1));
+    }
+
     /**
      *
      * @param aid
@@ -576,50 +773,170 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
     }
 
-
-
     /**
      * 审核流程推送,只要不是完成状态就继续判断是否跳过
      * @param newEa
      */
-    private List<ExpenseAccountExamine> examineByprocess( ExpenseAccount newEa,AdminListBo admin) {
-        //获取当前流程审核人,如果有已审核则跳过当前审核
-        List<ExpenseAccountExamine> list = expenseAccountExamineMapper.selectByEaidAndProcessStatus(newEa.getId(), newEa.getProcessStatus());
-        boolean flag=false;
-        String aid="";
-        for (ExpenseAccountExamine e : list) {
-            if (e.getStatus()==1){
-                flag=true;
-                aid=e.getAuditor();
-                break;
+    private void examineByprocess( ExpenseAccount newEa,AdminListBo admin,OrganizationListOut dep,List<ExpenseConfigDetails> list) {
+        List<ExpenseAccountExamine> examineList=new ArrayList<>();
+        //小于财务复审的,走单审核
+        if (newEa.getProcessStatus()<EAProcessStatus.CWFS.getCode()){
+            examineList = expenseAccountExamineMapper.selectByEaidAndProcessStatus(newEa.getId(), newEa.getProcessStatus());
+            boolean flag=false;
+            String aid="";
+            if (examineList.size()>0){
+                for (ExpenseAccountExamine e : examineList) {
+                    if (e.getStatus()==1){
+                        flag=true;
+                        aid=e.getAuditor();
+                        break;
+                    }
+                }
             }
-            if(e.getAuditor().equals(newEa.getAid())){
-                flag=true;
-                break;
+            //如果当前审核人已经审核,则跳过当前审核
+            if (flag){
+                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);
+                if (newEa.getProcessStatus()==EAProcessStatus.BMFZRSH.getCode()){
+                    addFinanceCount(admin.getDepFinance(),newEa.getCreateTime());
+                }
+                newEa.setProcessStatus(newEa.getProcessStatus()+1);
+                examineByprocess(newEa,admin,dep,list);
             }
-        }
-
-        if (flag){
-            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);
-            if (newEa.getProcessStatus()==EAProcessStatus.BMFZRSH.getCode()){
-                addFinanceCount(admin.getDepFinance(),newEa.getCreateTime());
+        }else {
+            //大于等于财务复审的,走多审核
+            String str=null;
+            //跳过标记
+            boolean flag2= false;
+            //审核通过标记
+            boolean flag3= false;
+            Date date2=new Date();
+            date2.setTime(date2.getTime()+1000l);
+            String tip=null;
+            String aid=null;
+            if (newEa.getProcessStatus()==EAProcessStatus.CWFS.getCode()){
+                //财务复审财务复审
+                if (dep.getExpenseRetrialFinanceExamine()==0){
+                    flag2=true;
+                    tip=EAProcessStatus.CWFS.getDesc();
+                }else {
+                    boolean expenseExamine = pushExpenseExamine(list, newEa,  EAProcessStatus.CWFS.getCode());
+                    if (expenseExamine){
+                        flag3=true;
+                    }
+                }
+            }else if (newEa.getProcessStatus()==EAProcessStatus.DSZSH.getCode()){
+                if (newEa.getApproval()!=1){
+                    flag2=true;
+                    tip="特批(财务选择)";
+                }else {
+                    if (dep.getCeoExamine()==1){
+                        boolean expenseExamine = pushExpenseExamine(list, newEa,  EAProcessStatus.DSZSH.getCode());
+                        if (expenseExamine){
+                            flag3=true;
+                        }
+                    }else {
+                        flag2=true;
+                        tip="特批(部门设置)";
+                    }
+                }
+            }else if (newEa.getProcessStatus()==EAProcessStatus.CWGGLYSH.getCode()){
+                if (dep.getExpenseRetrialFinanceExamine()==0){
+                    flag2=true;
+                    tip=EAProcessStatus.CWGGLYSH.getDesc();
+                    aid=null;
+                }else {
+                    boolean expenseExamine = pushExpenseExamine(list, newEa,  EAProcessStatus.CWGGLYSH.getCode());
+                    if (expenseExamine){
+                        flag3=true;
+                    }
+                }
+            }else if (newEa.getProcessStatus()==EAProcessStatus.GSFSSH.getCode()){
+                if (dep.getExpenseRetrialFinanceExamine()==0){
+                    flag2=true;
+                    tip=EAProcessStatus.GSFSSH.getDesc();
+                }else {
+                    boolean expenseExamine = pushExpenseExamine(list, newEa,  EAProcessStatus.GSFSSH.getCode());
+                    if (expenseExamine){
+                        flag3=true;
+                    }
+                }
+            }else if (newEa.getProcessStatus()==EAProcessStatus.CNSH.getCode()){
+                if (dep.getExpenseRetrialFinanceExamine()==0){
+                    flag2=true;
+                    tip=EAProcessStatus.CNSH.getDesc();
+                }else {
+                //财务出纳在审核时不与前置审核做同步
+                    pushExpenseExamine(list, newEa,  EAProcessStatus.CNSH.getCode());
+                }
+            }
+            if (flag2){
+                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);
+                    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);
+                    newEa.setProcessStatus(newEa.getProcessStatus());
+                    newEa.setStatus(2);
+                }
+            }else if (flag3){
+                newEa.setProcessStatus(newEa.getProcessStatus()+1);
+                examineByprocess(newEa,admin,dep,list);
             }
-            newEa.setProcessStatus(newEa.getProcessStatus()+1);
-            if (newEa.getProcessStatus()<EAProcessStatus.CWSH.getCode())examineByprocess(newEa,admin);
-            list=expenseAccountExamineMapper.selectByEaidAndProcessStatus(newEa.getId(), newEa.getProcessStatus());
         }
-        return list;
     }
 
-    private String getAdmins(List<Admin> list) {
-        StringBuffer str =new StringBuffer();
-        for (Admin admin : list) {
-            str=str.append(admin.getName()).append(",");
+    private boolean pushExpenseExamine(List<ExpenseConfigDetails> list, ExpenseAccount newEa, Integer status) {
+        int configDetails=0;
+        if (status==EAProcessStatus.CWFS.getCode())configDetails=1;
+        else if (status==EAProcessStatus.DSZSH.getCode())configDetails=2;
+        else if (status==EAProcessStatus.CWGGLYSH.getCode())configDetails=3;
+        else if (status==EAProcessStatus.GSFSSH.getCode())configDetails=4;
+        else if (status==EAProcessStatus.CNSH.getCode())configDetails=5;
+        int finalConfigDetails = configDetails;
+        //查询审核表,如果为空就新增,不然直接判定审核
+        List<ExpenseAccountExamine> expenseAccountExamines = expenseAccountExamineMapper.selectByEaidAndProcessStatus(newEa.getId(), status);
+        int count = 0;
+        int size=10;
+        if (expenseAccountExamines.isEmpty()){
+            List<ExpenseConfigDetails> collect = list.stream().filter(e -> e.getType() == finalConfigDetails).collect(Collectors.toList());
+            size= collect.size();
+            for (ExpenseConfigDetails e : collect) {
+                ExpenseAccountExamine eae=new ExpenseAccountExamine(newEa.getId(),status);
+                eae.setAuditor(e.getAid());
+                eae.setAuditorname(e.getAdminName());
+                eae.setStatus(0);
+                Integer i = expenseAccountExamineMapper.selectYesByParam(newEa.getId(), e.getAid());
+                if (status==EAProcessStatus.CNSH.getCode()){
+                    eae.setStatus(0);
+                    count++;
+                }else {
+                    if (i>0||e.getAid().equals(TokenManager.getAdminId())) {
+                        eae.setStatus(1);
+                        count++;
+                    }
+                }
+                expenseAccountExamineMapper.insertSelective(eae);
+            }
+
+        }else {
+            size = expenseAccountExamines.size();
+            for (ExpenseAccountExamine e : expenseAccountExamines) {
+                if (e.getStatus()==1){
+                    count++;
+                }
+            }
         }
-        return str.substring(0,str.length()-1);
+        if (count==size){
+            return true;
+        }
+        return false;
     }
 
     private void addNoticeAndEmail(ExpenseAccount in, Integer status, String str,String aname, List<Admin> aids) {
@@ -654,7 +971,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     }
 
     @Override
-    public Object pageList(InputPageListBo in) {
+    public Pagination<?> pageList(InputPageListBo in) {
         Map<String ,Object> param=new HashMap<>();
         addParam(in, param);
         Pagination<?> pagePlus = findPagePlus("selectExpenseAccountList",
@@ -679,7 +996,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     public Object selectById(Integer id) {
         OutExpenseAccount useEa = expenseAccountMapper.selectByid(id);
         //判断当前角色是否审核
-        pushExpenseAccountGetExamine(useEa);
+        useEa.setExamine(pushExpenseAccountGetExamine( id, useEa.getProcessStatus()));;
         if (useEa.getDebitId()!=null){
             pushExpenseAccountGetDebitAmount(useEa);
 
@@ -745,12 +1062,22 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         in.setExpenseMain(1);
         in.setTypeOther(String.join(",",typeList));
         expenseAccountMapper.insertSelective(in);
+        List<OutExpenseAccountLog> newLog=new ArrayList<>();
         list.stream().forEach(e -> {
             ExpenseRelationship er=new ExpenseRelationship();
             er.setId(in.getId());
             er.setEaId(e.getId());
             expenseRelationshipMapper.insertSelective(er);
+            List<OutExpenseAccountLog> listLog = expenseAccountLogMapper.selectByEaid(e.getId());
+            for (OutExpenseAccountLog log : listLog) {
+                if (!newLog.contains(log)){
+                    log.setEaid(in.getId());
+                    newLog.add(log);
+                }
+            }
+            expenseAccountLogMapper.deleteByeaid(e.getId());
         });
+        if (!newLog.isEmpty())expenseAccountLogMapper.insertBatch(newLog);
         expenseAccountMapper.updateByIds(list,1);
         return in.getId();
     }
@@ -759,17 +1086,10 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     public MainExpenseAccount mainExpense(Integer id) {
         MainExpenseAccount res = expenseAccountMapper.selectByMainId(id);
         res.setExamine(0);
-        List<ExpenseAccountExamine> expenseAccountExamines = expenseAccountExamineMapper.selectByEaidAndProcessStatus(id, res.getProcessStatus());
-        for (ExpenseAccountExamine e : expenseAccountExamines) {
-            if (e.getAuditor().equals(TokenManager.getAdminId())){
-                if (res.getStatus()==1){
-                    res.setExamine(1);
-                }
-                break;
-            }
-        }
         if (res.getAid().equals(TokenManager.getAdminId())){
             res.setExamine(2);
+        }else {
+            res.setExamine(pushExpenseAccountGetExamine( id, res.getProcessStatus()));;
         }
         return res;
     }
@@ -783,26 +1103,12 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         ExpenseAccount update =new ExpenseAccount();
         if (in.getStatus()==null)in.setStatus(1);
         if (in.getStatus()==1){
-            if (in.getOrderNo()!=null){
-                update.setOrderNo(in.getOrderNo());
-                update.setTargetType(1);
-            }
             if (in.getPayDep()!=null)update.setPayDep(in.getPayDep());
             if (in.getApplyDep()!=null)update.setApplyDep(in.getApplyDep());
             if (in.getRemarks()!=null)update.setRemarks(in.getRemarks());
             if (in.getEaaid()!=null)update.setEaaid(in.getEaaid());
             addExpenseAccountExamine(in.getId(),update);
             if (outExpenseAccount.getStatus()==0){
-                //补旧日志
-                MainExpenseAccount mianEA = expenseAccountMapper.selectByMainId(in.getId());
-                List<Integer> collect = mianEA.getSonList().stream().map(SonExpenseAccount::getId).collect(Collectors.toList());
-                if (!collect.isEmpty()){
-                    Integer i = expenseAccountMapper.selectDeleteIdBySonId(collect.get(0));
-                    if (i !=null)
-                        expenseAccountLogMapper.updateUseLogByUseId(in.getId(),i);
-                        expenseAccountLogMapper.deleteByeaid(i);
-                        expenseRelationshipMapper.deleteByPrimaryKey(i);
-                }
                 addExpenseAccountLogAndNoticEmail(outExpenseAccount,outExpenseAccount.getStatus(),"发起报销审核");
             }else if (outExpenseAccount.getStatus()==3){
                 addExpenseAccountLogAndNoticEmail(outExpenseAccount,4,"修改并发起审核");
@@ -814,8 +1120,26 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             expenseAccountMapper.updateByPrimaryKeySelective(update);
         }else if (in.getStatus()==4){
             expenseAccountMapper.updateByMainId(in.getId(),0);
+            addExpenseAccountLog(in.getId(),4,0,TokenManager.getAdminId(),"撤销报销审核");
+            List<ExpenseRelationship> list = expenseRelationshipMapper.selectById(in.getId());
+            //撤销日志处理,先将日志改在挂子编号上,在新发起的时候再从自编号加到新编号上
+            if (list.size()==1){
+                ExpenseRelationship e =list.get(0);
+                expenseAccountLogMapper.updateUseLogByUseId(e.getEaId(),e.getId());
+            }else {
+                List<OutExpenseAccountLog> outExpenseAccountLogs = expenseAccountLogMapper.selectByEaid(in.getId());
+                for (int i=0;i<list.size();i++){
+                    ExpenseRelationship e =list.get(i);
+                    for (OutExpenseAccountLog eal : outExpenseAccountLogs) {
+
+                        eal.setEaid(e.getEaId());
+                    }
+                    expenseAccountLogMapper.insertBatch(outExpenseAccountLogs);
+                }
+            }
+            expenseAccountLogMapper.deleteByeaid(in.getId());
+            expenseRelationshipMapper.deleteByPrimaryKey(in.getId());
             expenseAccountMapper.deleteByPrimaryKey(in.getId());
-            addExpenseAccountLog(in.getId(),4,0,in.getAid(),"撤销报销审核");
         }
         return 1;
     }
@@ -833,17 +1157,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)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
-                in.setProcessStatus(1);
+                 in.setProcessStatus(3);
+             }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.APPROVAL_DECISION)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_ASSISTANT)){
-                in.setProcessStatus(4);
-            }else if(false){
-                //先不做财务查看权限
                 in.setProcessStatus(5);
-            }else if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)||TokenManager.hasRole(AFTConstants.SUPERADMIN)){
-                //财务管理员和超级管理员查看全部
+            }else if(TokenManager.hasRole(AFTConstants.VICE_CEO)){
+                //先不做财务查看权限
+                in.setProcessStatus(7);
+            }else if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
                 in.setProcessStatus(6);
             }
         }else {
@@ -875,7 +1201,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     }
 
     @Override
-    public Object detailsList(InputDetailsListBo in) {
+    public Pagination<?> detailsList(InputDetailsListBo in) {
         Map<String,Object> params = new HashMap<>();
         if(in.getStatus()!=null)params.put("status",in.getStatus());
         if(in.getType()!=null)params.put("type",in.getType());
@@ -949,29 +1275,9 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
     /**
      * 判断角色是否已经审核
-     * @param useEa
-     */
-    private void pushExpenseAccountGetExamine(OutExpenseAccount useEa) {
-        List<ExpenseAccountExamine> list = expenseAccountExamineMapper.selectByEaidAndProcessStatus(useEa.getId(), useEa.getProcessStatus());
-        boolean flag=false;
-        for (ExpenseAccountExamine e : list) {
-            if (e.getAuditor().equals(TokenManager.getAdminId())){
-                if (e.getStatus()==0){
-                    flag=true;
-                    break;
-                }
-            }
-        }
-        if (flag){
-            useEa.setExamine(1);
-        }else {
-            useEa.setExamine(0);
-        }
-    }
-
-    /**
-     * 判断角色是否已经审核
-     * @param
+     * @param id  编号
+     * @param processStatus  审核状态
+     * @return 0 无需审核 1 需要审核
      */
     private Integer pushExpenseAccountGetExamine(Integer id,Integer processStatus) {
         List<ExpenseAccountExamine> list = expenseAccountExamineMapper.selectByEaidAndProcessStatus(id, processStatus);

+ 35 - 0
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseConfigServiceImpl.java

@@ -0,0 +1,35 @@
+package com.goafanti.expenseAccount.service.impl;
+
+import com.goafanti.common.dao.ExpenseConfigDetailsMapper;
+import com.goafanti.common.model.ExpenseConfigDetails;
+import com.goafanti.expenseAccount.service.ExpenseConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ExpenseConfigServiceImpl implements ExpenseConfigService {
+
+
+    @Autowired
+    private ExpenseConfigDetailsMapper expenseConfigDetailsMapper;
+
+
+
+
+    @Override
+    public Object addDeTails(ExpenseConfigDetails details) {
+        expenseConfigDetailsMapper.insertSelective(details);
+        return details;
+    }
+
+    @Override
+    public Object deleteDeTails(Integer id) {
+        expenseConfigDetailsMapper.deleteByPrimaryKey(id);
+        return 1;
+    }
+
+
+
+
+
+}

+ 223 - 0
src/main/java/com/goafanti/organization/bo/InputDep.java

@@ -0,0 +1,223 @@
+package com.goafanti.organization.bo;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+import javax.validation.constraints.NotNull;
+
+public class InputDep {
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String name;
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String type;
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String managerId;
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String superId;
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String status;
+    private Integer province;
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String remarks;
+    private String id;
+    private String abbreviation;
+    private String financeId;
+    private Integer workingHoursType;
+    private Integer hideSign;
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private String depNo;
+    private Integer approval;
+    private String approvalAid;
+    private String expenseFinanceId;
+    /**
+     * 财务复审 0-不需要 ,1-需要
+     */
+    private Integer expenseRetrialFinanceExamine;
+
+    /**
+     * 董事长审核 0-不需要 ,1-需要
+     */
+    private Integer ceoExamine;
+
+    /**
+     * 财务总监出纳状态 0-不需要 ,1-需要
+     */
+    private Integer cfoExamine;
+
+    /**
+     * 公司副总出纳状态 0-不需要 ,1-需要
+     */
+    private Integer viceCeoExamine;
+
+    /**
+     * 出纳审核 0-不需要 ,1-需要
+     */
+    private Integer cashierExamine;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getManagerId() {
+        return managerId;
+    }
+
+    public void setManagerId(String managerId) {
+        this.managerId = managerId;
+    }
+
+    public String getSuperId() {
+        return superId;
+    }
+
+    public void setSuperId(String superId) {
+        this.superId = superId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getAbbreviation() {
+        return abbreviation;
+    }
+
+    public void setAbbreviation(String abbreviation) {
+        this.abbreviation = abbreviation;
+    }
+
+    public String getFinanceId() {
+        return financeId;
+    }
+
+    public void setFinanceId(String financeId) {
+        this.financeId = financeId;
+    }
+
+    public Integer getWorkingHoursType() {
+        return workingHoursType;
+    }
+
+    public void setWorkingHoursType(Integer workingHoursType) {
+        this.workingHoursType = workingHoursType;
+    }
+
+    public Integer getHideSign() {
+        return hideSign;
+    }
+
+    public void setHideSign(Integer hideSign) {
+        this.hideSign = hideSign;
+    }
+
+    public String getDepNo() {
+        return depNo;
+    }
+
+    public void setDepNo(String depNo) {
+        this.depNo = depNo;
+    }
+
+    public Integer getApproval() {
+        return approval;
+    }
+
+    public void setApproval(Integer approval) {
+        this.approval = approval;
+    }
+
+    public String getApprovalAid() {
+        return approvalAid;
+    }
+
+    public void setApprovalAid(String approvalAid) {
+        this.approvalAid = approvalAid;
+    }
+
+    public String getExpenseFinanceId() {
+        return expenseFinanceId;
+    }
+
+    public void setExpenseFinanceId(String expenseFinanceId) {
+        this.expenseFinanceId = expenseFinanceId;
+    }
+
+    public Integer getExpenseRetrialFinanceExamine() {
+        return expenseRetrialFinanceExamine;
+    }
+
+    public void setExpenseRetrialFinanceExamine(Integer expenseRetrialFinanceExamine) {
+        this.expenseRetrialFinanceExamine = expenseRetrialFinanceExamine;
+    }
+
+    public Integer getCeoExamine() {
+        return ceoExamine;
+    }
+
+    public void setCeoExamine(Integer ceoExamine) {
+        this.ceoExamine = ceoExamine;
+    }
+
+    public Integer getCfoExamine() {
+        return cfoExamine;
+    }
+
+    public void setCfoExamine(Integer cfoExamine) {
+        this.cfoExamine = cfoExamine;
+    }
+
+    public Integer getViceCeoExamine() {
+        return viceCeoExamine;
+    }
+
+    public void setViceCeoExamine(Integer viceCeoExamine) {
+        this.viceCeoExamine = viceCeoExamine;
+    }
+
+    public Integer getCashierExamine() {
+        return cashierExamine;
+    }
+
+    public void setCashierExamine(Integer cashierExamine) {
+        this.cashierExamine = cashierExamine;
+    }
+}

+ 404 - 243
src/main/java/com/goafanti/organization/bo/OrganizationListOut.java

@@ -1,288 +1,449 @@
 package com.goafanti.organization.bo;
 
+import com.goafanti.common.model.ExpenseConfigDetails;
+
 import java.util.List;
 
 public class OrganizationListOut {
-	/**登录用户ID**/
-	private String uid;
-	/**组织ID**/
-	private String id;
-	/**创建人**/
-	private String createId;
-	/**创建时间**/
-	private String createTime;
-	/**更新时间**/
-	private String updateTime;
-	/**删除标识**/
-	private String deletedSign;
-	/**组织名称**/
-	private String name;
-	/**组织类型**/
-	private String type;
-	/** 负责人姓名 **/
-	private String managerName;
-	/**组织负责人ID**/
-	private String managerId;
-	/**组织编号**/
-	private String depNo;
-	/** 上级组织名称 **/
-	private String superName;
-	/**上级组织**/
-	private String superId;
-	/**组织职能说明**/
-	private String remarks;
-	/**组织状态**/
-	private String status;
-	/**
-	 * 缩写
-	 */
-	private String abbreviation;
-	private String financeName;
-	private String financeId;
-
-	private String retrialFinanceId;
-	private String retrialFinanceName;
-
-	private String expenseFinanceId;
-	private String expenseFinanceName;
-	private String expenseRetrialFinanceId;
-	private String expenseRetrialFinanceName;
-	private Integer approval;
-	private String approvalAid;
-	private String approvalName;
-	private Integer province;
-	private Integer hideSign;
-	private Integer workingHoursType;
-	private String workingHoursName;
-	private Integer lvl;
-	private List<OrganizationListOut> list;
-
-
-	public String getExpenseRetrialFinanceId() {
-		return expenseRetrialFinanceId;
-	}
+    /**
+     * 登录用户ID
+     **/
+    private String uid;
+    /**
+     * 组织ID
+     **/
+    private String id;
+    /**
+     * 创建人
+     **/
+    private String createId;
+    /**
+     * 创建时间
+     **/
+    private String createTime;
+    /**
+     * 更新时间
+     **/
+    private String updateTime;
+    /**
+     * 删除标识
+     **/
+    private String deletedSign;
+    /**
+     * 组织名称
+     **/
+    private String name;
+    /**
+     * 组织类型
+     **/
+    private String type;
+    /**
+     * 负责人姓名
+     **/
+    private String managerName;
+    /**
+     * 组织负责人ID
+     **/
+    private String managerId;
+    /**
+     * 组织编号
+     **/
+    private String depNo;
+    /**
+     * 上级组织名称
+     **/
+    private String superName;
+    /**
+     * 上级组织
+     **/
+    private String superId;
+    /**
+     * 组织职能说明
+     **/
+    private String remarks;
+    /**
+     * 组织状态
+     **/
+    private String status;
+    /**
+     * 缩写
+     */
+    private String abbreviation;
+    private String financeName;
+    private String financeId;
+
+    private String retrialFinanceId;
+    private String retrialFinanceName;
+
+    private String expenseFinanceId;
+    private String expenseFinanceName;
+
+    private Integer approval;
+    private String approvalAid;
+    private String approvalName;
+    private Integer province;
+    private Integer hideSign;
+    private Integer workingHoursType;
+    private String workingHoursName;
+    private Integer lvl;
+    private List<OrganizationListOut> list;
+    /**
+     * 财务复审 0-不需要 ,1-需要
+     */
+    private Integer expenseRetrialFinanceExamine;
+
+    /**
+     * 董事长审核 0-不需要 ,1-需要
+     */
+    private Integer ceoExamine;
+
+    /**
+     * 财务总监出纳状态 0-不需要 ,1-需要
+     */
+    private Integer cfoExamine;
+
+    /**
+     * 公司副总出纳状态 0-不需要 ,1-需要
+     */
+    private Integer viceCeoExamine;
+
+    /**
+     * 出纳审核 0-不需要 ,1-需要
+     */
+    private Integer cashierExamine;
+    private List<ExpenseConfigDetails> expenseRetrialFinanceExamineList;
+    private List<ExpenseConfigDetails> ceoExamineList;
+    private List<ExpenseConfigDetails> cfoExamineList;
+    private List<ExpenseConfigDetails> viceCeoExamineList;
+    private List<ExpenseConfigDetails> cashierExamineList;
+
+    public List<ExpenseConfigDetails> getExpenseRetrialFinanceExamineList() {
+        return expenseRetrialFinanceExamineList;
+    }
+
+    public void setExpenseRetrialFinanceExamineList(List<ExpenseConfigDetails> expenseRetrialFinanceExamineList) {
+        this.expenseRetrialFinanceExamineList = expenseRetrialFinanceExamineList;
+    }
+
+    public List<ExpenseConfigDetails> getCeoExamineList() {
+        return ceoExamineList;
+    }
+
+    public void setCeoExamineList(List<ExpenseConfigDetails> ceoExamineList) {
+        this.ceoExamineList = ceoExamineList;
+    }
+
+    public List<ExpenseConfigDetails> getCfoExamineList() {
+        return cfoExamineList;
+    }
+
+    public void setCfoExamineList(List<ExpenseConfigDetails> cfoExamineList) {
+        this.cfoExamineList = cfoExamineList;
+    }
+
+    public List<ExpenseConfigDetails> getViceCeoExamineList() {
+        return viceCeoExamineList;
+    }
 
-	public void setExpenseRetrialFinanceId(String expenseRetrialFinanceId) {
-		this.expenseRetrialFinanceId = expenseRetrialFinanceId;
-	}
+    public void setViceCeoExamineList(List<ExpenseConfigDetails> viceCeoExamineList) {
+        this.viceCeoExamineList = viceCeoExamineList;
+    }
 
-	public String getExpenseRetrialFinanceName() {
-		return expenseRetrialFinanceName;
-	}
+    public List<ExpenseConfigDetails> getCashierExamineList() {
+        return cashierExamineList;
+    }
 
-	public void setExpenseRetrialFinanceName(String expenseRetrialFinanceName) {
-		this.expenseRetrialFinanceName = expenseRetrialFinanceName;
-	}
+    public void setCashierExamineList(List<ExpenseConfigDetails> cashierExamineList) {
+        this.cashierExamineList = cashierExamineList;
+    }
 
-	public String getExpenseFinanceId() {
-		return expenseFinanceId;
+    public Integer getExpenseRetrialFinanceExamine() {
+		return expenseRetrialFinanceExamine;
 	}
 
-	public void setExpenseFinanceId(String expenseFinanceId) {
-		this.expenseFinanceId = expenseFinanceId;
+	public void setExpenseRetrialFinanceExamine(Integer expenseRetrialFinanceExamine) {
+		this.expenseRetrialFinanceExamine = expenseRetrialFinanceExamine;
 	}
 
-	public String getExpenseFinanceName() {
-		return expenseFinanceName;
+	public Integer getCeoExamine() {
+		return ceoExamine;
 	}
 
-	public void setExpenseFinanceName(String expenseFinanceName) {
-		this.expenseFinanceName = expenseFinanceName;
+	public void setCeoExamine(Integer ceoExamine) {
+		this.ceoExamine = ceoExamine;
 	}
 
-	public String getApprovalName() {
-		return approvalName;
+	public Integer getCfoExamine() {
+		return cfoExamine;
 	}
 
-	public void setApprovalName(String approvalName) {
-		this.approvalName = approvalName;
+	public void setCfoExamine(Integer cfoExamine) {
+		this.cfoExamine = cfoExamine;
 	}
 
-	public Integer getApproval() {
-		return approval;
+	public Integer getViceCeoExamine() {
+		return viceCeoExamine;
 	}
 
-	public void setApproval(Integer approval) {
-		this.approval = approval;
+	public void setViceCeoExamine(Integer viceCeoExamine) {
+		this.viceCeoExamine = viceCeoExamine;
 	}
 
-	public String getApprovalAid() {
-		return approvalAid;
+	public Integer getCashierExamine() {
+		return cashierExamine;
 	}
 
-	public void setApprovalAid(String approvalAid) {
-		this.approvalAid = approvalAid;
+	public void setCashierExamine(Integer cashierExamine) {
+		this.cashierExamine = cashierExamine;
 	}
 
-	public String getRetrialFinanceId() {
-		return retrialFinanceId;
-	}
+	public String getExpenseFinanceId() {
+        return expenseFinanceId;
+    }
 
-	public void setRetrialFinanceId(String retrialFinanceId) {
-		this.retrialFinanceId = retrialFinanceId;
-	}
+    public void setExpenseFinanceId(String expenseFinanceId) {
+        this.expenseFinanceId = expenseFinanceId;
+    }
 
-	public String getRetrialFinanceName() {
-		return retrialFinanceName;
-	}
+    public String getExpenseFinanceName() {
+        return expenseFinanceName;
+    }
 
-	public void setRetrialFinanceName(String retrialFinanceName) {
-		this.retrialFinanceName = retrialFinanceName;
-	}
+    public void setExpenseFinanceName(String expenseFinanceName) {
+        this.expenseFinanceName = expenseFinanceName;
+    }
 
-	public List<OrganizationListOut> getList() {
-		return list;
-	}
+    public String getApprovalName() {
+        return approvalName;
+    }
 
-	public void setList(List<OrganizationListOut> list) {
-		this.list = list;
-	}
+    public void setApprovalName(String approvalName) {
+        this.approvalName = approvalName;
+    }
 
-	public Integer getLvl() {
-		return lvl;
-	}
+    public Integer getApproval() {
+        return approval;
+    }
 
-	public void setLvl(Integer lvl) {
-		this.lvl = lvl;
-	}
+    public void setApproval(Integer approval) {
+        this.approval = approval;
+    }
 
-	public Integer getHideSign() {
-		return hideSign;
-	}
+    public String getApprovalAid() {
+        return approvalAid;
+    }
 
-	public void setHideSign(Integer hideSign) {
-		this.hideSign = hideSign;
-	}
+    public void setApprovalAid(String approvalAid) {
+        this.approvalAid = approvalAid;
+    }
 
-	public String getUid() {
-		return uid;
-	}
-	public void setUid(String uid) {
-		this.uid = uid;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public String getCreateId() {
-		return createId;
-	}
-	public void setCreateId(String createId) {
-		this.createId = createId;
-	}
-	public String getCreateTime() {
-		return createTime;
-	}
-	public void setCreateTime(String createTime) {
-		this.createTime = createTime;
-	}
-	public String getUpdateTime() {
-		return updateTime;
-	}
-	public void setUpdateTime(String updateTime) {
-		this.updateTime = updateTime;
-	}
-	public String getDeletedSign() {
-		return deletedSign;
-	}
-	public void setDeletedSign(String deletedSign) {
-		this.deletedSign = deletedSign;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getType() {
-		return type;
-	}
-	public void setType(String type) {
-		this.type = type;
-	}
-	public String getManagerName() {
-		return managerName;
-	}
-	public void setManagerName(String managerName) {
-		this.managerName = managerName;
-	}
-	public String getManagerId() {
-		return managerId;
-	}
-	public void setManagerId(String managerId) {
-		this.managerId = managerId;
-	}
-	public String getDepNo() {
-		return depNo;
-	}
-	public void setDepNo(String depNo) {
-		this.depNo = depNo;
-	}
-	public String getSuperName() {
-		return superName;
-	}
-	public void setSuperName(String superName) {
-		this.superName = superName;
-	}
-	public String getSuperId() {
-		return superId;
-	}
-	public void setSuperId(String superId) {
-		this.superId = superId;
-	}
-	public String getRemarks() {
-		return remarks;
-	}
-	public void setRemarks(String remarks) {
-		this.remarks = remarks;
-	}
-	public String getStatus() {
-		return status;
-	}
-	public void setStatus(String status) {
-		this.status = status;
-	}
-	public String getAbbreviation() {
-		return abbreviation;
-	}
-	public void setAbbreviation(String abbreviation) {
-		this.abbreviation = abbreviation;
-	}
-	public String getFinanceId() {
-		return financeId;
-	}
-	public void setFinanceId(String financeId) {
-		this.financeId = financeId;
-	}
-	public String getFinanceName() {
-		return financeName;
-	}
-	public void setFinanceName(String financeName) {
-		this.financeName = financeName;
-	}
-	public Integer getProvince() {
-		return province;
-	}
-	public void setProvince(Integer province) {
-		this.province = province;
-	}
-	public Integer getWorkingHoursType() {
-		return workingHoursType;
-	}
-	public void setWorkingHoursType(Integer workingHoursType) {
-		this.workingHoursType = workingHoursType;
-	}
-	public String getWorkingHoursName() {
-		return workingHoursName;
-	}
-	public void setWorkingHoursName(String workingHoursName) {
-		this.workingHoursName = workingHoursName;
-	}
+    public String getRetrialFinanceId() {
+        return retrialFinanceId;
+    }
+
+    public void setRetrialFinanceId(String retrialFinanceId) {
+        this.retrialFinanceId = retrialFinanceId;
+    }
+
+    public String getRetrialFinanceName() {
+        return retrialFinanceName;
+    }
+
+    public void setRetrialFinanceName(String retrialFinanceName) {
+        this.retrialFinanceName = retrialFinanceName;
+    }
+
+    public List<OrganizationListOut> getList() {
+        return list;
+    }
+
+    public void setList(List<OrganizationListOut> list) {
+        this.list = list;
+    }
+
+    public Integer getLvl() {
+        return lvl;
+    }
+
+    public void setLvl(Integer lvl) {
+        this.lvl = lvl;
+    }
+
+    public Integer getHideSign() {
+        return hideSign;
+    }
+
+    public void setHideSign(Integer hideSign) {
+        this.hideSign = hideSign;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(String createId) {
+        this.createId = createId;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(String updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getDeletedSign() {
+        return deletedSign;
+    }
+
+    public void setDeletedSign(String deletedSign) {
+        this.deletedSign = deletedSign;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getManagerName() {
+        return managerName;
+    }
+
+    public void setManagerName(String managerName) {
+        this.managerName = managerName;
+    }
+
+    public String getManagerId() {
+        return managerId;
+    }
+
+    public void setManagerId(String managerId) {
+        this.managerId = managerId;
+    }
+
+    public String getDepNo() {
+        return depNo;
+    }
+
+    public void setDepNo(String depNo) {
+        this.depNo = depNo;
+    }
+
+    public String getSuperName() {
+        return superName;
+    }
+
+    public void setSuperName(String superName) {
+        this.superName = superName;
+    }
+
+    public String getSuperId() {
+        return superId;
+    }
+
+    public void setSuperId(String superId) {
+        this.superId = superId;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getAbbreviation() {
+        return abbreviation;
+    }
+
+    public void setAbbreviation(String abbreviation) {
+        this.abbreviation = abbreviation;
+    }
+
+    public String getFinanceId() {
+        return financeId;
+    }
+
+    public void setFinanceId(String financeId) {
+        this.financeId = financeId;
+    }
+
+    public String getFinanceName() {
+        return financeName;
+    }
+
+    public void setFinanceName(String financeName) {
+        this.financeName = financeName;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public Integer getWorkingHoursType() {
+        return workingHoursType;
+    }
 
+    public void setWorkingHoursType(Integer workingHoursType) {
+        this.workingHoursType = workingHoursType;
+    }
 
+    public String getWorkingHoursName() {
+        return workingHoursName;
+    }
 
+    public void setWorkingHoursName(String workingHoursName) {
+        this.workingHoursName = workingHoursName;
+    }
 
 
 }

+ 12 - 13
src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java

@@ -4,10 +4,14 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.dao.DepartmentMapper;
+import com.goafanti.common.utils.ParamUtils;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.organization.bo.InputDep;
 import com.goafanti.organization.bo.OrganizationListOut;
 import com.goafanti.organization.service.OrganizationService;
 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;
@@ -93,31 +97,26 @@ public class AdminOrganizationController extends BaseApiController{
 	 * 修改部门信息
 	 **/
 	@RequestMapping(value = "/updateOrganization" , method = RequestMethod.POST)
-	public Result updateOrganization(String name, String type, String managerId, String superId, String status,Integer province,String retrialFinanceId,
-									 String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,
-									 Integer hideSign,String depNo,Integer approval,String approvalAid,
-									 String expenseFinanceId){
+	public Result updateOrganization(@Validated InputDep in, BindingResult bindingResult){
 		Result res = new Result();
-		if(StringUtils.isBlank(name) || StringUtils.isBlank(type)
-				|| StringUtils.isBlank(managerId)|| StringUtils.isBlank(superId)
-				|| StringUtils.isBlank(status)|| StringUtils.isBlank(remarks)|| StringUtils.isBlank(depNo)){
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
 			return res;
 		}
-		if (id ==superId){
+		if (in.getId() ==in.getSuperId()){
 			res.getError().add(buildError("不能设置自己为上级"));
 			return res;
 		}
-		if (organizationService.checkDepNo(depNo,1)){
+		if (organizationService.checkDepNo(in.getDepNo(),1)){
 			res.getError().add(buildError("","部门编号已存在"));
 			return res;
 		}
-		if (approval==null||(approval==1&&StringUtils.isBlank(approvalAid))){
+		if (in.getApproval()==null||(in.getApproval()==1&&StringUtils.isBlank(in.getApprovalAid()))){
 			res.getError().add(buildError("特批审核开启必须设置特批人"));
 			return res;
 		}
-		int i=organizationService.updateOrganization(name, type, managerId, superId, status, province,
-				retrialFinanceId,remarks,id, abbreviation,financeId,workingHoursType,hideSign,depNo, approval, approvalAid,expenseFinanceId);
+		int i=organizationService.updateOrganization(in);
 		return res.data(i);
 	}
 

+ 2 - 3
src/main/java/com/goafanti/organization/service/OrganizationService.java

@@ -3,6 +3,7 @@ package com.goafanti.organization.service;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.organization.bo.DepOut;
+import com.goafanti.organization.bo.InputDep;
 import com.goafanti.organization.bo.OrganizationListOut;
 
 import java.util.List;
@@ -43,9 +44,7 @@ public interface OrganizationService {
 
 	int deleteById(String id);
 
-	int updateOrganization(String name,String type,String managerId,String superId,String status,Integer province,String retrialFinanceId,
-			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign,String depNo,
-						   Integer approval,String approvalAid,String expenseFinanceId);
+	int updateOrganization(InputDep in);
 
 	boolean checkDepNo(String depNo,Integer type);
 

+ 48 - 30
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -2,16 +2,16 @@ package com.goafanti.organization.service.impl;
 
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.common.dao.DepartmentMapper;
-import com.goafanti.common.dao.FinanceCountMapper;
-import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.dao.ExpenseConfigDetailsMapper;
 import com.goafanti.common.model.Department;
+import com.goafanti.common.model.ExpenseConfigDetails;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.organization.bo.DepOut;
+import com.goafanti.organization.bo.InputDep;
 import com.goafanti.organization.bo.OrganizationListOut;
 import com.goafanti.organization.service.OrganizationService;
 import net.sourceforge.pinyin4j.PinyinHelper;
@@ -21,19 +21,19 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
+import java.util.stream.Collectors;
+
 @Service
 public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> implements OrganizationService {
 	@Autowired
 	private DepartmentMapper departmentMapper;
 	@Autowired
-	private TOrderMidMapper	tOrderMidMapper;
-	@Autowired
-	private TOrderNewMapper	tOrderNewMapper;
-	@Autowired
-	private FinanceCountMapper financeCountMapper;
+	private ExpenseConfigDetailsMapper expenseConfigDetailsMapper;
+
 	@Autowired
 	private AsyncUtils asyncUtils;
 
+
 	@Override
 	public Pagination<OrganizationListOut> listOrganizationManagement(OrganizationListOut olo, Integer pageNo,
 			Integer pageSize) {
@@ -184,6 +184,12 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 	@Override
 	public OrganizationListOut selectAllById(String id) {
 		OrganizationListOut olo=departmentMapper.selectAllById(id);
+		List<ExpenseConfigDetails> list = expenseConfigDetailsMapper.selectByDepId(id);
+		olo.setExpenseRetrialFinanceExamineList(list.stream().filter(e ->e.getType()==1).collect(Collectors.toList()));
+		olo.setCeoExamineList(list.stream().filter(e ->e.getType()==2).collect(Collectors.toList()));
+		olo.setCfoExamineList(list.stream().filter(e ->e.getType()==3).collect(Collectors.toList()));
+		olo.setViceCeoExamineList(list.stream().filter(e ->e.getType()==4).collect(Collectors.toList()));
+		olo.setCashierExamineList(list.stream().filter(e ->e.getType()==5).collect(Collectors.toList()));
 		olo.setSuperId(departmentMapper.selectNameById(olo.getSuperId()));
 		return olo;
 	}
@@ -193,33 +199,45 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		return 1;
 	}
 	@Override
-	public int updateOrganization(String name, String type, String managerId, String superId, String status,Integer province,String retrialFinanceId,
-			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign,String depNo,
-								  Integer approval,String approvalAid,String expenseFinanceId) {
+	public int updateOrganization(InputDep in) {
 		//获取上级编号
-		Department superDep=departmentMapper.selectByPrimaryKey(superId);
+		Department superDep=departmentMapper.selectByPrimaryKey(in.getSuperId());
 		Date now=new Date();
 		Department dep=new Department();
 		dep.setLvl(superDep.getLvl()+1);
-		dep.setName(name);
-		dep.setType(type);
+		dep.setName(in.getName());
+		dep.setType(in.getType());
 		dep.setUpdateTime(now);
-		dep.setManagerId(managerId);
-		dep.setStatus(status);
-		dep.setRemarks(remarks);
-		dep.setId(id);
-		dep.setSuperId(superId);
-		dep.setDepNo(depNo);
-		dep.setAbbreviation(abbreviation);
-		dep.setRetrialFinanceId(retrialFinanceId);
-		dep.setFinanceId(financeId);
-		dep.setProvince(province);
-		dep.setHideSign(hideSign);
-		dep.setWorkingHoursType(workingHoursType);
-		dep.setApproval(approval);
-		dep.setApprovalAid(approvalAid);
-		dep.setExpenseFinanceId(expenseFinanceId);
-		checkFinaceUpdate(id,financeId);
+		dep.setManagerId(in.getManagerId());
+		dep.setStatus(in.getStatus());
+		dep.setRemarks(in.getRemarks());
+		dep.setId(in.getId());
+		dep.setSuperId(in.getSuperId());
+		dep.setDepNo(in.getDepNo());
+		dep.setAbbreviation(in.getAbbreviation());
+		dep.setFinanceId(in.getFinanceId());
+		dep.setProvince(in.getProvince());
+		dep.setHideSign(in.getHideSign());
+		dep.setWorkingHoursType(in.getWorkingHoursType());
+		dep.setApproval(in.getApproval());
+		dep.setApprovalAid(in.getApprovalAid());
+		dep.setExpenseFinanceId(in.getExpenseFinanceId());
+		checkFinaceUpdate(in.getId(),in.getFinanceId());
+		if (in.getExpenseRetrialFinanceExamine()==1){
+			dep.setExpenseRetrialFinanceExamine(in.getExpenseRetrialFinanceExamine());
+		}
+		if (in.getCeoExamine()==1){
+			dep.setCeoExamine(in.getCeoExamine());
+		}
+		if (in.getCfoExamine()==1){
+			 dep.setCfoExamine(in.getCfoExamine());
+		}
+		if (in.getViceCeoExamine()==1){
+			dep.setViceCeoExamine(in.getViceCeoExamine());
+		}
+		if (in.getCashierExamine()==1){
+			dep.setCashierExamine(in.getCashierExamine());
+		}
 		int x=departmentMapper.updateByPrimaryKeySelective(dep);
 		return x;
 	}

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

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20221026?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20
@@ -52,7 +52,7 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.3.01
+static.host=//static.jishutao.com/1.3.03
 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

+ 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.00
+static.host=//static.jishutao.com/1.3.03
 rd.static.host=//static.jishutao.com/RD/1.0.03
 avatar.upload.host=//static.jishutao.com/upload