Commit 2f6ac23e by huluobin

小程序审批流程

parent 5affe103
......@@ -4,6 +4,7 @@ import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.cost.dto.request.AppCheckCostListReq;
import com.blt.other.module.cost.dto.request.AppCostListReq;
import com.blt.other.module.cost.dto.request.AppCostPassReq;
import com.blt.other.module.cost.dto.request.AppCostRejectReq;
import com.blt.other.module.cost.service.AppCostService;
......@@ -52,4 +53,11 @@ public class MiniAppCostController {
appCostService.appCostReject(req);
return CostResult.success();
}
@ApiOperation("费用列表")
@PostMapping("/appCostList")
public CostResult<Page<CostDto>> appCostList(@RequestBody AppCostListReq req) {
Page<CostDto> page = appCostService.appCostList(req);
return CostResult.success(page);
}
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.cost.dto.request.AppCheckCostListReq;
import com.blt.other.module.cost.dto.request.AppCostListReq;
import com.blt.other.module.cost.dto.request.CheckCostListReq;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.CostExportVo;
......@@ -67,4 +68,8 @@ public interface CostDao extends BaseMapper<CostDomain> {
//小程序审核列表查询
Page<CostDomain> appCheckCostList(@Param("page") IPage<CostDomain> page,
@Param("req") AppCheckCostListReq req);
//小程序列表查询
Page<CostDomain> appCostList(@Param("page") IPage<CostDomain> costDomainIPage,
@Param("req") AppCostListReq req);
}
package com.blt.other.module.cost.dto.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* <p>
*
......@@ -20,4 +23,9 @@ public class AppCheckCostListReq {
@ApiModelProperty("当前oa用户id")
private Integer oaUserId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime endTime;
}
package com.blt.other.module.cost.dto.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/14 2:45 下午
*/
@Data
public class AppCostListReq {
private Integer pageNum;
private Integer pageSize;
@ApiModelProperty("当前oa用户id")
private Integer oaUserId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime endTime;
}
......@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service;
import com.bailuntec.cost.api.dto.CostDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.cost.dto.request.AppCheckCostListReq;
import com.blt.other.module.cost.dto.request.AppCostListReq;
import com.blt.other.module.cost.dto.request.AppCostPassReq;
import com.blt.other.module.cost.dto.request.AppCostRejectReq;
......@@ -37,4 +38,12 @@ public interface AppCostService {
* @param req req
*/
void appCostReject(AppCostRejectReq req);
/**
* 费用列表
*
* @param req req
* @return 费用列表
*/
Page<CostDto> appCostList(AppCostListReq req);
}
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dto.request.AppCheckCostListReq;
import com.blt.other.module.cost.dto.request.AppCostListReq;
import com.blt.other.module.cost.dto.request.AppCostPassReq;
import com.blt.other.module.cost.dto.request.AppCostRejectReq;
import com.blt.other.module.cost.model.CostDomain;
......@@ -49,6 +50,12 @@ public class AppCostServiceImpl implements AppCostService {
costContext.refuse(req.getRejectReason());
}
@Override
public Page<CostDto> appCostList(AppCostListReq req) {
IPage<CostDomain> costDomainIPage = new Page<>(req.getPageNum(), req.getPageSize());
return (Page<CostDto>) costDao.appCostList(costDomainIPage, req).convert(CostDomain::castToDto);
}
private CostContext getCostState(String costNo, Integer oaUserId) {
CostDomain costDomain = costDao.selectByCostNo(costNo);
CostState costState;
......
......@@ -479,28 +479,47 @@
<select id="appCheckCostList" resultType="com.blt.other.module.cost.model.CostDomain">
select t1.*
from cost t1
left join cost_log t2 on t1.cost_no = t2.cost_no
left join cost_company t3 on t1.company_no = t3.company_no
-- 最终审核人
LEFT JOIN cost_reviewer t4 on t3.id = t4.refer_id and t4.type = 3
-- 财务审核人
LEFT JOIN cost_reviewer t5 on t3.id = t5.refer_id and t5.type = 2
-- 部门审核人
LEFT JOIN oa_user t6 on t1.create_userid = t6.oa_user_id
LEFT JOIN cost_reviewer t7 on t6.primary_department_id = t7.refer_id and t7.type = 1
-- 行政审核
LEFT JOIN cost_reviewer t8 on t3.id = t8.refer_id and t5.type = 4
where
-- 最终审核
(t1.cost_status = 8 and t4.reviewer_user_id = #{req.oaUserId})
-- 财务审核
or (t1.cost_status = 7 and t5.reviewer_user_id = #{req.oaUserId})
-- 部门审核
or (t1.cost_status = 6 and t7.reviewer_user_id = #{req.oaUserId})
-- 行政审核
or (t1.cost_status = 9 and t8.reviewer_user_id = #{req.oaUserId})
group by
t1.id
left join cost_log t2 on t1.cost_no = t2.cost_no
left join cost_company t3 on t1.company_no = t3.company_no
-- 最终审核人
left join cost_reviewer t4 on t3.id = t4.refer_id and t4.type = 3
-- 财务审核人
left join cost_reviewer t5 on t3.id = t5.refer_id and t5.type = 2
-- 部门审核人
left join oa_user t6 on t1.create_userid = t6.oa_user_id
left join cost_reviewer t7 on t6.primary_department_id = t7.refer_id and t7.type = 1
-- 行政审核
left join cost_reviewer t8 on t3.id = t8.refer_id and t5.type = 4
where (
-- 最终审核
(t1.cost_status = 8 and t4.reviewer_user_id = #{req.oaUserId})
-- 财务审核
or (t1.cost_status = 7 and t5.reviewer_user_id = #{req.oaUserId})
-- 部门审核
or (t1.cost_status = 6 and t7.reviewer_user_id = #{req.oaUserId})
-- 行政审核
or (t1.cost_status = 9 and t8.reviewer_user_id = #{req.oaUserId})
)
<if test=" req.startTime!=null">
and t1.create_time &gt;=#{req.startTime}
</if>
<if test=" req.endTime!=null">
and t1.create_time &lt;=#{req.endTime}
</if>
group by t1.id
order by t1.create_time desc
</select>
<select id="appCostList" resultType="com.blt.other.module.cost.model.CostDomain">
select *
from cost
where create_userid = #{req.oaUserId}
and cost_status in (6,7,8,9)
<if test=" req.startTime!=null">
and create_time &gt;=#{req.startTime}
</if>
<if test=" req.endTime!=null">
and create_time &lt;=#{req.endTime}
</if>
</select>
</mapper>
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