专检创建新任务,成品标签

master
philip 3 years ago
parent 57873ca77f
commit d6c7374221

@ -177,6 +177,8 @@ public interface Constants {
// 余料标签 // 余料标签
String PRINT_TYPE_EXM = "EXM"; String PRINT_TYPE_EXM = "EXM";
// 成品标签
String PRINT_TYPE_PRODUCT = "PRODUCT";
/** /**
* Y-使N-/ * Y-使N-/
*/ */

@ -29,6 +29,7 @@ public class LabelPrintDto implements Serializable {
private String label; private String label;
//在制品标签参数 //在制品标签参数
private String shopOrder;
//工作指令 //工作指令
private String workOrder; private String workOrder;
//图纸版本号 //图纸版本号
@ -44,6 +45,14 @@ public class LabelPrintDto implements Serializable {
//打印张数 //打印张数
private Integer printNum; private Integer printNum;
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getSite() { public String getSite() {
return site; return site;
} }

@ -287,8 +287,8 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
task.setSite(site); task.setSite(site);
task.setCategory(category); task.setCategory(category);
task.setTaskNo(taskNo); task.setTaskNo(taskNo);
task.setStatus(Constants.INSPECTION_TASK_STATUS_COMPLETE); task.setStatus(Constants.INSPECTION_TASK_STATUS_NEW);
task.setResrce(Constants.RSESULT_OK); task.setResult(null);
task.setDescription("专检检验任务"); task.setDescription("专检检验任务");
task.setInspectionItemBo( null); task.setInspectionItemBo( null);
task.setShopOrder(shopOrder); task.setShopOrder(shopOrder);

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

Loading…
Cancel
Save