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

master
philip 3 years ago
parent 57873ca77f
commit d6c7374221

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

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

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

@ -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)) {

Loading…
Cancel
Save