Commit 361fbb90 by huluobin

update

parent 3f2f7377
...@@ -21,7 +21,6 @@ import com.blt.other.module.cost.vo.*; ...@@ -21,7 +21,6 @@ import com.blt.other.module.cost.vo.*;
import com.blt.other.module.database.model.CostExpDomain; import com.blt.other.module.database.model.CostExpDomain;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.InputStreamResource;
...@@ -218,25 +217,17 @@ public class CostController { ...@@ -218,25 +217,17 @@ public class CostController {
@ApiOperation("审核费用单列表") @ApiOperation("审核费用单列表")
@GetMapping("/checkCostList") @GetMapping("/checkCostList")
public CostResult<IPage<CostDto>> checkCostList(@RequestParam Integer userid, public CostResult<IPage<CostDto>> checkCostList(CostApiDto.CheckCostListReq req) {
@RequestParam Integer pageNum,
@RequestParam Integer pageSize,
@RequestParam @ApiParam("1-财务+最终审核 2-部门审核") Integer type,
@RequestParam @ApiParam("1- 全部 2-待审核 3-已手动审核 4-已自动审核") Integer status) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
IPage<CostDto> page = costService.checkCostList(userid, pageNum, pageSize, type, status); IPage<CostDto> page = costService.checkCostList(req);
return CostResult.success(page); return CostResult.success(page);
} }
@ApiOperation("审核费用单列表") @ApiOperation("审核费用单列表")
@GetMapping("/checkCostCount") @GetMapping("/checkCostCount")
public CostResult<Long> checkCostCount(@RequestParam Integer userid, public CostResult<Long> checkCostCount(CostApiDto.CheckCostListReq req) {
@RequestParam Integer pageNum,
@RequestParam Integer pageSize,
@RequestParam @ApiParam("1-财务+最终审核 2-部门审核") Integer type,
@RequestParam @ApiParam("1- 全部 2-待审核 3-已手动审核 4-已自动审核") Integer status) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
Long count = costService.checkCostList(userid, pageNum, pageSize, type, status).getTotal(); Long count = costService.checkCostList(req).getTotal();
return CostResult.success(count); return CostResult.success(count);
} }
......
...@@ -3,6 +3,7 @@ package com.blt.other.module.cost.dao; ...@@ -3,6 +3,7 @@ package com.blt.other.module.cost.dao;
import com.bailuntec.cost.api.dto.ManageCostDto; import com.bailuntec.cost.api.dto.ManageCostDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.CostExportVo; import com.blt.other.module.cost.vo.CostExportVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -108,14 +109,9 @@ public interface CostDao extends BaseMapper<CostDomain> { ...@@ -108,14 +109,9 @@ public interface CostDao extends BaseMapper<CostDomain> {
/** /**
* 审核列表查询 * 审核列表查询
* *
* @param page page * @param page page
* @param type type
* @param status status
* @param userid userid
* @return * @return
*/ */
IPage<CostDomain> checkCostList(@Param("page") IPage<CostDomain> page, IPage<CostDomain> checkCostList(@Param("page") IPage<CostDomain> page,
@Param("type") Integer type, @Param("req") CostApiDto.CheckCostListReq req);
@Param("status") Integer status,
@Param("userid") Integer userid);
} }
...@@ -4,6 +4,7 @@ import com.bailuntec.cost.api.dto.CostDto; ...@@ -4,6 +4,7 @@ import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.CostListPrintDto; import com.bailuntec.cost.api.dto.CostListPrintDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -54,4 +55,16 @@ public class CostApiDto { ...@@ -54,4 +55,16 @@ public class CostApiDto {
List<CostDto> costs; List<CostDto> costs;
} }
@Data
public static class CheckCostListReq {
Integer userid;
Integer pageNum;
Integer pageSize;
@ApiModelProperty("1-财务+最终审核 2-部门审核")
Integer type;
@ApiModelProperty("1- 全部 2-待审核 3-已手动审核 4-已自动审核")
Integer status;
private String costNo;
}
} }
...@@ -108,7 +108,7 @@ public interface CostService { ...@@ -108,7 +108,7 @@ public interface CostService {
* @param type 1-财务+最终审核 2-部门审核 * @param type 1-财务+最终审核 2-部门审核
* @return 费用单列表 * @return 费用单列表
*/ */
IPage<CostDto> checkCostList(Integer userid, Integer pageNum, Integer pageSize, Integer type, Integer status); IPage<CostDto> checkCostList(CostApiDto.CheckCostListReq req);
/** /**
* <p> * <p>
......
...@@ -230,10 +230,11 @@ public abstract class AbstractCostService implements CostService { ...@@ -230,10 +230,11 @@ public abstract class AbstractCostService implements CostService {
@Transactional @Transactional
@Override @Override
public IPage<CostDto> checkCostList(Integer userid, Integer pageNum, Integer pageSize, Integer type, Integer status) { public IPage<CostDto> checkCostList(CostApiDto.CheckCostListReq req) {
IPage<CostDomain> page = new Page<>(pageNum, pageSize); IPage<CostDomain> page = new Page<>(req.getPageNum(), req.getPageSize());
UserDomain userDomain = userService.findByUserid(userid);
return costDao.checkCostList(page, type, status, userid).convert(CostDomain::castToDto); UserDomain userDomain = userService.findByUserid(req.getUserid());
return costDao.checkCostList(page, req).convert(CostDomain::castToDto);
} }
@Resource @Resource
......
...@@ -425,25 +425,29 @@ ...@@ -425,25 +425,29 @@
LEFT JOIN cost_reviewer t7 on t6.primary_department_id = t7.refer_id and t7.type = 1 LEFT JOIN cost_reviewer t7 on t6.primary_department_id = t7.refer_id and t7.type = 1
where true where true
/*财务 或者 最终审核 只显示待审核的*/ /*财务 或者 最终审核 只显示待审核的*/
<if test="type==1"> <if test="req.type == 1">
and (t1.cost_status = 7 or t1.cost_status = 8) and (t1.cost_status = 7 or t1.cost_status = 8)
and (t4.reviewer_user_id = #{userid} or t5.reviewer_user_id = #{userid}) and (t4.reviewer_user_id = #{req.userid} or t5.reviewer_user_id = #{req.userid})
</if> </if>
/*部门审核*/ /*部门审核*/
<if test="type==2"> <if test="req.type == 2">
/*待审核*/ /*待审核*/
<if test=" status == 2 "> <if test=" req.status == 2 ">
and t1.cost_status = 6 and t1.cost_status = 6
</if> </if>
/*已手动审核*/ /*已手动审核*/
<if test=" status == 3 "> <if test=" req.status == 3 ">
and t2.type = 5 and t2.type = 5
</if> </if>
/*已自动审核*/ /*已自动审核*/
<if test=" status == 4 "> <if test=" req.status == 4 ">
and t2.type = 4 and t2.type = 4
</if> </if>
and (t7.reviewer_user_id = #{userid} ) and (t7.reviewer_user_id = #{req.userid} )
</if>
<if test="req.costNo != null and req.costNo !='' ">
and t1.cost_no =#{req.costNo}
</if> </if>
group by group by
t1.id t1.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment