|
|
|
@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
@ -41,6 +42,7 @@ public class LabelFormatUserDefaultServiceImpl extends ServiceImpl<LabelFormatUs |
|
|
|
lambdaUpdate() |
|
|
|
.eq(LabelFormatUserDefault::getSite,labelFormatUserDefault.getSite()) |
|
|
|
.eq(LabelFormatUserDefault::getFormatId,labelFormatUserDefault.getFormatId()) |
|
|
|
.eq(LabelFormatUserDefault::getUsername,labelFormatUserDefault.getUsername()) |
|
|
|
.update(labelFormatUserDefault); |
|
|
|
} |
|
|
|
|
|
|
|
@ -66,7 +68,12 @@ public class LabelFormatUserDefaultServiceImpl extends ServiceImpl<LabelFormatUs |
|
|
|
if (list.isEmpty()){ |
|
|
|
throw new RuntimeException(customer.getBoxNo()+" "+ sysMsgService.getLanguageMsg(SysMsgConstant.THE_PRINTER_IS_NOT_MAINTAINED)); |
|
|
|
} |
|
|
|
List<String> defaultPrinterName = list.stream().map(l->l.getDefaultPrinterName()+("(type)")+l.getPrintType()).collect(Collectors.toList()); |
|
|
|
Map<String, List<LabelFormatUserDefault>> collect = list.stream().collect(Collectors.groupingBy(LabelFormatUserDefault::getLabelType)); |
|
|
|
List<LabelFormatUserDefault> list1 = collect.get(Constant.EXTERNAL_LABEL_TYPE); |
|
|
|
if (list1.isEmpty()){ |
|
|
|
throw new RuntimeException(customer.getBoxNo()+" "+ sysMsgService.getLanguageMsg(SysMsgConstant.THE_PRINTER_IS_NOT_MAINTAINED)); |
|
|
|
} |
|
|
|
List<String> defaultPrinterName = list1.stream().map(l->l.getDefaultPrinterName()+("(type)")+l.getPrintType()).collect(Collectors.toList()); |
|
|
|
printerNameList.add(defaultPrinterName); |
|
|
|
} |
|
|
|
return printerNameList; |
|
|
|
|