标签打印&测试问题修改

Leon 4 years ago
parent 17a45bff59
commit a473213da8

@ -0,0 +1,151 @@
package com.foreverwin.mesnac.common.dto;
import java.io.Serializable;
import java.math.BigDecimal;
/**
*
*
*/
public class LabelPrintDto implements Serializable {
private String site;
private String user;
//打印机
private String printer;
//打印模板名称
private String printTemplate;
//物料编码
private String item;
//物料描述
private String itemDescription;
//供应商
private String supplier;
//批次号
private String batch;
//工作指令
private String workOrder;
//图纸版本号
private String drawingVersion;
//产品条码
private String sfc;
//数量
private BigDecimal qty;
//下料尺寸
private String blankingSize;
//下道工序
private String operation;
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getPrinter() {
return printer;
}
public void setPrinter(String printer) {
this.printer = printer;
}
public String getPrintTemplate() {
return printTemplate;
}
public void setPrintTemplate(String printTemplate) {
this.printTemplate = printTemplate;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getItemDescription() {
return itemDescription;
}
public void setItemDescription(String itemDescription) {
this.itemDescription = itemDescription;
}
public String getSupplier() {
return supplier;
}
public void setSupplier(String supplier) {
this.supplier = supplier;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public String getWorkOrder() {
return workOrder;
}
public void setWorkOrder(String workOrder) {
this.workOrder = workOrder;
}
public String getDrawingVersion() {
return drawingVersion;
}
public void setDrawingVersion(String drawingVersion) {
this.drawingVersion = drawingVersion;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public BigDecimal getQty() {
return qty;
}
public void setQty(BigDecimal qty) {
this.qty = qty;
}
public String getBlankingSize() {
return blankingSize;
}
public void setBlankingSize(String blankingSize) {
this.blankingSize = blankingSize;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
}

@ -2,8 +2,11 @@ package com.foreverwin.mesnac.common.service.impl;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONString;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.common.dto.LabelPrintDto;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.foreverwin.mesnac.common.mapper.PrintLogMapper;
import com.foreverwin.mesnac.common.service.PrintLogService;
@ -15,6 +18,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
@ -54,16 +58,16 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
return;
}
JSONArray jsonArray = new JSONArray();
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
for (PrintLog printLog : printList) {
JSONObject _json = new JSONObject();
_json.put("PRINTER", printLog.getPrintName());
_json.put("PRINT_TEMPLATE", printLog.getPrintTemplate());
_json.put("PRINT_PARAM", printLog.getPrintParam());
jsonArray.add(_json);
LabelPrintDto labelPrintDto = new LabelPrintDto();
labelPrintDto.setPrinter(printLog.getPrintName());
labelPrintDto.setPrintTemplate(printLog.getPrintTemplate());
labelPrintDto.setItem(printLog.getItem());
labelPrintDto.setItemDescription(printLog.getItemDescription());
labelPrintDtoList.add(labelPrintDto);
}
HttpUtil.post(printServer, jsonArray.toJSONString(), 30000);
HttpUtil.post(printServer, JSON.toJSONString(labelPrintDtoList), 30000);
}
}

@ -69,6 +69,12 @@ public class CallItemController {
List<CallItem> result;
try {
callItem.setSite(CommonMethods.getSite());
if (callItem.getRequireFromDate_S() != null) {
callItem.setRequireFromDate(DateUtil.parse(callItem.getRequireFromDate_S()));
}
if (callItem.getRequireToDate_S() != null) {
callItem.setRequireToDate(DateUtil.parse(callItem.getRequireToDate_S()));
}
if (callItem.getStartFromDate_S() != null) {
callItem.setStartFromDate(DateUtil.parse(callItem.getStartFromDate_S()));
}

@ -95,7 +95,7 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
for (int i = 0; i< callItemList.size(); i++) {
CallItem callItem = callItemList.get(i);
String component = StringUtil.trimHandle(callItem.getComponentBo());
String callItemNo = callItem.getSfc() + component;
String callItemNo = callItem.getSfc() + callItem.getStepId() + component;
callItem.setCallItemNo(callItemNo);
callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo));

@ -145,7 +145,7 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
}
Item itemModel = itemService.selectCurrent(site, item);
if (itemModel == null) {
throw BusinessException.build("物料{0}没有维护当前版本!", item);
throw BusinessException.build("物料【" +item+"】没有维护当前版本!");
}
String itemBo = itemModel.getHandle();
String materialType = itemModel.getMaterialType();
@ -243,7 +243,7 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
//查询匹配的叫料记录
List<CallItem> list = callItemService.findIssueMatchCallItemList(site, workOrder, blankingSize, resource, item);
if (list == null || list.size() <= 0) {
throw BusinessException.build("根据发料数据未找到发料记录!");
throw BusinessException.build("未找到当前物料对应的叫料记录!");
}
BigDecimal remainQty = new BigDecimal(qty);

@ -316,8 +316,6 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
//派工导入
if (DispatchStatusEnum.IMPORT.getCode().equals(type)) {
//TODO 派工单已经开始或完成的不修改
String handle = HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo);
SfcDispatch sfcDispatchModel = this.getById(handle);
if (sfcDispatchModel == null) {
@ -327,9 +325,16 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
continue;
}
resourceType = sfcDispatchModel.getResourceType();
String status = sfcDispatchModel.getDispatchStatus();
//派工单已经开始或完成的不修改
if (DispatchStatusEnum.START.equals(status) || DispatchStatusEnum.COMPLETE.equals(status)) {
flag = false;
message.append(seq++ % 3 == 0 ? "\n" : "| |");
message.append("派工单[" + dispatchNo + "]已经开始/完成,不能修改派工数据!");
continue;
}
type = sfcDispatch.getDispatchStatus();
sfcDispatch.setHandle(handle);
//是否导入
sfcDispatch.setIsImport(Constants.BOOL_TRUE);
@ -454,12 +459,4 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
String site = CommonMethods.getSite();
return sfcDispatchMapper.findSfcDispatchBySfc(site,sfcDispatch);
}
// @Override
// public SfcDispatchDto findResrceBySfc(SfcDispatch sfcDispatch) {
// String site = CommonMethods.getSite();
// String[] status = {"START","COMPLETE"};
// return sfcDispatchMapper.findResrceBySfc(sfcDispatch,site,status);
// }
}

@ -659,6 +659,9 @@
GROUP BY SFC_DISPATCH_BO
) VP ON VP.SFC_DISPATCH_BO = ZCI.SFC_DISPATCH_BO
WHERE ZSD.SITE = #{site}
<if test="dispatchNo != null and dispatchNo != ''">
AND ZSD.DISPATCH_NO = #{dispatchNo}
</if>
<if test="workCenter != null and workCenter != ''">
AND ZSD.WORK_CENTER = #{workCenter}
</if>
@ -815,16 +818,16 @@
ORDER BY ZSD.SFC, ZSD.STEP_ID, ZCI.CALL_TYPE
</select>
<update id="modifyCallItemStatusByDispatchBo">
MODIFY Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
<update id="updateCallItemStatusByDispatchBo">
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE STATUS != '804' AND SFC_DISPATCH_BO IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.sfcDispatchBo}
</foreach>
</update>
<update id="modifyCallItemStatusByCallItemNo">
MODIFY Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
<update id="updateCallItemStatusByCallItemNo">
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE STATUS != '804' AND CALL_ITEM_NO IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
@ -832,7 +835,7 @@
</update>
<update id="refreshRequiredTime">
MODIFY Z_CALL_ITEM SET MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}, REQUIRED_DATE_TIME = (
UPDATE Z_CALL_ITEM SET MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}, REQUIRED_DATE_TIME = (
SELECT ZSD.PLANNED_START_DATE
FROM Z_SFC_DISPATCH ZSD
WHERE Z_CALL_ITEM.SFC_DISPATCH_BO = ZSD.HANDLE
@ -850,8 +853,11 @@
INNER JOIN ITEM M ON B.COMPONENT_BO = M.HANDLE
INNER JOIN SHOP_ORDER Z ON Z.SITE = B.SITE AND Z.SHOP_ORDER = B.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = Z.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
WHERE B.SITE = #{site} AND M.ITEM = #{item} AND P.BLANKING_SIZE = #{blankingSize}
WHERE B.SITE = #{site} AND M.ITEM = #{item}
AND (B.ISSUE_QTY IS NULL OR B.ISSUE_QTY &lt; B.REQUIRED_QTY)
<if test="blankingSize != null and blankingSize != ''">
AND P.BLANKING_SIZE = #{blankingSize}
</if>
<if test="workOrder != null and workOrder != ''">
AND CF.VALUE = #{workOrder}
</if>

@ -656,7 +656,7 @@
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh'
INNER JOIN SFC_ROUTING SG ON SG.SFC_BO = SC.HANDLE
INNER JOIN SFC_ROUTER SR ON SR.SFC_ROUTING_BO = SG.HANDLE AND SR.IN_USE = 'true'
INNER JOIN SFC_STEP SP ON SP.SFC_ROUTER_BO = SR.HANDLE
INNER JOIN SFC_STEP SP ON SP.SFC_ROUTER_BO = SR.HANDLE AND (SP.QTY_IN_QUEUE > 0 OR SP.QTY_IN_WORK > 0)
INNER JOIN OPERATION OP ON SP.OPERATION_BO = 'OperationBO:'||OP.SITE||','||OP.OPERATION||',#' AND OP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = OP.HANDLE AND OT.LOCALE = 'zh'
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZSD.SITE = SC.SITE AND ZSD.SFC = SC.SFC AND ZSD.OPERATION = OP.OPERATION AND ZSD.STEP_ID = SP.STEP_ID

Loading…
Cancel
Save