Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit ff4cffe3d6

@ -50,7 +50,7 @@ public class LabelPrintDto implements Serializable {
//打印张数 //打印张数
private Integer printNum; private Integer printNum;
//是否主观件 //是否主观件
private String mainPart; private Boolean mainPart;
public String getItemNumber() { public String getItemNumber() {
return itemNumber; return itemNumber;
@ -204,11 +204,11 @@ public class LabelPrintDto implements Serializable {
this.printNum = printNum; this.printNum = printNum;
} }
public String getMainPart() { public Boolean getMainPart() {
return mainPart; return mainPart;
} }
public void setMainPart(String mainPart) { public void setMainPart(Boolean mainPart) {
this.mainPart = mainPart; this.mainPart = mainPart;
} }
} }

@ -476,4 +476,22 @@ public class ZprodordconfStruIn implements java.io.Serializable {
_javaType, _xmlType, typeDesc); _javaType, _xmlType, typeDesc);
} }
@Override
public String toString() {
return "ZprodordconfStruIn{" +
"aufnr='" + aufnr + '\'' +
", vornr='" + vornr + '\'' +
", aueru='" + aueru + '\'' +
", lmnga=" + lmnga +
", xmnga=" + xmnga +
", ism01=" + ism01 +
", ism02=" + ism02 +
", ism03=" + ism03 +
", ism04=" + ism04 +
", ism05=" + ism05 +
", ism06=" + ism06 +
", __equalsCalc=" + __equalsCalc +
", __hashCodeCalc=" + __hashCodeCalc +
'}';
}
} }

@ -512,4 +512,23 @@ public class ZprodordconfStruOut implements java.io.Serializable {
_javaType, _xmlType, typeDesc); _javaType, _xmlType, typeDesc);
} }
@Override
public String toString() {
return "ZprodordconfStruOut{" +
"aufnr='" + aufnr + '\'' +
", vornr='" + vornr + '\'' +
", aueru='" + aueru + '\'' +
", lmnga=" + lmnga +
", ism01=" + ism01 +
", ism02=" + ism02 +
", ism03=" + ism03 +
", ism04=" + ism04 +
", ism05=" + ism05 +
", ism06=" + ism06 +
", ret='" + ret + '\'' +
", msg='" + msg + '\'' +
", __equalsCalc=" + __equalsCalc +
", __hashCodeCalc=" + __hashCodeCalc +
'}';
}
} }

@ -24,6 +24,7 @@ import com.foreverwin.mesnac.common.util.DateUtil;
import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.BomComponentDto; import com.foreverwin.mesnac.meapi.dto.BomComponentDto;
import com.foreverwin.mesnac.meapi.dto.RouterStepDto; import com.foreverwin.mesnac.meapi.dto.RouterStepDto;
import com.foreverwin.mesnac.meapi.mapper.CustomFieldsMapper;
import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper; import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper;
import com.foreverwin.mesnac.meapi.mapper.WorkCenterMapper; import com.foreverwin.mesnac.meapi.mapper.WorkCenterMapper;
import com.foreverwin.mesnac.meapi.model.*; import com.foreverwin.mesnac.meapi.model.*;
@ -113,6 +114,9 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
private ItemService itemService; private ItemService itemService;
@Autowired @Autowired
private SfcService sfcService; private SfcService sfcService;
@Autowired
private CustomFieldsMapper customFieldsMapper;
@Override @Override
public IPage<ProdReadyTask> selectPage(FrontPage<ProdReadyTask> frontPage, ProdReadyTask prodReadyTask) { public IPage<ProdReadyTask> selectPage(FrontPage<ProdReadyTask> frontPage, ProdReadyTask prodReadyTask) {
@ -480,6 +484,13 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
labelPrintDto.setItemNumber(itemNumber); labelPrintDto.setItemNumber(itemNumber);
labelPrintDto.setWorkOrder(workOrder); labelPrintDto.setWorkOrder(workOrder);
labelPrintDto.setBlankingSize(sfcDispatchDto.getBlankingSize()); labelPrintDto.setBlankingSize(sfcDispatchDto.getBlankingSize());
// 是否主观件 :辅料类型是9则为主观件
String accessory_type = customFieldsMapper.selectCustomFieldsValue(selectCurrent.getHandle(), "ACCESSORY_TYPE");
if ("9".equals(accessory_type)){
labelPrintDto.setMainPart(true);
}else{
labelPrintDto.setMainPart(false);
}
//下道工序 //下道工序
Router router = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfcServiceById.getSfc())); Router router = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfcServiceById.getSfc()));
int seq = 0; int seq = 0;

@ -567,15 +567,18 @@
ORDER BY PL.CREATED_DATE_TIME DESC ORDER BY PL.CREATED_DATE_TIME DESC
</select> </select>
<!--根据sfcBo,查询当前条码的打印信息--> <!--根据sfc,查询当前条码的打印信息-->
<select id="findSfcPrintInfoBySfc" resultType="com.foreverwin.mesnac.common.dto.LabelPrintDto"> <select id="findSfcPrintInfoBySfc" resultType="com.foreverwin.mesnac.common.dto.LabelPrintDto">
SELECT IM.ITEM , I.ITEM_BO PRINTER, S.SFC, IT.DESCRIPTION ITEM_DESCRIPTION, ZSD.SHOP_ORDER, SELECT IM.ITEM , I.ITEM_BO PRINTER, S.SFC, IT.DESCRIPTION ITEM_DESCRIPTION, ZSD.SHOP_ORDER,
I.QTY_ON_HAND QTY ,ZSD.BLANKING_SIZE , CF.VALUE DRAWING_REVISION ,CASE WHEN CFA.VALUE = '9' THEN 'true' ELSE 'false' END MAIN_PART I.QTY_ON_HAND QTY ,ZSD.BLANKING_SIZE , CF.VALUE DRAWING_REVISION ,CFB.VALUE WORK_ORDER ,
CASE WHEN CFA.VALUE = '9' THEN 'true' ELSE 'false' END MAIN_PART
FROM INVENTORY I FROM INVENTORY I
LEFT JOIN SFC S ON I.INVENTORY_CONTEXT_GBO = S.HANDLE LEFT JOIN SFC S ON I.INVENTORY_CONTEXT_GBO = S.HANDLE
LEFT JOIN LEFT JOIN
(SELECT MAX(STEP_ID),BLANKING_SIZE,SFC,SHOP_ORDER FROM Z_SFC_DISPATCH (SELECT MAX(STEP_ID),BLANKING_SIZE,SFC,SHOP_ORDER FROM Z_SFC_DISPATCH
WHERE SFC = #{sfc} AND SITE = #{site} GROUP BY BLANKING_SIZE ,SFC,SHOP_ORDER) ZSD ON ZSD.SFC = S.SFC WHERE SFC = #{sfc} AND SITE = #{site} GROUP BY BLANKING_SIZE ,SFC,SHOP_ORDER) ZSD ON ZSD.SFC = S.SFC
LEFT JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZSD.SHOP_ORDER AND SO.SITE = #{site}
LEFT JOIN CUSTOM_FIELDS CFB ON CFB.HANDLE = SO.HANDLE AND CFB."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN ITEM IM ON IM.HANDLE = I.ITEM_BO LEFT JOIN ITEM IM ON IM.HANDLE = I.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh' LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh'
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = I.ITEM_BO AND CF."ATTRIBUTE" = 'DRAWING_REVISION' LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = I.ITEM_BO AND CF."ATTRIBUTE" = 'DRAWING_REVISION'

@ -45,9 +45,9 @@ ftp:
quartz: quartz:
enabled: true enabled: true
#打印服务器配置 #打印服务
print: print:
server: http://10.10.170.32:8022/print/mesnacprint server: http://172.16.170.163:8022/print/mesnacprint
activeMq: activeMq:
sendWeChatMessage: tcp://localhost:61616?wireFormat.maxInactivityDuration=0 sendWeChatMessage: tcp://localhost:61616?wireFormat.maxInactivityDuration=0

@ -31,10 +31,8 @@ import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.mapper.SfcDataAssembleMapper; import com.foreverwin.mesnac.production.mapper.SfcDataAssembleMapper;
import com.foreverwin.mesnac.production.model.LoadInventory; import com.foreverwin.mesnac.production.model.LoadInventory;
import com.foreverwin.mesnac.production.model.SfcHoldLog; import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.foreverwin.mesnac.production.service.LoadInventoryService; import com.foreverwin.mesnac.production.model.WorkShopTransfer;
import com.foreverwin.mesnac.production.service.PodTemplateService; import com.foreverwin.mesnac.production.service.*;
import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.mesnac.production.service.SfcHoldLogService;
import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices; import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.CommonMethods;
@ -92,6 +90,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private LoadInventoryService loadInventoryService; private LoadInventoryService loadInventoryService;
@Autowired @Autowired
private SfcHoldLogService sfcHoldLogService; private SfcHoldLogService sfcHoldLogService;
@Autowired
private WorkShopTransferService workShopTransferService;
@Override @Override
public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) { public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) {
@ -208,6 +208,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
String dispatchNo = sfcDto.getDispatchNo(); String dispatchNo = sfcDto.getDispatchNo();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc)); Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString()); BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
WorkShopTransfer transfer = workShopTransferService.sfcEnter(sfc, "OUT");
String isOutSource = transfer.getIsOutSource();
if (StringUtil.isBlank(isOutSource)||!isOutSource.equals(Constants.STATUS_Y)){
//是否有互检检验项目 //是否有互检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_H); List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_H);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) { if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
@ -220,6 +223,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
throw new BaseException("互检任务不合格,不能开始请检查"); throw new BaseException("互检任务不合格,不能开始请检查");
} }
} }
}
//是否完成专检 //是否完成专检
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>(); QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(InspectionTask.CATEGORY, Constants.INSPECTION_TYPE_P); queryWrapper.eq(InspectionTask.CATEGORY, Constants.INSPECTION_TYPE_P);
@ -258,7 +262,11 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (status.equals("404")) { if (status.equals("404")) {
throw new BaseException("产品条码" + sfc + "已暂停"); throw new BaseException("产品条码" + sfc + "已暂停");
} }
BigDecimal workHour=BigDecimal.ZERO;
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString()); BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
WorkShopTransfer transfer = workShopTransferService.sfcEnter(sfc, "OUT");
String isOutSource = transfer.getIsOutSource();
if (StringUtil.isBlank(isOutSource)||!isOutSource.equals(Constants.STATUS_Y)) {
//是否有自检检验项目 //是否有自检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z); List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) { if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
@ -283,7 +291,6 @@ public class PodTemplateServiceImpl implements PodTemplateService {
} }
//物料消耗 //物料消耗
materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce); materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce);
try {
//专检创建 //专检创建
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("SFC", sfc); paramMap.put("SFC", sfc);
@ -312,7 +319,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//计算工时 //计算工时
LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc)); LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc));
long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds(); long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds();
BigDecimal workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP); workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP);
//减去暂停时间 //减去暂停时间
QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>(); QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(SfcHoldLog.SFC, sfc); queryWrapper.eq(SfcHoldLog.SFC, sfc);
@ -323,6 +330,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
BigDecimal holdTime = list.stream().map(SfcHoldLog::getHoldDuration).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal holdTime = list.stream().map(SfcHoldLog::getHoldDuration).reduce(BigDecimal.ZERO, BigDecimal::add);
workHour = workHour.subtract(holdTime); workHour = workHour.subtract(holdTime);
} }
}
try {
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty); sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
//更改派工单状态 //更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour); sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour);

Loading…
Cancel
Save