Commit 407204a7 by liyanlin

fix

parent d90c179d
...@@ -32,7 +32,7 @@ import java.util.stream.Collectors; ...@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
*/ */
@Component @Component
@Scope("prototype") @Scope("prototype")
public class GeneralManagerCheckState extends CostState{ public class GeneralManagerCheckState extends CostState {
@Resource @Resource
UnPayState unPayState; UnPayState unPayState;
...@@ -54,7 +54,7 @@ public class GeneralManagerCheckState extends CostState{ ...@@ -54,7 +54,7 @@ public class GeneralManagerCheckState extends CostState{
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
} }
//小于1w的自动审核 //小于1w的自动审核
if(this.autoPass(costDomain)){ if (this.autoPass(costDomain)) {
//自动审核通过 //自动审核通过
if (this.autoCheck(costDomain)) { if (this.autoCheck(costDomain)) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
...@@ -74,12 +74,9 @@ public class GeneralManagerCheckState extends CostState{ ...@@ -74,12 +74,9 @@ public class GeneralManagerCheckState extends CostState{
return; return;
} }
} }
if(currentUserId != null) { if (currentUserId != null) {
//目前限定铭哥能审核 //目前限定铭哥能审核
if (currentUserId != 681) { if (currentUserId == 681 || currentUserId == 2346) {
throw new BizRuntimeException("current user no authority");
}
//大于等于1w需要铭哥审批 //大于等于1w需要铭哥审批
if (costDomain.getAmountRmb().compareTo(new BigDecimal("10000")) >= 0) { if (costDomain.getAmountRmb().compareTo(new BigDecimal("10000")) >= 0) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
...@@ -98,6 +95,9 @@ public class GeneralManagerCheckState extends CostState{ ...@@ -98,6 +95,9 @@ public class GeneralManagerCheckState extends CostState{
costContext.costService.toFinancial(costDomain); costContext.costService.toFinancial(costDomain);
return; return;
} }
} else {
throw new BizRuntimeException("current user no authority");
}
} }
} }
...@@ -114,9 +114,7 @@ public class GeneralManagerCheckState extends CostState{ ...@@ -114,9 +114,7 @@ public class GeneralManagerCheckState extends CostState{
} }
//人工审核通过 //人工审核通过
if (currentUserId != 681) { if (currentUserId == 681 || currentUserId == 2346) {
throw new BizRuntimeException("current user no authority");
}
ApprovalHistoryDomain approvalHistoryDomain = ApprovalHistoryDomain.builder() ApprovalHistoryDomain approvalHistoryDomain = ApprovalHistoryDomain.builder()
.approvalUserId(currentUserId) .approvalUserId(currentUserId)
.approvalTime(LocalDateTime.now()) .approvalTime(LocalDateTime.now())
...@@ -127,6 +125,9 @@ public class GeneralManagerCheckState extends CostState{ ...@@ -127,6 +125,9 @@ public class GeneralManagerCheckState extends CostState{
approvalHistoryService.save(approvalHistoryDomain); approvalHistoryService.save(approvalHistoryDomain);
costContext.costService.reject(costDomain.getCostNo()); costContext.costService.reject(costDomain.getCostNo());
costLogService.save(costDomain.getCostNo(), currentUserId, "总经办审核拒绝,理由:" + rejectReason, CostLogDomain.TYPE_UPDATE); costLogService.save(costDomain.getCostNo(), currentUserId, "总经办审核拒绝,理由:" + rejectReason, CostLogDomain.TYPE_UPDATE);
} else {
throw new BizRuntimeException("current user no authority");
}
} }
@Override @Override
...@@ -146,16 +147,16 @@ public class GeneralManagerCheckState extends CostState{ ...@@ -146,16 +147,16 @@ public class GeneralManagerCheckState extends CostState{
} }
private boolean autoPass(CostDomain costDomain){ private boolean autoPass(CostDomain costDomain) {
if(costDomain.getAmountRmb().compareTo(new BigDecimal("10000")) < 0){ if (costDomain.getAmountRmb().compareTo(new BigDecimal("10000")) < 0) {
return true; return true;
} }
if(costDomain.getCostForm().equals(2)){ if (costDomain.getCostForm().equals(2)) {
//收款不需要审核 //收款不需要审核
return true; return true;
} }
CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costDomain.getTypeNo()); CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costDomain.getTypeNo());
if(costTypeDomain.getTypeName().contains("工资") || costTypeDomain.getTypeName().contains("物流")){ if (costTypeDomain.getTypeName().contains("工资") || costTypeDomain.getTypeName().contains("物流")) {
return true; return true;
} }
return false; return false;
......
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