|
|
|
@ -11,6 +11,8 @@ import com.gaotao.modules.label.entity.Seq; |
|
|
|
import com.gaotao.modules.label.mapper.PrintRollLabelRecordMapper; |
|
|
|
import com.gaotao.modules.label.service.PrintRollLabelRecordService; |
|
|
|
import com.gaotao.modules.label.service.SeqService; |
|
|
|
import com.gaotao.modules.manufacturer.data.ManufacturerInformationData; |
|
|
|
import com.gaotao.modules.manufacturer.service.ManufacturerInformationService; |
|
|
|
import com.gaotao.modules.part.entity.Category; |
|
|
|
import com.gaotao.modules.part.service.CategoryService; |
|
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
|
@ -28,10 +30,7 @@ import org.springframework.util.StringUtils; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@ -44,6 +43,8 @@ public class PrintRollLabelRecordServiceImpl extends ServiceImpl<PrintRollLabelR |
|
|
|
private SysMsgService sysMsgService; |
|
|
|
@Autowired |
|
|
|
private CategoryService categoryService; |
|
|
|
@Autowired |
|
|
|
private ManufacturerInformationService manufacturerInformationService; |
|
|
|
|
|
|
|
@Value("${label.rollNum}") |
|
|
|
private int rollNum; |
|
|
|
@ -82,6 +83,16 @@ public class PrintRollLabelRecordServiceImpl extends ServiceImpl<PrintRollLabelR |
|
|
|
if ("Y".equals(category.getSerialNumberRequired()) && !serialNumberList.isEmpty()){ |
|
|
|
size = serialNumberList.size(); |
|
|
|
} |
|
|
|
// 获取SiteCode 工厂编码 |
|
|
|
String str = "00"; |
|
|
|
if (StringUtils.hasText(printRollLabelRecord.getManufacturerNo())){ |
|
|
|
ManufacturerInformationData manufacturer = manufacturerInformationService.lambdaQuery() |
|
|
|
.eq(ManufacturerInformationData::getSite, printRollLabelRecord.getSite()) |
|
|
|
.eq(ManufacturerInformationData::getManufacturerNo, printRollLabelRecord.getManufacturerNo()) |
|
|
|
.one(); |
|
|
|
str = Optional.ofNullable(manufacturer.getManufacturerCode()).orElse("00"); |
|
|
|
} |
|
|
|
|
|
|
|
List<PrintRollLabelRecord> printRollLabelRecords = new ArrayList<>(); |
|
|
|
for (int j = 0; j < size; j++) { |
|
|
|
// 获得序列号 |
|
|
|
@ -110,7 +121,7 @@ public class PrintRollLabelRecordServiceImpl extends ServiceImpl<PrintRollLabelR |
|
|
|
.toLocalDate(); |
|
|
|
// LocalDate localDate = LocalDate.of(printRollLabelRecord.getManufacturerTime().getYear() + 1900, |
|
|
|
// printRollLabelRecord.getManufacturerTime().getMonth()+1,printRollLabelRecord.getManufacturerTime().getDate()); |
|
|
|
printRollLabelRecord.setManufacturerDate(GenDate.dateToJuLian(localDate,"09")); |
|
|
|
printRollLabelRecord.setManufacturerDate(GenDate.dateToJuLian(localDate,str)); |
|
|
|
PrintRollLabelRecord target = new PrintRollLabelRecord(); |
|
|
|
BeanUtils.copyProperties(printRollLabelRecord,target); |
|
|
|
target.setCreateTime(new Date()); |
|
|
|
|