Compare commits
8 Commits
f2df17fb52
...
fbb1e90ae4
| Author | SHA1 | Date |
|---|---|---|
|
|
fbb1e90ae4 | |
|
|
998cbbb074 | |
|
|
61fa709345 | |
|
|
e60b389ffc | |
|
|
b17e1fcec8 | |
|
|
66e5407cbf | |
|
|
3b5e6b4ef2 | |
|
|
5ca36762ca |
|
|
@ -108,7 +108,6 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
|||
/**
|
||||
* 提交检测项
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("pad/add-check-item")
|
||||
public ApiResult<Void> addCheckItem(@Valid @RequestBody QmsIncomingInspectionTaskTodoCheckSubmitQO request){
|
||||
incomingInspectionTaskControllerService.submitCheckItem(request);
|
||||
|
|
@ -118,7 +117,6 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
|||
/**
|
||||
* 暂存检验结果
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("pad/staging")
|
||||
public ApiResult<Void> staging(@Valid @RequestBody QmsIncomingInspectionTaskSubmitQO request){
|
||||
incomingInspectionTaskControllerService.staging(request);
|
||||
|
|
@ -128,7 +126,6 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
|||
/**
|
||||
* 提交检验结果
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("pad/submit")
|
||||
public ApiResult<Void> submit(@Valid @RequestBody QmsIncomingInspectionTaskSubmitQO request){
|
||||
incomingInspectionTaskControllerService.submit(request);
|
||||
|
|
@ -140,7 +137,7 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
|||
*/
|
||||
@PostMapping("callback")
|
||||
public ApiResult<Void> callback(@RequestParam Long taskId){
|
||||
wmsIncomingInspectionTaskCallbackService.process(taskId, (short) 0);
|
||||
wmsIncomingInspectionTaskCallbackService.process(taskId);
|
||||
return ApiResult.success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
42
nflg-qms-admin/src/main/java/com/nflg/qms/admin/controller/external/MaterialController.java
vendored
Normal file
42
nflg-qms-admin/src/main/java/com/nflg/qms/admin/controller/external/MaterialController.java
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package com.nflg.qms.admin.controller.external;
|
||||
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.qo.ExemptMaterialCheckQO;
|
||||
import com.nflg.wms.common.pojo.vo.ExemptMaterialCheckVO;
|
||||
import com.nflg.wms.repository.service.IQmsExemptMaterialService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对外接口-物料信息
|
||||
* @folder 对外接口/物料信息
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/external/material")
|
||||
public class MaterialController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IQmsExemptMaterialService exemptMaterialService;
|
||||
|
||||
/**
|
||||
* 批量判断物料是否免检
|
||||
* - 参数为供应商编号和物料编号的组合列表
|
||||
* - 根据系统中已审核、已启用且在有效期内的免检设置判断
|
||||
* - 返回每个组合的免检标志(exempt=true 表示免检)
|
||||
*/
|
||||
@PostMapping("batchCheckExempt")
|
||||
public ApiResult<List<ExemptMaterialCheckVO>> batchCheckExempt(
|
||||
@Valid @RequestBody @NotEmpty List<ExemptMaterialCheckQO> request) {
|
||||
return ApiResult.success(exemptMaterialService.batchCheckExempt(request));
|
||||
}
|
||||
}
|
||||
|
|
@ -224,6 +224,18 @@ public class IncomingInspectionTaskControllerService {
|
|||
.setTriggerTime(LocalDateTime.now())
|
||||
);
|
||||
}
|
||||
|
||||
// 9. 设置检测数量
|
||||
Integer total;
|
||||
if (Objects.equals(standard.getTestingMethodDictItemId(), dictionaryItemService.getIdByCode("InspectionStandardTestingMethod", "Full"))) {
|
||||
total = task.getInspectionQty();
|
||||
} else {
|
||||
total = getCountOfSampling(task.getId(), task.getInspectionQty(), standard);
|
||||
}
|
||||
incomingInspectionTaskService.lambdaUpdate()
|
||||
.set(QmsIncomingInspectionTask::getDetectionQty, total)
|
||||
.eq(QmsIncomingInspectionTask::getId, task.getId())
|
||||
.update();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -333,6 +345,18 @@ public class IncomingInspectionTaskControllerService {
|
|||
.setTriggerTime(LocalDateTime.now())
|
||||
);
|
||||
}
|
||||
|
||||
// 9. 设置检测数量
|
||||
Integer total;
|
||||
if (Objects.equals(standard.getTestingMethodDictItemId(), dictionaryItemService.getIdByCode("InspectionStandardTestingMethod", "Full"))) {
|
||||
total = task.getInspectionQty();
|
||||
} else {
|
||||
total = getCountOfSampling(task.getId(), task.getInspectionQty(), standard);
|
||||
}
|
||||
incomingInspectionTaskService.lambdaUpdate()
|
||||
.set(QmsIncomingInspectionTask::getDetectionQty, total)
|
||||
.eq(QmsIncomingInspectionTask::getId, task.getId())
|
||||
.update();
|
||||
}
|
||||
|
||||
private DictionaryItem getAql(Long id, List<DictionaryItem> aqls) {
|
||||
|
|
@ -521,6 +545,7 @@ public class IncomingInspectionTaskControllerService {
|
|||
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
||||
QmsIncomingInspectionTaskVO detail = incomingInspectionTaskService.getDetail(id);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(detail)).throwMessage("任务不存在");
|
||||
detail.setInspectedQty(incomingInspectionTaskService.getInspectedQty(id));
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
|
@ -918,6 +943,7 @@ public class IncomingInspectionTaskControllerService {
|
|||
updateWrapper.update();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void submit(@Valid QmsIncomingInspectionTaskSubmitQO request) {
|
||||
QmsIncomingInspectionTask task = incomingInspectionTaskService.getById(request.getTaskId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(task)).throwMessage("任务不存在");
|
||||
|
|
@ -960,7 +986,7 @@ public class IncomingInspectionTaskControllerService {
|
|||
updateWrapper.update();
|
||||
|
||||
if (task.getInspectionResult()) {
|
||||
wmsIncomingInspectionTaskCallbackService.process(task.getId(), (short) 0);
|
||||
wmsIncomingInspectionTaskCallbackService.process(task.getId());
|
||||
} else {
|
||||
issueTicketControllerService.initiate(task.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
|||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTask;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecord;
|
||||
import com.nflg.wms.repository.entity.QmsIssueTicket;
|
||||
import com.nflg.wms.repository.service.IQmsIncomingInspectionTaskRecordService;
|
||||
import com.nflg.wms.repository.service.IQmsIncomingInspectionTaskService;
|
||||
import com.nflg.wms.repository.service.IQmsIssueTicketService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
|
@ -17,6 +19,7 @@ import org.springframework.scheduling.annotation.Async;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Wms来料检验任务回调服务
|
||||
|
|
@ -40,6 +43,9 @@ public class WmsIncomingInspectionTaskCallbackService {
|
|||
@Resource
|
||||
private WmsApiService wmsApiService;
|
||||
|
||||
@Resource
|
||||
private IQmsIssueTicketService issueTicketService;
|
||||
|
||||
/**
|
||||
* 向WMS系统发送来料检验任务回调
|
||||
*/
|
||||
|
|
@ -152,11 +158,31 @@ public class WmsIncomingInspectionTaskCallbackService {
|
|||
/**
|
||||
* WMS系统来料检验任务回调
|
||||
* @param taskId 来料检验任务ID
|
||||
*/
|
||||
public void process(Long taskId) {
|
||||
QmsIncomingInspectionTaskVO taskVO = incomingInspectionTaskService.getDetail(taskId);
|
||||
VUtil.trueThrowBusinessError(Objects.equals(taskVO.getCallbackResult(), true)).throwMessage("请勿重复回调");
|
||||
VUtil.trueThrowBusinessError(taskVO.getInspectionStatus() != 2).throwMessage("来料检验任务状态不允许回调");
|
||||
if (taskVO.getInspectionResult()) {
|
||||
process(taskVO, (short) 0);
|
||||
} else {
|
||||
QmsIssueTicket issueTicket = issueTicketService.lambdaQuery()
|
||||
.eq(QmsIssueTicket::getSourceId, taskId)
|
||||
.eq(QmsIssueTicket::getStatus, 2)
|
||||
.orderByDesc(QmsIssueTicket::getId)
|
||||
.last("limit 1")
|
||||
.one();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(issueTicket)).throwMessage("未找到符合条件的工单");
|
||||
process(taskVO, issueTicket.getApprovalStatus());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WMS系统来料检验任务回调
|
||||
* @param taskVO 来料检验任务VO
|
||||
* @param processingResult 处理结果:0=通过,3=报废,4=维修,5=挑选使用,6=让渡使用
|
||||
*/
|
||||
public void process(Long taskId, Short processingResult) {
|
||||
QmsIncomingInspectionTaskVO taskVO = incomingInspectionTaskService.getDetail(taskId);
|
||||
VUtil.trueThrowBusinessError(taskVO.getCallbackResult()).throwMessage("请勿重复回调");
|
||||
private void process(QmsIncomingInspectionTaskVO taskVO, Short processingResult) {
|
||||
switch (taskVO.getInspectionType()) {
|
||||
case 1:
|
||||
incoming(taskVO,processingResult);
|
||||
|
|
@ -169,4 +195,15 @@ public class WmsIncomingInspectionTaskCallbackService {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WMS系统来料检验任务回调
|
||||
* @param taskId 来料检验任务ID
|
||||
* @param processingResult 处理结果:0=通过,3=报废,4=维修,5=挑选使用,6=让渡使用
|
||||
*/
|
||||
private void process(Long taskId, Short processingResult) {
|
||||
QmsIncomingInspectionTaskVO taskVO = incomingInspectionTaskService.getDetail(taskId);
|
||||
VUtil.trueThrowBusinessError(Objects.equals(taskVO.getCallbackResult(),true)).throwMessage("请勿重复回调");
|
||||
process(taskVO, processingResult);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 免检物料判断 单条请求对象
|
||||
*/
|
||||
@Data
|
||||
public class ExemptMaterialCheckQO {
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
@NotBlank(message = "供应商编号不能为空")
|
||||
private String supplierCode;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@NotBlank(message = "物料编号不能为空")
|
||||
private String materialNo;
|
||||
}
|
||||
|
|
@ -66,10 +66,10 @@ public class ExternalIncomingInspectionApplyQO {
|
|||
private String factory;
|
||||
|
||||
/**
|
||||
* 检验数量(必填),即送检数量
|
||||
* 送检数量(必填)
|
||||
*/
|
||||
@NotNull(message = "检验数量不能为空")
|
||||
@Min(value = 1, message = "检验数量必须大于0")
|
||||
@NotNull(message = "送检数量不能为空")
|
||||
@Min(value = 1, message = "送检数量必须大于0")
|
||||
private Integer inspectionQty;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 免检物料判断 结果VO
|
||||
*/
|
||||
@Data
|
||||
public class ExemptMaterialCheckVO {
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierCode;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 是否免检:true=免检,false=非免检
|
||||
*/
|
||||
private Boolean exempt;
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ public class QmsIncomingInspectionTaskVO {
|
|||
private Integer inspectionType;
|
||||
|
||||
/**
|
||||
* 检验数量
|
||||
* 送检数量
|
||||
*/
|
||||
private Integer inspectionQty;
|
||||
|
||||
|
|
@ -117,6 +117,25 @@ public class QmsIncomingInspectionTaskVO {
|
|||
*/
|
||||
private Integer unqualifiedQty;
|
||||
|
||||
/**
|
||||
* 检测数量
|
||||
*/
|
||||
private Integer detectionQty;
|
||||
|
||||
/**
|
||||
* 已检数量
|
||||
*/
|
||||
private Integer inspectedQty = 0;
|
||||
|
||||
/**
|
||||
* 未检数量
|
||||
*/
|
||||
private Integer uninspectedQty;
|
||||
|
||||
public Integer getUninspectedQty() {
|
||||
return detectionQty - inspectedQty;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检验状态:0=待检,1=已检
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class QmsIncomingInspectionTask implements Serializable {
|
|||
private Integer inspectionType;
|
||||
|
||||
/**
|
||||
* 检验数量,即送检数量
|
||||
* 送检数量
|
||||
*/
|
||||
private Integer inspectionQty;
|
||||
|
||||
|
|
@ -102,6 +102,11 @@ public class QmsIncomingInspectionTask implements Serializable {
|
|||
*/
|
||||
private Integer unqualifiedQty;
|
||||
|
||||
/**
|
||||
* 检测数量
|
||||
*/
|
||||
private Integer detectionQty;
|
||||
|
||||
/**
|
||||
* 检验状态:0=待检,1=检验中,2=已检
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.ExemptMaterialCheckVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsExemptMaterialVO;
|
||||
import com.nflg.wms.repository.entity.QmsExemptMaterial;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -29,4 +30,11 @@ public interface QmsExemptMaterialMapper extends BaseMapper<QmsExemptMaterial> {
|
|||
* 按物料编号查询关联的供应商免检明细
|
||||
*/
|
||||
List<QmsExemptMaterialVO> detailByMaterial(@Param("materialNo") String materialNo);
|
||||
|
||||
/**
|
||||
* 批量查询有效免检物料(供应商编号+物料编号组合)
|
||||
* 仅返回审核通过、启用且在有效期内的记录
|
||||
*/
|
||||
List<ExemptMaterialCheckVO> batchCheckExempt(@Param("supplierCodes") List<String> supplierCodes,
|
||||
@Param("materialNos") List<String> materialNos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,6 @@ public interface QmsIncomingInspectionTaskMapper extends BaseMapper<QmsIncomingI
|
|||
* 根据id查询任务详情
|
||||
*/
|
||||
QmsIncomingInspectionTaskVO getDetail(Long id);
|
||||
|
||||
Integer getInspectedQty(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ package com.nflg.wms.repository.service;
|
|||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.qo.ExemptMaterialCheckQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialAuditQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialSaveQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.ExemptMaterialCheckVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsExemptMaterialVO;
|
||||
import com.nflg.wms.repository.entity.QmsExemptMaterial;
|
||||
|
||||
|
|
@ -44,4 +46,10 @@ public interface IQmsExemptMaterialService extends IService<QmsExemptMaterial> {
|
|||
* 审核免检物料
|
||||
*/
|
||||
void audit(QmsExemptMaterialAuditQO request);
|
||||
|
||||
/**
|
||||
* 批量判断物料是否免检
|
||||
* 根据供应商编号和物料编号判断,返回每个组合的免检标志
|
||||
*/
|
||||
List<ExemptMaterialCheckVO> batchCheckExempt(List<ExemptMaterialCheckQO> items);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,4 +48,6 @@ public interface IQmsIncomingInspectionTaskService extends IService<QmsIncomingI
|
|||
* @return 任务详情
|
||||
*/
|
||||
QmsIncomingInspectionTaskVO getDetail(Long id);
|
||||
|
||||
Integer getInspectedQty(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.constant.STATE;
|
||||
import com.nflg.wms.common.exception.NflgException;
|
||||
import com.nflg.wms.common.pojo.qo.ExemptMaterialCheckQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialAuditQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialSaveQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsExemptMaterialSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.ExemptMaterialCheckVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsExemptMaterialVO;
|
||||
import com.nflg.wms.common.util.StringUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
|
|
@ -21,7 +23,10 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 免检物料 服务实现类
|
||||
|
|
@ -166,4 +171,36 @@ public class QmsExemptMaterialServiceImpl extends ServiceImpl<QmsExemptMaterialM
|
|||
}
|
||||
return LocalDateTime.parse(dateStr, DATE_FMT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExemptMaterialCheckVO> batchCheckExempt(List<ExemptMaterialCheckQO> items) {
|
||||
// 提取所有供应商编号和物料编号
|
||||
List<String> supplierCodes = items.stream()
|
||||
.map(ExemptMaterialCheckQO::getSupplierCode)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<String> materialNos = items.stream()
|
||||
.map(ExemptMaterialCheckQO::getMaterialNo)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 一次性查询所有有效免检组合
|
||||
List<ExemptMaterialCheckVO> exemptList = baseMapper.batchCheckExempt(supplierCodes, materialNos);
|
||||
|
||||
// 构建免检组合的快速查询集合,格式:supplierCode:materialNo
|
||||
Set<String> exemptSet = exemptList.stream()
|
||||
.map(v -> v.getSupplierCode() + ":" + v.getMaterialNo())
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
|
||||
// 构建返回结果
|
||||
List<ExemptMaterialCheckVO> result = new ArrayList<>(items.size());
|
||||
for (ExemptMaterialCheckQO item : items) {
|
||||
ExemptMaterialCheckVO vo = new ExemptMaterialCheckVO();
|
||||
vo.setSupplierCode(item.getSupplierCode());
|
||||
vo.setMaterialNo(item.getMaterialNo());
|
||||
vo.setExempt(exemptSet.contains(item.getSupplierCode() + ":" + item.getMaterialNo()));
|
||||
result.add(vo);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,9 @@ public class QmsIncomingInspectionTaskServiceImpl extends ServiceImpl<QmsIncomin
|
|||
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
||||
return baseMapper.getDetail(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getInspectedQty(Long id) {
|
||||
return baseMapper.getInspectedQty(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,4 +134,27 @@
|
|||
ORDER BY em.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 批量查询有效免检物料(供应商编号+物料编号组合),仅返回审核通过、启用且在有效期内的记录 -->
|
||||
<select id="batchCheckExempt" resultType="com.nflg.wms.common.pojo.vo.ExemptMaterialCheckVO">
|
||||
SELECT
|
||||
us.supplier_code AS supplierCode,
|
||||
em.material_no AS materialNo
|
||||
FROM qms_exempt_material em
|
||||
INNER JOIN user_supplier us ON us.id = em.supplier_id
|
||||
WHERE em.audit_status = 1
|
||||
AND em.enable = true
|
||||
AND (
|
||||
em.exempt_mode = 0
|
||||
OR (em.exempt_mode = 1 AND em.valid_end_date IS NOT NULL AND em.valid_end_date >= NOW())
|
||||
)
|
||||
AND us.supplier_code IN
|
||||
<foreach collection="supplierCodes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
AND em.material_no IN
|
||||
<foreach collection="materialNos" item="no" open="(" separator="," close=")">
|
||||
#{no}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@
|
|||
t.purchase_group,
|
||||
t.callback_result,
|
||||
t.warehouse,
|
||||
t.storage_days
|
||||
t.storage_days,
|
||||
t.storage_location
|
||||
FROM qms_incoming_inspection_task t
|
||||
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
||||
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
||||
|
|
@ -137,7 +138,8 @@
|
|||
t2.task_no as related_task_no,
|
||||
t.update_user_id,
|
||||
t.update_user_name,
|
||||
t.update_time
|
||||
t.update_time,
|
||||
t.detection_qty
|
||||
FROM qms_incoming_inspection_task t
|
||||
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
||||
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
||||
|
|
@ -214,7 +216,8 @@
|
|||
t.warehouse,
|
||||
t.storage_location,
|
||||
t.storage_days,
|
||||
t.callback_result
|
||||
t.callback_result,
|
||||
t.detection_qty
|
||||
FROM qms_incoming_inspection_task t
|
||||
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
||||
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
||||
|
|
@ -222,4 +225,9 @@
|
|||
WHERE t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getInspectedQty" resultType="java.lang.Integer">
|
||||
SELECT COALESCE(SUM(inspection_qty),0)
|
||||
FROM qms_incoming_inspection_task_record
|
||||
WHERE task_id=#{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue