1、中空界面调用推送数据接口
2、中空流程卡缺片信息统计sql优化
3、修改缺片查询接口注释,避免接口错误调用
5个文件已修改
140 ■■■■■ 已修改文件
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/controller/HollowBigStorageCageHistoryTaskController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/HollowBigStorageCageHistoryTaskService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml 113 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java
@@ -40,14 +40,14 @@
        return Result.success(hollowAllFlowCardVOList);
    }
    @ApiOperation("查询指定流程卡及层数的缺片详情")
    @ApiOperation("界面展示:查询流程卡、层数的缺片详情")
    @PostMapping("/queryAllLackByFlowCard")
    public Result<List<LackDetailsDTO>> queryAllLackByFlowCard() {
        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryAllLackByFlowCard();
        return Result.success(lackDetailsList);
    }
    @ApiOperation("缺片玻璃信息详情")
    @ApiOperation("按照流程卡、订单序号、层号获取缺片玻璃信息详情")
    @PostMapping("/queryLackGlassByFlowCard")
    public Result<List<GlassInfo>> queryLackGlassByFlowCard(@RequestBody HollowBigStorageDetailsQueryVO query) {
        List<GlassInfo> lackGlassList = hollowGlassRelationInfoService.queryLackGlassByFlowCard(query);
@@ -60,7 +60,7 @@
//        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId);
//        return Result.success(lackDetailsList);
//    }
    @ApiOperation("查询指定流程卡及层数的缺片详情")
    @ApiOperation("查询指定流程卡的缺片详情")
    @PostMapping("/queryLackByFlowCard")
    public Result<Map<Integer,List<LackDetailsDTO>>> queryLackByFlowCard(String flowCardId) {
        Map<Integer,List<LackDetailsDTO>> lackDetailsMap = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId);
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/controller/HollowBigStorageCageHistoryTaskController.java
@@ -47,5 +47,11 @@
    public Result<List<RunTime>> queryRunTimes(String days) {
        return Result.success(hollowBigStorageCageHistoryTaskService.queryRunTimes(days));
    }
    @ApiOperation(value = "查询中空大理片界面所有信息", notes = "查询中空大理片界面所有信息")
    @GetMapping("/queryAllMessage")
    public Result<String> queryAllMessage() {
        return Result.success(hollowBigStorageCageHistoryTaskService.queryAllMessage());
    }
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/HollowBigStorageCageHistoryTaskService.java
@@ -22,5 +22,7 @@
    DailyProductionVO queryHollowDailyProduction(HollowBigStorageCageHistoryRequest request);
    List<RunTime> queryRunTimes(String days);
    String queryAllMessage();
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java
@@ -9,11 +9,13 @@
import com.mes.hollowtask.entity.request.HollowBigStorageCageHistoryRequest;
import com.mes.hollowtask.mapper.HollowBigStorageCageHistoryTaskMapper;
import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService;
import com.mes.job.PushMessageToIndex;
import com.mes.largenscreen.entity.DailyProductionVO;
import com.mes.largenscreen.entity.RunTime;
import com.mes.tools.DateUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.List;
@@ -25,6 +27,9 @@
 */
@Service
public class HollowBigStorageCageHistoryTaskServiceImpl extends ServiceImpl<HollowBigStorageCageHistoryTaskMapper, HollowBigStorageCageHistoryTask> implements HollowBigStorageCageHistoryTaskService {
    @Resource
    PushMessageToIndex pushMessageToIndex;
    @Override
    public Page<HollowBigStorageCageHistoryTask> queryHollowBigStorageCageHistoryTask(HollowBigStorageCageHistoryRequest request) {
@@ -57,8 +62,14 @@
    }
    @Override
    public List<RunTime> queryRunTimes(String days){
    public List<RunTime> queryRunTimes(String days) {
        return baseMapper.queryRunTimes(days);
    }
    @Override
    public String queryAllMessage() {
        pushMessageToIndex.hollowGlassMessage();
        return "success";
    }
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -13,10 +13,10 @@
    <resultMap id="lackBaseMap" type="com.mes.hollow.entity.dto.LackDetailsDTO">
        <result column="flow_card_id" property="flowCardId"/>
        <result column="layer" property="layer"/>
        <result column="order_sort" property="glassType"/>
        <result column="films_id" property="filmsId"/>
        <result column="first_length" property="width"/>
        <result column="second_Length" property="height"/>
        <result column="glass_type" property="glassType"/>
        <result column="filmsid" property="filmsId"/>
        <result column="width" property="width"/>
        <result column="height" property="height"/>
        <result column="thickness" property="thickness"/>
        <result column="lack_count" property="lackCount"/>
        <result column="damage_count" property="damageCount"/>
@@ -106,58 +106,67 @@
        from result
    </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
        WITH flow_card_id_info AS (
            SELECT DISTINCT flow_card_id
            FROM hollow_big_storage_cage_details
            WHERE state = 100
        ),
             relation_length as (
                 select flow_card_id,
                        layer,
                        order_sort,
                        tempering_layout_id,
                        tempering_feed_sequence,
                        GREATEST(width, height) as first_length,
                        LEAST(width, height)    as second_Length,
                        width,
                        height,
                        thickness,
                        films_id
                 from hollow_glass_relation_info
                 where flow_card_id in (select flow_card_id from flow_card_id_info)
                   and tempering_layout_id is null
                   and tempering_feed_sequence is null
             glass_temp AS (
                 SELECT t.*
                 FROM glass_info t
                          INNER JOIN flow_card_id_info t1 ON t.flow_card_id = t1.flow_card_id
             ),
             lack_count_temp as (
                 select flow_card_id,
                        layer,
                        order_sort,
                        first_length,
                        films_id,
                        second_Length,
                        thickness,
                        count(*) as lack_count
                 from relation_length
                 group by flow_card_id, layer, order_sort, films_id, first_length, second_Length, thickness
             detail_temp AS (
                 SELECT t.*
                 FROM glass_temp t
                 WHERE NOT EXISTS (
                         SELECT 1
                         FROM hollow_big_storage_cage_details t1
                         WHERE t1.glass_id = t.glass_id
                           AND t1.state NOT IN (8,9)
                     )
             ),
             damage_count_temp as (
                 select process_id                                                                     as flow_card_id,
                        technology_number                                                              as layer,
                        order_number                                                                   as order_sort,
                        count(distinct
                              case when type = 8 and status &lt; 3 then glass_id else null end)        as damage_count,
                        count(distinct case when type = 8 and status >= 3 then glass_id else null end) as patch_count
                 from damage
                 where process_id in (select flow_card_id from flow_card_id_info)
                 group by process_id, technology_number, order_number
             damage_latest AS (
                 SELECT
                     dr.glass_id,
                     dr.type,
                     dr.status
                 FROM (
                          SELECT
                              t1.glass_id,
                              t1.type,
                              t1.status,
                              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.flow_card_id = t1.process_id
                      ) dr
                 WHERE dr.rn = 1
             ),
             result_count as (
                 select t.*, IFNULL(t1.damage_count, 0) damage_count, IFNULL(t1.patch_count, 0) patch_count
                 from lack_count_temp t
                          left join damage_count_temp t1 on t.flow_card_id = t1.flow_card_id and t.layer = t1.layer and
                                                            t.order_sort = t1.order_sort
                 order by t.flow_card_id, t.layer
             result_temp AS (
                 SELECT
                     t.flow_card_id,
                     t.layer,
                     t.glass_type,
                     t.thickness,
                     t.filmsId,
                     t.width,
                     t.height,
                     COUNT(DISTINCT t.glass_id) as lack_count,
                     COUNT(DISTINCT CASE WHEN t1.type IN (7,8) AND t1.status = 1 THEN t.glass_id END) as damage_count
                 FROM detail_temp t
                          LEFT JOIN damage_latest t1 ON t.glass_id = t1.glass_id
                 GROUP BY
                     t.flow_card_id,
                     t.layer,
                     t.glass_type,
                     t.thickness,
                     t.filmsId,
                     t.width,
                     t.height
             )
        select *
        from result_count
        SELECT *
        FROM result_temp
        ORDER BY flow_card_id, layer;
    </select>
    <select id="queryLayerByFlowCardId" resultType="java.lang.Integer">
        select count(distinct layer)
@@ -212,7 +221,7 @@
           , detail_temp as (
            select t.*
            from glass_temp t
                     left join hollow_big_storage_cage_details t1 on t.glass_id = t1.glass_id
                     left join hollow_big_storage_cage_details t1 on t.glass_id = t1.glass_id and t1.state  not in (8,9)
            where t1.glass_id is null
        )
           , damage_ranked AS (