diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java index 89162c43..b0ab6527 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java @@ -361,12 +361,12 @@ public class AbnormalBillController { } - @GetMapping("/findResrceBySfc") - public R findResrceBySfc(SfcDispatchDto sfcDispatch){ + @GetMapping("/findResrceAndWorkCenterBySfc") + public R findResrceAndWorkCenterBySfc(SfcDispatchDto sfcDispatch){ try{ - return R.ok(sfcDispatchCommonService.findResrceBySfc(sfcDispatch)); + return R.ok(sfcDispatchCommonService.findResrceAndWorkCenterBySfc(sfcDispatch)); }catch (Exception e){ - return R.failed("根据sfc查找设备失败:"+e.getMessage()); + return R.failed("根据sfc查找设备和工作中心失败:"+e.getMessage()); } } diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java index c01e2eba..007188e7 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java @@ -10,7 +10,6 @@ import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing; import com.foreverwin.mesnac.anomaly.service.ReportService; import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.modular.core.util.CommonMethods; -import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -82,4 +81,6 @@ public class ReportController { return R.failed(e.getMessage()); } } + + } diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java index 0ca38386..80672bcb 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java @@ -1,6 +1,5 @@ package com.foreverwin.mesnac.anomaly.service.impl; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing; import com.foreverwin.mesnac.anomaly.mapper.ReportMapper; import com.foreverwin.mesnac.anomaly.service.ReportService; @@ -61,6 +60,12 @@ public class ReportServiceImpl implements ReportService { return reportMapper.partsManufacturing(site,locale,partsManufacturing); } + /** + * 余料退回明细表 + * @param item + * @param itemDescription + * @return + */ @Override public List> surplusReturnTable(String item, String itemDescription) { String locale = LocaleContextHolder.getLocale().getLanguage(); @@ -68,13 +73,16 @@ public class ReportServiceImpl implements ReportService { return reportMapper.surplusReturnTable(site,locale,item,itemDescription); } + /** + * 资源维修报表 + * @param map + * @return + */ @Override public List> resourceRepair(Map map) { String locale = LocaleContextHolder.getLocale().getLanguage(); String site = CommonMethods.getSite(); - - Map> ncCodeMap = new HashMap<>(); NcCode ncCode = new NcCode(); ncCode.setSite(site); @@ -132,6 +140,11 @@ public class ReportServiceImpl implements ReportService { return maps; } + /** + * 检验记录报表 + * @param paramMap + * @return + */ @Override public List> findInspectionTask(Map paramMap) { return reportMapper.findInspectionTask(paramMap); diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/ReportDataController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/ReportDataController.java new file mode 100644 index 00000000..08a73edd --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/ReportDataController.java @@ -0,0 +1,41 @@ +package com.foreverwin.mesnac.common.controller; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-23 + */ + +import com.foreverwin.mesnac.common.service.ReportDataService; +import com.foreverwin.modular.core.util.CommonMethods; +import com.foreverwin.modular.core.util.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/REPORT-DATA") +public class ReportDataController { + + @Autowired + public ReportDataService reportDataService; + + /** + * 查询质量检验任务 + * + * @param paramMap + * @return + */ + @GetMapping("/findInspectionTask") + public R findInspectionTask(@RequestParam(required = false) Map paramMap) { + try { + paramMap.put("site", CommonMethods.getSite()); + List> result = reportDataService.findInspectionTask(paramMap); + return R.ok(result); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + } +} diff --git a/common/src/main/java/com/foreverwin/mesnac/common/dto/LabelPrintDto.java b/common/src/main/java/com/foreverwin/mesnac/common/dto/LabelPrintDto.java index d576e969..2a9749f5 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/dto/LabelPrintDto.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/dto/LabelPrintDto.java @@ -49,6 +49,8 @@ public class LabelPrintDto implements Serializable { private String operation; //打印张数 private Integer printNum; + //是否主观件 + private String mainPart; public String getItemNumber() { return itemNumber; @@ -201,4 +203,12 @@ public class LabelPrintDto implements Serializable { public void setPrintNum(Integer printNum) { this.printNum = printNum; } + + public String getMainPart() { + return mainPart; + } + + public void setMainPart(String mainPart) { + this.mainPart = mainPart; + } } diff --git a/common/src/main/java/com/foreverwin/mesnac/common/mapper/ReportDataMapper.java b/common/src/main/java/com/foreverwin/mesnac/common/mapper/ReportDataMapper.java new file mode 100644 index 00000000..a4d13aaa --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/mapper/ReportDataMapper.java @@ -0,0 +1,11 @@ +package com.foreverwin.mesnac.common.mapper; + +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface ReportDataMapper { + List> findInspectionTask(Map paramMap); +} diff --git a/common/src/main/java/com/foreverwin/mesnac/common/model/ProdReadyTask.java b/common/src/main/java/com/foreverwin/mesnac/common/model/ProdReadyTask.java index 35d33a22..f622a1e7 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/model/ProdReadyTask.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/model/ProdReadyTask.java @@ -191,7 +191,29 @@ public class ProdReadyTask extends Model { @TableField(exist = false) private String texture; - public String getMatSpec() { + @TableField(exist = false) + private String prodHours; + + @TableField(exist = false) + private String qty; + + public String getQty() { + return qty; + } + + public void setQty(String qty) { + this.qty = qty; + } + + public String getProdHours() { + return prodHours; + } + + public void setProdHours(String prodHours) { + this.prodHours = prodHours; + } + + public String getMatSpec() { return matSpec; } diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/ReportDataService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/ReportDataService.java new file mode 100644 index 00000000..84d18732 --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/ReportDataService.java @@ -0,0 +1,14 @@ +package com.foreverwin.mesnac.common.service; + +import java.util.List; +import java.util.Map; + +public interface ReportDataService { + /** + * 查询质量检验任务 + * + * @param paramMap + * @return + */ + List> findInspectionTask(Map paramMap); +} diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/SfcDispatchCommonService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/SfcDispatchCommonService.java index 12d95b2c..9b85e83a 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/SfcDispatchCommonService.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/SfcDispatchCommonService.java @@ -43,7 +43,7 @@ public interface SfcDispatchCommonService { * @param sfcDispatch * @return */ - SfcDispatchDto findResrceBySfc(SfcDispatchDto sfcDispatch); + SfcDispatchDto findResrceAndWorkCenterBySfc(SfcDispatchDto sfcDispatch); /** * 查询派工单 diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java index 9e041d9e..e933f1e5 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java @@ -180,7 +180,7 @@ public class InspectionTaskServiceImpl extends ServiceImpl> findInspectionTask(Map paramMap) { + return reportDataMapper.findInspectionTask(paramMap); + } +} diff --git a/common/src/main/resources/mapper/ProdReadyTaskMapper.xml b/common/src/main/resources/mapper/ProdReadyTaskMapper.xml index b2dea01b..0cd501cd 100644 --- a/common/src/main/resources/mapper/ProdReadyTaskMapper.xml +++ b/common/src/main/resources/mapper/ProdReadyTaskMapper.xml @@ -631,7 +631,7 @@ + SELECT WT.DESCRIPTION WORK_CENTER_DESCRIPTION, C2.VALUE ITEM_NUMBER, C3.VALUE PRODUCT_MODEL,IM.ITEM ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, + ZT.SFC, ZT.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, ZT.RESRCE, RS.DESCRIPTION RESOURCE_DESCRIPTION, ZT.TASK_NO, ZT.CATEGORY, + ZT."RESULT", ZT.CREATE_USER, ZNU.FULL_NAME, ZT.MODIFIED_DATE_TIME + FROM Z_INSPECTION_TASK ZT + LEFT JOIN WORK_CENTER WC ON WC.SITE = ZT.SITE AND WC.WORK_CENTER = ZT.WORK_CENTER + LEFT JOIN WORK_CENTER_T WT ON WT.WORK_CENTER_BO = WC.HANDLE AND WT.LOCALE = 'zh' + INNER JOIN SHOP_ORDER SO ON ZT.SITE = SO.SITE AND ZT.SHOP_ORDER = SO.SHOP_ORDER + LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER' + LEFT JOIN CUSTOM_FIELDS C2 ON C2.HANDLE = SO.HANDLE AND C2."ATTRIBUTE" = 'ITEM_NUMBER' + LEFT JOIN CUSTOM_FIELDS C3 ON C3.HANDLE = SO.HANDLE AND C3."ATTRIBUTE" = 'PRODUCT_MODEL' + INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO + LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh' + INNER JOIN OPERATION OP ON OP.SITE = ZT.SITE AND OP.OPERATION = ZT.OPERATION AND OP.CURRENT_REVISION = 'true' + LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = OP.HANDLE AND OT.LOCALE = 'zh' + INNER JOIN RESRCE RS ON RS.SITE = ZT.SITE AND RS.RESRCE = ZT.RESRCE + LEFT JOIN Z_NWA_USER ZNU ON ZNU.SITE = ZT.SITE AND ZNU.USER_NAME = ZT.CREATE_USER + WHERE ZT.SITE = #{site} + + AND WC.WORK_CENTER = #{workCenter} + + + AND ZT.CATEGORY = #{category} + + + AND C2.VALUE LIKE '%'||#{itemNumber}||'%' + + + AND C3.VALUE LIKE '%'||#{model}||'%' + + + AND ZT.OPERATION = #{operation} + + + AND ZT.RESRCE = #{resrce} + + + AND ZT.RESULT = #{result} + + + AND ZT.MODIFIED_DATE_TIME >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD') + + + AND ZT.MODIFIED_DATE_TIME <= TO_DATE(#{startToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS') + + + + \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java index fd7366f3..4ca9ed10 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java @@ -53,7 +53,7 @@ public interface SfcDispatchMapper extends BaseMapper { * @param site * @return */ - SfcDispatchDto findResrceBySfc(@Param("sfcDispatch")SfcDispatchDto sfcDispatch, @Param("site") String site); + SfcDispatchDto findResrceAndWorkCenterBySfc(@Param("sfcDispatch")SfcDispatchDto sfcDispatch, @Param("site") String site); SfcDispatchDto findSfcDispatchBySfc(@Param("site")String site, @Param("dto")SfcDispatchDto sfcDispatch); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java index 493b80f6..1192b2e5 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java @@ -691,10 +691,9 @@ public class SfcDispatchServiceImpl extends ServiceImpl - + SELECT ZSD2.RESRCE,ZSD2.WORK_CENTER WORK_CENTER FROM SFC S INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE INNER JOIN SFC_ROUTER ST ON ST.SFC_ROUTING_BO = SR.HANDLE INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = ST.HANDLE AND (SS.QTY_IN_QUEUE > 0 OR SS.QTY_IN_WORK > 0) LEFT JOIN Z_SFC_DISPATCH ZSD2 ON ZSD2.DISPATCH_NO = S.SFC || '-' || SS.STEP_ID WHERE S.SITE = #{site} - AND ZSD2.RESRCE IS NOT NULL AND S.SFC = #{sfcDispatch.sfc} + AND S.SFC = #{sfcDispatch.sfc} SELECT CF.VALUE FROM RESRCE R - LEFT JOIN CUSTOM_FIELDS cf ON CF.HANDLE = R.HANDLE AND CF."ATTRIBUTE" = 'IS_SPOT' + LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = R.HANDLE AND CF."ATTRIBUTE" = 'IS_SPOT' WHERE R.RESRCE = #{resrce} AND R.SITE = #{site} diff --git a/meapi/src/main/resources/mapper/UserGroupMapper.xml b/meapi/src/main/resources/mapper/UserGroupMapper.xml index 4bd1b9e0..ec64be23 100644 --- a/meapi/src/main/resources/mapper/UserGroupMapper.xml +++ b/meapi/src/main/resources/mapper/UserGroupMapper.xml @@ -391,12 +391,13 @@