Commit 046adc61 by jianshuqin

增加总经办审核日志

parent ce1cebae
...@@ -163,6 +163,7 @@ public class GeneralManagerCheckState extends CostState { ...@@ -163,6 +163,7 @@ public class GeneralManagerCheckState extends CostState {
.map(CostCurrentReviewer::getOaUserId) .map(CostCurrentReviewer::getOaUserId)
.collect(Collectors.toList()) .collect(Collectors.toList())
.contains(costLogDomain.getUpdateUserid())) { .contains(costLogDomain.getUpdateUserid())) {
costLogService.saveByManage(costDomain.getCostNo(),"部门审核人和总经办审核人是同一人,符合自动审核条件",null);
//部门审核人和总经办审核人是同一个人,总经办审核人自动通过。 //部门审核人和总经办审核人是同一个人,总经办审核人自动通过。
return true; return true;
} }
...@@ -171,6 +172,7 @@ public class GeneralManagerCheckState extends CostState { ...@@ -171,6 +172,7 @@ public class GeneralManagerCheckState extends CostState {
return true; return true;
} }
if (costDomain.getProjectType() != null && costDomain.getProjectType().equalsIgnoreCase("DSP")) { if (costDomain.getProjectType() != null && costDomain.getProjectType().equalsIgnoreCase("DSP")) {
costLogService.saveByManage(costDomain.getCostNo(),"项目类型【DSP】符合设定自动审核条件",null);
//DSP不需要审核 //DSP不需要审核
return true; return true;
} }
...@@ -180,11 +182,13 @@ public class GeneralManagerCheckState extends CostState { ...@@ -180,11 +182,13 @@ public class GeneralManagerCheckState extends CostState {
|| costTypeDomain.getTypeName().contains("公积金") || costTypeDomain.getTypeName().contains("公积金")
|| costTypeDomain.getTypeName().contains("租金物业水电费") || costTypeDomain.getTypeName().contains("租金物业水电费")
|| costTypeDomain.getTypeName().contains("车辆使用费")) { || costTypeDomain.getTypeName().contains("车辆使用费")) {
costLogService.saveByManage(costDomain.getCostNo(),"费用类型【" + costTypeDomain.getTypeName() + "】符合设定自动审核条件",null);
return true; return true;
} }
//小于5k不需要总经办审批,特殊情况除外; //小于5k不需要总经办审批,特殊情况除外;
if (costDomain.getAmountRmb().compareTo(new BigDecimal("5000")) < 0) { if (costDomain.getAmountRmb().compareTo(new BigDecimal("5000")) < 0) {
costLogService.saveByManage(costDomain.getCostNo(),"人民币金额【" + costDomain.getAmountRmb() + "】少于设定5000审核条件",null);
//特殊情况:0(含)-5k(不含)的每天随机抽取三个订单 //特殊情况:0(含)-5k(不含)的每天随机抽取三个订单
//if (costDomain.getAmountRmb().compareTo(new BigDecimal("5000")) >= 0) { //if (costDomain.getAmountRmb().compareTo(new BigDecimal("5000")) >= 0) {
/* 取消每天随机抽取三个订单的特殊情况 /* 取消每天随机抽取三个订单的特殊情况
......
...@@ -83,6 +83,9 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme ...@@ -83,6 +83,9 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
costDomain.setCostStatus(0); costDomain.setCostStatus(0);
costDomain.setAmount(costPlanDomain.getPlanAmount()); costDomain.setAmount(costPlanDomain.getPlanAmount());
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
if (BigDecimal.ZERO.compareTo(toRmbRate) == 0 || (costDomain.getDic() != null && !costDomain.getDic().equals("CNY") && BigDecimal.ONE.compareTo(toRmbRate) == 0)) {
throw new BizRuntimeException("获取汇率异常,请重试!");
}
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
if(StringUtils.isBlank(costDomain.getCategoryName())){ if(StringUtils.isBlank(costDomain.getCategoryName())){
......
...@@ -117,6 +117,9 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -117,6 +117,9 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
costDomain.setDic(costDetailDomains.get(0).getDic()); costDomain.setDic(costDetailDomains.get(0).getDic());
costDomain.setCostStatus(0); costDomain.setCostStatus(0);
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
if (BigDecimal.ZERO.compareTo(toRmbRate) == 0 || (costDomain.getDic() != null && !costDomain.getDic().equals("CNY") && BigDecimal.ONE.compareTo(toRmbRate) == 0)) {
throw new BizRuntimeException("获取汇率异常,请重试!");
}
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
// 执行添加记录流程 // 执行添加记录流程
......
...@@ -2,8 +2,18 @@ package com.blt.other.module.cost.service.impl; ...@@ -2,8 +2,18 @@ package com.blt.other.module.cost.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.database.model.CostLogDomain;
import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.module.cost.dao.CostCurrentReviewerMapper;
import com.blt.other.module.cost.dao.CostLogDao;
import com.blt.other.module.cost.dao.CostTypeDao;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostApiService; import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.cost.service.CostLogService;
import com.blt.other.module.cost.service.CostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
...@@ -12,6 +22,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; ...@@ -12,6 +22,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
...@@ -30,8 +43,76 @@ public class CostApiServiceImplTest { ...@@ -30,8 +43,76 @@ public class CostApiServiceImplTest {
@Resource @Resource
CostApiService costApiService; CostApiService costApiService;
@Autowired
CostLogService costLogService;
@Resource
CostLogDao costLogDao;
@Resource
CostCurrentReviewerMapper costCurrentReviewerMapper;
@Resource
private CostService costService;
@Resource
CostTypeDao costTypeDao;
@Test @Test
public void getCostList() { public void getCostList() {
costApiService.getCostList("2021-01-01 00:00:00", "2021-01-01 00:00:00", 1, 10); costApiService.getCostList("2021-01-01 00:00:00", "2021-01-01 00:00:00", 1, 10);
} }
@Test
public void autoPass() {
boolean result = false;
String costNo = "F055624";
CostDomain costDomain = costService.getCostByCostNo(costNo);
CostLogDomain costLogDomain = costLogDao.selectDepartmentCheckLog(costDomain.getCostNo());
List<CostCurrentReviewer> costCurrentReviewerList = costCurrentReviewerMapper.selectByCostNo(costDomain.getCostNo());
if (costLogDomain != null
&& costCurrentReviewerList
.stream()
.map(CostCurrentReviewer::getOaUserId)
.collect(Collectors.toList())
.contains(costLogDomain.getUpdateUserid())) {
//部门审核人和总经办审核人是同一个人,总经办审核人自动通过。
result = true;
}
if (costDomain.getCostForm().equals(2)) {
//收款不需要审核
result = true;
}
if (costDomain.getProjectType() != null && costDomain.getProjectType().equalsIgnoreCase("DSP")) {
//DSP不需要审核
result = true;
}
CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costDomain.getTypeNo());
if (costTypeDomain.getTypeName().contains("工资") || costTypeDomain.getTypeName().contains("物流")
|| costTypeDomain.getTypeName().contains("社保费")
|| costTypeDomain.getTypeName().contains("公积金")
|| costTypeDomain.getTypeName().contains("租金物业水电费")
|| costTypeDomain.getTypeName().contains("车辆使用费")) {
result = true;
}
//小于5k不需要总经办审批,特殊情况除外;
if (costDomain.getAmountRmb().compareTo(new BigDecimal("5000")) < 0) {
result = true;
}
result = false;
}
@Test
@Rollback(false)
public void saveByManage() {
boolean result = false;
String costNo = "F056019";
String updateMainNote = "测试日志";
Integer type = null;
costLogService.saveByManage(costNo,updateMainNote,type);
}
} }
...@@ -28,7 +28,6 @@ class CostCompanyServiceImplTest { ...@@ -28,7 +28,6 @@ class CostCompanyServiceImplTest {
@Resource @Resource
CostCompanyService costCompanyService; CostCompanyService costCompanyService;
@Rollback
@Test @Test
void syncCompany() { void syncCompany() {
String result = costCompanyService.syncCompany(); String result = costCompanyService.syncCompany();
......
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