|
|
|
@ -36,6 +36,7 @@ import com.foreverwin.modular.core.util.FrontPage;
|
|
|
|
|
import com.sap.me.messaging.MessageTypeBOHandle;
|
|
|
|
|
import com.sap.me.user.UserGroupBOHandle;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.i18n.LocaleContextHolder;
|
|
|
|
|
import org.springframework.jms.core.JmsMessagingTemplate;
|
|
|
|
@ -45,7 +46,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <p>
|
|
|
|
@ -68,6 +68,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
|
public static final String STATUS_CANCEL = "CANCEL";
|
|
|
|
|
public static final String MESSAGE_TYPE_WLZB = "WLZB";
|
|
|
|
|
@Autowired
|
|
|
|
|
@Qualifier("defaultJmsTemplate")
|
|
|
|
|
private JmsMessagingTemplate jmsTemplate;
|
|
|
|
|
@Value("${print.server}")
|
|
|
|
|
private String printServer;
|
|
|
|
@ -441,7 +442,13 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
|
PrintLog printTag = new PrintLog();
|
|
|
|
|
|
|
|
|
|
String resrce = sfcDispatchDto.getResrce();
|
|
|
|
|
String shopOrder = sfcDispatchDto.getShopOrder();
|
|
|
|
|
String factory = customFieldsService.getCustomFieldsValue(HandleEnum.SHOP_ORDER.getHandle(site, shopOrder), CustomFieldConstant.SO_FACTORY);
|
|
|
|
|
String printName = customFieldsService.getCustomFieldsValue(HandleEnum.RESOURCE.getHandle(site, resrce), CustomFieldConstant.RESRCE_CUSTOM_FIELD_PRINT_NAME);
|
|
|
|
|
String type=Constants.PRINT_TYPE_SFC;
|
|
|
|
|
if (StringUtil.notBlank(factory)&&factory.equals("6100")){
|
|
|
|
|
type=Constants.PRINT_TYPE_PRODUCT;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isBlank(printName)) {
|
|
|
|
|
throw new BaseException("资源" + resrce + "维护的打印机不能为空");
|
|
|
|
|
}
|
|
|
|
@ -451,14 +458,15 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
|
queryWrapper.eq(PrintLog.SFC, prodReadyTask.getSfc());
|
|
|
|
|
queryWrapper.eq(PrintLog.STEP_ID, prodReadyTask.getStepId());
|
|
|
|
|
queryWrapper.eq(PrintLog.RESRCE, prodReadyTask.getResrce());
|
|
|
|
|
queryWrapper.eq(PrintLog.CATEGORY, Constants.PRINT_TYPE_SFC);
|
|
|
|
|
queryWrapper.eq(PrintLog.CATEGORY, Constants.PRINT_TYPE_SFC);
|
|
|
|
|
queryWrapper.eq(PrintLog.CATEGORY, type);
|
|
|
|
|
queryWrapper.eq(PrintLog.PRINT_TEMPLATE, type);
|
|
|
|
|
List<PrintLog> printLogList = printLogService.list(queryWrapper);
|
|
|
|
|
if (printLogList.isEmpty()) {
|
|
|
|
|
//打印参数
|
|
|
|
|
LabelPrintDto labelPrintDto = new LabelPrintDto();
|
|
|
|
|
labelPrintDto.setPrinter(printName);
|
|
|
|
|
labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_SFC);
|
|
|
|
|
labelPrintDto.setPrintTemplate(type);
|
|
|
|
|
labelPrintDto.setShopOrder(shopOrder);
|
|
|
|
|
labelPrintDto.setItem(selectCurrent.getItem());
|
|
|
|
|
labelPrintDto.setItemDescription(selectCurrent.getDescription());
|
|
|
|
|
labelPrintDto.setSfc(prodReadyTask.getSfc());
|
|
|
|
@ -482,16 +490,15 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
|
if (seq != stepOperationList.size() - 1) {
|
|
|
|
|
RouterStepDto stepOperation = stepOperationList.get(seq + 1);
|
|
|
|
|
labelPrintDto.setOperation(stepOperation.getOperationDesc());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
labelPrintDtoList.add(labelPrintDto);
|
|
|
|
|
printData = JSON.toJSONString(labelPrintDtoList);
|
|
|
|
|
//打印记录
|
|
|
|
|
printTag.setHandle(UUID.randomUUID().toString());
|
|
|
|
|
printTag.setPrintName(printName);
|
|
|
|
|
printTag.setPrintTemplate(Constants.PRINT_TYPE_SFC);
|
|
|
|
|
printTag.setPrintTemplate(type);
|
|
|
|
|
printTag.setSite(site);
|
|
|
|
|
printTag.setCategory(Constants.PRINT_TYPE_SFC);
|
|
|
|
|
printTag.setCategory(type);
|
|
|
|
|
printTag.setPrintParam(JSON.toJSONString(labelPrintDtoList));
|
|
|
|
|
printTag.setSfc(prodReadyTask.getSfc());
|
|
|
|
|
printTag.setResrce(prodReadyTask.getResrce());
|
|
|
|
@ -677,7 +684,6 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
|
|
|
|
|
messageObject.put("RESOURCE", resource);
|
|
|
|
|
messageObject.put("RESOURCE_TYPE", resourceType);
|
|
|
|
|
String causeMessage = null;
|
|
|
|
|
jmsTemplate.getJmsTemplate().setReceiveTimeout(TimeUnit.SECONDS.toMillis(30));
|
|
|
|
|
String message = jmsTemplate.convertSendAndReceive(queue, messageObject.toString(), String.class);
|
|
|
|
|
|
|
|
|
|
if (StringUtil.isBlank(message)) {
|
|
|
|
|