|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.heai.modules.production.dao.OutboundLabelScanMapper; |
|
|
|
import com.heai.modules.production.entity.OutboundLabelScan; |
|
|
|
import com.heai.modules.production.entity.OutboundLabelScanData; |
|
|
|
import com.heai.modules.production.entity.PrintLabelRecord; |
|
|
|
import com.heai.modules.production.service.OutboundLabelScanService; |
|
|
|
import com.heai.modules.production.service.PrintLabelRecordService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -18,6 +19,9 @@ import java.util.Objects; |
|
|
|
@Slf4j |
|
|
|
public class OutboundLabelScanServiceImpl extends ServiceImpl<OutboundLabelScanMapper, OutboundLabelScan> implements OutboundLabelScanService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PrintLabelRecordService printLabelRecordService; |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public boolean save(OutboundLabelScan entity) { |
|
|
|
@ -63,9 +67,13 @@ public class OutboundLabelScanServiceImpl extends ServiceImpl<OutboundLabelScanM |
|
|
|
@Transactional |
|
|
|
public void saveLabel(OutboundLabelScan outboundLabelScan) { |
|
|
|
if (Objects.nonNull(outboundLabelScan.getPrintId())){ |
|
|
|
List<OutboundLabelScan> list = lambdaQuery().eq(OutboundLabelScan::getPrintId, outboundLabelScan.getPrintId()).list(); |
|
|
|
PrintLabelRecord record = printLabelRecordService.lambdaQuery().eq(PrintLabelRecord::getSeqNo, outboundLabelScan.getSeqNo()).eq(PrintLabelRecord::getItemNo, outboundLabelScan.getPrintId()).one(); |
|
|
|
if (Objects.isNull(record)){ |
|
|
|
throw new RuntimeException("标签异常,请重新打印"); |
|
|
|
} |
|
|
|
List<OutboundLabelScan> list = lambdaQuery().eq(OutboundLabelScan::getPrintId, record.getId()).list(); |
|
|
|
if (!list.isEmpty()){ |
|
|
|
throw new RuntimeException("标签已扫描,请勿重复扫描"); |
|
|
|
throw new RuntimeException("重复扫描"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询用户信息 |
|
|
|
|