Commit 89e8aa70 by jianshuqin

增加功能:审核通过增加审核意见

parent 08525780
......@@ -100,7 +100,7 @@ public class CostApiController implements CostApi {
CostContext costContext = new CostContext(costNo, costDomain.getCreateUserid());
costContext.setCostState(unSubmitState);
costContext.handle();
costContext.handle(null);
return CostResult.successMsg("success");
}
......
......@@ -155,7 +155,7 @@ public class CostController {
CostContext costContext = new CostContext(costNo, costDomain.getCreateUserid());
costContext.setCostState(unSubmitState);
costContext.handle();
costContext.handle(null);
UpdateCostResp resp = new UpdateCostResp();
......@@ -181,7 +181,7 @@ public class CostController {
CostContext costContext = new CostContext(costNo, costDomain.getCreateUserid());
costContext.setCostState(unSubmitState);
costContext.handle();
costContext.handle(null);
}
......@@ -242,7 +242,7 @@ public class CostController {
@RequestParam Integer userid) {
CostContext costContext = new CostContext(costNo, userid);
costContext.setCostState(departmentCheckState);
costContext.handle();
costContext.handle(null);
return CostResult.success();
}
......@@ -261,10 +261,11 @@ public class CostController {
@GetMapping("/check/financialCheck")
@ApiOperation("财务审核通过")
public CostResult<Void> financialCheck(@RequestParam String costNo,
@RequestParam Integer userid) {
@RequestParam Integer userid,
@RequestParam String reason) {
CostContext costContext = new CostContext(costNo, userid);
costContext.setCostState(financialCheckState);
costContext.handle();
costContext.handle(reason);
return CostResult.success();
}
......@@ -285,7 +286,7 @@ public class CostController {
@RequestParam Integer userid) {
CostContext costContext = new CostContext(costNo, userid);
costContext.setCostState(finalCheckState);
costContext.handle();
costContext.handle(null);
return CostResult.success();
}
......@@ -306,7 +307,7 @@ public class CostController {
@RequestParam Integer userid) {
CostContext costContext = new CostContext(costNo, userid);
costContext.setCostState(generalManagerCheckState);
costContext.handle();
costContext.handle(null);
return CostResult.success();
}
......@@ -327,7 +328,7 @@ public class CostController {
@RequestParam Integer userid) {
CostContext costContext = new CostContext(costNo, userid);
costContext.setCostState(factoryCheckState);
costContext.handle();
costContext.handle(null);
return CostResult.success();
}
......@@ -348,7 +349,7 @@ public class CostController {
@RequestParam Integer userid) {
CostContext costContext = new CostContext(costNo, userid);
costContext.setCostState(hrCheckState);
costContext.handle();
costContext.handle(null);
return CostResult.success();
}
......
......@@ -52,7 +52,7 @@ public class AppCostServiceImpl implements AppCostService {
@Override
public void appCostPass(AppCostPassReq req) {
CostContext costContext = this.getCostState(req.getCostNo(), req.getOaUserId());
costContext.handle();
costContext.handle(null);
}
@Override
......
......@@ -19,6 +19,6 @@ public class CostSubscribe {
public void subscribe(CostContext costContext) {
costContext.handle();
costContext.handle(null);
}
}
......@@ -35,8 +35,8 @@ public class CostContext {
}
public void handle() {
costState.handle();
public void handle(String reason) {
costState.handle(reason);
}
public void refuse(String rejectReason) {
......
......@@ -85,7 +85,7 @@ public abstract class CostState {
}
public abstract void handle();
public abstract void handle(String reason);
public abstract void refuse(String rejectReason);
......
package com.blt.other.module.cost.service.impl.costcheck;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.database.model.CostLogDomain;
......@@ -58,7 +59,7 @@ public class DepartmentCheckState extends CostState {
@Transactional(rollbackFor = Exception.class)
@Override
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId;
CostTemplate costTemplate = costTemplateService.queryDetail(costDomain.getCostTemplateId());
......@@ -136,7 +137,7 @@ public class DepartmentCheckState extends CostState {
costDomain.setCostStatus(CostDomain.STATUS_HR_CHECK);
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain);
costLogService.save(costDomain.getCostNo(), currentUserId, "部门审核通过", CostLogDomain.DEPARTMENT_MANUAL_PASS);
costLogService.save(costDomain.getCostNo(), currentUserId, "部门审核通过" + (StringUtils.isNotBlank(reason) ? (":" + reason) : ""), CostLogDomain.DEPARTMENT_MANUAL_PASS);
//审批历史
approvalHistoryService.save(approvalHistoryDomain);
nextState(hrCheckState);
......
......@@ -56,7 +56,7 @@ public class FactoryCheckState extends CostState {
@Override
@Transactional(rollbackFor = Exception.class)
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId;
//CostTemplate costTemplate = costTemplateService.queryDetail(costDomain.getCostTemplateId());
......
package com.blt.other.module.cost.service.impl.costcheck;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.config.property.WxWebHook;
import com.blt.other.common.exception.BizRuntimeException;
......@@ -101,7 +102,7 @@ public class FinalCheckState extends CostState {
@Transactional(rollbackFor = Exception.class)
@Override
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId;
CostTemplate costTemplate = costTemplateService.queryDetail(costDomain.getCostTemplateId());
......@@ -159,7 +160,7 @@ public class FinalCheckState extends CostState {
costDao.updateById(costDomain);
log.info("费用单:{}最终审核人工审核通过", costDomain.getCostNo());
costLogService.save(costDomain.getCostNo(), currentUserId, "最终审核通过", CostLogDomain.FINAL_MANUAL_PASS);
costLogService.save(costDomain.getCostNo(), currentUserId, "最终审核通过" + (StringUtils.isNotBlank(reason) ? (":" + reason) : ""), CostLogDomain.FINAL_MANUAL_PASS);
approvalHistoryService.save(approvalHistoryDomain);
......
package com.blt.other.module.cost.service.impl.costcheck;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.config.property.WxWebHook;
import com.blt.other.common.exception.BizRuntimeException;
......@@ -83,7 +84,7 @@ public class FinancialCheckState extends CostState {
@Transactional(rollbackFor = Exception.class)
@Override
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId;
CostTemplate costTemplate = costTemplateService.queryDetail(costDomain.getCostTemplateId());
......@@ -127,7 +128,7 @@ public class FinancialCheckState extends CostState {
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain);
costLogService.save(costDomain.getCostNo(), currentUserId, "财务审核通过", CostLogDomain.FINANCIAL_MANUAL_PASS);
costLogService.save(costDomain.getCostNo(), currentUserId, "财务审核通过" + (StringUtils.isNotBlank(reason) ? (":" + reason) : ""), CostLogDomain.FINANCIAL_MANUAL_PASS);
sendWxMsg(costDomain, currentUserId);
approvalHistoryService.save(approvalHistoryDomain);
//流转状态
......
......@@ -53,7 +53,7 @@ public class GeneralManagerCheckState extends CostState {
static Map<LocalDate, Integer> APPROVE_TIMES = new ConcurrentHashMap<>();
@Override
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId;
//CostTemplate costTemplate = costTemplateService.queryDetail(costDomain.getCostTemplateId());
......
......@@ -48,7 +48,7 @@ public class HrCheckState extends CostState {
ApprovalHistoryService approvalHistoryService;
@Override
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId;
CostTemplate costTemplate = costTemplateService.queryDetail(costDomain.getCostTemplateId());
......
......@@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
public class PayedState extends CostState {
@Override
public void handle() {
public void handle(String reason) {
}
......
......@@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
public class RefuseState extends CostState {
@Override
public void handle() {
public void handle(String reason) {
throw new BizRuntimeException("unsupported operate ");
}
......
......@@ -20,7 +20,7 @@ import org.springframework.stereotype.Component;
public class UnPayState extends CostState {
@Override
public void handle() {
public void handle(String reason) {
}
......
......@@ -27,7 +27,7 @@ public class UnSubmitState extends CostState {
@Transactional(rollbackFor = Exception.class)
@Override
public void handle() {
public void handle(String reason) {
CostDomain costDomain = costContext.costDomain;
//校验费用单状态 和 当前处理用户
......
......@@ -15,7 +15,7 @@
select *
from cost_log
where cost_no = #{costNo}
and type in (2, 3)
and type in (2, 3, 5)
order by update_time desc
limit 1;
</select>
......
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