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

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

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

+ 19 - 14
src/main/java/com/goafanti/common/mapper/ExpenseConfigDetailsMapper.xml

@@ -5,28 +5,28 @@
     <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, admin_name, create_time
+    id, `type`, aid, dep_id, admin_name, create_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select
+    select 
     <include refid="Base_Column_List" />
     from expense_config_details
     where id = #{id,jdbcType=INTEGER}
   </select>
-
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <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, admin_name,
-      create_time)
-    values (#{type,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{adminName,jdbcType=VARCHAR},
-      #{createTime,jdbcType=TIMESTAMP})
+    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
@@ -37,6 +37,9 @@
       <if test="aid != null">
         aid,
       </if>
+      <if test="depId != null">
+        dep_id,
+      </if>
       <if test="adminName != null">
         admin_name,
       </if>
@@ -51,6 +54,9 @@
       <if test="aid != null">
         #{aid,jdbcType=VARCHAR},
       </if>
+      <if test="depId != null">
+        #{depId,jdbcType=VARCHAR},
+      </if>
       <if test="adminName != null">
         #{adminName,jdbcType=VARCHAR},
       </if>
@@ -68,6 +74,9 @@
       <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>
@@ -81,13 +90,9 @@
     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="selectAll"  resultMap="BaseResultMap">
-    select
-    <include refid="Base_Column_List" />
-    from expense_config_details
-  </select>
-</mapper>
+</mapper>

+ 14 - 1
src/main/java/com/goafanti/common/model/ExpenseConfigDetails.java

@@ -11,7 +11,7 @@ public class ExpenseConfigDetails implements Serializable {
     private Integer id;
 
     /**
-     * 1=董事长,2=财务总监,3=集团副总
+     * 1=财务复审,2=董事长审核,3=财务总监,4=集团副总,5=出纳
      */
     private Integer type;
 
@@ -21,6 +21,11 @@ public class ExpenseConfigDetails implements Serializable {
     private String aid;
 
     /**
+     * 部门编号
+     */
+    private String depId;
+
+    /**
      * 管理员名称编号牌
      */
     private String adminName;
@@ -56,6 +61,14 @@ public class ExpenseConfigDetails implements Serializable {
         this.aid = aid;
     }
 
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
     public String getAdminName() {
         return adminName;
     }

+ 6 - 27
src/main/java/com/goafanti/expenseAccount/controller/ExpenseConfigController.java

@@ -2,7 +2,6 @@ package com.goafanti.expenseAccount.controller;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.model.ExpenseConfig;
 import com.goafanti.common.model.ExpenseConfigDetails;
 import com.goafanti.expenseAccount.service.ExpenseConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,18 +16,6 @@ public class ExpenseConfigController extends CertifyApiController {
     @Autowired
     private ExpenseConfigService expenseConfigService;
 
-
-    /**
-     * 修改报销配置
-     * @param config
-     * @return
-     */
-    @RequestMapping(value = "/update",method= RequestMethod.POST)
-    public Result update(ExpenseConfig config){
-        Result res =new Result();
-        return res.data(expenseConfigService.update(config));
-    }
-
     /**
      * 新增报销配置人员
      * @param details
@@ -37,27 +24,19 @@ public class ExpenseConfigController extends CertifyApiController {
     @RequestMapping(value = "/addDeTails",method= RequestMethod.POST)
     public Result add(ExpenseConfigDetails details){
         Result res =new Result();
-        return res.data(expenseConfigService.addDeTails(details));
+        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));
     }
 
-    @RequestMapping(value = "/configDetails",method= RequestMethod.GET)
-    public Result configDetails(){
-        Result res =new Result();
-        return res.data(expenseConfigService.configDetails());
-    }
-
-
-    @RequestMapping(value = "/configDetailsEvict",method= RequestMethod.POST)
-    public Result configDetailsEvict(){
-        Result res =new Result();
-        return res.data(expenseConfigService.configDetailsEvict());
-    }
-
 
 }

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

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

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

@@ -21,6 +21,7 @@ import com.goafanti.expenseAccount.Enums.EATypes;
 import com.goafanti.expenseAccount.Enums.EAsecondaryTypes;
 import com.goafanti.expenseAccount.bo.*;
 import com.goafanti.expenseAccount.service.ExpenseAccountService;
+import com.goafanti.expenseAccount.service.ExpenseConfigService;
 import com.goafanti.organization.bo.OrganizationListOut;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
@@ -62,6 +63,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private DepartmentService departmentService;
     @Autowired
     private DepartmentMapper departmentMapper;
+    @Autowired
+    private ExpenseConfigService expenseConfigService;
 
 
 
@@ -136,24 +139,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 if (StringUtils.isBlank(dep.getExpenseRetrialFinanceId()))throw new BusinessException("报销部门财务复审人不存在。");
                 eae.setAuditor(dep.getExpenseRetrialFinanceId());
                 eae.setAuditorname(dep.getExpenseRetrialFinanceName());
-            }else if (i==6){
-                List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.FINANCE_ADMIN);
-                for (Admin admin : admins) {
-                    eae.setAuditor(admin.getId());
-                    eae.setAuditorname(admin.getName());
-                }
-            }else if (i==7){
-                List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.VICE_CEO);
-                for (Admin admin : admins) {
-                    eae.setAuditor(admin.getId());
-                    eae.setAuditorname(admin.getName());
-                }
-            }else if (i==8){
-                if (StringUtils.isBlank(dep.getCashierName()))throw new BusinessException("报销部门出纳不存在。");
-                    eae.setAuditor(dep.getCashierId());
-                    eae.setAuditorname(dep.getCashierName());
             }
-            if (i!=5){
+            if (StringUtils.isNotEmpty(eae.getAuditor())){
                 if (eae.getAuditor().equals(aid))eae.setStatus(1);
                 else  eae.setStatus(0);
                 list.add(eae);
@@ -518,10 +505,6 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 newEa.setStatus(status);
                 newEa.setExamineName("");
             }else {
-                //添加后续流程
-                if(newEa.getProcessStatus()==EAProcessStatus.CWSH.getCode()){
-                    addExpenseAccountExamineFollow(in);
-                }
                 //新的流程是当前流程+1
                 newEa.setProcessStatus(useEa.getProcessStatus()+1);
                 if (newEa.getApproval()==null)newEa.setApproval(useEa.getApproval());
@@ -548,25 +531,6 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         addNoticeAndEmail(in,  status,str.toString(),admin.getName(),aids);
     }
 
-    private void addExpenseAccountExamineFollow(InputExpenseAccount in) {
-        Date date = new Date();
-        if (in.getApproval()!=null&&in.getApproval()==1){
-            List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.APPROVAL_DECISION);
-            List<ExpenseAccountExamine> list=new ArrayList<>();
-            for (Admin admin:admins){
-            ExpenseAccountExamine eae=new ExpenseAccountExamine(in.getId(),5);
-                eae.setEaid(in.getId());
-                eae.setCreateTime(date);
-                eae.setStatus(0);
-                eae.setAuditor(admin.getId());
-                eae.setAuditorname(admin.getName());
-                list.add(eae);
-            }
-            expenseAccountExamineMapper.insertBatch(list);
-        }
-
-    }
-
     /**
      *
      * @param aid
@@ -609,24 +573,52 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
      */
     private List<ExpenseAccountExamine> examineByprocess( ExpenseAccount newEa,AdminListBo admin) {
         //在跳入董事长审核的时候非特批直接跳过,原则上下个流程不可再跳过
-        if (newEa.getProcessStatus()==EAProcessStatus.DSZSH.getCode()&&newEa.getApproval()!=1){
+        boolean flag2= false;
+        Date date2=new Date();
+        date2.setTime(date2.getTime()+1000l);
+        String statusName="";
+        if (newEa.getProcessStatus()==EAProcessStatus.DSZSH.getCode()){
+            if (newEa.getApproval()!=1){
+                newEa.setProcessStatus(newEa.getProcessStatus()+1);
+                flag2=true;
+                statusName="特批(财务选择)";
+            }
+        }else {
+            newEa.setProcessStatus(newEa.getProcessStatus()+1);
+            flag2=true;
+            statusName=EAProcessStatus.DSZSH.getDesc();
+        }
+        if (newEa.getProcessStatus()==EAProcessStatus.CWGGLYSH.getCode()){
             newEa.setProcessStatus(newEa.getProcessStatus()+1);
+            flag2=true;
+            statusName=EAProcessStatus.CWGGLYSH.getDesc();
+        }
+        if (newEa.getProcessStatus()==EAProcessStatus.GSFSSH.getCode()){
+            newEa.setProcessStatus(newEa.getProcessStatus()+1);
+            flag2=true;
+            statusName=EAProcessStatus.GSFSSH.getDesc();
+        }
+        if (flag2){
+            addExpenseAccountLog(newEa.getId(),1,newEa.getProcessStatus(),"1",String.format("未设置[%s]审核,跳过此流程"),date2);
         }
         //获取当前流程审核人,如果有已审核则跳过当前审核
         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;
-            }
-            if(e.getAuditor().equals(newEa.getAid())){
-                flag=true;
-                break;
+        if (list.size()>0){
+            for (ExpenseAccountExamine e : list) {
+                if (e.getStatus()==1){
+                    flag=true;
+                    aid=e.getAuditor();
+                    break;
+                }
+                if(e.getAuditor().equals(newEa.getAid())){
+                    flag=true;
+                    break;
+                }
             }
         }
+        //如果当前审核人已经审核,则跳过当前审核
         if (flag&&newEa.getProcessStatus()<6){
             String str=String.format("重复审核人跳过[%s]。",EAProcessStatus.getDesc(newEa.getProcessStatus()));
             Date date=new Date();

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

@@ -4,18 +4,10 @@ import com.goafanti.common.dao.ExpenseConfigDetailsMapper;
 import com.goafanti.common.dao.ExpenseConfigMapper;
 import com.goafanti.common.model.ExpenseConfig;
 import com.goafanti.common.model.ExpenseConfigDetails;
-import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.expenseAccount.service.ExpenseConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
 @Service
 public class ExpenseConfigServiceImpl implements ExpenseConfigService {
 
@@ -34,37 +26,16 @@ public class ExpenseConfigServiceImpl implements ExpenseConfigService {
     @Override
     public Object addDeTails(ExpenseConfigDetails details) {
         expenseConfigDetailsMapper.insertSelective(details);
-        configDetailsEvict();
         return 1;
     }
 
     @Override
     public Object deleteDeTails(Integer id) {
         expenseConfigDetailsMapper.deleteByPrimaryKey(id);
-        configDetailsEvict();
         return 1;
     }
 
-    @Override
-    @Cacheable(value = "configDetails")
-    public Object configDetails() {
-        Map<String ,Object> map =new HashMap<>();
-        ExpenseConfig expenseConfig = expenseConfigMapper.selectByPrimaryKey(1);
-        List<ExpenseConfigDetails> expenseConfigDetails = expenseConfigDetailsMapper.selectAll();
-
-        map.put("config",expenseConfig);
-        map.put("ceo",expenseConfigDetails.stream().filter(e -> e.getType() == 1).collect(Collectors.toList()));
-        map.put("cfo",expenseConfigDetails.stream().filter(e -> e.getType() == 2).collect(Collectors.toList()));
-        map.put("vice_ceo",expenseConfigDetails.stream().filter(e -> e.getType() == 3).collect(Collectors.toList()));
-        return map;
-    }
 
-    @Override
-    @CacheEvict
-    public Object configDetailsEvict() {
-        LoggerUtils.debug(getClass(),"清除缓存数据");
-        return 1;
-    }