Commit aeee3783 by huluobin

update

parent 2478960a
......@@ -18,12 +18,14 @@ import org.springframework.stereotype.Component;
@ConfigurationProperties("cost.url")
public class CostUrlProperties {
//采购回调用
public String purchaseApplyCallbackUrlPost;
public String purchaseCashierCallbackUrlPost;
//费用单回调
public String costApplyCallbackUrlPost;
public String costCashierCallbackUrlPost;
public String lendCostApplyCallBackUrlPost;
public String lendCostCashierCallbackUrlPost;
public String getBuyDetailApi;
public String getCostDetailApi;
......
......@@ -3,6 +3,7 @@ package com.blt.other.module.cost.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -81,7 +82,27 @@ public class CostTemplateCol implements Serializable {
Field field = clazz.getDeclaredField(this.costTemplateBaseCol.getColName());
field.setAccessible(true);
Object fieldVar = field.get(costDomain);
return true;
switch (autoRuleType) {
case 1:
return autoRuleCheckVal.compareTo(fieldVar.toString()) == 0;
case 2:
return autoRuleCheckVal.compareTo(fieldVar.toString()) != 0;
case 3:
return autoRuleCheckVal.compareTo(fieldVar.toString()) < 0;
case 4:
return autoRuleCheckVal.compareTo(fieldVar.toString()) <= 0;
case 5:
return autoRuleCheckVal.compareTo(fieldVar.toString()) > 0;
case 6:
return autoRuleCheckVal.compareTo(fieldVar.toString()) >= 0;
case 7:
return Lists.newArrayList(autoRuleCheckVal.split(",")).contains(fieldVar.toString());
case 8:
return !Lists.newArrayList(autoRuleCheckVal.split(",")).contains(fieldVar.toString());
//不用自动校验
default:
return true;
}
} catch (Exception e) {
return false;
......
......@@ -34,19 +34,9 @@ public class PayCostServiceImpl extends AbstractCostService implements CostServi
public void toFinancial(CostDomain cost) {
PostApplyReq req = buildPostApplyReq(cost);
// 审核回调地址(ApplyCallbackUrl)不可为空;
if (cost.getCostNo().startsWith("S")) {
log.info("补差额的付款单:" + cost.getCostNo());
// 审核回调地址(ApplyCallbackUrl)不可为空;
req.setApplyCallbackUrl(costUrlProperties.lendCostApplyCallBackUrlPost);
// 出纳回调地址(CashierCallbackUrl)不可为空;
req.setCashierCallbackUrl(costUrlProperties.lendCostCashierCallbackUrlPost);
} else {
// 审核回调地址(ApplyCallbackUrl)不可为空;
req.setApplyCallbackUrl(costUrlProperties.costApplyCallbackUrlPost);
// 出纳回调地址(CashierCallbackUrl)不可为空;
req.setCashierCallbackUrl(costUrlProperties.costCashierCallbackUrlPost);
}
req.setApplyCallbackUrl(costUrlProperties.costApplyCallbackUrlPost);
// 出纳回调地址(CashierCallbackUrl)不可为空;
req.setCashierCallbackUrl(costUrlProperties.costCashierCallbackUrlPost);
req.setApplyType("" + 1);
......
......@@ -59,7 +59,7 @@ public class DepartmentCheckState extends CostState {
//需要自动审核
if (costTemplate.shouldDepartmentAutoCheck()) {
//自动审核通过
if (autoCheck(costDomain)) {
if (this.autoCheck(costDomain)) {
costDomain.setCostStatus(CostDomain.STATUS_FINANCIAL_CHECK);
costDao.updateById(costDomain);
costLogService.saveByManage(costDomain.getCostNo(), "部门自动审核通过", CostLogDomain.DEPARTMENT_AUTO_PASS);
......
......@@ -61,8 +61,7 @@ public class FinalCheckState extends CostState {
if (!costTemplate.shouldFinalCheck(costDomain.getAmount())) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
costDao.updateById(costDomain);
costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过", CostLogDomain.FINAL_AUTO_PASS);
costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过", null);
//通知财务系统
costContext.costService.toFinancial(costDomain);
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.module.auth.dao.CostReviewerMapper;
import com.blt.other.module.auth.dao.OaDepartmentMapper;
import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.auth.model.CostReviewer;
import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.auth.service.IOaCompanyService;
import com.blt.other.module.auth.service.IOaDepartmentService;
......@@ -61,10 +62,35 @@ public class OaDepartmentServiceImplTest {
oaCompany.getName().contains("4k") ||
oaCompany.getName().contains("歌戈儿") ||
oaCompany.getName().contains("迪致") ||
oaCompany.getName().contains("快询")){
oaCompany.getName().contains("快询")) {
}
});
}
@Test
public void setDepartmentReviewer() {
costReviewerMapper.delete(new LambdaQueryWrapper<CostReviewer>()
.eq(CostReviewer::getType, CostReviewer.departmentReviewer));
oaDepartmentMapper.selectList(new LambdaQueryWrapper<>())
.forEach(oaDepartment -> {
try {
String manage = oaDepartment.getManageUser1();
OaUser oaUser = oaUserMapper.selectByUserName(manage);
CostReviewer costReviewer = CostReviewer.builder()
.reviewerUserId(oaUser.getOaUserId())
.reviewerUserName(oaUser.getUserName())
.referId(oaDepartment.getDepartmentId())
.type(CostReviewer.departmentReviewer)
.build();
costReviewerMapper.insert(costReviewer);
} catch (Exception ignore) {
}
});
}
}
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