You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-spms-java/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java

555 lines
25 KiB
Java

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.glxp.api.controller.inout;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.dao.inout.IoCodeDao;
import com.glxp.api.dao.inout.IoCodeTempDao;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.basic.EntrustReceEntity;
import com.glxp.api.entity.inout.*;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.alihealth.AlihealthYljgSinglerelationReqeust;
import com.glxp.api.req.alihealth.AlihealthYljgUploadinoutbillReqeust;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.req.inout.ReviewFinishRequest;
import com.glxp.api.req.inout.ReviewSpmsRequest;
import com.glxp.api.req.inout.UpdateExportStatusRequest;
import com.glxp.api.req.sync.SpsSyncDataRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.alihealth.AlihealthYljgSinglerelationResponse;
import com.glxp.api.res.inout.AcceptOrderResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.res.sync.SpsSyncOrderResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.basic.EntrustReceService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.collect.RelCodeBatchService;
import com.glxp.api.service.collect.RelCodeDetailService;
import com.glxp.api.service.inout.*;
import com.glxp.api.service.inout.impl.IoCodeService;
import com.glxp.api.service.inout.impl.IoCodeTempService;
import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.*;
import com.glxp.api.util.alihealth.AlihealthYljgUtils;
import com.glxp.api.util.udi.UdiCalCountUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.*;
//单据验收
@Slf4j
@RestController
public class IoOrderReviewController extends BaseController {
@Resource
private RedisUtil redisUtil;
@Resource
private IoOrderDetailResultService orderDetailResultService;
@Resource
IoOrderService orderService;
@Resource
IoCheckInoutService ioCheckInoutService;
//获取验收单据业务详情
@AuthRuleAnnotation("")
@GetMapping("/udiwms/stock/order/accept/getOrder")
public BaseResponse getAcceptOrder(String billNo) {
if (StrUtil.isBlank(billNo)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
AcceptOrderResponse acceptOrderEntity = new AcceptOrderResponse();
acceptOrderEntity.setBillNo(billNo);
List<IoOrderDetailResultResponse> datas = (List<IoOrderDetailResultResponse>) redisUtil.get(ConstantStatus.REDIS_BILLNO + billNo);
if (CollUtil.isNotEmpty(datas)) {
acceptOrderEntity.setOrderDetailEntities(datas);
acceptOrderEntity.setExitAccept(true);
} else {
FilterOrderDetailResultRequest filterOrderDetailResultRequest = new FilterOrderDetailResultRequest();
filterOrderDetailResultRequest.setOrderIdFk(billNo);
List<IoOrderDetailResultResponse> orderDetailResultResponses = orderDetailResultService.filterList(filterOrderDetailResultRequest);
acceptOrderEntity.setOrderDetailEntities(orderDetailResultResponses);
acceptOrderEntity.setExitAccept(false);
}
return ResultVOUtils.success(acceptOrderEntity);
}
//获取验收单据业务详情
@AuthRuleAnnotation("")
@GetMapping("/udiwms/stock/order/accept/getStatus")
public BaseResponse getStatus(String billNo) {
if (StrUtil.isBlank(billNo)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
AcceptOrderResponse acceptOrderEntity = new AcceptOrderResponse();
acceptOrderEntity.setBillNo(billNo);
List<IoOrderDetailResultResponse> datas = (List<IoOrderDetailResultResponse>) redisUtil.get(ConstantStatus.REDIS_BILLNO + billNo);
if (CollUtil.isNotEmpty(datas)) {
boolean isFinish = vailFinish(datas);
if (isFinish)
return ResultVOUtils.success("单据已验收完成");
else
return ResultVOUtils.error(500, "单据未验收完成");
} else {
return ResultVOUtils.error(500, "单据未验收完成");
}
}
@Resource
private AlihealthYljgUtils alihealthYljgUtils;
@Resource
private IoCodeService ioCodeService;
@Resource
private RelCodeBatchService relCodeBatchService;
@Resource
private RelCodeDetailService relCodeDetailService;
@Resource
private IoCodeDao ioCodeDao;
//前端二次审核
@AuthRuleAnnotation("")
@PostMapping("/spms/inout/order/web/updateStatus")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse webUpdateStatus(@RequestBody ReviewFinishRequest updateExportStatusRequest,
BindingResult bindingResult) {
log.error("单据审核进来了==="+updateExportStatusRequest);
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
IoOrderEntity orderEntity = orderService.findByBillNo(updateExportStatusRequest.getOrderId());
if (orderEntity == null) {
return ResultVOUtils.error(500, "未找到该业务单据");
}
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) {
BaseResponse baseResponse = updateReview(getUser(), orderEntity);
log.error("单据审核进来了===orderEntity===="+orderEntity);
if(baseResponse.getCode() == 20000) {
//todo 审核通过上传关联关系
BasicBussinessTypeEntity businessType = basicBussinessTypeService.findByAction(orderEntity.getAction());
log.error("单据审核进来了===businessType===="+businessType);
if (businessType.getCorpType() == ConstantStatus.CORP_SP && businessType.getMainAction().equals(ConstantType.TYPE_PUT) && businessType.getProductType() == 2) {
aliBillsDispose(orderEntity);
}
}
return baseResponse;
} else if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
return thirdUpdateReview(getUser(), orderEntity);
} else {
return ResultVOUtils.error(500, "当前单据状态非处于审核状态!");
}
}
//前端第三次验收
@AuthRuleAnnotation("")
@PostMapping("/spms/inout/order/third/updateStatus")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse thirdUpdateStatus(@RequestBody ReviewFinishRequest updateExportStatusRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
IoOrderEntity orderEntity = orderService.findByBillNo(updateExportStatusRequest.getOrderId());
if (orderEntity == null) {
return ResultVOUtils.error(500, "未找到该业务单据");
}
return thirdUpdateReview(getUser(), orderEntity);
}
@Resource
IoCodeService codeService;
@Resource
IoCodeTempService codeTempService;
@Resource
UdiCalCountUtil calCountUtil;
//前端扫码验收
@AuthRuleAnnotation("")
@PostMapping("/udiwms/stock/order/accept/addCode")
public BaseResponse acceptAddCode(@RequestBody AcceptOrderResponse acceptOrderEntity) {
IoOrderEntity stockOrderEntity = orderService.findByBillNo(acceptOrderEntity.getBillNo());
List<IoCodeEntity> codeList;
List<IoCodeEntity> codeEntityList = (List<IoCodeEntity>) redisUtil.get(ConstantStatus.REDIS_BILLNO_CODES + acceptOrderEntity.getBillNo());
if (CollUtil.isEmpty(codeEntityList)) {
codeList = codeService.findByOrderId(stockOrderEntity.getBillNo());
} else {
codeList = codeEntityList;
}
IoCodeEntity codeEntity = isExit(codeList, acceptOrderEntity.getCode());
if (codeEntity == null) {
return ResultVOUtils.error(500, "非此单UDI码");
}
int status = checkCodeExit(codeEntity.getCode(), codeList);
if (status == Constant.CHECK_REPEAT) {
return ResultVOUtils.error(500, "重复扫码!");
} else if (status == Constant.CHECK_NULL) {
return ResultVOUtils.error(500, "非此单UDI码");
}
List<IoOrderDetailResultResponse> orderDetailResultResponses = acceptOrderEntity.getOrderDetailEntities();
if (StrUtil.isNotEmpty(acceptOrderEntity.getCode()) && CollUtil.isNotEmpty(orderDetailResultResponses)) {
boolean isExit = false;
for (IoOrderDetailResultResponse orderDetailResultResponse : orderDetailResultResponses) {
if (orderDetailResultResponse.getBindRlFk().longValue() == codeEntity.getRelId().longValue() &&
StrUtil.trimToEmpty(orderDetailResultResponse.getBatchNo()).equals(StrUtil.trimToEmpty(codeEntity.getBatchNo()))) {
orderDetailResultResponse.setAcceptCount(orderDetailResultResponse.getAcceptCount() + calCountUtil.getActCount(codeEntity.getNameCode()));
if (orderDetailResultResponse.getAcceptCount() > orderDetailResultResponse.getCount()) {
return ResultVOUtils.error(500, "数量溢出!");
}
isExit = true;
break;
}
}
if (isExit) {
redisUtil.set(ConstantStatus.REDIS_BILLNO + acceptOrderEntity.getBillNo(), orderDetailResultResponses);
redisUtil.set(ConstantStatus.REDIS_BILLNO_CODES + acceptOrderEntity.getBillNo(), codeList);
acceptOrderEntity.setOrderDetailEntities(orderDetailResultResponses);
if (vailFinish(orderDetailResultResponses)) {
acceptOrderEntity.setFinishAccept(true);
return ResultVOUtils.success(acceptOrderEntity);
}
return ResultVOUtils.success(acceptOrderEntity);
}
}
return ResultVOUtils.error(500, "非此单条码!");
}
@Resource
AuthAdminService authAdminService;
@Resource
EntrustReceService entrustReceService;
//手持终端验收完成后,更新订单状态
@AuthRuleAnnotation("")
@PostMapping("/spms/inout/order/check/updateStatus")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse updateStatus(@RequestBody UpdateExportStatusRequest updateExportStatusRequest,
BindingResult bindingResult) {
AuthAdmin authAdmin = null;
if (StrUtil.isNotEmpty(updateExportStatusRequest.getWmsUserId())) {
authAdmin = authAdminService.findById(Long.parseLong(updateExportStatusRequest.getWmsUserId()));
} else
authAdmin = getUser();
IoOrderEntity orderEntity = orderService.findByBillNo(updateExportStatusRequest.getOrderId());
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
return ResultVOUtils.error(500, "单据已验收!");
}
if (updateExportStatusRequest.isEntrust() && updateExportStatusRequest.getEntrustId() != null) {
EntrustReceEntity entrustReceEntity = entrustReceService.findById(updateExportStatusRequest.getEntrustId());
if (entrustReceEntity == null) {
return ResultVOUtils.error(500, "无验收权限!");
} else {
if (orderEntity.getFromType().intValue() != ConstantStatus.FROM_CHANGE && orderEntity.getFromType().intValue() != ConstantStatus.FROM_PEACE_CHANGE) {
if (StrUtil.isNotEmpty(entrustReceEntity.getEntrustAction())) {
transferOrder(orderEntity, entrustReceEntity);
}
}
if (!entrustReceEntity.getFinishRece()) {
redisUtil.del(ConstantStatus.REDIS_BILLNO + orderEntity.getBillNo());
redisUtil.del(ConstantStatus.REDIS_BILLNO_CODES + orderEntity.getBillNo());
return ResultVOUtils.success("验收成功!");
} else
return updateReview(authAdmin, orderEntity);
}
} else
return updateReview(authAdmin, orderEntity);
}
@Resource
IBasicBussinessTypeService basicBussinessTypeService;
@Resource
GennerOrderUtils gennerOrderUtils;
@Resource
SystemParamConfigService systemParamConfigService;
public void transferOrder(IoOrderEntity orderEntity, EntrustReceEntity entrustReceEntity) {
List<IoCodeEntity> warehouseEntities = codeService.findByOrderId(orderEntity.getBillNo());
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(entrustReceEntity.getEntrustAction());
IoOrderEntity supplementOrder = new IoOrderEntity();
BeanUtil.copyProperties(orderEntity, supplementOrder);
//生成补单单号
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
String supplementOrderNo = orderNo;
supplementOrder.setOriginUllageSupNo(orderEntity.getBillNo());
supplementOrder.setBillNo(supplementOrderNo);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置状态为补录单据
} else {
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); //设置状态为补录单据
}
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置导出状态为未导出
supplementOrder.setCorpOrderId(CustomUtil.getId() + "x");
//修改往来单位及当前库存号
supplementOrder.setFromDeptCode(orderEntity.getDeptCode());
supplementOrder.setFromInvCode(orderEntity.getInvCode());
supplementOrder.setDeptCode(entrustReceEntity.getEntrustDept());
supplementOrder.setInvCode(entrustReceEntity.getEntrustInv());
supplementOrder.setFromType(ConstantStatus.FROM_REVIEW);
supplementOrder.setMainAction(bussinessTypeEntity.getMainAction());
supplementOrder.setAction(bussinessTypeEntity.getAction());
orderEntity.setBusType(bussinessTypeEntity.getBusType());
//复制码表
List<IoCodeTempEntity> supplementCodes = new ArrayList<>();
warehouseEntities.forEach(
code -> {
IoCodeTempEntity supplementCode = new IoCodeTempEntity();
BeanUtil.copyProperties(code, supplementCode);
supplementCode.setInvCode(supplementOrder.getInvCode());
supplementCode.setDeptCode(supplementOrder.getDeptCode());
supplementCode.setOrderId(supplementOrderNo);
//查询补单设置
supplementCode.setAction(bussinessTypeEntity.getSupplementOrderType());
supplementCode.setMainAction(bussinessTypeEntity.getMainAction());
supplementCode.setId(null);
supplementCodes.add(supplementCode);
}
);
//更新数据
orderService.insertOrder(supplementOrder);
orderEntity.setUllageSupNo(supplementOrder.getBillNo());
orderService.update(orderEntity);
codeTempService.insertBatch(supplementCodes);
}
public int checkCodeExit(String code, List<IoCodeEntity> codesList) {
if (StrUtil.isNotEmpty(code)) {
code = code.replace("\r\n", "");
}
if (code.endsWith("\u001D")) {
code = code.replace("\u001D", "");
}
for (IoCodeEntity checkOrderCodesBean : codesList) {
String checkCode = checkOrderCodesBean.getCode();
if (checkCode.endsWith("\u001D")) {
checkCode = checkCode.replace("\u001D", "");
}
if (checkCode.toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) {
if (StrUtil.isNotEmpty(checkOrderCodesBean.getSerialNo())) {
if (checkOrderCodesBean.getScanCount() > 0) {
return Constant.CHECK_REPEAT;
}
}
int curCount = checkOrderCodesBean.getScanCount() + calCountUtil.getActCount(checkOrderCodesBean.getNameCode());
if (curCount == IntUtil.value(checkOrderCodesBean.getReCount())) {
checkOrderCodesBean.setStatus(Constant.DB_CHECK_ED);
}
checkOrderCodesBean.setScanCount(curCount);
return Constant.CHECK_EXIT;
}
}
return Constant.CHECK_NULL;
}
public IoCodeEntity isExit(List<IoCodeEntity> codeList, String code) {
if (CollUtil.isNotEmpty(codeList)) {
if (StrUtil.isNotEmpty(code)) {
code = code.replace("\r\n", "");
}
if (code.endsWith("\u001D")) {
code = code.replace("\u001D", "");
}
for (IoCodeEntity codeEntity : codeList) {
String checkCode = codeEntity.getCode();
if (checkCode.endsWith("\u001D")) {
checkCode = checkCode.replace("\u001D", "");
}
if (checkCode.equals(code)) {
return codeEntity;
}
}
}
return null;
}
public boolean vailFinish(List<IoOrderDetailResultResponse> orderDetailResultResponses) {
if (CollUtil.isNotEmpty(orderDetailResultResponses)) {
for (IoOrderDetailResultResponse stockOrderDetailEntity : orderDetailResultResponses) {
if (stockOrderDetailEntity.getCount() != stockOrderDetailEntity.getAcceptCount()) {
return false;
}
}
return true;
}
return false;
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/stock/order/acceptClear")
public BaseResponse acceptClear(@RequestBody AcceptOrderResponse acceptOrderEntity) {
String billNo = acceptOrderEntity.getBillNo();
redisUtil.del(ConstantStatus.REDIS_BILLNO + billNo);
redisUtil.del(ConstantStatus.REDIS_BILLNO_CODES + billNo);
FilterOrderDetailResultRequest filterOrderDetailResultRequest = new FilterOrderDetailResultRequest();
filterOrderDetailResultRequest.setOrderIdFk(billNo);
List<IoOrderDetailResultResponse> orderDetailResultResponses = orderDetailResultService.filterList(filterOrderDetailResultRequest);
acceptOrderEntity.setOrderDetailEntities(orderDetailResultResponses);
return ResultVOUtils.success(acceptOrderEntity);
}
public BaseResponse updateReview(AuthAdmin authAdmin, IoOrderEntity orderEntity) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_AUDITED);
orderEntity.setReviewUser(authAdmin.getId() + "");
orderEntity.setUpdateTime(new Date());
orderEntity.setAuditTime(new Date());
orderService.update(orderEntity);
redisUtil.del(ConstantStatus.REDIS_BILLNO + orderEntity.getBillNo());
redisUtil.del(ConstantStatus.REDIS_BILLNO_CODES + orderEntity.getBillNo());
//验收完成->进入流程
ioCheckInoutService.checkSecond(orderEntity);
return ResultVOUtils.success("更新成功");
}
//前端第二次次验收
public BaseResponse thirdUpdateReview(AuthAdmin authAdmin, IoOrderEntity orderEntity) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
orderEntity.setCheckUser(authAdmin.getId() + "");
orderEntity.setUpdateTime(new Date());
orderEntity.setCheckTime(new Date());
orderEntity.setDeliveryStatus(ConstantStatus.ORDER_DELIVERY_STATUS_ED);
orderService.update(orderEntity);
redisUtil.del(ConstantStatus.REDIS_BILLNO + orderEntity.getBillNo());
redisUtil.del(ConstantStatus.REDIS_BILLNO_CODES + orderEntity.getBillNo());
//验收完成->进入流程
ioCheckInoutService.checkThird(orderEntity);
return ResultVOUtils.success("更新成功");
}
// 异步处理阿里单据
public BaseResponse aliBillsDispose( IoOrderEntity orderEntity) {
ThreadUtil.execAsync(() -> {
//1.上传入库单
AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust = new AlihealthYljgUploadinoutbillReqeust();
alihealthYljgUploadinoutbillReqeust.setBill_code(orderEntity.getBillNo());
alihealthYljgUploadinoutbillReqeust.setBill_time(DateUtil.formatDateTime(orderEntity.getAuditTime()));
alihealthYljgUploadinoutbillReqeust.setBill_type(102);
// 先写死 到时候以阿里的为准
alihealthYljgUploadinoutbillReqeust.setPhysic_type(3);
alihealthYljgUploadinoutbillReqeust.setClient_type("2");
// 查询改单据传的码
List<IoCodeEntity> ioCodeEntityList = ioCodeDao.selectList(new QueryWrapper<IoCodeEntity>().eq("orderId", orderEntity.getBillNo()));
if(ioCodeEntityList!=null && ioCodeEntityList.size() >0){
List<String> codeList = new ArrayList<>();
for (IoCodeEntity ioCodeEntity : ioCodeEntityList) {
codeList.add(ioCodeEntity.getCode());
}
Set<String> set = new HashSet<>(codeList);
alihealthYljgUploadinoutbillReqeust.setTrace_codes( String.join(",", codeList));
// 单据上传先注释了
// BaseResponse baseResponseUploadinoutbill = alihealthYljgUtils.yljgUploadinoutbill(alihealthYljgUploadinoutbillReqeust,orderEntity.getFromCorp());
// if(baseResponseUploadinoutbill.getCode() == 20000){
// try {
// Thread.sleep(1000);
log.error("要查询阿里关联关系的码==="+set);
relCodeBatchService.addRelCodeAli(set, orderEntity.getFromCorp());
//
// } catch (InterruptedException e) {
// }
// }else {
// log.error("阿里调用上传单据失败==="+baseResponseUploadinoutbill.getMessage());
//
// }
}
});
return ResultVOUtils.success("更新成功");
}
@Resource
SpsSyncDownloadService spsSyncDownloadService;
// UDI管理系统获取验收单据信息
@AuthRuleAnnotation("")
@PostMapping("/udiwms/order/getReviews")
public BaseResponse getReviewOrderSpms(@RequestBody ReviewSpmsRequest reviewSpmsRequest) {
String billNo = reviewSpmsRequest.getBillNo();
getUser();
if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
IoOrderEntity orderEntity = orderService.findByBillNo(reviewSpmsRequest.getBillNo());
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
return ResultVOUtils.error(500, "单据已审核!");
} else if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW) {
return ResultVOUtils.error(500, "当前单据不处于待审核状态,无法审核!");
}
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
spsSyncDataRequest.setBillNo(reviewSpmsRequest.getBillNo());
return spsSyncDownloadService.findOrder(spsSyncDataRequest);
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/order/getSimpleOrder")
public BaseResponse getSimpleOrder(@RequestBody ReviewSpmsRequest reviewSpmsRequest) {
getUser();
if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
IoOrderEntity orderEntity = orderService.findByBillNo(reviewSpmsRequest.getBillNo());
return ResultVOUtils.success(orderEntity);
}
}