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 String mainPart;
private Boolean mainPart;
public String getItemNumber() {
return itemNumber;
@ -204,11 +204,11 @@ public class LabelPrintDto implements Serializable {
this.printNum = printNum;
}
public String getMainPart() {
public Boolean getMainPart() {
return mainPart;
}
public void setMainPart(String mainPart) {
public void setMainPart(Boolean mainPart) {
this.mainPart = mainPart;
}
}

@ -476,4 +476,22 @@ public class ZprodordconfStruIn implements java.io.Serializable {
_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);
}
@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.meapi.dto.BomComponentDto;
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.WorkCenterMapper;
import com.foreverwin.mesnac.meapi.model.*;
@ -113,6 +114,9 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
private ItemService itemService;
@Autowired
private SfcService sfcService;
@Autowired
private CustomFieldsMapper customFieldsMapper;
@Override
public IPage<ProdReadyTask> selectPage(FrontPage<ProdReadyTask> frontPage, ProdReadyTask prodReadyTask) {
@ -480,6 +484,13 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
labelPrintDto.setItemNumber(itemNumber);
labelPrintDto.setWorkOrder(workOrder);
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()));
int seq = 0;

@ -567,15 +567,18 @@
ORDER BY PL.CREATED_DATE_TIME DESC
</select>
<!--根据sfcBo,查询当前条码的打印信息-->
<!--根据sfc,查询当前条码的打印信息-->
<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,
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
LEFT JOIN SFC S ON I.INVENTORY_CONTEXT_GBO = S.HANDLE
LEFT JOIN
(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
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_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'

@ -45,9 +45,9 @@ ftp:
quartz:
enabled: true
#打印服务器配置
#打印服务
print:
server: http://10.10.170.32:8022/print/mesnacprint
server: http://172.16.170.163:8022/print/mesnacprint
activeMq:
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.model.LoadInventory;
import com.foreverwin.mesnac.production.model.SfcHoldLog;
import com.foreverwin.mesnac.production.service.LoadInventoryService;
import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.mesnac.production.service.SfcHoldLogService;
import com.foreverwin.mesnac.production.model.WorkShopTransfer;
import com.foreverwin.mesnac.production.service.*;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
@ -92,6 +90,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private LoadInventoryService loadInventoryService;
@Autowired
private SfcHoldLogService sfcHoldLogService;
@Autowired
private WorkShopTransferService workShopTransferService;
@Override
public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) {
@ -208,16 +208,20 @@ public class PodTemplateServiceImpl implements PodTemplateService {
String dispatchNo = sfcDto.getDispatchNo();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
//是否有互检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_H);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
//是否有互检检验任务及已完成
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_H, sfc, operation, stepId);
if (createTask == null || !createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("请完成互检检验任务");
}
if (!createTask.getResult().equals(Constants.RSESULT_OK)) {
throw new BaseException("互检任务不合格,不能开始请检查");
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);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
//是否有互检检验任务及已完成
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_H, sfc, operation, stepId);
if (createTask == null || !createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("请完成互检检验任务");
}
if (!createTask.getResult().equals(Constants.RSESULT_OK)) {
throw new BaseException("互检任务不合格,不能开始请检查");
}
}
}
//是否完成专检
@ -258,32 +262,35 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (status.equals("404")) {
throw new BaseException("产品条码" + sfc + "已暂停");
}
BigDecimal workHour=BigDecimal.ZERO;
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
//是否有自检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
//是否有自检检验任务
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operation, stepId);
if (createTask == null || !createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("请完成自检检验任务");
}
if (!createTask.getResult().equals(Constants.RSESULT_OK)) {
throw new BaseException("自检任务不合格,不能完成请检查");
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);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
//是否有自检检验任务
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operation, stepId);
if (createTask == null || !createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("请完成自检检验任务");
}
if (!createTask.getResult().equals(Constants.RSESULT_OK)) {
throw new BaseException("自检任务不合格,不能完成请检查");
}
}
}
//是否装配完成
List<Map<String, Object>> assembleList = sfcDataAssembleMapper.querySfcAssemble(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
if (assembleList != null && assembleList.size() > 0) {
for (Map<String, Object> objectMap : assembleList) {
String isAssemble = (String) objectMap.get("IS_ASSEMBLE");
if (!isAssemble.equals("GREEN")) {
throw new BaseException("未装配完成");
//是否装配完成
List<Map<String, Object>> assembleList = sfcDataAssembleMapper.querySfcAssemble(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
if (assembleList != null && assembleList.size() > 0) {
for (Map<String, Object> objectMap : assembleList) {
String isAssemble = (String) objectMap.get("IS_ASSEMBLE");
if (!isAssemble.equals("GREEN")) {
throw new BaseException("未装配完成");
}
}
}
}
//物料消耗
materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce);
try {
//物料消耗
materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce);
//专检创建
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("SFC", sfc);
@ -312,17 +319,20 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//计算工时
LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc));
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.eq(SfcHoldLog.SFC,sfc);
queryWrapper.eq(SfcHoldLog.STEP_ID,stepId);
queryWrapper.eq(SfcHoldLog.TYPE,"CANCEL");
QueryWrapper<SfcHoldLog> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(SfcHoldLog.SFC, sfc);
queryWrapper.eq(SfcHoldLog.STEP_ID, stepId);
queryWrapper.eq(SfcHoldLog.TYPE, "CANCEL");
List<SfcHoldLog> list = sfcHoldLogService.list(queryWrapper);
if (!list.isEmpty()){
if (!list.isEmpty()) {
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);
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour);

Loading…
Cancel
Save