Browse Source

20240402

master
qiezi 1 year ago
parent
commit
4a4af80d84
  1. 29
      src/main/java/com/gaotao/modules/label/service/impl/PrintLabelRecordServiceImpl.java
  2. 2
      src/main/resources/mapper/label/PrintLabelRecordMapper.xml
  3. 2
      src/main/resources/mapper/label/PrintRollLabelRecordMapper.xml

29
src/main/java/com/gaotao/modules/label/service/impl/PrintLabelRecordServiceImpl.java

@ -99,7 +99,7 @@ public class PrintLabelRecordServiceImpl extends ServiceImpl<PrintLabelRecordMap
// 判断是否需要打印SN
Map<String,String> pictureMap = new HashMap<>();
if ("Hardware(Antenna)-Serials".equalsIgnoreCase(printLabelRecord.getCategory()) && "Y".equalsIgnoreCase(userEntity.getAutoSerialNumber())){
if (StringUtils.isEmpty(printLabelRecord.getTemplateNo())){
if (StringUtils.isEmpty(printLabelRecord.getTemplateNo()) && !Integer.valueOf(1).equals(printLabelRecord.getPrintLabelType())){
throw new RuntimeException("No template was selected");
}
printLabelRecord.setCreateTime(new Date());
@ -201,13 +201,19 @@ public class PrintLabelRecordServiceImpl extends ServiceImpl<PrintLabelRecordMap
}
@Override
@Transactional
public IPage<PrintLabelRecord> selectPrintLabelRecordPage(PrintLabelRecord printLabelRecord, Integer no, Integer size) {
SysUserEntity userEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
Page<PrintLabelRecord> page = new Page<>(no, size);
printLabelRecord.setCreateBy(userEntity.getUsername());
IPage<PrintLabelRecord> iPage = baseMapper.selectPrintLabelRecordPage(page, printLabelRecord);
// 获得当前登录用户
if ("Hardware(Antenna)-Serials".equalsIgnoreCase(printLabelRecord.getCategory()) && "Y".equalsIgnoreCase(userEntity.getAutoSerialNumber())){
// // 获得当前登录用户
// if ("Hardware(Antenna)-Serials".equalsIgnoreCase(printLabelRecord.getCategory()) && "Y".equalsIgnoreCase(userEntity.getAutoSerialNumber())){
//
// }
if (!"Y".equalsIgnoreCase(userEntity.getAutoSerialNumber())){
return iPage;
}
for (PrintLabelRecord record : iPage.getRecords()) {
if (!"Hardware(Antenna)-Serials".equals(record.getCategory())){
continue;
@ -220,6 +226,22 @@ public class PrintLabelRecordServiceImpl extends ServiceImpl<PrintLabelRecordMap
.eq(ExternalPartPicture::getPictureClassify, "ProPicture")
.list();
Map<String,String> pictureMap = new HashMap<>();
pictureMap.put("P1","");
pictureMap.put("P2","");
pictureMap.put("P3","");
pictureMap.put("P4","");
pictureMap.put("P5","");
pictureMap.put("P6","");
pictureMap.put("P7","");
pictureMap.put("P8","");
pictureMap.put("P9","");
pictureMap.put("P10","");
pictureMap.put("P11","");
pictureMap.put("P12","");
pictureMap.put("P13","");
pictureMap.put("P14","");
pictureMap.put("P15","");
pictureMap.put("P16","");
for (ExternalPartPicture picture : pictureList) {
// 通过URL转Base64
String pictureUrl = picture.getPictureUrl();
@ -236,7 +258,6 @@ public class PrintLabelRecordServiceImpl extends ServiceImpl<PrintLabelRecordMap
}
record.setPictureMap(pictureMap);
}
}
return iPage;
}
}

2
src/main/resources/mapper/label/PrintLabelRecordMapper.xml

@ -150,6 +150,6 @@
</select>
<select id="autoCreateSerialNumber" resultType="com.gaotao.modules.label.entity.PrintLabelRecord">
exec dbo.AutoCreateSerialNumber #{params.site}, #{params.partNo}, #{params.createTime}, #{qty}
exec dbo.AutoCreateSerialNumber #{params.site}, #{params.partNo}, #{params.manufacturerTime}, #{qty}
</select>
</mapper>

2
src/main/resources/mapper/label/PrintRollLabelRecordMapper.xml

@ -109,6 +109,6 @@
</foreach>
</if>
</where>
order by plr.id desc
order by plr.id
</select>
</mapper>
Loading…
Cancel
Save