Browse Source

24-05-16 标签记录

master
qiezi 2 years ago
parent
commit
6e48c86221
  1. 4
      src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java
  2. 2
      src/main/java/com/heai/modules/production/entity/PrintLabelRecord.java
  3. 12
      src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java

4
src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java

@ -613,8 +613,10 @@ public class BoardServiceImpl implements BoardService {
record.setPrintQty(BigDecimal.valueOf(packagePrintData.getUnitQty())); record.setPrintQty(BigDecimal.valueOf(packagePrintData.getUnitQty()));
record.setCreateTime(new Date()); record.setCreateTime(new Date());
printLabelRecordService.save(record); printLabelRecordService.save(record);
Integer count = printLabelRecordService.lambdaQuery().eq(PrintLabelRecord::getSeqNo, packagePrintData.getSeqNo()).count();
printLabelRecordService.lambdaUpdate().set(PrintLabelRecord::getItemNo,count).eq(PrintLabelRecord::getId,record.getId()).update();
// 参数赋值 // 参数赋值
packagePrintData.setPrintId(record.getId());
packagePrintData.setPrintId(count.longValue());
List<PackagePrintData> resultList = new ArrayList<>(); List<PackagePrintData> resultList = new ArrayList<>();
resultList.add(packagePrintData); resultList.add(packagePrintData);
return resultList; return resultList;

2
src/main/java/com/heai/modules/production/entity/PrintLabelRecord.java

@ -24,4 +24,6 @@ public class PrintLabelRecord {
private BigDecimal printQty; private BigDecimal printQty;
private Date createTime; private Date createTime;
private Long itemNo;
} }

12
src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java

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

Loading…
Cancel
Save