33 changed files with 686 additions and 39 deletions
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.seeyon.entity.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TodoVoQuery { |
||||
|
|
||||
|
private String userId; |
||||
|
|
||||
|
private Integer startRow; |
||||
|
|
||||
|
private Integer pageSize; |
||||
|
|
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.qs.serve.modules.seeyon.enums; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/10 |
||||
|
*/ |
||||
|
public enum CheckTypeEnum { |
||||
|
|
||||
|
/** 费用申请 */ |
||||
|
CostBill, |
||||
|
|
||||
|
/** 政策 */ |
||||
|
ReleasePolicy, |
||||
|
|
||||
|
/** 核销 */ |
||||
|
CheckCost, |
||||
|
|
||||
|
/** 预算申请 */ |
||||
|
budgetAdjust, |
||||
|
|
||||
|
/** 预算修改 */ |
||||
|
budgetAdjust2 |
||||
|
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.qs.serve.modules.seeyon.mapper; |
||||
|
|
||||
|
import com.qs.serve.modules.seeyon.entity.dto.TodoVoQuery; |
||||
|
import com.qs.serve.modules.seeyon.entity.vo.TodoVO; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/10 |
||||
|
*/ |
||||
|
public interface CommonCheckMapper { |
||||
|
|
||||
|
/** |
||||
|
* 查询回退的审批列表 |
||||
|
* @param query |
||||
|
* @return |
||||
|
*/ |
||||
|
List<TodoVO> pageCallbackList(@Param("query") TodoVoQuery query); |
||||
|
|
||||
|
/** |
||||
|
* 合计回退的审批列表 |
||||
|
* @param query |
||||
|
* @return |
||||
|
*/ |
||||
|
Long countCallback(@Param("query") TodoVoQuery query); |
||||
|
|
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.qs.serve.modules.tbs.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.StringUtils; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsBudgetChangeCondition; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsBudgetChangeScheduleItem; |
||||
|
import com.qs.serve.modules.tbs.service.TbsBudgetChangeConditionService; |
||||
|
import com.qs.serve.modules.tbs.service.TbsBudgetChangeScheduleItemService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.tbs.entity.TbsBudgetChange; |
||||
|
import com.qs.serve.modules.tbs.service.TbsBudgetChangeService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 预算 预算更变记录 |
||||
|
* @author YenHex |
||||
|
* @since 2023-08-09 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tbs/budgetChange") |
||||
|
public class TbsBudgetChangeController { |
||||
|
|
||||
|
private TbsBudgetChangeService tbsBudgetChangeService; |
||||
|
private TbsBudgetChangeScheduleItemService tbsBudgetChangeScheduleItemService; |
||||
|
private TbsBudgetChangeConditionService tbsBudgetChangeConditionService; |
||||
|
|
||||
|
/** |
||||
|
* 列表 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/list") |
||||
|
public R<List<TbsBudgetChange>> getList(TbsBudgetChange param){ |
||||
|
if(param.getBudgetId()==null){ |
||||
|
return R.error("BudgetId不能为空"); |
||||
|
} |
||||
|
LambdaQueryWrapper<TbsBudgetChange> lqw = new LambdaQueryWrapper<>(param); |
||||
|
List<TbsBudgetChange> list = tbsBudgetChangeService.list(lqw); |
||||
|
for (TbsBudgetChange budgetChange : list) { |
||||
|
List<TbsBudgetChangeScheduleItem> changeScheduleItemList = tbsBudgetChangeScheduleItemService.listByChangeId(budgetChange.getId()); |
||||
|
List<TbsBudgetChangeCondition> changeConditionList = tbsBudgetChangeConditionService.listByChangeId(budgetChange.getId()); |
||||
|
budgetChange.setChangeScheduleItemList(changeScheduleItemList); |
||||
|
budgetChange.setChangeConditionList(changeConditionList); |
||||
|
} |
||||
|
return R.ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
//@GetMapping("/page")
|
||||
|
public R<PageVo<TbsBudgetChange>> getPage(TbsBudgetChange param){ |
||||
|
LambdaQueryWrapper<TbsBudgetChange> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<TbsBudgetChange> list = tbsBudgetChangeService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,81 @@ |
|||||
|
package com.qs.serve.modules.tbs.service.impl; |
||||
|
|
||||
|
import com.qs.serve.common.framework.manager.AsyncFactory; |
||||
|
import com.qs.serve.common.framework.manager.AsyncManager; |
||||
|
import com.qs.serve.common.util.Assert; |
||||
|
import com.qs.serve.modules.seeyon.service.SeeYonOperationService; |
||||
|
import com.qs.serve.modules.tbs.common.TbsBudgetCheckState; |
||||
|
import com.qs.serve.modules.tbs.common.TbsSeeYonConst; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsBudget; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsBudgetChange; |
||||
|
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsBudgetChangeMapper; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsBudgetMapper; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 预算改动的申请 |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TbsBudgetChangeOperationServiceImpl implements SeeYonOperationService { |
||||
|
|
||||
|
private TbsBudgetChangeMapper budgetChangeMapper; |
||||
|
|
||||
|
@Override |
||||
|
public void doCommitBacked(String targetId) { |
||||
|
AsyncManager.me().execute(AsyncFactory.submitBudgetChange(targetId)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getSyFormIdByTargetInfo(TbsAffairCommitBo affairCommit) { |
||||
|
TbsBudgetChange budgetChange = budgetChangeMapper.selectById(affairCommit.getTargetId()); |
||||
|
if(!budgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
Assert.throwEx("操作失败,预算处于非审批状态"); |
||||
|
} |
||||
|
return budgetChange.getSyFormId(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object doBacked(TbsAffairCommitBo param) { |
||||
|
TbsBudgetChange budgetChange = budgetChangeMapper.selectById(param.getTargetId()); |
||||
|
if(budgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
budgetChange.setBudgetCheckState(TbsBudgetCheckState.State_3_setback); |
||||
|
budgetChangeMapper.updateById(budgetChange); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object doFinished(TbsAffairCommitBo param) { |
||||
|
TbsBudgetChange budgetChange = budgetChangeMapper.selectById(param.getTargetId()); |
||||
|
if(budgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
budgetChange.setBudgetCheckState(TbsBudgetCheckState.State_2_finished); |
||||
|
budgetChangeMapper.updateById(budgetChange); |
||||
|
} |
||||
|
//TODO 更新到主表
|
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object doRefuse(TbsAffairCommitBo param) { |
||||
|
TbsBudgetChange budgetChange = budgetChangeMapper.selectById(param.getTargetId()); |
||||
|
if(budgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
budgetChange.setBudgetCheckState(TbsBudgetCheckState.State_4_stop); |
||||
|
budgetChangeMapper.updateById(budgetChange); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getTemplateCode() { |
||||
|
return TbsSeeYonConst.BudgetApplyConf.Code(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
<?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.qs.serve.modules.seeyon.mapper.CommonCheckMapper"> |
||||
|
|
||||
|
<select id="pageCallbackList" resultType="com.qs.serve.modules.seeyon.entity.vo.TodoVO"> |
||||
|
select |
||||
|
'CostBill' as target_type, |
||||
|
cost.id as target_id, |
||||
|
cost.`code` as target_code, |
||||
|
cost.charge_theme as title, |
||||
|
cost.submit_time |
||||
|
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'ReleasePolicy' as target_type, |
||||
|
policy.id as target_id, |
||||
|
policy.policy_code as target_code, |
||||
|
policy.title, |
||||
|
policy.submit_time |
||||
|
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'CheckCost' as target_type, |
||||
|
vtb.id as target_id, |
||||
|
vtb.`verification_code` as target_code, |
||||
|
act.act_title as title, |
||||
|
vtb.create_time as submit_time |
||||
|
from vtb_verification vtb |
||||
|
left join tbs_activity act on vtb.activity_id = act.id |
||||
|
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and act.del_flag = 0 and vtb.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'budgetAdjust' as target_type, |
||||
|
budget.id as target_id, |
||||
|
budget.budget_number as target_code, |
||||
|
budget.budget_code as title, |
||||
|
budget.submit_time |
||||
|
from tbs_budget budget |
||||
|
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'budgetAdjust2' as target_type, |
||||
|
budget_change.id as target_id, |
||||
|
budget_change.change_code as target_code, |
||||
|
budget_change.budget_title as title, |
||||
|
budget_change.submit_time |
||||
|
from tbs_budget_change budget_change |
||||
|
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0 |
||||
|
limit #{query.startRow},#{query.pageSize} |
||||
|
</select> |
||||
|
|
||||
|
<select id="countCallback" resultType="java.lang.Long"> |
||||
|
select count(0) from ( |
||||
|
select |
||||
|
'CostBill' as target_type, |
||||
|
cost.id as target_id |
||||
|
from tbs_cost_apply cost where cost.charge_state = 4 and cost.user_id = #{query.userId} and cost.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'ReleasePolicy' as target_type, |
||||
|
policy.id as target_id |
||||
|
from tzc_policy policy where policy.policy_status = 4 and policy.user_id = #{query.userId} and policy.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'CheckCost' as target_type, |
||||
|
vtb.id as target_id |
||||
|
from vtb_verification vtb |
||||
|
left join tbs_activity act on vtb.activity_id = act.id |
||||
|
where vtb.verification_state = 3 and vtb.user_id = #{query.userId} and vtb.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'budgetAdjust' as target_type, |
||||
|
budget.id as target_id |
||||
|
from tbs_budget budget |
||||
|
where budget.budget_check_state = 3 and budget.user_id = #{query.userId} and budget.del_flag = 0 |
||||
|
UNION |
||||
|
select |
||||
|
'budgetAdjust2' as target_type, |
||||
|
budget_change.id as target_id |
||||
|
from tbs_budget_change budget_change |
||||
|
where budget_change.budget_check_state = 3 and budget_change.user_id = #{query.userId} and budget_change.del_flag = 0 |
||||
|
) tmp_tb |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue