|
|
|
@ -13,11 +13,13 @@ import com.gaotao.modules.label.service.PrintRollLabelRecordService; |
|
|
|
import com.gaotao.modules.label.service.SeqService; |
|
|
|
import com.gaotao.modules.sys.service.SysMsgService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.time.DateFormatUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDate; |
|
|
|
@ -52,6 +54,10 @@ public class PrintRollLabelRecordServiceImpl extends ServiceImpl<PrintRollLabelR |
|
|
|
BigDecimal cartonCount = printRollLabelRecord.getCartonCount(); |
|
|
|
// 计数器 |
|
|
|
BigDecimal zero = BigDecimal.ZERO; |
|
|
|
// 处理OrderNo/Po |
|
|
|
if(StringUtils.isEmpty(printRollLabelRecord.getOrderNo())){ |
|
|
|
printRollLabelRecord.setOrderNo(DateFormatUtils.format(new Date(), "yyyyMMdd")); |
|
|
|
} |
|
|
|
if (cartonCount.compareTo(zero) == 0 && cartonCount.scale() != 0){ |
|
|
|
throw new RuntimeException(sysMsgService.getLanguageMsg(SysMsgConstant.PRINT_LABEL_COUNT_ERROR)); |
|
|
|
} |
|
|
|
|