以下接口增加判断-是否可以进行对应节点操作逻辑处理(比如两个人停留在请领单界面,一个人提交了,另一个人未刷新也进行提交)
请领单购物车提交 请领单回退单作废 请领单回退单回退 请领单回退单出库 请领单回退单收货
This commit is contained in:
parent
6058b33ab0
commit
357dc98f8c
|
|
@ -336,16 +336,11 @@ public class InvoicingQldApi {
|
|||
*/
|
||||
@ApiOperation(value = "请领单-出库(单个/批量)", notes = "请领单-出库(单个/批量)")
|
||||
@PostMapping(value = "/outbound")
|
||||
public Result<?> outbound(@RequestBody InvoicingQldMainEntity dto) {
|
||||
public Result<Map<String, Object>> outbound(@RequestBody InvoicingQldMainEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getQldNo())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.outbound(dto);
|
||||
if (result) {
|
||||
return Result.OK("出库成功");
|
||||
} else {
|
||||
return Result.error("出库失败");
|
||||
}
|
||||
return Result.ok(qinglingApi.outbound(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public interface IQinglingApi {
|
|||
|
||||
boolean orderReturn(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean outbound(InvoicingQldMainEntity dto);
|
||||
Map<String, Object> outbound(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean deleteQldWl(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface INuInvoicingQldLogService extends IService<NuInvoicingQldLog> {
|
||||
|
||||
boolean opeNodeJudgeCanStatus(String qldNo, String status);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,51 @@
|
|||
package com.nu.modules.qld.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.qld.entity.NuInvoicingQldLog;
|
||||
import com.nu.modules.qld.mapper.NuInvoicingQldLogMapper;
|
||||
import com.nu.modules.qld.service.INuInvoicingQldLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 进销存-请领单-操作日志表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-26
|
||||
* @Date: 2025-11-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuInvoicingQldLogServiceImpl extends ServiceImpl<NuInvoicingQldLogMapper, NuInvoicingQldLog> implements INuInvoicingQldLogService {
|
||||
|
||||
/**
|
||||
* 操作节点是否可以正常执行(如是否可以提交)
|
||||
*
|
||||
* @param qldNo
|
||||
* @param status 需要判断操作节点 ->之前应该存在的状态<- 多个使用逗号分隔
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean opeNodeJudgeCanStatus(String qldNo, String status) {
|
||||
QueryWrapper<NuInvoicingQldLog> logQW = new QueryWrapper<>();
|
||||
logQW.eq("qld_no", qldNo);
|
||||
logQW.orderByDesc("create_time");
|
||||
List<NuInvoicingQldLog> logList = baseMapper.selectList(logQW);
|
||||
if (!CollectionUtils.isEmpty(logList)) {
|
||||
String status_ = logList.get(0).getStatus();
|
||||
String[] statusArray = status.split(",");
|
||||
for (String s : statusArray) {
|
||||
if (s.equals(status_)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.apache.commons.lang.StringUtils;
|
|||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -95,6 +96,8 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
private IBlWarehouseMaterialInfoService warehouseMaterialInfoService;
|
||||
@Autowired
|
||||
private INuWarehouseMaterialCrkInfoService warehouseMaterialCrkInfoService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity materialCategoryEntity) {
|
||||
|
|
@ -254,6 +257,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
public Map<String, Object> submitQld(InvoicingQldGwcEntity dto) {
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
if (StringUtils.isNotBlank(dto.getQldNo())) {
|
||||
//检测是否可以正常提交
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "3")) {
|
||||
result.put("status", "faild");
|
||||
return result;
|
||||
}
|
||||
|
||||
//回退单-提交
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
|
|
@ -292,6 +301,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
gwcQW.eq("elder_id", dto.getElderId());
|
||||
List<NuInvoicingQldGwc> gwcList = invoicingQldGwcService.list(gwcQW);
|
||||
|
||||
//请购车未添加物料
|
||||
if (CollectionUtils.isEmpty(gwcList)) {
|
||||
result.put("status", "empty");
|
||||
return result;
|
||||
}
|
||||
|
||||
//检测哪些物料有未完成请领流程的
|
||||
{
|
||||
//请领流程未完成物料id
|
||||
|
|
@ -529,12 +544,14 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
@Override
|
||||
public boolean cancellation(InvoicingQldMainEntity dto) {
|
||||
//检测是否可以正常作废
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,3")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain one = invoicingQldMainService.getOne(qw);
|
||||
if (one == null || !"1".equals(one.getStatus())) {
|
||||
return false;
|
||||
}
|
||||
dto.setNuId(one.getNuId());
|
||||
dto.setElderId(one.getElderId());
|
||||
String status = "2";
|
||||
|
|
@ -587,7 +604,11 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean confirmReceipt(InvoicingQldMainEntity dto) {
|
||||
// Map<String, Object> result = Maps.newHashMap();
|
||||
//检测是否可以正常收货
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "4")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String status = "5";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
|
|
@ -728,12 +749,14 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
@Override
|
||||
public boolean orderReturn(InvoicingQldMainEntity dto) {
|
||||
//检测是否可以正常回退
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain one = invoicingQldMainService.getOne(qw);
|
||||
if (one == null || "2".equals(one.getStatus()) || "3".equals(one.getStatus()) || "5".equals(one.getStatus())) {
|
||||
return false;
|
||||
}
|
||||
dto.setNuId(one.getNuId());
|
||||
dto.setElderId(one.getElderId());
|
||||
String status = "3";
|
||||
|
|
@ -759,7 +782,26 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean outbound(InvoicingQldMainEntity dto) {
|
||||
public Map<String, Object> outbound(InvoicingQldMainEntity dto) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
//检测是否可以正常出库
|
||||
String[] qldNosArr = dto.getQldNo().split(",");
|
||||
//本次处理单号中 - 不可出库单号
|
||||
String cannotHandleQldNos = Arrays.stream(qldNosArr)
|
||||
.filter(qldNo -> !invoicingQldLogService.opeNodeJudgeCanStatus(qldNo, "1"))
|
||||
.collect(Collectors.joining(","));
|
||||
//本次处理单号中 - 可正常出库单号
|
||||
String normalQldNos = Arrays.stream(qldNosArr)
|
||||
.filter(qldNo -> !cannotHandleQldNos.contains(qldNo))
|
||||
.collect(Collectors.joining(","));
|
||||
if (StringUtils.isBlank(normalQldNos)) {
|
||||
map.put("status", "faild");
|
||||
map.put("faildQldNos", cannotHandleQldNos);
|
||||
return map;
|
||||
}
|
||||
|
||||
dto.setQldNo(normalQldNos);
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.in("qld_no", dto.getQldNo().split(","));
|
||||
List<NuInvoicingQldMain> list = invoicingQldMainService.list(qw);
|
||||
|
|
@ -792,7 +834,9 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
qldData.setIzYgRead("N");//员工改为未读
|
||||
qldData.setCkBy(sysUser.getId());//出库人
|
||||
qldData.setCkTime(new Date());//出库时间
|
||||
return invoicingQldMainService.update(qldData, qw);
|
||||
invoicingQldMainService.update(qldData, qw);
|
||||
map.put("status", "success");
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue