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

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

@@ -1,6 +1,7 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.ExpenseAccountLog;
+import com.goafanti.expenseAccount.bo.ExpenseAccountExamineLog;
 import com.goafanti.expenseAccount.bo.OutExpenseAccountLog;
 
 import java.util.List;
@@ -19,4 +20,6 @@ public interface ExpenseAccountLogMapper {
     int updateByPrimaryKey(ExpenseAccountLog record);
 
     List<OutExpenseAccountLog> selectByEaid(Integer eaid);
+
+    ExpenseAccountExamineLog selectExamineLog(Integer eaid);
 }

+ 11 - 0
src/main/java/com/goafanti/common/mapper/ExpenseAccountLogMapper.xml

@@ -103,4 +103,15 @@
     from expense_account_log a left join admin b on a.auditor =b.id
     where a.eaid= #{eaid}
   </select>
+  <select id="selectExamineLog" resultType="com.goafanti.expenseAccount.bo.ExpenseAccountExamineLog">
+    select a.id,a.status ,a.process_status processStatus ,b.name yxy ,c.name yxjl,yxgly.name yxgly,e.name cwzy,zc.name boss
+    from expense_account a left join admin b on a.aid=b.id left join admin c on b.superior_id =c.id
+    left join department d on b.department_id =d.id left join admin e on d.finance_id =e.id
+    left join (select a.department_id depId,group_concat(a.name) name from admin a left join user_role b
+        on a.id=b.uid left join `role` c on b.rid =c.id where c.role_type ='9996' and a.status ='0' group by a.department_id )yxgly
+    on b.department_id =yxgly.depId
+    left join (select group_concat(a.name) name from admin a left join user_role b on a.id=b.uid left join `role` c
+        on b.rid =c.id where c.role_type in ('99998','99988','99999','99989') and a.status ='0' ) zc on 1=1
+    where a.id= #{eaid}
+  </select>
 </mapper>

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

@@ -271,4 +271,42 @@
     FROM expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
     WHERE a.id= #{id}
   </select>
+
+
+  <select id="selectExpenseAccountList" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountBo">
+    select a.id,a.total_amount totalAmount,a.`type`,a.process_status processStatus,
+           date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr
+    from expense_account a
+    where 1=1
+    <if test="processStatus ==0">
+    and a.aid= #{aid}
+    </if>
+    order by
+    <if test="timeSort !=null">
+      create_time
+      <if test="timeSort  == 1">
+        desc
+      </if>
+      ,
+    </if>
+    <if test="examineSort!=null">
+      a.status
+      <if test="examineSort == 1">
+        desc
+      </if>
+
+    </if>
+    <if test="page_sql !=null">
+      ${page_sql}
+    </if>
+
+  </select>
+  <select id="selectExpenseAccountCount" resultType="java.lang.Integer">
+    select count(*)
+    from expense_account a
+    where 1=1
+    <if test="processStatus ==0">
+      and a.aid= #{aid}
+    </if>
+  </select>
 </mapper>

+ 77 - 0
src/main/java/com/goafanti/expenseAccount/bo/ExpenseAccountExamineLog.java

@@ -0,0 +1,77 @@
+package com.goafanti.expenseAccount.bo;
+
+public class ExpenseAccountExamineLog {
+    private Integer id;
+    private Integer status;
+    private Integer processStatus;
+    private String yxy;
+    private String yxjl;
+    private String cwzy;
+    private String yxgly;
+    private String boss;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+    public String getYxy() {
+        return yxy;
+    }
+
+    public void setYxy(String yxy) {
+        this.yxy = yxy;
+    }
+
+    public String getYxjl() {
+        return yxjl;
+    }
+
+    public void setYxjl(String yxjl) {
+        this.yxjl = yxjl;
+    }
+
+    public String getCwzy() {
+        return cwzy;
+    }
+
+    public void setCwzy(String cwzy) {
+        this.cwzy = cwzy;
+    }
+
+    public String getYxgly() {
+        return yxgly;
+    }
+
+    public void setYxgly(String yxgly) {
+        this.yxgly = yxgly;
+    }
+
+    public String getBoss() {
+        return boss;
+    }
+
+    public void setBoss(String boss) {
+        this.boss = boss;
+    }
+}

+ 43 - 0
src/main/java/com/goafanti/expenseAccount/bo/InputExamine.java

@@ -0,0 +1,43 @@
+package com.goafanti.expenseAccount.bo;
+
+import com.goafanti.common.utils.Param;
+
+import javax.validation.constraints.NotNull;
+
+public class InputExamine {
+
+    @NotNull
+    @Param(name = "报销编号")
+    private Integer id;
+    @NotNull
+    @Param(name = "状态")
+    private Integer status;
+    @NotNull
+    @Param(name = "流程状态")
+    private Integer processStatus;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+}

+ 49 - 0
src/main/java/com/goafanti/expenseAccount/bo/InputPageListBo.java

@@ -0,0 +1,49 @@
+package com.goafanti.expenseAccount.bo;
+
+public class InputPageListBo {
+    private Integer timeSort;
+    private Integer examineSort;
+    private Integer processStatus;
+    private Integer pageNo;
+    private Integer pageSize;
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+    public Integer getTimeSort() {
+        return timeSort;
+    }
+
+    public void setTimeSort(Integer timeSort) {
+        this.timeSort = timeSort;
+    }
+
+    public Integer getExamineSort() {
+        return examineSort;
+    }
+
+    public void setExamineSort(Integer examineSort) {
+        this.examineSort = examineSort;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+}

+ 47 - 0
src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountBo.java

@@ -0,0 +1,47 @@
+package com.goafanti.expenseAccount.bo;
+
+import java.math.BigDecimal;
+
+public class OutExpenseAccountBo {
+    private Integer id;private BigDecimal totalAmount;private Integer type;private Integer processStatus;private String createTimeStr;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+    public String getCreateTimeStr() {
+        return createTimeStr;
+    }
+
+    public void setCreateTimeStr(String createTimeStr) {
+        this.createTimeStr = createTimeStr;
+    }
+}

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

@@ -4,11 +4,13 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.ExpenseAccountPrivate;
+import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.utils.ParamUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.expenseAccount.bo.InputExpenseAccount;
 import com.goafanti.expenseAccount.bo.InputExpenseAccountDetails;
 import com.goafanti.expenseAccount.bo.InputExpenseAccountPrivate;
+import com.goafanti.expenseAccount.bo.InputPageListBo;
 import com.goafanti.expenseAccount.service.ExpenseAccountPrivateService;
 import com.goafanti.expenseAccount.service.ExpenseAccountService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -59,6 +61,12 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+    @RequestMapping(value = "/pageList",method = RequestMethod.GET)
+    public Result pageList(InputPageListBo in ){
+        Result res =new Result();
+        res.setData(expenseAccountService.pageList(in));
+        return res;
+    }
     /**
      * 新增报销详情
      * @param in
@@ -111,4 +119,28 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+    @RequestMapping(value = "/examineLog",method = RequestMethod.GET)
+    public Result examineLog(Integer eaid){
+        Result res =new Result();
+        if (eaid==null){
+            res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"报销编号"));
+            return res;
+        }
+        res.setData(expenseAccountService.examineLog(eaid));
+        return res;
+    }
+
+
+    @RequestMapping(value = "/examine",method = RequestMethod.GET)
+    public Result examine(InputExpenseAccount in,BindingResult bindingResult){
+        Result res =new Result();
+        if (bindingResult.hasErrors()) {
+            String param=bindingResult.getFieldError().getField();
+            res.getError().add(buildError(ParamUtils.getParamMsg(in,param),ParamUtils.getParamName(in,param)));
+            return res;
+        }
+        res.setData(expenseAccountService.updateExamine(in));
+        return res;
+    }
+
 }

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

@@ -1,9 +1,6 @@
 package com.goafanti.expenseAccount.service;
 
-import com.goafanti.expenseAccount.bo.InputExpenseAccount;
-import com.goafanti.expenseAccount.bo.InputExpenseAccountDetails;
-import com.goafanti.expenseAccount.bo.OutExpenseAccount;
-import com.goafanti.expenseAccount.bo.OutExpenseAccountDetails;
+import com.goafanti.expenseAccount.bo.*;
 
 import java.util.List;
 
@@ -20,4 +17,10 @@ public interface ExpenseAccountService {
     List<OutExpenseAccountDetails> detailsList(Integer eaid);
 
     Object logList(Integer eaid);
+
+    ExpenseAccountExamineLog examineLog(Integer eaid);
+
+    int updateExamine(InputExpenseAccount in);
+
+    Object pageList(InputPageListBo in);
 }

+ 51 - 6
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -4,22 +4,24 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.ExpenseAccount;
 import com.goafanti.common.model.ExpenseAccountLog;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.common.utils.DateUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.expenseAccount.bo.InputExpenseAccount;
-import com.goafanti.expenseAccount.bo.InputExpenseAccountDetails;
-import com.goafanti.expenseAccount.bo.OutExpenseAccount;
-import com.goafanti.expenseAccount.bo.OutExpenseAccountDetails;
+import com.goafanti.expenseAccount.bo.*;
 import com.goafanti.expenseAccount.service.ExpenseAccountService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Service
-public class ExpenseAccountServiceImpl implements ExpenseAccountService {
+public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapper> implements ExpenseAccountService {
     @Autowired
     private  AdminMapper adminMapper;
     @Autowired
@@ -85,7 +87,7 @@ public class ExpenseAccountServiceImpl implements ExpenseAccountService {
         if (useEA.getStatus()==0){
             addExpenseAccountLog(useEA.getId(),1,"发起报销审核");
         }else if (useEA.getStatus()==3){
-            addExpenseAccountLog(useEA.getId(),1,"修改重新发起审核");
+            addExpenseAccountLog(useEA.getId(),4,"修改重新发起审核");
         }
         return expenseAccountMapper.updateByPrimaryKeySelective(in);
     }
@@ -111,4 +113,47 @@ public class ExpenseAccountServiceImpl implements ExpenseAccountService {
     public Object logList(Integer eaid) {
         return expenseAccountLogMapper.selectByEaid(eaid);
     }
+
+    @Override
+    public ExpenseAccountExamineLog examineLog(Integer eaid) {
+        return expenseAccountLogMapper.selectExamineLog(eaid);
+    }
+
+    @Override
+    public int updateExamine(InputExpenseAccount in) {
+        ExpenseAccount useEa = expenseAccountMapper.selectByPrimaryKey(in.getId());
+        if (useEa.getStatus()!=1)throw new BusinessException("审核状态错误");
+        if (useEa.getProcessStatus()!=in.getProcessStatus())throw new BusinessException("审核流程错误");
+        //审核通知
+        return 0;
+    }
+
+    @Override
+    public Object pageList(InputPageListBo in) {
+        Map<String ,Object> param=new HashMap<>();
+        addParam(in, param);
+        return findPage("selectExpenseAccountList", "selectExpenseAccountCount", param, in.getPageNo(), in.getPageSize());
+    }
+
+    private void addParam(InputPageListBo in, Map<String, Object> param) {
+        param.put("aid",TokenManager.getAdminId());
+        if (in.getTimeSort()!=null){
+            param.put("timeSort", in.getTimeSort());
+        }else {
+            param.put("timeSort",0);
+        }
+
+        if (in.getExamineSort()!=null){
+            param.put("examineSort", in.getExamineSort());
+        }else {
+            param.put("examineSort",0);
+        }
+        if (in.getProcessStatus()!=null){
+            param.put("processStatus", in.getProcessStatus());
+        }else {
+            param.put("processStatus",0);
+        }
+    }
+
+
 }