add:启动注入定时器任务;倒冲领料忽略过账
This commit is contained in:
@@ -395,8 +395,6 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
if (struct ==null ||StringUtils.isEmpty(param.getStorageVehicleCode())){
|
if (struct ==null ||StringUtils.isEmpty(param.getStorageVehicleCode())){
|
||||||
throw new BadRequestException("当前虚拟仓库未绑定"+param.getStorageVehicleCode());
|
throw new BadRequestException("当前虚拟仓库未绑定"+param.getStorageVehicleCode());
|
||||||
}
|
}
|
||||||
//创建出库单据
|
|
||||||
String status = StockReturnStatusEnum.TODO.getCode();
|
|
||||||
final List<ReceiveOutRequest.Entrys> entrys = new ArrayList<>();
|
final List<ReceiveOutRequest.Entrys> entrys = new ArrayList<>();
|
||||||
|
|
||||||
for (WorkOrderBomItem bomItem : workOrderBomItems) {
|
for (WorkOrderBomItem bomItem : workOrderBomItems) {
|
||||||
@@ -438,7 +436,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
receiveOutRequest.setWorkArea(param.getWorkArea());
|
receiveOutRequest.setWorkArea(param.getWorkArea());
|
||||||
receiveOutRequest.setEntrys(entrys);
|
receiveOutRequest.setEntrys(entrys);
|
||||||
ReceiveOutReturn entity = receiveOutReturnService.saveFromRequest(
|
ReceiveOutReturn entity = receiveOutReturnService.saveFromRequest(
|
||||||
receiveOutRequest, status, null,null,param.getReportParam());
|
receiveOutRequest, StockReturnStatusEnum.TODO.getCode(), null,null,param.getReportParam());
|
||||||
return PdaResponse.requestOk();
|
return PdaResponse.requestOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,9 @@ import org.nl.common.base.ResponseData;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.BatchAllocateParam;
|
import org.nl.wms.pm_manage.demand.service.dto.*;
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.DemandInventryDto;
|
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandDto;
|
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;import org.nl.common.base.ResponseData;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package org.nl.wms.pm_manage.demand.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -14,13 +13,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.MapOf;
|
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||||
import org.nl.wms.ext_manage.enums.EXTConstant;
|
import org.nl.wms.ext_manage.enums.EXTConstant;
|
||||||
import org.nl.wms.ext_manage.purchase.service.dto.EasAuditRequestDto;
|
|
||||||
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
||||||
import org.nl.wms.ext_manage.service.dto.ZDInventory;
|
import org.nl.wms.ext_manage.service.dto.ZDInventory;
|
||||||
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
||||||
@@ -31,15 +28,12 @@ import org.nl.wms.pm_manage.demand.service.dto.PmDemandDto;
|
|||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
||||||
import org.nl.wms.pm_manage.demand.service.enums.DemandStatus;
|
import org.nl.wms.pm_manage.demand.service.enums.DemandStatus;
|
||||||
import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl;
|
|
||||||
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
|
||||||
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
import org.nl.wms.system_manage.service.param.ISysParamService;
|
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||||
import org.nl.wms.system_manage.service.param.dao.Param;
|
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.IOutBillService;
|
import org.nl.wms.warehouse_manage.inAndOut.service.IOutBillService;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
|
||||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||||
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
||||||
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
||||||
@@ -47,9 +41,9 @@ import org.nl.wms.warehouse_manage.inventory.core.param.impl.InFinishParam;
|
|||||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
||||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -259,16 +253,20 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
if (CollectionUtils.isEmpty(pmDemandDtos)){
|
if (CollectionUtils.isEmpty(pmDemandDtos)){
|
||||||
throw new BadRequestException("下推失败,请求数据不能为空");
|
throw new BadRequestException("下推失败,请求数据不能为空");
|
||||||
}
|
}
|
||||||
final long count = pmDemandDtos.stream().filter(a -> !a.getStatus().equals("01")).count();
|
|
||||||
if (count>0){
|
|
||||||
throw new BadRequestException("下推失败,单据状态不为已分配不能下推");
|
|
||||||
}
|
|
||||||
final int disCount = this.count(new LambdaQueryWrapper<PmDemand>()
|
final int disCount = this.count(new LambdaQueryWrapper<PmDemand>()
|
||||||
.in(PmDemand::getId, pmDemandDtos.stream().map(PmDemandDto::getId).collect(Collectors.toList()))
|
.in(PmDemand::getId, pmDemandDtos.stream().map(PmDemandDto::getId).collect(Collectors.toList()))
|
||||||
.eq(PmDemand::getStatus,DemandStatus.DIS.getValue()));
|
.eq(PmDemand::getStatus,DemandStatus.DIS.getValue()));
|
||||||
if (disCount<pmDemandDtos.size()){
|
if (disCount<pmDemandDtos.size()){
|
||||||
throw new BadRequestException("下推失败,单据状态不为已分配不能下推");
|
throw new BadRequestException("下推失败,单据状态不为已分配不能下推");
|
||||||
}
|
}
|
||||||
|
int allWorkCount = this.count(new LambdaQueryWrapper<PmDemand>()
|
||||||
|
.in(PmDemand::getWork_order, pmDemandDtos.stream()
|
||||||
|
.map(PmDemandDto::getWorkOrder)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList())));
|
||||||
|
if (pmDemandDtos.size() < allWorkCount){
|
||||||
|
throw new BadRequestException("存在未勾选完全的工单");
|
||||||
|
}
|
||||||
// 一次性分成两组
|
// 一次性分成两组
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -297,7 +295,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
for (String workOrder : groupByWorkOrder.keySet()) {
|
for (String workOrder : groupByWorkOrder.keySet()) {
|
||||||
final List<PmDemandDto> demandDtos = groupByWorkOrder.get(workOrder);
|
final List<PmDemandDto> demandDtos = groupByWorkOrder.get(workOrder);
|
||||||
final int orderCount = this.count(new LambdaQueryWrapper<PmDemand>()
|
final int orderCount = this.count(new LambdaQueryWrapper<PmDemand>()
|
||||||
.eq(PmDemand::getWork_order, workOrder));
|
.eq(PmDemand::getWork_order, workOrder)
|
||||||
|
.in(PmDemand::getInventory_dis, ZD_STOR_SET));
|
||||||
if (orderCount > demandDtos.size()){
|
if (orderCount > demandDtos.size()){
|
||||||
throw new BadRequestException("工单"+workOrder+"下推中鼎失败,存在未勾选的单子");
|
throw new BadRequestException("工单"+workOrder+"下推中鼎失败,存在未勾选的单子");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.nl.wms.sch_manage.service.core;
|
package org.nl.wms.sch_manage.service.core;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.system_manage.service.quartz.config;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.wms.system_manage.service.quartz.ISysQuartzJobService;
|
import org.nl.wms.system_manage.service.quartz.ISysQuartzJobService;
|
||||||
|
import org.nl.wms.system_manage.service.quartz.dao.SysQuartzJob;
|
||||||
import org.nl.wms.system_manage.service.quartz.utils.QuartzManage;
|
import org.nl.wms.system_manage.service.quartz.utils.QuartzManage;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -10,6 +11,8 @@ import org.springframework.boot.ApplicationRunner;
|
|||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 项目启动时重新激活启用的定时任务
|
* 项目启动时重新激活启用的定时任务
|
||||||
@@ -33,5 +36,9 @@ public class JobRunner implements ApplicationRunner {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments applicationArguments) {
|
public void run(ApplicationArguments applicationArguments) {
|
||||||
|
log.info("--------------------注入定时任务---------------------");
|
||||||
|
List<SysQuartzJob> quartzJobs = quartzJobService.findByIsPauseIsFalse();
|
||||||
|
quartzJobs.forEach(quartzManage::addJob);
|
||||||
|
log.info("--------------------定时任务注入完成---------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.controller;
|
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import org.nl.common.base.ResponseData;
|
import org.nl.common.base.ResponseData;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
@@ -9,7 +7,6 @@ import org.nl.common.utils.MapOf;
|
|||||||
import org.nl.wms.ext_manage.api.EasApi;
|
import org.nl.wms.ext_manage.api.EasApi;
|
||||||
import org.nl.wms.ext_manage.api.request.QueryEasStockRequest;
|
import org.nl.wms.ext_manage.api.request.QueryEasStockRequest;
|
||||||
import org.nl.wms.ext_manage.api.response.QueryEasStockResponse;
|
import org.nl.wms.ext_manage.api.response.QueryEasStockResponse;
|
||||||
import org.nl.wms.ext_manage.service.WmsToErpService;
|
|
||||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
||||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
||||||
@@ -25,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -125,4 +122,38 @@ public class ReceiveOutReturnController {
|
|||||||
return ResponseData.build(result);
|
return ResponseData.build(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@PutMapping("/detail/ignore/{detailId}")
|
||||||
|
@Log("明细忽略过账")
|
||||||
|
public ResponseEntity<Object> ignoreDetail(@PathVariable Long detailId) {
|
||||||
|
receiveOutReturnService.ignoreDetail(detailId);
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/detail/restore/{detailId}")
|
||||||
|
@Log("明细恢复过账")
|
||||||
|
public ResponseEntity<Object> restoreDetail(@PathVariable Long detailId) {
|
||||||
|
receiveOutReturnService.restoreDetail(detailId);
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/detail/ignore/batch")
|
||||||
|
@Log("批量明细忽略过账")
|
||||||
|
public ResponseEntity<Object> ignoreDetails(@RequestBody Set<Long> detailIds) {
|
||||||
|
receiveOutReturnService.ignoreDetails(detailIds);
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/detail/restore/batch")
|
||||||
|
@Log("批量明细恢复过账")
|
||||||
|
public ResponseEntity<Object> restoreDetails(@RequestBody Set<Long> detailIds) {
|
||||||
|
receiveOutReturnService.restoreDetails(detailIds);
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/reSubmit")
|
||||||
|
public ResponseEntity reSubmit(HashSet<String> ids){
|
||||||
|
receiveOutReturnService.reSubmit(ids);
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class ReceiveOutReturnDetail implements Serializable {
|
|||||||
|
|
||||||
private Integer seq;
|
private Integer seq;
|
||||||
private String materialno;
|
private String materialno;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String materialname;
|
||||||
private String unitno;
|
private String unitno;
|
||||||
private BigDecimal qty;
|
private BigDecimal qty;
|
||||||
private BigDecimal baseqty;
|
private BigDecimal baseqty;
|
||||||
@@ -41,4 +43,5 @@ public class ReceiveOutReturnDetail implements Serializable {
|
|||||||
private String updateTime;
|
private String updateTime;
|
||||||
private String status;
|
private String status;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
private String last_status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,10 @@ package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.ReceiveOutReturnDetail;
|
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.ReceiveOutReturnDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public interface ReceiveOutReturnDetailMapper extends BaseMapper<ReceiveOutReturnDetail> {
|
public interface ReceiveOutReturnDetailMapper extends BaseMapper<ReceiveOutReturnDetail> {
|
||||||
|
|
||||||
|
List<ReceiveOutReturnDetail> getDetailById(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper.ReceiveOutReturnDetailMapper">
|
||||||
|
|
||||||
|
<select id="getDetailById"
|
||||||
|
resultType="org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.ReceiveOutReturnDetail">
|
||||||
|
select
|
||||||
|
d.*,
|
||||||
|
m.material_name materialname
|
||||||
|
from receive_out_return_detail d
|
||||||
|
left join md_me_materialbase m on d.materialno = m.material_code
|
||||||
|
where return_id = #{id}
|
||||||
|
order by d.seq asc,d.id asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -11,7 +11,6 @@ import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dto.ReceiveOutRet
|
|||||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dto.ReceiveOutReturnQuery;
|
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dto.ReceiveOutReturnQuery;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public interface IReceiveOutReturnService extends IService<ReceiveOutReturn> {
|
public interface IReceiveOutReturnService extends IService<ReceiveOutReturn> {
|
||||||
@@ -34,10 +33,20 @@ public interface IReceiveOutReturnService extends IService<ReceiveOutReturn> {
|
|||||||
|
|
||||||
void refreshUploadResult(Long id);
|
void refreshUploadResult(Long id);
|
||||||
|
|
||||||
|
void ignoreDetail(Long detailId);
|
||||||
|
|
||||||
|
void restoreDetail(Long detailId);
|
||||||
|
|
||||||
|
void ignoreDetails(Set<Long> detailIds);
|
||||||
|
|
||||||
|
void restoreDetails(Set<Long> detailIds);
|
||||||
|
|
||||||
void uploadErp(ReceiveOutReturn mst);
|
void uploadErp(ReceiveOutReturn mst);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 抽出事物方法
|
* 抽出事物方法
|
||||||
*/
|
*/
|
||||||
Boolean callEasByAllBill(ReceiveOutReturn entity, List<ReceiveOutReturnDetail> details, String now, ErpUtil login);
|
Boolean callEasByAllBill(ReceiveOutReturn entity, List<ReceiveOutReturnDetail> details, String now, ErpUtil login);
|
||||||
|
|
||||||
|
void reSubmit(Set<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import org.nl.wms.ext_manage.api.EasApi;
|
|||||||
import org.nl.wms.ext_manage.api.request.QueryEasStockRequest;
|
import org.nl.wms.ext_manage.api.request.QueryEasStockRequest;
|
||||||
import org.nl.wms.ext_manage.api.request.ReceiveOutRequest;
|
import org.nl.wms.ext_manage.api.request.ReceiveOutRequest;
|
||||||
import org.nl.wms.ext_manage.api.response.QueryEasStockResponse;
|
import org.nl.wms.ext_manage.api.response.QueryEasStockResponse;
|
||||||
|
import org.nl.wms.ext_manage.mes.service.MesReportService;
|
||||||
|
import org.nl.wms.ext_manage.mes.service.dto.WorkReportParam;
|
||||||
import org.nl.wms.ext_manage.util.ErpUtil;
|
import org.nl.wms.ext_manage.util.ErpUtil;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInv;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInv;
|
||||||
@@ -84,6 +86,8 @@ public class ReceiveOutReturnServiceImpl extends ServiceImpl<ReceiveOutReturnMap
|
|||||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStInventoryService iStInventoryService;
|
private IStInventoryService iStInventoryService;
|
||||||
|
@Autowired
|
||||||
|
private MesReportService mesReportService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private EasApi easApi;
|
private EasApi easApi;
|
||||||
@@ -126,10 +130,7 @@ public class ReceiveOutReturnServiceImpl extends ServiceImpl<ReceiveOutReturnMap
|
|||||||
throw new BadRequestException("记录不存在");
|
throw new BadRequestException("记录不存在");
|
||||||
}
|
}
|
||||||
ReceiveOutReturnDto dto = toDto(entity);
|
ReceiveOutReturnDto dto = toDto(entity);
|
||||||
dto.setDetails(receiveOutReturnDetailMapper.selectList(new LambdaQueryWrapper<ReceiveOutReturnDetail>()
|
dto.setDetails(receiveOutReturnDetailMapper.getDetailById(id));
|
||||||
.eq(ReceiveOutReturnDetail::getReturnId, id)
|
|
||||||
.orderByAsc(ReceiveOutReturnDetail::getSeq)
|
|
||||||
.orderByAsc(ReceiveOutReturnDetail::getId)));
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,6 +526,19 @@ public class ReceiveOutReturnServiceImpl extends ServiceImpl<ReceiveOutReturnMap
|
|||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void reSubmit(Set<String> ids) {
|
||||||
|
List<ReceiveOutReturn> receiveOutReturns = this.listByIds(ids);
|
||||||
|
for (ReceiveOutReturn receiveOutReturn : receiveOutReturns) {
|
||||||
|
String reportParam = receiveOutReturn.getReportParam();
|
||||||
|
WorkReportParam workReportParam = JSONObject.parseObject(reportParam, WorkReportParam.class);
|
||||||
|
|
||||||
|
mesReportService.workReportReturn(workReportParam);
|
||||||
|
this.removeById(receiveOutReturn.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Boolean callEasByOneBill(ReceiveOutReturn entity, Boolean sucess, Long id, List<ReceiveOutReturnDetail> details, String now, ErpUtil login) {
|
private Boolean callEasByOneBill(ReceiveOutReturn entity, Boolean sucess, Long id, List<ReceiveOutReturnDetail> details, String now, ErpUtil login) {
|
||||||
for (ReceiveOutReturnDetail detail : details) {
|
for (ReceiveOutReturnDetail detail : details) {
|
||||||
final Long detailId = detail.getId();
|
final Long detailId = detail.getId();
|
||||||
@@ -614,6 +628,98 @@ public class ReceiveOutReturnServiceImpl extends ServiceImpl<ReceiveOutReturnMap
|
|||||||
receiveOutReturnDetailMapper.updateById(detail);
|
receiveOutReturnDetailMapper.updateById(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void ignoreDetail(Long detailId) {
|
||||||
|
ReceiveOutReturnDetail detail = receiveOutReturnDetailMapper.selectById(detailId);
|
||||||
|
if (detail == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (StockReturnStatusEnum.IGNORE.getCode().equals(detail.getStatus())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
receiveOutReturnDetailMapper.update(null, new LambdaUpdateWrapper<ReceiveOutReturnDetail>()
|
||||||
|
.eq(ReceiveOutReturnDetail::getId, detailId)
|
||||||
|
.set(ReceiveOutReturnDetail::getLast_status, detail.getStatus())
|
||||||
|
.set(ReceiveOutReturnDetail::getStatus, StockReturnStatusEnum.IGNORE.getCode())
|
||||||
|
.set(ReceiveOutReturnDetail::getRemark, "已忽略过账")
|
||||||
|
.set(ReceiveOutReturnDetail::getUpdateTime, DateUtil.now()));
|
||||||
|
this.refreshUploadResult(detail.getReturnId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void restoreDetail(Long detailId) {
|
||||||
|
ReceiveOutReturnDetail detail = receiveOutReturnDetailMapper.selectById(detailId);
|
||||||
|
if (detail == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String prevStatus = detail.getLast_status();
|
||||||
|
if (prevStatus == null || prevStatus.isEmpty()) {
|
||||||
|
prevStatus = StockReturnStatusEnum.TODO.getCode();
|
||||||
|
}
|
||||||
|
receiveOutReturnDetailMapper.update(null, new LambdaUpdateWrapper<ReceiveOutReturnDetail>()
|
||||||
|
.eq(ReceiveOutReturnDetail::getId, detailId)
|
||||||
|
.set(ReceiveOutReturnDetail::getLast_status, null)
|
||||||
|
.set(ReceiveOutReturnDetail::getStatus, prevStatus)
|
||||||
|
.set(ReceiveOutReturnDetail::getRemark, "已恢复过账")
|
||||||
|
.set(ReceiveOutReturnDetail::getUpdateTime, DateUtil.now()));
|
||||||
|
this.refreshUploadResult(detail.getReturnId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void ignoreDetails(Set<Long> detailIds) {
|
||||||
|
if (detailIds == null || detailIds.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Set<Long> returnIds = new HashSet<>();
|
||||||
|
for (Long detailId : detailIds) {
|
||||||
|
ReceiveOutReturnDetail detail = receiveOutReturnDetailMapper.selectById(detailId);
|
||||||
|
if (detail == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StockReturnStatusEnum.IGNORE.getCode().equals(detail.getStatus())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
receiveOutReturnDetailMapper.update(null, new LambdaUpdateWrapper<ReceiveOutReturnDetail>()
|
||||||
|
.eq(ReceiveOutReturnDetail::getId, detailId)
|
||||||
|
.set(ReceiveOutReturnDetail::getLast_status, detail.getStatus())
|
||||||
|
.set(ReceiveOutReturnDetail::getStatus, StockReturnStatusEnum.IGNORE.getCode())
|
||||||
|
.set(ReceiveOutReturnDetail::getRemark, "已忽略过账")
|
||||||
|
.set(ReceiveOutReturnDetail::getUpdateTime, DateUtil.now()));
|
||||||
|
returnIds.add(detail.getReturnId());
|
||||||
|
}
|
||||||
|
returnIds.forEach(this::refreshUploadResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void restoreDetails(Set<Long> detailIds) {
|
||||||
|
if (detailIds == null || detailIds.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Set<Long> returnIds = new HashSet<>();
|
||||||
|
for (Long detailId : detailIds) {
|
||||||
|
ReceiveOutReturnDetail detail = receiveOutReturnDetailMapper.selectById(detailId);
|
||||||
|
if (detail == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String prevStatus = detail.getLast_status();
|
||||||
|
if (prevStatus == null || prevStatus.isEmpty()) {
|
||||||
|
prevStatus = StockReturnStatusEnum.TODO.getCode();
|
||||||
|
}
|
||||||
|
receiveOutReturnDetailMapper.update(null, new LambdaUpdateWrapper<ReceiveOutReturnDetail>()
|
||||||
|
.eq(ReceiveOutReturnDetail::getId, detailId)
|
||||||
|
.set(ReceiveOutReturnDetail::getLast_status, null)
|
||||||
|
.set(ReceiveOutReturnDetail::getStatus, prevStatus)
|
||||||
|
.set(ReceiveOutReturnDetail::getRemark, "已恢复过账")
|
||||||
|
.set(ReceiveOutReturnDetail::getUpdateTime, DateUtil.now()));
|
||||||
|
returnIds.add(detail.getReturnId());
|
||||||
|
}
|
||||||
|
returnIds.forEach(this::refreshUploadResult);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refreshUploadResult(Long id) {
|
public void refreshUploadResult(Long id) {
|
||||||
final List<ReceiveOutReturnDetail> receiveOutReturnDetails = receiveOutReturnDetailMapper.selectList(new LambdaQueryWrapper<ReceiveOutReturnDetail>()
|
final List<ReceiveOutReturnDetail> receiveOutReturnDetails = receiveOutReturnDetailMapper.selectList(new LambdaQueryWrapper<ReceiveOutReturnDetail>()
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="serialNo" width="90" label="序号" />
|
<el-table-column show-overflow-tooltip prop="serialNo" width="90" label="序号" />
|
||||||
<el-table-column prop="status" width="100" label="状态" :formatter="statusFormat" />
|
<!-- <el-table-column prop="status" width="100" label="状态" :formatter="statusFormat" />-->
|
||||||
<el-table-column prop="status" label="单据状态" width="90">
|
<el-table-column prop="status" label="单据状态" width="90">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusFormat(scope.row.status) }}</el-tag>
|
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusFormat(scope.row.status) }}</el-tag>
|
||||||
@@ -284,8 +284,8 @@ export default {
|
|||||||
if (this.multipleSelection.length !== 1) return true
|
if (this.multipleSelection.length !== 1) return true
|
||||||
return this.multipleSelection[0].status !== 10
|
return this.multipleSelection[0].status !== 10
|
||||||
},
|
},
|
||||||
statusFormat(row) {
|
statusFormat(status) {
|
||||||
return this.statusLabel(row.status)
|
return this.statusLabel(status)
|
||||||
},
|
},
|
||||||
statusTagType(status) {
|
statusTagType(status) {
|
||||||
const map = { '0': '', '1': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
const map = { '0': '', '1': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
type="sucess"
|
type="sucess"
|
||||||
icon="el-icon-position"
|
icon="el-icon-position"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
:disabled="allowAgainSubmit()"
|
||||||
@click="deductionOrderSync"
|
@click="deductionOrderSync"
|
||||||
>
|
>
|
||||||
重新提交报工
|
重新提交报工
|
||||||
@@ -132,7 +133,16 @@
|
|||||||
<el-descriptions-item label="出入库单号" :span="2">{{ currentRow.requestId }}</el-descriptions-item>
|
<el-descriptions-item label="出入库单号" :span="2">{{ currentRow.requestId }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="报工参数" :span="2">{{ currentRow.reportParam }}</el-descriptions-item>
|
<el-descriptions-item label="报工参数" :span="2">{{ currentRow.reportParam }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-table :data="pagedDetails" size="mini" style="width: 100%; margin-top: 12px;">
|
<div style="margin-top: 12px;">
|
||||||
|
<el-button size="mini" type="warning" plain :disabled="!canBatchIgnore" @click="handleBatchIgnore">
|
||||||
|
批量忽略过账
|
||||||
|
</el-button>
|
||||||
|
<el-button size="mini" type="success" plain :disabled="!canBatchRestore" @click="handleBatchRestore">
|
||||||
|
批量恢复过账
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table ref="detailTable" :data="pagedDetails" size="mini" style="width: 100%; margin-top: 8px;" @selection-change="onDetailSelectionChange">
|
||||||
|
<el-table-column type="selection" width="40" />
|
||||||
<el-table-column prop="seq" label="序号" width="60" />
|
<el-table-column prop="seq" label="序号" width="60" />
|
||||||
<el-table-column label="状态" min-width="100">
|
<el-table-column label="状态" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -142,23 +152,14 @@
|
|||||||
<el-table-column prop="materialno" label="物料编号" min-width="120" />
|
<el-table-column prop="materialno" label="物料编号" min-width="120" />
|
||||||
<el-table-column prop="materialname" label="物料名称" min-width="180" />
|
<el-table-column prop="materialname" label="物料名称" min-width="180" />
|
||||||
<el-table-column prop="unitno" label="单位" min-width="70" />
|
<el-table-column prop="unitno" label="单位" min-width="70" />
|
||||||
<!-- <el-table-column prop="qty" label="工单扣减数量" min-width="100" />-->
|
|
||||||
<el-table-column prop="baseqty" label="BOM数量" min-width="50" />
|
<el-table-column prop="baseqty" label="BOM数量" min-width="50" />
|
||||||
<el-table-column prop="warehouseno" label="仓库" min-width="60" />
|
<el-table-column prop="warehouseno" label="仓库" min-width="60" />
|
||||||
<el-table-column prop="remark" label="备注" min-width="180" />
|
<el-table-column prop="remark" label="备注" min-width="180" />
|
||||||
<!-- <el-table-column prop="lotnumber" label="批号" min-width="100" />-->
|
|
||||||
<!-- <el-table-column prop="tracknumber" label="追踪号" min-width="120" />-->
|
|
||||||
<el-table-column prop="updateTime" label="更新时间" min-width="130" />
|
<el-table-column prop="updateTime" label="更新时间" min-width="130" />
|
||||||
<!-- 新增操作列 -->
|
<el-table-column label="操作" width="110" align="center" fixed="right">
|
||||||
<el-table-column label="操作" width="140" align="center" fixed="right">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="primary" plain @click="handleSyncEasStock(scope.row)">
|
||||||
size="mini"
|
EAS库存
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
@click="handleSyncEasStock(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.easQty || '库存查询' }}
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -183,8 +184,7 @@ import rrOperation from '@crud/RR.operation.vue'
|
|||||||
import crudOperation from '@crud/CRUD.operation.vue'
|
import crudOperation from '@crud/CRUD.operation.vue'
|
||||||
import udOperation from '@crud/UD.operation.vue'
|
import udOperation from '@crud/UD.operation.vue'
|
||||||
import pagination from '@crud/Pagination.vue'
|
import pagination from '@crud/Pagination.vue'
|
||||||
import { get } from './receiveOutReturn'
|
import { get, uploadReceiveOut, ignoreDetails, restoreDetails } from './receiveOutReturn'
|
||||||
import { uploadReceiveOut } from './receiveOutReturn'
|
|
||||||
|
|
||||||
const createDefaultForm = () => ({
|
const createDefaultForm = () => ({
|
||||||
id: null,
|
id: null,
|
||||||
@@ -232,6 +232,7 @@ export default {
|
|||||||
uploadFlag: true,
|
uploadFlag: true,
|
||||||
currentRow: {},
|
currentRow: {},
|
||||||
detailPage: { page: 1, size: 10 },
|
detailPage: { page: 1, size: 10 },
|
||||||
|
detailSelections: [],
|
||||||
permission: {
|
permission: {
|
||||||
add: ['purchasemst:add'],
|
add: ['purchasemst:add'],
|
||||||
edit: ['purchasemst:edit'],
|
edit: ['purchasemst:edit'],
|
||||||
@@ -239,10 +240,10 @@ export default {
|
|||||||
},
|
},
|
||||||
statusOptions: [
|
statusOptions: [
|
||||||
{ value: '0', label: '待过账' },
|
{ value: '0', label: '待过账' },
|
||||||
{ value: '1', label: '过账成功' },
|
{ value: '1', label: '过账完成' },
|
||||||
{ value: '2', label: '过账中' },
|
{ value: '2', label: '过账中' },
|
||||||
{ value: '3', label: '过账异常' },
|
{ value: '3', label: '重新提交' },
|
||||||
{ value: '4', label: '忽略过账' },
|
{ value: '4', label: '忽略过账' }
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
orgno: [{ required: true, message: '请输入机构编号', trigger: 'blur' }],
|
orgno: [{ required: true, message: '请输入机构编号', trigger: 'blur' }],
|
||||||
@@ -256,6 +257,14 @@ export default {
|
|||||||
const list = this.currentRow.details || []
|
const list = this.currentRow.details || []
|
||||||
const start = (this.detailPage.page - 1) * this.detailPage.size
|
const start = (this.detailPage.page - 1) * this.detailPage.size
|
||||||
return list.slice(start, start + this.detailPage.size)
|
return list.slice(start, start + this.detailPage.size)
|
||||||
|
},
|
||||||
|
canBatchIgnore() {
|
||||||
|
if (!this.detailSelections.length) { return false }
|
||||||
|
return this.detailSelections.every(r => String(r.status) !== '4' && String(r.status) !== '1')
|
||||||
|
},
|
||||||
|
canBatchRestore() {
|
||||||
|
if (!this.detailSelections.length) { return false }
|
||||||
|
return this.detailSelections.every(r => String(r.status) === '4')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -278,7 +287,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSelectionChange(val, row) {
|
handleSelectionChange(val, row) {
|
||||||
if (val.length == 1) {
|
if (val.length === 1) {
|
||||||
if (val[0].status === '0' || val[0].status === '2') {
|
if (val[0].status === '0' || val[0].status === '2') {
|
||||||
this.uploadFlag = false
|
this.uploadFlag = false
|
||||||
}
|
}
|
||||||
@@ -294,8 +303,10 @@ export default {
|
|||||||
this.currentRow = currentRow
|
this.currentRow = currentRow
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onDetailSelectionChange(selections) {
|
||||||
|
this.detailSelections = selections
|
||||||
|
},
|
||||||
handleSyncEasStock(row) {
|
handleSyncEasStock(row) {
|
||||||
// 检查必要参数
|
|
||||||
if (!row.materialno) {
|
if (!row.materialno) {
|
||||||
this.$message.warning('物料编号不能为空')
|
this.$message.warning('物料编号不能为空')
|
||||||
return
|
return
|
||||||
@@ -306,15 +317,57 @@ export default {
|
|||||||
}
|
}
|
||||||
crudReceiveOutReturn.allStock({ 'warehouseno': row.warehouseno, 'materialno': row.materialno }).then(res => {
|
crudReceiveOutReturn.allStock({ 'warehouseno': row.warehouseno, 'materialno': row.materialno }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
// 显示同步结果
|
|
||||||
const qty = res.data
|
const qty = res.data
|
||||||
// 可选:在行中显示查询到的库存数量
|
|
||||||
this.$set(row, 'easQty', qty)
|
this.$set(row, 'easQty', qty)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message || 'EAS库存查询失败')
|
this.$message.error(res.message || 'EAS库存查询失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleBatchIgnore() {
|
||||||
|
const ids = this.detailSelections.map(r => r.id)
|
||||||
|
if (!ids.length) {
|
||||||
|
this.$message.warning('请选择要操作的明细')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$confirm(`确认将选中的 ${ids.length} 条明细置为忽略过账?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
ignoreDetails(ids).then(() => {
|
||||||
|
this.$message.success('批量忽略过账成功')
|
||||||
|
this.refreshDetailView()
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
handleBatchRestore() {
|
||||||
|
const ids = this.detailSelections.map(r => r.id)
|
||||||
|
if (!ids.length) {
|
||||||
|
this.$message.warning('请选择要操作的明细')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$confirm(`确认恢复选中的 ${ids.length} 条明细的过账状态?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
restoreDetails(ids).then(() => {
|
||||||
|
this.$message.success('批量恢复过账成功')
|
||||||
|
this.refreshDetailView()
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
refreshDetailView() {
|
||||||
|
if (!this.currentRow.id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
get(this.currentRow.id).then(res => {
|
||||||
|
this.currentRow = res.data
|
||||||
|
this.detailPage.page = 1
|
||||||
|
this.detailSelections = []
|
||||||
|
})
|
||||||
|
},
|
||||||
upload() {
|
upload() {
|
||||||
const rows = this.crud.selections || []
|
const rows = this.crud.selections || []
|
||||||
if (rows.length < 1) {
|
if (rows.length < 1) {
|
||||||
@@ -358,9 +411,10 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const row = rows[0]
|
const row = rows[0]
|
||||||
|
|
||||||
const doUpload = () => {
|
const doUpload = () => {
|
||||||
this.fullscreenLoading = true
|
this.fullscreenLoading = true
|
||||||
crudReceiveOutReturn.deductionOrderSync(JSON.parse(row.reportParam)).then(() => {
|
crudReceiveOutReturn.reSubmit([row.id]).then(() => {
|
||||||
this.crud.notify('单据重新报工成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('单据重新报工成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@@ -403,6 +457,10 @@ export default {
|
|||||||
this.detailPage.page = 1
|
this.detailPage.page = 1
|
||||||
this.viewShow = true
|
this.viewShow = true
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
allowAgainSubmit() {
|
||||||
|
const rows = this.crud.selections || []
|
||||||
|
return rows.some(item => item.status !== '3')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,4 +59,37 @@ export function deductionOrderSync(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export default { add, edit, del, get, easStock, uploadReceiveOut, allStock, deductionOrderSync }
|
export function reSubmit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/receiveOutReturn/reSubmit',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function ignoreDetails(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/receiveOutReturn/detail/ignore/batch',
|
||||||
|
method: 'put',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function restoreDetails(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/receiveOutReturn/detail/restore/batch',
|
||||||
|
method: 'put',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function ignoreDetail(detailId) {
|
||||||
|
return request({
|
||||||
|
url: '/api/receiveOutReturn/detail/ignore/' + detailId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function restoreDetail(detailId) {
|
||||||
|
return request({
|
||||||
|
url: '/api/receiveOutReturn/detail/restore/' + detailId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, get, easStock, uploadReceiveOut, allStock, deductionOrderSync, reSubmit, ignoreDetail, restoreDetail, ignoreDetails, restoreDetails }
|
||||||
|
|||||||
Reference in New Issue
Block a user