11 changed files with 212 additions and 5 deletions
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.tbs.common; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
public interface TbsBudgetCheckState { |
||||
|
|
||||
|
/** |
||||
|
* 0=未发布;1=审批中;2=完成;3-被驳回;4-中止; |
||||
|
*/ |
||||
|
int State_0_unPublish = 0; |
||||
|
int State_1_apply = 1; |
||||
|
int State_2_finished = 2; |
||||
|
int State_3_setback = 3; |
||||
|
int State_4_stop = 4; |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.qs.serve.modules.tbs.controller; |
||||
|
|
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.modules.tbs.entity.bo.TbsBudgetUpdateAfterStartBo; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* 预算 预算审批 |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tbs/budgetCheck") |
||||
|
public class TbsBudgetCheckController { |
||||
|
|
||||
|
/** |
||||
|
* 提交申请 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("commitApply/{id}") |
||||
|
public R<?> commitApply(@PathVariable("id") String id){ |
||||
|
|
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 提交更新申请 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("commitChangeApply") |
||||
|
public R<?> commitApply(@RequestBody TbsBudgetUpdateAfterStartBo param){ |
||||
|
|
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsBudgetAmtBo { |
||||
|
|
||||
|
private Integer type; |
||||
|
|
||||
|
private Long budgetScheduleItemId; |
||||
|
|
||||
|
private Integer amount; |
||||
|
|
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
package com.qs.serve.modules.tbs.service.impl; |
||||
|
|
||||
|
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.bo.TbsAffairCommitBo; |
||||
|
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 TbsBudgetApplyOperationServiceImpl implements SeeYonOperationService { |
||||
|
|
||||
|
private TbsBudgetMapper budgetMapper; |
||||
|
|
||||
|
@Override |
||||
|
public String getTargetId(TbsAffairCommitBo affairCommit) { |
||||
|
return affairCommit.getTargetId(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getSyFormIdByTargetInfo(TbsAffairCommitBo affairCommit) { |
||||
|
TbsBudget tbsBudget = budgetMapper.selectById(affairCommit.getTargetId()); |
||||
|
if(!tbsBudget.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
Assert.throwEx("操作失败,预算处于非审批状态"); |
||||
|
} |
||||
|
return tbsBudget.getSyFormId(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object doBacked(TbsAffairCommitBo param) { |
||||
|
TbsBudget tbsBudget = budgetMapper.selectById(param.getTargetId()); |
||||
|
if(tbsBudget.getBudgetState().equals(0)&&tbsBudget.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
tbsBudget.setBudgetCheckState(TbsBudgetCheckState.State_3_setback); |
||||
|
budgetMapper.updateById(tbsBudget); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object doFinished(TbsAffairCommitBo param) { |
||||
|
TbsBudget tbsBudget = budgetMapper.selectById(param.getTargetId()); |
||||
|
if(tbsBudget.getBudgetState().equals(0)&&tbsBudget.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
tbsBudget.setBudgetCheckState(TbsBudgetCheckState.State_2_finished); |
||||
|
//启用预算
|
||||
|
tbsBudget.setBudgetState(1); |
||||
|
budgetMapper.updateById(tbsBudget); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object doRefuse(TbsAffairCommitBo param) { |
||||
|
TbsBudget tbsBudget = budgetMapper.selectById(param.getTargetId()); |
||||
|
if(tbsBudget.getBudgetState().equals(0)&&tbsBudget.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){ |
||||
|
tbsBudget.setBudgetCheckState(TbsBudgetCheckState.State_4_stop); |
||||
|
budgetMapper.updateById(tbsBudget); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object compensateBacked(String targetId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object compensateFinished(String targetId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object compensateRefuse(String targetId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getTemplateCode() { |
||||
|
return TbsSeeYonConst.BudgetApplyConf.Code(); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue