diff --git a/src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java b/src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java index 5aec8d2..f094d2d 100644 --- a/src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java +++ b/src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java @@ -11,6 +11,7 @@ import com.heai.modules.pad.entity.AttachmentListData; import com.heai.modules.production.dao.FunctionMapper; import com.heai.modules.production.dao.SoScheduledListMapper; import com.heai.modules.production.entity.*; +import com.heai.modules.production.service.PrintLabelRecordService; import com.heai.modules.taskmanage.dao.TaskDetailDao; import com.heai.modules.taskmanage.vo.TaskDetailVo; import com.heai.modules.taskmanage.vo.TaskListVo; @@ -564,6 +565,8 @@ public class BoardServiceImpl implements BoardService { return boardMapper.searchBIBoardAddress(inData); } + @Autowired + private PrintLabelRecordService printLabelRecordService; @Override public List getPackagePrintDataList(Integer previousSeqNo, BigDecimal number,String site,String orderNo) { // 1、上一道工序 @@ -602,7 +605,16 @@ public class BoardServiceImpl implements BoardService { packagePrintData.setCode("CODEXX"); break; } + // 新增 打印记录 SITE+PART_NO+SEQ_NO_PRINT_QTY+ID + PrintLabelRecord record = new PrintLabelRecord(); + record.setSite(site); + record.setPartNo(packagePrintData.getPartNo()); + record.setSeqNo(Long.valueOf(packagePrintData.getSeqNo())); + record.setPrintQty(BigDecimal.valueOf(packagePrintData.getUnitQty())); + record.setCreateTime(new Date()); + printLabelRecordService.save(record); // 参数赋值 + packagePrintData.setPrintId(record.getId()); List resultList = new ArrayList<>(); resultList.add(packagePrintData); return resultList; diff --git a/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java b/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java new file mode 100644 index 0000000..952bc0d --- /dev/null +++ b/src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java @@ -0,0 +1,9 @@ +package com.heai.modules.production.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.heai.modules.production.entity.PrintLabelRecord; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface PrintLabelRecordMapper extends BaseMapper { +} diff --git a/src/main/java/com/heai/modules/production/entity/OutboundLabelScan.java b/src/main/java/com/heai/modules/production/entity/OutboundLabelScan.java index b56e907..caaeda2 100644 --- a/src/main/java/com/heai/modules/production/entity/OutboundLabelScan.java +++ b/src/main/java/com/heai/modules/production/entity/OutboundLabelScan.java @@ -56,5 +56,7 @@ public class OutboundLabelScan implements Serializable { private Integer seqNo; + private Long printId; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/heai/modules/production/entity/PackagePrintData.java b/src/main/java/com/heai/modules/production/entity/PackagePrintData.java index aa559dd..d65a1e9 100644 --- a/src/main/java/com/heai/modules/production/entity/PackagePrintData.java +++ b/src/main/java/com/heai/modules/production/entity/PackagePrintData.java @@ -37,6 +37,16 @@ public class PackagePrintData { private String site; + private Long printId; + + public Long getPrintId() { + return printId; + } + + public void setPrintId(Long printId) { + this.printId = printId; + } + public String getSite() { return site; } diff --git a/src/main/java/com/heai/modules/production/entity/PrintLabelRecord.java b/src/main/java/com/heai/modules/production/entity/PrintLabelRecord.java new file mode 100644 index 0000000..4228f06 --- /dev/null +++ b/src/main/java/com/heai/modules/production/entity/PrintLabelRecord.java @@ -0,0 +1,27 @@ +package com.heai.modules.production.entity; + + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@TableName("print_label_record") +@Data +public class PrintLabelRecord { + + @TableId("id") + private Long id; + + private String site; + + private String partNo; + + private Long seqNo; + + private BigDecimal printQty; + + private Date createTime; +} diff --git a/src/main/java/com/heai/modules/production/service/PrintLabelRecordService.java b/src/main/java/com/heai/modules/production/service/PrintLabelRecordService.java new file mode 100644 index 0000000..e9be6a3 --- /dev/null +++ b/src/main/java/com/heai/modules/production/service/PrintLabelRecordService.java @@ -0,0 +1,7 @@ +package com.heai.modules.production.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.heai.modules.production.entity.PrintLabelRecord; + +public interface PrintLabelRecordService extends IService { +} diff --git a/src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java b/src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java index 05c24c2..ba4c4ee 100644 --- a/src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java +++ b/src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java @@ -5,7 +5,9 @@ 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.service.OutboundLabelScanService; +import com.heai.modules.production.service.PrintLabelRecordService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -60,6 +62,12 @@ public class OutboundLabelScanServiceImpl extends ServiceImpl list = lambdaQuery().eq(OutboundLabelScan::getPrintId, outboundLabelScan.getPrintId()).list(); + if (!list.isEmpty()){ + throw new RuntimeException("标签已扫描,请勿重复扫描"); + } + } // 查询用户信息 outboundLabelScan.setCreateBy(baseMapper.getUserName(outboundLabelScan.getCreateBy())); save(outboundLabelScan); diff --git a/src/main/java/com/heai/modules/production/service/impl/PrintLabelRecordServiceImpl.java b/src/main/java/com/heai/modules/production/service/impl/PrintLabelRecordServiceImpl.java new file mode 100644 index 0000000..b1caa95 --- /dev/null +++ b/src/main/java/com/heai/modules/production/service/impl/PrintLabelRecordServiceImpl.java @@ -0,0 +1,11 @@ +package com.heai.modules.production.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.heai.modules.production.dao.PrintLabelRecordMapper; +import com.heai.modules.production.entity.PrintLabelRecord; +import com.heai.modules.production.service.PrintLabelRecordService; +import org.springframework.stereotype.Service; + +@Service +public class PrintLabelRecordServiceImpl extends ServiceImpl implements PrintLabelRecordService { +} diff --git a/src/main/resources/mapper/production/OutboundLabelScanMapper.xml b/src/main/resources/mapper/production/OutboundLabelScanMapper.xml index 158ab6d..093a44e 100644 --- a/src/main/resources/mapper/production/OutboundLabelScanMapper.xml +++ b/src/main/resources/mapper/production/OutboundLabelScanMapper.xml @@ -3,10 +3,10 @@ - insert into outbound_label_scan(site, del_notify_no, del_notify_item_no, scan_item_no,seq_no,scan_type,scan_qty, create_by, create_data) + insert into outbound_label_scan(site, del_notify_no, del_notify_item_no, scan_item_no,seq_no,scan_type,scan_qty, create_by, create_data,print_id) values(#{site},#{delNotifyNo},#{delNotifyItemNo}, (select isnull(max(scan_item_no),1)+1 from outbound_label_scan where site = #{site} and del_notify_no = #{delNotifyNo} and del_notify_item_no = #{delNotifyItemNo}), - #{seqNo},#{scanType},#{scanQty},#{createBy},#{createData}) + #{seqNo},#{scanType},#{scanQty},#{createBy},#{createData},#{printId})