Browse Source

24-05-16 标签记录

master
zelian_wu 2 years ago
parent
commit
1e30908886
  1. 12
      src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java
  2. 9
      src/main/java/com/heai/modules/production/dao/PrintLabelRecordMapper.java
  3. 2
      src/main/java/com/heai/modules/production/entity/OutboundLabelScan.java
  4. 10
      src/main/java/com/heai/modules/production/entity/PackagePrintData.java
  5. 27
      src/main/java/com/heai/modules/production/entity/PrintLabelRecord.java
  6. 7
      src/main/java/com/heai/modules/production/service/PrintLabelRecordService.java
  7. 8
      src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java
  8. 11
      src/main/java/com/heai/modules/production/service/impl/PrintLabelRecordServiceImpl.java
  9. 4
      src/main/resources/mapper/production/OutboundLabelScanMapper.xml

12
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<PackagePrintData> 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<PackagePrintData> resultList = new ArrayList<>();
resultList.add(packagePrintData);
return resultList;

9
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<PrintLabelRecord> {
}

2
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;
}

10
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;
}

27
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;
}

7
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<PrintLabelRecord> {
}

8
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<OutboundLabelScanM
@Override
@Transactional
public void saveLabel(OutboundLabelScan outboundLabelScan) {
if (Objects.nonNull(outboundLabelScan.getPrintId())){
List<OutboundLabelScan> list = lambdaQuery().eq(OutboundLabelScan::getPrintId, outboundLabelScan.getPrintId()).list();
if (!list.isEmpty()){
throw new RuntimeException("标签已扫描,请勿重复扫描");
}
}
// 查询用户信息
outboundLabelScan.setCreateBy(baseMapper.getUserName(outboundLabelScan.getCreateBy()));
save(outboundLabelScan);

11
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<PrintLabelRecordMapper, PrintLabelRecord> implements PrintLabelRecordService {
}

4
src/main/resources/mapper/production/OutboundLabelScanMapper.xml

@ -3,10 +3,10 @@
<mapper namespace="com.heai.modules.production.dao.OutboundLabelScanMapper">
<insert id="save">
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})
</insert>
<select id="searchOutboundLabelScanList" resultType="com.heai.modules.production.entity.OutboundLabelScanData">

Loading…
Cancel
Save