|
@@ -16,15 +16,20 @@
|
|
|
*/
|
|
*/
|
|
|
package org.springblade.check.service.impl;
|
|
package org.springblade.check.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.trade.purchase.extra.feign.IClaimClient;
|
|
import com.trade.purchase.extra.feign.IClaimClient;
|
|
|
import com.trade.purchase.extra.feign.ILeadsClient;
|
|
import com.trade.purchase.extra.feign.ILeadsClient;
|
|
|
import com.trade.purchase.office.feign.IOfficeOrderClient;
|
|
import com.trade.purchase.office.feign.IOfficeOrderClient;
|
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
|
|
|
+import jodd.util.ObjectUtil;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.check.dto.AuditProecessDTO;
|
|
import org.springblade.check.dto.AuditProecessDTO;
|
|
|
import org.springblade.check.entity.AuditPathsActs;
|
|
import org.springblade.check.entity.AuditPathsActs;
|
|
@@ -41,6 +46,7 @@ import org.springblade.client.feign.IMessageClient;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
|
|
|
+import org.springblade.finance.dto.SettlementDTO;
|
|
|
import org.springblade.finance.feign.IFinanceClient;
|
|
import org.springblade.finance.feign.IFinanceClient;
|
|
|
import org.springblade.finance.vojo.Settlement;
|
|
import org.springblade.finance.vojo.Settlement;
|
|
|
import org.springblade.project.entity.ServiceProject;
|
|
import org.springblade.project.entity.ServiceProject;
|
|
@@ -53,6 +59,7 @@ import org.springblade.school.feign.ISalaryClient;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
|
|
+import org.springblade.system.user.feign.IUserSearchClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -101,6 +108,10 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
|
|
|
|
|
|
|
|
private final ILeadsClient leadsClient;
|
|
private final ILeadsClient leadsClient;
|
|
|
|
|
|
|
|
|
|
+ private final ISysClient iSysClient;
|
|
|
|
|
+
|
|
|
|
|
+ private final IUserSearchClient iUserSearchClient;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<AuditProecessVO> selectAuditProecessPage(IPage<AuditProecessVO> page, AuditProecessVO auditProecess) {
|
|
public IPage<AuditProecessVO> selectAuditProecessPage(IPage<AuditProecessVO> page, AuditProecessVO auditProecess) {
|
|
|
return page.setRecords(baseMapper.selectAuditProecessPage(page, auditProecess));
|
|
return page.setRecords(baseMapper.selectAuditProecessPage(page, auditProecess));
|
|
@@ -419,6 +430,82 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
|
|
|
if (!save.isSuccess()) {
|
|
if (!save.isSuccess()) {
|
|
|
throw new SecurityException("发送消息失败");
|
|
throw new SecurityException("发送消息失败");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!"681169".equals(AuthUtil.getTenantId())){
|
|
|
|
|
+ Settlement settlement = new Settlement();
|
|
|
|
|
+ settlement.setId(auditProecess.getSrcBillId());
|
|
|
|
|
+ R settlementR = financeClient.details(auditProecess.getSrcBillId());
|
|
|
|
|
+ if (settlementR.isSuccess()) {
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
|
+ Settlement settlement1 = objectMapper.convertValue(settlementR.getData(), Settlement.class);
|
|
|
|
|
+ SettlementDTO settlementDTO = new SettlementDTO();
|
|
|
|
|
+ settlementDTO.setId(settlement1.getId());
|
|
|
|
|
+ settlementDTO.setItemsList(settlement1.getItemsList());
|
|
|
|
|
+ settlementDTO.setSrcOrderno(settlement1.getSrcOrderno());
|
|
|
|
|
+ settlementDTO.setAmount(settlement1.getAmount());
|
|
|
|
|
+ settlementDTO.setBillType("付费");
|
|
|
|
|
+ settlementDTO.setCaseOverPayment(settlement1.getCaseOverPayment());
|
|
|
|
|
+ settlementDTO.setCheckStatus(settlement1.getCheckStatus());
|
|
|
|
|
+ settlementDTO.setCorpId(settlement1.getCorpId());
|
|
|
|
|
+ settlementDTO.setCreateTime(settlement1.getCreateTime());
|
|
|
|
|
+ settlementDTO.setCreateUser(settlement1.getCreateUser());
|
|
|
|
|
+ settlementDTO.setCreateUserName(settlement1.getCreateUserName());
|
|
|
|
|
+ settlementDTO.setCustomerModel(settlement1.getCustomerModel());
|
|
|
|
|
+ settlementDTO.setDc(settlement1.getDc());
|
|
|
|
|
+
|
|
|
|
|
+ settlementDTO.setFinanceStatus(settlement1.getFinanceStatus());
|
|
|
|
|
+
|
|
|
|
|
+ settlementDTO.setPageLabel(settlement1.getPageLabel());
|
|
|
|
|
+ settlementDTO.setOverPayment(settlement1.getOverPayment());
|
|
|
|
|
+ settlementDTO.setPageStatus(settlement1.getPageStatus());
|
|
|
|
|
+ settlementDTO.setSettlementType(settlement1.getSettlementType());
|
|
|
|
|
+ settlementDTO.setSrcBillId(settlement1.getSrcBillId());
|
|
|
|
|
+ settlementDTO.setSysNo(settlement1.getSysNo());
|
|
|
|
|
+ settlementDTO.setTenantId(settlement1.getTenantId());
|
|
|
|
|
+ settlementDTO.setUrl(settlement1.getUrl());
|
|
|
|
|
+ R saveR = financeClient.saveOrEdit(settlementDTO);
|
|
|
|
|
+ if (saveR.isSuccess()) {
|
|
|
|
|
+
|
|
|
|
|
+ R roleId = iSysClient.getRoleIds(AuthUtil.getTenantId(), "财务出纳");
|
|
|
|
|
+ if (roleId.isSuccess() && ObjectUtils.isNotNull(roleId.getData())) {
|
|
|
|
|
+ R<List<User>> userList = iUserSearchClient.listByRole(roleId.getData().toString());
|
|
|
|
|
+ if (userList.isSuccess() && ObjectUtils.isNotNull(userList.getData())) {
|
|
|
|
|
+ for (User user : userList.getData()) {
|
|
|
|
|
+ //信息
|
|
|
|
|
+ Message message = new Message();
|
|
|
|
|
+ message.setParameter(String.valueOf(auditProecess.getBillId()));
|
|
|
|
|
+ message.setUserName(AuthUtil.getUserName());
|
|
|
|
|
+ message.setUserId(AuthUtil.getUserId());
|
|
|
|
|
+ message.setToUserId(user.getId());
|
|
|
|
|
+ message.setToUserName(user.getName());
|
|
|
|
|
+ message.setMessageType(1);
|
|
|
|
|
+ message.setTenantId(AuthUtil.getTenantId());
|
|
|
|
|
+ message.setCreateUser(AuthUtil.getUserId());
|
|
|
|
|
+ message.setCreateTime(new Date());
|
|
|
|
|
+ message.setUrl(auditProecess.getUrl());
|
|
|
|
|
+ message.setPageLabel(auditProecess.getPageLabel());
|
|
|
|
|
+ message.setPageStatus(auditProecess.getPageStatus());
|
|
|
|
|
+ message.setMessageBody("付费请核已通过" + ",采购订单号:" + proecessTemp.getBillNo() + ",请继续操作");
|
|
|
|
|
+ R messageR = messageClient.save(message);
|
|
|
|
|
+ if (!messageR.isSuccess()) {
|
|
|
|
|
+ throw new SecurityException("发送消息失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new SecurityException("发送消息失败102");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new SecurityException("发送消息失败101");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new SecurityException("生成账单保存失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new SecurityException("生成账单失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
//不通过
|
|
//不通过
|
|
|
else if (operate == 2) {
|
|
else if (operate == 2) {
|
|
@@ -954,9 +1041,9 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
|
|
|
List<AuditProecess> auditProecessList = proecessList.stream().filter(e -> e.getBatchNo() == max).collect(Collectors.toList());
|
|
List<AuditProecess> auditProecessList = proecessList.stream().filter(e -> e.getBatchNo() == max).collect(Collectors.toList());
|
|
|
//如果最新审批记录 第一级已经操作,就禁止撤回
|
|
//如果最新审批记录 第一级已经操作,就禁止撤回
|
|
|
long count = auditProecessList.stream().filter(
|
|
long count = auditProecessList.stream().filter(
|
|
|
- e -> e.getBatchNo() == max &&
|
|
|
|
|
- e.getLevelId() == 1 &&
|
|
|
|
|
- ("A".equals(e.getAuditStatus()) || "B".equals(e.getAuditStatus())))
|
|
|
|
|
|
|
+ e -> e.getBatchNo() == max &&
|
|
|
|
|
+ e.getLevelId() == 1 &&
|
|
|
|
|
+ ("A".equals(e.getAuditStatus()) || "B".equals(e.getAuditStatus())))
|
|
|
.count();
|
|
.count();
|
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
|
throw new SecurityException("第一级审批已经开始,禁止撤回");
|
|
throw new SecurityException("第一级审批已经开始,禁止撤回");
|
|
@@ -1459,20 +1546,20 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
|
|
|
else if (operate == 2) {
|
|
else if (operate == 2) {
|
|
|
auditProecess.setAuditStatus("B");
|
|
auditProecess.setAuditStatus("B");
|
|
|
// if (auditProecess.getLevelId() == 1) {
|
|
// if (auditProecess.getLevelId() == 1) {
|
|
|
- R submit;
|
|
|
|
|
- if ("fybx".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
- submit = claimClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
- sendMessage.setMessageBody("您的费用报销请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
- } else if ("jjd".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
- submit = handoverClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
- sendMessage.setMessageBody("您的交接单请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
- } else {
|
|
|
|
|
- throw new SecurityException("此审批类型未查到相关审批类型");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ R submit;
|
|
|
|
|
+ if ("fybx".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
+ submit = claimClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
+ sendMessage.setMessageBody("您的费用报销请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
+ } else if ("jjd".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
+ submit = handoverClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
+ sendMessage.setMessageBody("您的交接单请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new SecurityException("此审批类型未查到相关审批类型");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (!submit.isSuccess()) {
|
|
|
|
|
- throw new SecurityException("修改原数据失败");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!submit.isSuccess()) {
|
|
|
|
|
+ throw new SecurityException("修改原数据失败");
|
|
|
|
|
+ }
|
|
|
// }
|
|
// }
|
|
|
R save = messageClient.save(sendMessage);
|
|
R save = messageClient.save(sendMessage);
|
|
|
if (!save.isSuccess()) {
|
|
if (!save.isSuccess()) {
|
|
@@ -1511,20 +1598,20 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
|
|
|
else if (operate == 2) {
|
|
else if (operate == 2) {
|
|
|
auditProecess.setAuditStatus("B");
|
|
auditProecess.setAuditStatus("B");
|
|
|
// if (auditProecess.getLevelId() == 2) {
|
|
// if (auditProecess.getLevelId() == 2) {
|
|
|
- R submit;
|
|
|
|
|
- if ("fybx".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
- submit = claimClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
- sendMessage.setMessageBody("您的费用报销请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
- } else if ("jjd".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
- submit = handoverClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
- sendMessage.setMessageBody("您的交接单请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
- } else {
|
|
|
|
|
- throw new SecurityException("此审批类型未查到相关审批类型");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ R submit;
|
|
|
|
|
+ if ("fybx".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
+ submit = claimClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
+ sendMessage.setMessageBody("您的费用报销请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
+ } else if ("jjd".equals(proecessTemp.getCheckType())) {
|
|
|
|
|
+ submit = handoverClient.passCancel(auditProecess.getSrcBillId());
|
|
|
|
|
+ sendMessage.setMessageBody("您的交接单请核未通过,驳回原因:" + auditProecess.getAuditMsg());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new SecurityException("此审批类型未查到相关审批类型");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (!submit.isSuccess()) {
|
|
|
|
|
- throw new SecurityException("修改原数据失败");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!submit.isSuccess()) {
|
|
|
|
|
+ throw new SecurityException("修改原数据失败");
|
|
|
|
|
+ }
|
|
|
// }
|
|
// }
|
|
|
R save = messageClient.save(sendMessage);
|
|
R save = messageClient.save(sendMessage);
|
|
|
if (!save.isSuccess()) {
|
|
if (!save.isSuccess()) {
|
|
@@ -1716,6 +1803,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 销售机会审批
|
|
* 销售机会审批
|
|
|
|
|
+ *
|
|
|
* @param auditProecess
|
|
* @param auditProecess
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|