Merge remote-tracking branch 'origin/master'
# Conflicts:
# hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
# hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
| | |
| | | damage_temp as ( |
| | | select engineer_id, tempering_layout_id, count(*) as damage_count |
| | | from damage |
| | | where type in(8,9) |
| | | where type in(8,9) and STATUS = 1 |
| | | group by engineer_id, tempering_layout_id |
| | | ), |
| | | result as ( |
| | |
| | | } |
| | | |
| | | @ApiOperation("查询指定流程卡及层数的缺片详情") |
| | | @PostMapping("/queryLackByFlowCard") |
| | | public Result<List<LackDetailsDTO>> queryLackByFlowCard() { |
| | | List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(); |
| | | @PostMapping("/queryAllLackByFlowCard") |
| | | public Result<List<LackDetailsDTO>> queryAllLackByFlowCard() { |
| | | List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryAllLackByFlowCard(); |
| | | return Result.success(lackDetailsList); |
| | | } |
| | | |
| | |
| | | // List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId); |
| | | // return Result.success(lackDetailsList); |
| | | // } |
| | | @ApiOperation("查询指定流程卡及层数的缺片详情") |
| | | @PostMapping("/queryLackByFlowCard") |
| | | public Result<Map<Integer,List<LackDetailsDTO>>> queryLackByFlowCard(String flowCardId) { |
| | | Map<Integer,List<LackDetailsDTO>> lackDetailsMap = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId); |
| | | return Result.success(lackDetailsMap); |
| | | } |
| | | |
| | | @ApiOperation("中空缺片爆破笼报破损") |
| | | @PostMapping("/hollowBigStorageGlassDamage") |
| | |
| | | */ |
| | | private String productName; |
| | | /** |
| | | * 中空片序 0 直通 1 笼内 |
| | | */ |
| | | private int hollowSequence; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsId; |
| | |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private int layer; |
| | |
| | | */ |
| | | private Integer patchCount; |
| | | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | private String workingProcedure; |
| | | |
| | | } |
| | |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO; |
| | | import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | void updateDeviceIdBySlot(@Param("list") List<Integer> slotList); |
| | | |
| | | List<HollowBigStorageCageDetails> queryPairGlassList(@Param("flowCardId")String flowCardId, @Param("totalLayer")Integer totalLayer, @Param("totalPairQuantity")Integer totalPairQuantity,@Param("isOut") Integer isOut); |
| | | List<HollowBigStorageCageDetails> queryPairGlassList(@Param("flowCardId") String flowCardId, @Param("totalLayer") Integer totalLayer, @Param("totalPairQuantity") Integer totalPairQuantity, @Param("isOut") Integer isOut); |
| | | |
| | | List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer(); |
| | | |
| | | /** |
| | | * 查询笼内的缺片详情 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query); |
| | | } |
| | | |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.hollow.entity.HollowGlassRelationInfo; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.order.entity.OrderDetailsDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface HollowGlassRelationInfoMapper extends BaseMapper<HollowGlassRelationInfo> { |
| | | |
| | | |
| | | List<LackDetailsDTO> queryAllLackByFlowCard(); |
| | | |
| | | List<LackDetailsDTO> queryLackByFlowCard(); |
| | | |
| | | int queryLayerByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | void clearDirtyFlowCardData(@Param("flowCardId") String flowCardId, @Param("layer") int layer); |
| | | |
| | | List<LackDetailsDTO> queryLackByFlowCard(@Param("flowCardId") String flowCardId); |
| | | |
| | | List<GlassInfo> queryLackGlassByFlowCard(@Param("flowCardId") String flowCardId, @Param("orderSort") Integer orderSort, @Param("layer") Integer layer); |
| | | } |
| | | |
| | |
| | | import com.mes.base.entity.vo.BigStorageVO; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.dto.*; |
| | | import com.mes.hollow.entity.vo.HollowAllFlowCardVO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | Boolean updateHollowStorageCageDisabled(int slot, int enableState); |
| | | |
| | | List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer(); |
| | | |
| | | List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query); |
| | | } |
| | | |
| | |
| | | |
| | | List<FlowCardGlassInfoDTO> queryHollowAllFlowCardSummary(HollowBigStorageDetailsQueryVO query); |
| | | |
| | | List<LackDetailsDTO> queryLackByFlowCard(); |
| | | List<LackDetailsDTO> queryAllLackByFlowCard(); |
| | | |
| | | int queryLayerByFlowCardId(String flowCardId); |
| | | // List<LackDetailsDTO> queryLackByFlowCard(String flowCardId); |
| | | |
| | | Map<Integer,List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId); |
| | | |
| | | |
| | | /** |
| | |
| | | return baseMapper.queryFlowCardIdsAndLayer(); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) { |
| | | return baseMapper.queryHollowAllFlowCard(query); |
| | | } |
| | | |
| | | private List<HollowBigStorageAndDetailsDTO> hollowBigStorageCageDetailsChild(String glassId, Integer deviceId, Integer slot, int state) { |
| | | //将对应格子号的玻璃id置为101 |
| | | this.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | |
| | | public List<HollowAllFlowCardVO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) { |
| | | Date startDate = new Date(); |
| | | log.info("开始查询中空流程卡任务信息,开始时间{}", startDate); |
| | | List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .like(StringUtils.isNotBlank(query.getFilmsId()), HollowBigStorageCageDetails::getFilmsId, query.getFilmsId()) |
| | | .like(StringUtils.isNotBlank(query.getFlowCardId()), HollowBigStorageCageDetails::getFlowCardId, query.getFlowCardId()) |
| | | .eq(query.getThickness() != 0, HollowBigStorageCageDetails::getThickness, query.getThickness()) |
| | | .orderByAsc(HollowBigStorageCageDetails::getFlowCardId) |
| | | ); |
| | | List<FlowCardGlassInfoDTO> detailsList = hollowBigStorageCageDetailsService.queryHollowAllFlowCard(query); |
| | | |
| | | if (CollectionUtil.isEmpty(detailsList)) { |
| | | log.info("笼内无玻璃"); |
| | | return new ArrayList<>(); |
| | | } |
| | | Date middleDate = new Date(); |
| | | log.info("中空理片笼详情数据已查询完毕,耗时:{}ms", middleDate.getTime() - startDate.getTime()); |
| | | Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId)); |
| | | Map<String, List<FlowCardGlassInfoDTO>> listMap = detailsList.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId)); |
| | | List<HollowAllFlowCardVO> resultList = new ArrayList<>(); |
| | | AtomicInteger pairTotalCount = new AtomicInteger(); |
| | | listMap.forEach((e, v) -> { |
| | | HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO(); |
| | | HollowBigStorageCageDetails cageDetails = v.get(0); |
| | | FlowCardGlassInfoDTO cageDetails = v.get(0); |
| | | //按照流程卡获取对应的产品名称 |
| | | OrderDetailsDTO orderDetails = this.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName()); |
| | | if (null != orderDetails) { |
| | |
| | | } else { |
| | | hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE); |
| | | } |
| | | List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE); |
| | | log.info("获取到的流程卡信息为:{}", flowCardInfoList); |
| | | if (CollectionUtil.isNotEmpty(flowCardInfoList)) { |
| | | hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList); |
| | | pairTotalCount.addAndGet(flowCardInfoList.get(0).getPairCount()); |
| | | } |
| | | hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(v); |
| | | pairTotalCount.addAndGet(cageDetails.getPairCount()); |
| | | resultList.add(hollowAllFlowCardVO); |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LackDetailsDTO> queryLackByFlowCard() { |
| | | List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(); |
| | | public List<LackDetailsDTO> queryAllLackByFlowCard() { |
| | | List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryAllLackByFlowCard(); |
| | | return lackDetailsList; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<Integer,List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId) { |
| | | List<LackDetailsDTO> detailsDTOS = baseMapper.queryLackByFlowCard(flowCardId); |
| | | return detailsDTOS.stream().collect(Collectors.groupingBy(item -> item.getLayer())); |
| | | } |
| | | |
| | | @Override |
| | | public Integer getGlassGapByThickness(Double thickness) { |
| | | int sysKey = 0; |
| | | if (thickness >= 12) { |
| | |
| | | jsonObject.append("bigStorageCageUsageSummary", bigStorageCageUsageSummary); |
| | | |
| | | //缺片详情 |
| | | List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(); |
| | | List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryAllLackByFlowCard(); |
| | | jsonObject.append("lackDetailsList", lackDetailsList); |
| | | |
| | | jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>() |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | northGlassMes: |
| | | url: jdbc:mysql://127.0.0.1:3306/north_glass_mes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/yw_mes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | database: 1 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
| | | kangaroohy: |
| | | milo: |
| | | enabled: true |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://10.153.19.150:49320 |
| | | security-policy: basic256sha256 |
| | | username: admin |
| | | password: 1qaz2wsx3edc4rfv |
| | | cache: |
| | | type: redis # 明确指定缓存类型 |
| | | redis: |
| | | time-to-live: -1 # 缓存过期时间 |
| | | cache-null-values: true # 是否缓存空值 |
| | | use-key-prefix: true # 使用key前缀 |
| | | kangaroohy: |
| | | milo: |
| | | enabled: true |
| | | enabled: false |
| | | primary: default |
| | | config: |
| | | default: |
| | |
| | | where state in (100, 102, 103, 104) |
| | | group by flow_card_id, layer |
| | | </select> |
| | | |
| | | <select id="queryHollowAllFlowCard" resultType="com.mes.hollow.entity.dto.FlowCardGlassInfoDTO"> |
| | | WITH hollow_flow_temp AS ( |
| | | SELECT DISTINCT flow_card_id |
| | | FROM hollow_big_storage_cage_details |
| | | WHERE state = 100 |
| | | <if test="flowCardId != null and flowCardId != ''"> |
| | | AND flow_card_id LIKE CONCAT('%', #{flowCardId}, '%') |
| | | </if> |
| | | <if test="filmsId != null and filmsId != ''"> |
| | | AND films_id LIKE CONCAT('%', #{filmsId}, '%') |
| | | </if> |
| | | <if test="thickness != 0"> |
| | | AND thickness = #{thickness} |
| | | </if> |
| | | ), |
| | | hollow_details_temp AS ( |
| | | SELECT |
| | | flow_card_id, |
| | | glass_id, |
| | | virtual_slot, |
| | | sequence, |
| | | layer, |
| | | total_layer, |
| | | hollow_sequence |
| | | FROM hollow_big_storage_cage_details |
| | | WHERE state = 100 |
| | | <if test="flowCardId != null and flowCardId != ''"> |
| | | AND flow_card_id LIKE CONCAT('%', #{flowCardId}, '%') |
| | | </if> |
| | | <if test="filmsId != null and filmsId != ''"> |
| | | AND films_id LIKE CONCAT('%', #{filmsId}, '%') |
| | | </if> |
| | | <if test="thickness != 0"> |
| | | AND thickness = #{thickness} |
| | | </if> |
| | | ), |
| | | hollow_through_temp AS ( |
| | | SELECT |
| | | flow_card_id, |
| | | MIN(hollow_sequence) as hollow_sequence, |
| | | MAX(total_layer) as total_layer |
| | | FROM hollow_details_temp |
| | | GROUP BY flow_card_id |
| | | ), |
| | | hollow_pair_temp AS ( |
| | | SELECT |
| | | t1.flow_card_id, |
| | | COUNT(*) AS pair_count |
| | | FROM hollow_details_temp t1 |
| | | INNER JOIN hollow_details_temp t2 |
| | | ON t1.flow_card_id = t2.flow_card_id |
| | | AND t1.virtual_slot = t2.virtual_slot |
| | | AND t1.sequence = t2.sequence |
| | | AND t1.layer = 1 AND t2.layer = 2 |
| | | WHERE NOT EXISTS ( |
| | | SELECT 1 |
| | | FROM hollow_through_temp ht |
| | | WHERE ht.flow_card_id = t1.flow_card_id |
| | | AND ht.total_layer = 3 |
| | | ) OR EXISTS ( |
| | | SELECT 1 |
| | | FROM hollow_details_temp t3 |
| | | WHERE t3.flow_card_id = t1.flow_card_id |
| | | AND t3.virtual_slot = t1.virtual_slot |
| | | AND t3.sequence = t1.sequence |
| | | AND t3.layer = 3 |
| | | ) |
| | | GROUP BY t1.flow_card_id |
| | | ), |
| | | glass_info_temp AS ( |
| | | SELECT |
| | | gi.id, |
| | | gi.glass_id, |
| | | gi.flow_card_id, |
| | | gi.layer, |
| | | gi.thickness, |
| | | gi.filmsId |
| | | FROM hollow_flow_temp hft |
| | | INNER JOIN glass_info gi ON hft.flow_card_id = gi.flow_card_id |
| | | ), |
| | | damage_ranked AS ( |
| | | SELECT |
| | | d.glass_id, |
| | | d.type, |
| | | d.status, |
| | | ROW_NUMBER() OVER(PARTITION BY d.glass_id ORDER BY d.id DESC) as rn |
| | | FROM hollow_flow_temp hft |
| | | INNER JOIN damage d ON hft.flow_card_id = d.process_id |
| | | ), |
| | | damage_latest AS ( |
| | | SELECT |
| | | glass_id, |
| | | type, |
| | | status |
| | | FROM damage_ranked |
| | | WHERE rn = 1 |
| | | ), |
| | | result_temp AS ( |
| | | SELECT |
| | | t.flow_card_id, |
| | | t.layer, |
| | | t.thickness, |
| | | t.filmsId, |
| | | COUNT(DISTINCT t.id) as sum_count, |
| | | COUNT(DISTINCT t1.glass_id) as real_count, |
| | | COUNT(DISTINCT t.id) - COUNT(DISTINCT t1.glass_id) as lack_count, |
| | | COUNT(DISTINCT CASE WHEN t2.type IN (7,8) AND t2.status = 1 THEN t.glass_id END) as damage_count |
| | | FROM glass_info_temp t |
| | | LEFT JOIN hollow_details_temp t1 ON t.glass_id = t1.glass_id |
| | | LEFT JOIN damage_latest t2 ON t.glass_id = t2.glass_id |
| | | GROUP BY t.flow_card_id, t.layer, t.thickness, t.filmsId |
| | | ) |
| | | SELECT |
| | | t.*, |
| | | COALESCE(t1.pair_count, 0) as pair_count, |
| | | t2.hollow_sequence, |
| | | t2.total_layer |
| | | FROM result_temp t |
| | | LEFT JOIN hollow_pair_temp t1 ON t.flow_card_id = t1.flow_card_id |
| | | LEFT JOIN hollow_through_temp t2 ON t.flow_card_id = t2.flow_card_id |
| | | ORDER BY t.flow_card_id |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="queryLackByFlowCard" resultMap="lackBaseMap"> |
| | | <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMap"> |
| | | with temp_flow as (SELECT t.process_id, |
| | | t.order_id, |
| | | t.order_number, |
| | | t.technology_number, |
| | | t.quantity, |
| | | t1.child_width, |
| | | t1.child_height |
| | | |
| | | from pp.flow_card t |
| | | LEFT JOIN sd.order_glass_detail t1 |
| | | on t.order_id = t1.order_id |
| | | and t.order_number = t1.order_number |
| | | and t.technology_number = t1.technology_number |
| | | where t.process_id = #{flowCardId}), |
| | | glass_info_temp as ( |
| | | select process_id, |
| | | order_id, |
| | | GREATEST(child_width, child_height) as first_length, |
| | | least(child_width, child_height) as second_length, |
| | | child_width, |
| | | child_height, |
| | | order_number, |
| | | technology_number, |
| | | quantity |
| | | from temp_flow |
| | | where technology_number = #{totalLayer} |
| | | ) |
| | | select row_number() over (order by second_length desc,first_length desc) as rn, t.* |
| | | from glass_info_temp t |
| | | </select> |
| | | <select id="queryAllLackByFlowCard" resultMap="lackBaseMap"> |
| | | with flow_card_id_info as ( |
| | | select distinct flow_card_id from hollow_big_storage_cage_details where state = 100 |
| | | ), |
| | |
| | | where t.flow_card_id=#{flowCardId} and t.glass_type=#{orderSort} and t.layer=#{layer} and t1.glass_id is null |
| | | and t2.glass_id is null |
| | | </select> |
| | | <select id="queryLackByFlowCard" resultType="com.mes.hollow.entity.dto.LackDetailsDTO"> |
| | | with hollow_flow_temp AS ( |
| | | SELECT DISTINCT flow_card_id |
| | | FROM hollow_big_storage_cage_details |
| | | WHERE state = 100 |
| | | <if test="flowCardId != null and flowCardId != ''"> |
| | | and flow_card_id = #{flowCardId} |
| | | </if> |
| | | ) |
| | | , glass_temp as ( |
| | | select t1.* |
| | | from hollow_flow_temp t |
| | | INNER JOIN glass_info t1 on t.flow_card_id = t1.flow_card_id |
| | | ) |
| | | , detail_temp as ( |
| | | select t.* |
| | | from glass_temp t |
| | | left join hollow_big_storage_cage_details t1 on t.glass_id = t1.glass_id |
| | | where t1.glass_id is null |
| | | ) |
| | | , damage_ranked AS ( |
| | | SELECT t.flow_card_id, |
| | | t.layer, |
| | | t.glass_id, |
| | | t.glass_type, |
| | | t.width, |
| | | t.height, |
| | | t.filmsId, |
| | | t.thickness, |
| | | case |
| | | when type in (7, 8) and status = 1 then '' |
| | | else t1.working_procedure end as working_procedure, |
| | | ROW_NUMBER() OVER (PARTITION BY t1.glass_id ORDER BY t1.id DESC) as rn |
| | | FROM detail_temp t |
| | | inner join damage t1 on t.glass_id = t1.glass_id |
| | | ) |
| | | , damage_latest AS ( |
| | | SELECT * |
| | | FROM damage_ranked |
| | | WHERE rn = 1 |
| | | ) |
| | | select * |
| | | from damage_latest |
| | | |
| | | </select> |
| | | |
| | | <update id="clearDirtyFlowCardData"> |
| | | update tempering_glass_relation_info |