|
|
@@ -19,7 +19,6 @@ package org.springblade.los.check.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
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.extension.service.impl.ServiceImpl;
|
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
|
@@ -28,6 +27,10 @@ import org.springblade.client.entity.Message;
|
|
|
import org.springblade.client.feign.IMessageClient;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.los.basic.corps.entity.BCorps;
|
|
|
+import org.springblade.los.basic.corps.service.IBCorpsService;
|
|
|
+import org.springblade.los.business.sea.entity.Bills;
|
|
|
+import org.springblade.los.business.sea.mapper.BillsMapper;
|
|
|
import org.springblade.los.check.dto.LosAuditProecessDTO;
|
|
|
import org.springblade.los.check.entity.LosAuditPathsActs;
|
|
|
import org.springblade.los.check.entity.LosAuditPathsLevels;
|
|
|
@@ -36,9 +39,6 @@ import org.springblade.los.check.mapper.AuditPathsActsMapper;
|
|
|
import org.springblade.los.check.mapper.AuditProecessMapper;
|
|
|
import org.springblade.los.check.service.IAuditProecessService;
|
|
|
import org.springblade.los.check.vo.LosAuditProecessVO;
|
|
|
-import org.springblade.system.feign.ISysClient;
|
|
|
-import org.springblade.system.user.feign.IUserClient;
|
|
|
-import org.springblade.system.user.feign.IUserSearchClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -63,11 +63,10 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
|
|
|
private final IMessageClient messageClient;
|
|
|
|
|
|
- private final ISysClient sysClient;
|
|
|
+ private final BillsMapper billsMapper;
|
|
|
|
|
|
- private final IUserClient userClient;
|
|
|
+ private final IBCorpsService bCorpsService;
|
|
|
|
|
|
- private final IUserSearchClient iUserSearchClient;
|
|
|
|
|
|
@Override
|
|
|
public IPage<LosAuditProecessVO> selectAuditProecessPage(IPage<LosAuditProecessVO> page, LosAuditProecessVO auditProecess) {
|
|
|
@@ -140,15 +139,12 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
|
|
|
String corpName = null;
|
|
|
if (auditProecessDTO.getCorpId() != null) {
|
|
|
- String status = sysClient.getParamService("mall.data");
|
|
|
- if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
|
|
|
- /*PjCorpsDesc corpMessage = ipjCorpClient.getByCorp(auditProecessDTO.getCorpId());
|
|
|
- if (corpMessage != null) {
|
|
|
- corpName = corpMessage.getCname();
|
|
|
- }*/
|
|
|
+ BCorps corpMessage = bCorpsService.getById(auditProecessDTO.getCorpId());
|
|
|
+ if (corpMessage != null) {
|
|
|
+ corpName = corpMessage.getCorpName();
|
|
|
}
|
|
|
}
|
|
|
- String orderDate = null;
|
|
|
+ String billsDate = null;
|
|
|
//开启之后, 给第一级推送消息
|
|
|
|
|
|
Message message = new Message();
|
|
|
@@ -157,13 +153,8 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
message.setMessageType(1);
|
|
|
message.setOrigin(1);
|
|
|
message.setParameter(String.valueOf(auditProecessDTO.getBillId()));
|
|
|
- if ("退款审批".equals(auditProecessDTO.getProcessType())) {
|
|
|
- message.setMessageBody("您有新的售后审核,客户名:" + corpName + "," + "订单号:" +
|
|
|
- "" + auditProecessDTO.getBillNo() + ",请审核。"
|
|
|
- + " 提交人:" + auditProecessDTO.getSendName() + " " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
|
|
|
- );
|
|
|
- } else if ("采购审核".equals(auditProecessDTO.getProcessType())) {
|
|
|
- message.setMessageBody("您有新的采购审核,客户名:" + corpName + "," + "订单号:" +
|
|
|
+ if ("海运出口审核".equals(auditProecessDTO.getProcessType())) {
|
|
|
+ message.setMessageBody("您有新的单据审核,客户名:" + corpName + "," + "业务单号:" +
|
|
|
"" + auditProecessDTO.getBillNo() + ",请审核。"
|
|
|
+ " 提交人:" + auditProecessDTO.getSendName() + " " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
|
|
|
);
|
|
|
@@ -232,12 +223,12 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 配件销售退款审核
|
|
|
+ * 海运出口单据审核
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
- public void pjOrderCheck(LosAuditProecess auditProecess) {
|
|
|
+ public void losBillsCheck(LosAuditProecess auditProecess) {
|
|
|
//查看最新操作记录,防止重复提交
|
|
|
LosAuditProecess proecessTemp = baseMapper.selectById(auditProecess.getId());
|
|
|
if (proecessTemp == null) {
|
|
|
@@ -274,7 +265,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
//审批时间
|
|
|
auditProecess.setAuditOpTime(new Date());
|
|
|
|
|
|
-// PjOrder order = ipjOrderClient.getByIdOrder(proecessTemp.getBillId());
|
|
|
+ Bills bills = billsMapper.selectById(proecessTemp.getBillId());
|
|
|
|
|
|
//不是最后一级
|
|
|
if ("F".equals(iffinalItem)) {
|
|
|
@@ -283,10 +274,16 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
if (operate == 1) {
|
|
|
//如果是第一级, 则修改状态为审批中
|
|
|
if (auditProecess.getLevelId() == 1) {
|
|
|
- /*R submit = ipjOrderClient.orderUnderReview(auditProecess.getSrcBillId());
|
|
|
- if (!submit.isSuccess()) {
|
|
|
+// R submit = billsService.underReview(auditProecess.getSrcBillId());
|
|
|
+ Bills detail = billsMapper.selectById(auditProecess.getSrcBillId());
|
|
|
+ if (detail == null) {
|
|
|
+ throw new SecurityException("审批通过失败");
|
|
|
+ }
|
|
|
+ detail.setStatus(2);
|
|
|
+ int count = billsMapper.updateById(detail);
|
|
|
+ if (count > 0) {
|
|
|
throw new SecurityException("审批开始修改审核状态失败");
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
auditProecess.setAuditStatus("A");
|
|
|
@@ -315,11 +312,11 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
|
|
|
|
|
|
//获得订单创建日期
|
|
|
- String orderDate = null;
|
|
|
+ String billsDate = null;
|
|
|
if (proecessTemp.getBillId() != null) {
|
|
|
- /*if (order != null) {
|
|
|
- orderDate = simpleDateFormat.format(order.getCreateTime());
|
|
|
- }*/
|
|
|
+ if (bills != null) {
|
|
|
+ billsDate = simpleDateFormat.format(bills.getCreateTime());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Message message = new Message();
|
|
|
@@ -329,8 +326,8 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
message.setMessageType(1);
|
|
|
message.setTenantId(AuthUtil.getTenantId());
|
|
|
|
|
|
- message.setMessageBody("您有新的审核,订单单号:" + "" + proecessTemp.getBillNo() + ","
|
|
|
- + "订单日期:" + orderDate + ",请审核。"
|
|
|
+ message.setMessageBody("您有新的审核,业务单号:" + "" + proecessTemp.getBillNo() + ","
|
|
|
+ + "单据日期:" + billsDate + ",请审核。"
|
|
|
+ "提交人:" + proecessTemp.getSendName() + " " + "提交时间" + simpleDateFormat.format(proecessTemp.getSendTime())
|
|
|
);
|
|
|
|
|
|
@@ -344,13 +341,18 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
//不通过
|
|
|
else if (operate == 2) {
|
|
|
auditProecess.setAuditStatus("B");
|
|
|
- //todo 调用feign取消
|
|
|
- /*R r = ipjOrderClient.orderPassCancel(auditProecess.getSrcBillId());
|
|
|
- if (!r.isSuccess()) {
|
|
|
+ Bills detail = billsMapper.selectById(auditProecess.getSrcBillId());
|
|
|
+ if (detail == null) {
|
|
|
+ throw new SecurityException("审批通过失败");
|
|
|
+ }
|
|
|
+ detail.setStatus(4);
|
|
|
+ int count = billsMapper.updateById(detail);
|
|
|
+// R r = billsService.passCancel(auditProecess.getSrcBillId());
|
|
|
+ if (count > 0) {
|
|
|
throw new SecurityException("修改订单数据失败");
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
- sendMessage.setMessageBody("您的审核未通过" + ",订单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
|
|
|
+ sendMessage.setMessageBody("您的审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
|
|
|
R save = messageClient.save(sendMessage);
|
|
|
if (!save.isSuccess()) {
|
|
|
throw new SecurityException("发送消息失败");
|
|
|
@@ -362,14 +364,19 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
else if ("T".equals(iffinalItem)) {
|
|
|
//通过
|
|
|
if (operate == 1) {
|
|
|
- //todo 调用feign直接通过
|
|
|
auditProecess.setAuditStatus("A");
|
|
|
- /*R r = ipjOrderClient.orderPassCheck(auditProecess.getSrcBillId());
|
|
|
- if (!r.isSuccess()) {
|
|
|
+ Bills detail = billsMapper.selectById(auditProecess.getSrcBillId());
|
|
|
+ if (bills == null) {
|
|
|
+ throw new SecurityException("审批通过失败");
|
|
|
+ }
|
|
|
+ detail.setStatus(3);
|
|
|
+ int count = billsMapper.updateById(detail);
|
|
|
+// R r = billsService.passCheck(auditProecess.getSrcBillId());
|
|
|
+ if (count > 0) {
|
|
|
throw new SecurityException("修改订单数据失败");
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
- sendMessage.setMessageBody("您的审核已通过" + ",订单号:" + proecessTemp.getBillNo() + ",请继续操作");
|
|
|
+ sendMessage.setMessageBody("您的审核已通过" + ",业务单号:" + proecessTemp.getBillNo() + ",请继续操作");
|
|
|
R save = messageClient.save(sendMessage);
|
|
|
if (!save.isSuccess()) {
|
|
|
throw new SecurityException("发送消息失败");
|
|
|
@@ -379,11 +386,20 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
|
|
|
else if (operate == 2) {
|
|
|
//todo 调用feign取消
|
|
|
auditProecess.setAuditStatus("B");
|
|
|
- /*R r = ipjOrderClient.orderPassCancel(auditProecess.getSrcBillId());
|
|
|
+ Bills detail = billsMapper.selectById(auditProecess.getSrcBillId());
|
|
|
+ if (detail == null) {
|
|
|
+ throw new SecurityException("审批通过失败");
|
|
|
+ }
|
|
|
+ detail.setStatus(4);
|
|
|
+ int count = billsMapper.updateById(detail);
|
|
|
+ if (count > 0) {
|
|
|
+ throw new SecurityException("修改订单数据失败");
|
|
|
+ }
|
|
|
+ /*R r = billsService.passCancel(auditProecess.getSrcBillId());
|
|
|
if (!r.isSuccess()) {
|
|
|
throw new SecurityException("修改订单数据失败");
|
|
|
}*/
|
|
|
- sendMessage.setMessageBody("您的审核未通过" + ",订单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
|
|
|
+ sendMessage.setMessageBody("您的审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
|
|
|
R save = messageClient.save(sendMessage);
|
|
|
if (!save.isSuccess()) {
|
|
|
throw new SecurityException("发送消息失败");
|