feat: 接口,来料检指定不良拖
This commit is contained in:
parent
c0162f9d40
commit
628a945444
@ -0,0 +1,9 @@
|
||||
package com.foreverwin.iep.qms.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class QmsInspectBatchDTO {
|
||||
private String site;
|
||||
private String inspectBatch;
|
||||
}
|
||||
@ -32,10 +32,22 @@ public class QmsIqcBarcodeMDTO {
|
||||
private String inspectBatch;
|
||||
// 检验任务
|
||||
private String inspectJob;
|
||||
// 供应商批次
|
||||
private String supplierBatch;
|
||||
// SAP批次
|
||||
private String sapBatch;
|
||||
// 收货批次
|
||||
private String receiptBath;
|
||||
// 收货数量
|
||||
private BigDecimal receivedQuantity ;
|
||||
// 退回数量
|
||||
private BigDecimal returnQuantity ;
|
||||
// 入库数量 (合格数量)
|
||||
private BigDecimal storageQuantity ;
|
||||
// 破坏数量
|
||||
private BigDecimal destructiveQuantity ;
|
||||
// 留样数量
|
||||
private BigDecimal testsampleQuantity ;
|
||||
// 状态
|
||||
private String status;
|
||||
// 条码明细
|
||||
|
||||
@ -7,6 +7,7 @@ import com.foreverwin.iep.qms.domain.InspecJobExtend;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecDetailDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecJobDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecResultNccodeDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspectBatchDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.iep.qms.service.AutoCreateJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecDetailService;
|
||||
|
||||
@ -1,35 +1,25 @@
|
||||
package com.foreverwin.iep.qms.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.iep.common.base.FrontPage;
|
||||
import com.foreverwin.iep.prd.dto.ItemDTO;
|
||||
import com.foreverwin.iep.prd.entity.ItemType;
|
||||
import com.foreverwin.iep.qms.domain.InspecJob;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecJobDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspectBatchDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeMDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsFrozenThawLog;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.iep.qms.entity.QmsIqcInspecDataSource;
|
||||
import com.foreverwin.iep.qms.service.QmsFrozenThawLogService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecNcBarcodeMService;
|
||||
import com.foreverwin.iep.qms.service.QmsIqcInspecDataSourceService;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* IQC指定不良拖
|
||||
*
|
||||
@ -45,6 +35,8 @@ public class QmsInspecNcBarcodeMController {
|
||||
private final QmsInspecNcBarcodeMService qmsInspecNcBarcodeMService;
|
||||
|
||||
private final QmsIqcInspecDataSourceService qmsIqcInspecDataSourceService;
|
||||
|
||||
private final QmsInspecJobService qmsInspecJobService;
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
@ -65,7 +57,7 @@ public class QmsInspecNcBarcodeMController {
|
||||
@ApiOperation(value = "保存条码扫描结果", notes = "保存条码扫描结果")
|
||||
@PutMapping("/saveBarcode")
|
||||
public R saveOrCommitBarcodeList(@RequestBody QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO) {
|
||||
qmsInspecNcBarcodeMService.saveOrCommitBarcodeList(qmsIqcBarcodeMDTO);
|
||||
qmsInspecNcBarcodeMService.saveBarcodeList(qmsIqcBarcodeMDTO);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -82,6 +74,17 @@ public class QmsInspecNcBarcodeMController {
|
||||
return R.ok(qmsIqcInspecDataSourceService.getReceiptNoPage(page,qmsIqcInspecDataSource));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询检验批次", notes = "分页查询检验批次")
|
||||
@PostMapping("/getInspectBatch")
|
||||
public R getInspectBatch(FrontPage page, QmsInspectBatchDTO qmsInspectBatchDTO) {
|
||||
return R.ok(qmsIqcInspecDataSourceService.getInspectBatchPage(page,qmsInspectBatchDTO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询检验任务", notes = "分页查询检验任务")
|
||||
@PostMapping("/getInspectJob")
|
||||
public R getInspectJob(FrontPage page, QmsInspecJob qmsInspecJob) {
|
||||
qmsInspecJob.setSite(TenantContextHolder.getTenantId());
|
||||
return R.ok(qmsInspecJobService.page(page, Wrappers.<QmsInspecJob>lambdaQuery().eq(QmsInspecJob::getSite, qmsInspecJob.getSite()).like(StrUtil.isNotBlank(qmsInspecJob.getJobNo()), QmsInspecJob::getJobNo, qmsInspecJob.getJobNo()).orderByDesc(QmsInspecJob::getJobNo)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ public interface QmsInspecNcBarcodeMService extends ExpansionService<QmsInspecN
|
||||
|
||||
List<QmsIqcBarcodeDDTO> getDetailBarcodeByMHandle(String mHandle);
|
||||
|
||||
void saveOrCommitBarcodeList(QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO);
|
||||
void saveBarcodeList(QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO);
|
||||
|
||||
void commitBarcodeList(QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.foreverwin.iep.qms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspectBatchDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeMDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsIqcInspecDataSource;
|
||||
import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionService;
|
||||
@ -16,4 +17,6 @@ import java.util.List;
|
||||
public interface QmsIqcInspecDataSourceService extends ExpansionService<QmsIqcInspecDataSource> {
|
||||
|
||||
IPage<QmsIqcInspecDataSource> getReceiptNoPage(Page page, QmsIqcInspecDataSource qmsIqcInspecDataSource);
|
||||
|
||||
IPage<QmsInspectBatchDTO> getInspectBatchPage(Page page, QmsInspectBatchDTO qmsInspectBatchDTO);
|
||||
}
|
||||
|
||||
@ -4,11 +4,15 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.integration.feign.RemoteInvokeService;
|
||||
import com.foreverwin.iep.prd.entity.Item;
|
||||
import com.foreverwin.iep.qms.domain.InspecJob;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeDDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeMDTO;
|
||||
@ -19,19 +23,24 @@ import com.foreverwin.iep.qms.mapper.QmsInspecNcBarcodeDMapper;
|
||||
import com.foreverwin.iep.qms.mapper.QmsInspecNcBarcodeMMapper;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecNcBarcodeDService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecNcBarcodeMService;
|
||||
import com.foreverwin.iep.sys.constant.HandleEnum;
|
||||
import com.foreverwin.mom.admin.api.entity.SysActivityOption;
|
||||
import com.foreverwin.mom.admin.api.feign.RemoteActivityOptionService;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.mom.wms.api.feign.RemoteWmsInventoryService;
|
||||
import com.foreverwin.mom.wms.dto.IqcResultNoticeDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* @author SEMI
|
||||
@ -49,6 +58,8 @@ public class QmsInspecNcBarcodeMServiceImpl extends ServiceImpl<QmsInspecNcBarco
|
||||
private final QmsInspecNcBarcodeMMapper qmsInspecNcBarcodeMMapper;
|
||||
private final QmsInspecNcBarcodeDService qmsInspecNcBarcodeDService;
|
||||
private final QmsInspecNcBarcodeDMapper qmsInspecNcBarcodeDMapper;
|
||||
|
||||
private final RemoteInvokeService remoteInvokeService;
|
||||
@Override
|
||||
public IPage<QmsIqcBarcodeMDTO> getQmsIqcBarcodeMPage(Page page, QmsIqcBarcodeDTO qmsIqcBarcodeDTO) {
|
||||
qmsIqcBarcodeDTO.setSite(TenantContextHolder.getTenantId());
|
||||
@ -75,28 +86,37 @@ public class QmsInspecNcBarcodeMServiceImpl extends ServiceImpl<QmsInspecNcBarco
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrCommitBarcodeList(QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO) {
|
||||
public void saveBarcodeList(QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
String item = qmsIqcBarcodeMDTO.getItem();
|
||||
String itemRevison = qmsIqcBarcodeMDTO.getItemRevision();
|
||||
String itemDesc = qmsIqcBarcodeMDTO.getItemDesc();
|
||||
String handle = qmsIqcBarcodeMDTO.getHandle();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<QmsIqcBarcodeDDTO> qmsIqcBarcodeDDTOList = qmsIqcBarcodeMDTO.getQmsIqcBarcodeDDTOList();
|
||||
if (CollUtil.isNotEmpty(qmsIqcBarcodeDDTOList)){
|
||||
|
||||
List<QmsInspecNcBarcodeD> qmsInspecNcBarcodeDList = new ArrayList<>(qmsIqcBarcodeDDTOList.size());
|
||||
qmsIqcBarcodeDDTOList.stream().forEach(qmsIqcBarcodeDDTO -> {
|
||||
for (int i = 0; i < qmsIqcBarcodeDDTOList.size(); i++) {
|
||||
String seq = String.valueOf(i+1);
|
||||
QmsIqcBarcodeDDTO qmsIqcBarcodeDDTO = qmsIqcBarcodeDDTOList.get(i);
|
||||
QmsInspecNcBarcodeD qmsInspecNcBarcodeD = new QmsInspecNcBarcodeD();
|
||||
qmsInspecNcBarcodeD.setHandle(QmsInspecNcBarcodeD.genHandle(site, handle, qmsIqcBarcodeDDTO.getSeq()));
|
||||
qmsInspecNcBarcodeD.setSeq(qmsIqcBarcodeDDTO.getSeq());
|
||||
qmsInspecNcBarcodeD.setHandle(QmsInspecNcBarcodeD.genHandle(site, handle, seq));
|
||||
qmsInspecNcBarcodeD.setSeq(seq);
|
||||
qmsInspecNcBarcodeD.setSite(site);
|
||||
qmsInspecNcBarcodeD.setBarcodeId(qmsIqcBarcodeDDTO.getBarcode());
|
||||
qmsInspecNcBarcodeD.setBarcodeQty(qmsIqcBarcodeDDTO.getQuantity());
|
||||
qmsInspecNcBarcodeD.setItem(item);
|
||||
qmsInspecNcBarcodeD.setItemDesc(itemDesc);
|
||||
qmsInspecNcBarcodeD.setItemRevision(itemRevison);
|
||||
qmsInspecNcBarcodeD.setInspecNcBarcodeMBo(handle);
|
||||
qmsInspecNcBarcodeDList.add(qmsInspecNcBarcodeD);
|
||||
});
|
||||
qmsInspecNcBarcodeD.setCreator(user);
|
||||
qmsInspecNcBarcodeD.setDateCreate(now);
|
||||
qmsInspecNcBarcodeD.setUpdater(user);
|
||||
qmsInspecNcBarcodeD.setItemDesc(qmsIqcBarcodeDDTO.getItemDesc());
|
||||
qmsInspecNcBarcodeD.setDateUpdate(now);
|
||||
qmsInspecNcBarcodeDList.add(qmsInspecNcBarcodeD);//码是否已存在
|
||||
}
|
||||
// 先移除所有旧数据
|
||||
qmsInspecNcBarcodeDService.remove(new LambdaQueryWrapper<QmsInspecNcBarcodeD>().eq(QmsInspecNcBarcodeD::getInspecNcBarcodeMBo, handle));
|
||||
// 保存新数据
|
||||
@ -108,9 +128,20 @@ public class QmsInspecNcBarcodeMServiceImpl extends ServiceImpl<QmsInspecNcBarco
|
||||
public void commitBarcodeList(QmsIqcBarcodeMDTO qmsIqcBarcodeMDTO) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String receiptNo = qmsIqcBarcodeMDTO.getReceiptNo();
|
||||
String item = qmsIqcBarcodeMDTO.getItem();
|
||||
String sapBatch = qmsIqcBarcodeMDTO.getInspectBatch();
|
||||
String itemNumber = qmsIqcBarcodeMDTO.getItemNumber();
|
||||
BigDecimal populationQty = qmsIqcBarcodeMDTO.getReceivedQuantity() == null ? BigDecimal.ZERO: qmsIqcBarcodeMDTO.getReceivedQuantity();//收货数量(采购数量)
|
||||
BigDecimal returnQty = qmsIqcBarcodeMDTO.getReturnQuantity() == null ? BigDecimal.ZERO:qmsIqcBarcodeMDTO.getReturnQuantity();//退回数量
|
||||
BigDecimal destructiveQty = qmsIqcBarcodeMDTO.getDestructiveQuantity() == null ? BigDecimal.ZERO: qmsIqcBarcodeMDTO.getDestructiveQuantity();//破坏数量
|
||||
BigDecimal testsampleQty = qmsIqcBarcodeMDTO.getTestsampleQuantity() == null ? BigDecimal.ZERO:qmsIqcBarcodeMDTO.getTestsampleQuantity();//留样数量
|
||||
BigDecimal storageQty = qmsIqcBarcodeMDTO.getStorageQuantity() == null ? BigDecimal.ZERO:qmsIqcBarcodeMDTO.getStorageQuantity(); //合格数量
|
||||
String activityId = qmsIqcBarcodeMDTO.getActivityId();
|
||||
this.saveOrCommitBarcodeList(qmsIqcBarcodeMDTO);
|
||||
List<QmsIqcBarcodeDDTO> qmsIqcBarcodeDDTOList = qmsIqcBarcodeMDTO.getQmsIqcBarcodeDDTOList();
|
||||
/**
|
||||
* 保存扫描结果
|
||||
*/
|
||||
this.saveBarcodeList(qmsIqcBarcodeMDTO);
|
||||
|
||||
if (StrUtil.isEmpty(activityId)){
|
||||
throw BusinessException.build(String.format("请求参数作业[%s]为空,请检查数据", activityId));
|
||||
@ -126,25 +157,89 @@ public class QmsInspecNcBarcodeMServiceImpl extends ServiceImpl<QmsInspecNcBarco
|
||||
// 判断作业规则是否需要调用ERP接口
|
||||
SysActivityOption sysActivityOptionErp = sysActivityOptionList.stream().filter(option -> option.getOptionName().equals("TO_ERP")).findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotNull(sysActivityOptionWms) && "Y".equals(sysActivityOptionWms.getOptionValue())){
|
||||
callWmsInterface(receiptNo, itemNumber, "BF");
|
||||
callWmsInterface(receiptNo, itemNumber, "BF", qmsIqcBarcodeDDTOList);
|
||||
}
|
||||
// ERP接口
|
||||
if (ObjectUtil.isNotNull(sysActivityOptionErp) && "Y".equals(sysActivityOptionErp.getOptionValue())){
|
||||
//callErpInterface("101", inspecJob, qmsIqcInspecDataSource, populationQty, storageQty, returnQty, destructiveQty, testsampleQty);
|
||||
callErpInterface("103",sapBatch,item,populationQty,storageQty,returnQty,destructiveQty,testsampleQty);
|
||||
}
|
||||
}
|
||||
private void callWmsInterface(String receiptNo,String itemNumber, String type){
|
||||
|
||||
/**
|
||||
* 调用ERP接口进行特采 103:特采,101:合格,102:判退
|
||||
* @param type
|
||||
* @param sapBatch
|
||||
* @param item
|
||||
* @param populationQty
|
||||
* @param storageQty
|
||||
* @param returnQty
|
||||
* @param destructiveQty
|
||||
* @param testsampleQty
|
||||
*/
|
||||
private void callErpInterface(String type,String sapBatch,String item,BigDecimal populationQty,BigDecimal storageQty, BigDecimal returnQty,BigDecimal destructiveQty,BigDecimal testsampleQty ) {
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("RFC_FUNCTION", "ZMM_MES_UD_POST");
|
||||
JSONObject contextJsonObject = new JSONObject();
|
||||
contextJsonObject.put("EXCHANGE_SYSTEM", "MES");
|
||||
contextJsonObject.put("EXCHANGE_DOC", "");
|
||||
contextJsonObject.put("EXCHANGE_ID", StrUtil.uuid());
|
||||
jsonBody.put("REQUEST_CONTEXT", contextJsonObject);
|
||||
JSONObject inputJsonObject = new JSONObject();
|
||||
inputJsonObject.put("ZPARTNER", SecurityUtils.getUserName());//员工BP账号
|
||||
inputJsonObject.put("VCODE", type);//使用决策编码
|
||||
inputJsonObject.put("WERKS",TenantContextHolder.getTenantId());//工厂
|
||||
inputJsonObject.put("MATNR", item);//物料编号
|
||||
inputJsonObject.put("CHARG",sapBatch);//批次编号 SAP批次
|
||||
inputJsonObject.put("Z_MENGE0",populationQty );// 总数量
|
||||
inputJsonObject.put("Z_MENGE1",storageQty );// 合格数量
|
||||
inputJsonObject.put("Z_MENGE2",returnQty );// 退货数量
|
||||
inputJsonObject.put("Z_MENGE3",destructiveQty.add(testsampleQty) );// 取样消耗数量
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(inputJsonObject);
|
||||
|
||||
JSONObject bodyJsonObject = new JSONObject();
|
||||
bodyJsonObject.put("IT_INPUT", jsonArray);
|
||||
|
||||
jsonBody.put("REQUEST_BODY", bodyJsonObject);
|
||||
|
||||
JSONObject rquestJsonObject = new JSONObject();
|
||||
rquestJsonObject.put("jsonBody", jsonBody);
|
||||
rquestJsonObject.put("SITE",TenantContextHolder.getTenantId());
|
||||
rquestJsonObject.put("KEY_VALUE", "SAP_INCOMING_INSPECTION");
|
||||
rquestJsonObject.put("MESSAGE_ID", "SAP_INCOMING_INSPECTION");
|
||||
|
||||
JSONObject returnJsonObject = remoteInvokeService.requestErpPort(rquestJsonObject);
|
||||
Object resultCode = returnJsonObject.get("RESULT").toString();
|
||||
if ("E".equals(resultCode)){
|
||||
throw BusinessException.build(returnJsonObject.get("MESSAGE").toString());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 调用WMS接口记性报废处理
|
||||
* @param receiptNo
|
||||
* @param itemNumber
|
||||
* @param type
|
||||
* @param qmsIqcBarcodeDDTOList
|
||||
*/
|
||||
private void callWmsInterface(String receiptNo,String itemNumber, String type,List<QmsIqcBarcodeDDTO> qmsIqcBarcodeDDTOList ){
|
||||
if (CollUtil.isEmpty(qmsIqcBarcodeDDTOList)){
|
||||
throw BusinessException.build("条码数据为空");
|
||||
}
|
||||
List<String> inventoryIds = new ArrayList<>(qmsIqcBarcodeDDTOList.size());
|
||||
qmsIqcBarcodeDDTOList.forEach(item -> {
|
||||
inventoryIds.add(item.getBarcode());
|
||||
});
|
||||
IqcResultNoticeDto iqcResultNoticeDto = new IqcResultNoticeDto();
|
||||
iqcResultNoticeDto.setExternalDocumentNo(receiptNo);
|
||||
iqcResultNoticeDto.setSeq(itemNumber);
|
||||
iqcResultNoticeDto.setResults(type);
|
||||
iqcResultNoticeDto.setInventoryIds(inventoryIds);
|
||||
R result = remoteWmsInventoryService.iqcResultNotice(iqcResultNoticeDto);
|
||||
if (result.getCode() != 0){
|
||||
throw BusinessException.build(result.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.foreverwin.iep.qms.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspectBatchDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsIqcInspecDataSource;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemFactor;
|
||||
import com.foreverwin.iep.qms.mapper.QmsIqcInspecDataSourceMapper;
|
||||
@ -30,6 +33,12 @@ public class QmsIqcInspecDataSourceServiceImpl extends ServiceImpl<QmsIqcInspecD
|
||||
qmsIqcInspecDataSource.setSite(TenantContextHolder.getTenantId());
|
||||
return qmsIqcInspecDataSourceMapper.selectReceiptNoPage(page,qmsIqcInspecDataSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<QmsInspectBatchDTO> getInspectBatchPage(Page page, QmsInspectBatchDTO qmsInspectBatchDTO) {
|
||||
qmsInspectBatchDTO.setSite(TenantContextHolder.getTenantId());
|
||||
return qmsIqcInspecDataSourceMapper.selectInspectBatchPage(page,qmsInspectBatchDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.foreverwin.iep.qms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspectBatchDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsIqcBarcodeMDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspectionLevel;
|
||||
@ -21,6 +22,8 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface QmsIqcInspecDataSourceMapper extends ExpansionBaseMapper<QmsIqcInspecDataSource> {
|
||||
|
||||
IPage<QmsIqcInspecDataSource> selectReceiptNoPage(IPage iPage, @Param("entity") QmsIqcInspecDataSource qmsIqcInspecDataSource);
|
||||
|
||||
IPage<QmsInspectBatchDTO> selectInspectBatchPage(IPage iPage, @Param("entity") QmsInspectBatchDTO qmsInspectBatchDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,13 +32,14 @@
|
||||
|
||||
<select id="selectMPage" resultType="com.foreverwin.iep.qms.dto.QmsIqcBarcodeMDTO">
|
||||
select distinct qinbm.HANDLE, qinbm.SITE,qinbm.INSPECTION_BATCH INSPECT_BATCH,qinbm.JOB_NO INSPECT_JOB
|
||||
,qinbm.DATE_CREATE,qinbm.POPULATION_QTY RECEIVED_QUANTITY,qinbm.RETURN_QTY RETURN_QUANTITY,qinbm.STATUS
|
||||
,qinbm.DATE_UPDATE
|
||||
,qiids.ITEM_NUMBER,qiids.RECEIPT_NO
|
||||
,qinbm.DATE_CREATE,qinbm.POPULATION_QTY RECEIVED_QUANTITY,qinbm.RETURN_QTY RETURN_QUANTITY,qinbm.STATUS ,qinbm.DATE_UPDATE
|
||||
,qiids.ITEM_NUMBER,qiids.RECEIPT_NO,qiids.SUPPLIER_BATCH ,qiids.RECEIPT_BATCH ,qiids.SAP_BATCH
|
||||
,i.ITEM,i.REVISION ITEM_REVISION,i.DESCRIPTION ITEM_DESC
|
||||
,ifnull(qij.STORAGE_QTY,0) STORAGE_QUANTITY,ifnull(qij.DESTRUCTIVE_QTY,0) DESTRUCTIVE_QUANTITY,ifnull(qij.TESTSAMPLE_QTY ,0) TESTSAMPLE_QUANTITY
|
||||
from qms_inspec_nc_barcode_m qinbm
|
||||
inner join qms_iqc_inspec_data_source qiids on qinbm.SITE = qiids.SITE and qiids.INSPECTION_BATCH = qinbm.INSPECTION_BATCH
|
||||
inner join item i on i.HANDLE = qiids.ITEM_BO
|
||||
inner join qms_inspec_job qij on qij.SITE = qinbm.SITE and qij.JOB_NO = qinbm.JOB_NO
|
||||
where qinbm.SITE = #{entity.site}
|
||||
<if test="entity.item != null and entity.item != ''">
|
||||
and i.ITEM = #{entity.item}
|
||||
|
||||
@ -34,11 +34,22 @@
|
||||
UPDATER,DATE_UPDATE
|
||||
</sql>
|
||||
<select id="selectReceiptNoPage" resultType="com.foreverwin.iep.qms.entity.QmsIqcInspecDataSource">
|
||||
select distinct qiids.SITE,qiids.RECEIPT_NO,qiids.PURCHASE_NO,qiids.SUPPLIER_NO from qms_iqc_inspec_data_source qiids
|
||||
select distinct qiids.SITE,qiids.RECEIPT_NO,qiids.PURCHASE_NO,qiids.SUPPLIER_NO,qiids.DATE_CREATE
|
||||
from qms_iqc_inspec_data_source qiids
|
||||
where qiids.SITE = #{entity.site}
|
||||
<if test="entity.receiptNo != null and entity.receiptNo != ''">
|
||||
and qiids.RECEIPT_NO like concat('%',#{entity.receiptNo},'%')
|
||||
</if>
|
||||
order by qiids.DATE_CREATE DESC
|
||||
</select>
|
||||
<select id="selectInspectBatchPage" resultType="com.foreverwin.iep.qms.dto.QmsInspectBatchDTO">
|
||||
select distinct qiids.INSPECTION_BATCH INSPECT_BATCH ,qiids.DATE_CREATE
|
||||
from qms_iqc_inspec_data_source qiids
|
||||
where qiids.SITE = #{entity.site}
|
||||
<if test="entity.inspectBatch != null and entity.inspectBatch != ''">
|
||||
and qiids.INSPECTION_BATCH like concat('%',#{entity.inspectBatch},'%')
|
||||
</if>
|
||||
order by qiids.DATE_CREATE DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user