Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
New file |
| | |
| | | package com.mes.largenscreen.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.largenscreen.entity.DateRequest; |
| | | import com.mes.largenscreen.service.LargenScreenService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 14:24 |
| | | * @Description: |
| | | */ |
| | | @Api(tags = "大屏统计信息") |
| | | @RestController |
| | | @RequestMapping("largenScreen") |
| | | public class LargenScreenController { |
| | | |
| | | @Resource |
| | | LargenScreenService largenScreenService; |
| | | |
| | | @ApiOperation("按照条件统计每日生产情况") |
| | | @PostMapping("/queryDailyProduction") |
| | | public Result<Page<DailyProductionVO>> queryDailyProduction(@RequestBody @Validated DateRequest query) { |
| | | return Result.build(200, "查询成功", largenScreenService.queryDailyProduction(query)); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.largenscreen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 14:30 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class DailyProductionVO { |
| | | |
| | | @ApiModelProperty(value = "日期") |
| | | private String date; |
| | | |
| | | @ApiModelProperty(value = "切割一线玻璃数量") |
| | | private int countOutOne; |
| | | |
| | | @ApiModelProperty(value = "切割一线玻璃面积") |
| | | private double totalAreaOutOne; |
| | | |
| | | @ApiModelProperty(value = "切割二线玻璃数量") |
| | | private int countOutTwo; |
| | | |
| | | @ApiModelProperty(value = "切割二线玻璃面积") |
| | | private double totalAreaOutTwo; |
| | | |
| | | @ApiModelProperty(value = "钢化前大理片笼玻璃数量") |
| | | private int countIn; |
| | | |
| | | @ApiModelProperty(value = "钢化前大理片笼玻璃面积") |
| | | private double totalAreaIn; |
| | | |
| | | @ApiModelProperty(value = "钢化玻璃数量") |
| | | private int countOut; |
| | | |
| | | @ApiModelProperty(value = "钢化玻璃面积") |
| | | private double totalAreaOut; |
| | | |
| | | @ApiModelProperty(value = "中空一线玻璃数量") |
| | | private int hollowCountOutOne; |
| | | |
| | | @ApiModelProperty(value = "中空一线玻璃面积") |
| | | private double hollowTotalAreaOutOne; |
| | | |
| | | @ApiModelProperty(value = "中空二线玻璃数量") |
| | | private int hollowCountOutTwo; |
| | | |
| | | @ApiModelProperty(value = "中空二线玻璃面积") |
| | | private double hollowTotalAreaOutTwo; |
| | | } |
New file |
| | |
| | | package com.mes.largenscreen.entity; |
| | | |
| | | import com.mes.base.entity.PageRequest; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 14:42 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class DateRequest extends PageRequest { |
| | | |
| | | @ApiModelProperty(value = "开始日期 ‘yyyy-MM-dd’") |
| | | private String BeginDate; |
| | | @ApiModelProperty(value = "结束日期 ‘yyyy-MM-dd’") |
| | | private String endDate; |
| | | } |
New file |
| | |
| | | package com.mes.largenscreen.mapper; |
| | | |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 14:46 |
| | | * @Description: |
| | | */ |
| | | |
| | | public interface LargenScreenMapper { |
| | | |
| | | List<DailyProductionVO> queryDailyProduction(String beginDate, String endDate); |
| | | } |
New file |
| | |
| | | package com.mes.largenscreen.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.largenscreen.entity.DateRequest; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 14:27 |
| | | * @Description: |
| | | */ |
| | | public interface LargenScreenService { |
| | | |
| | | Page<DailyProductionVO> queryDailyProduction(DateRequest query); |
| | | |
| | | DailyProductionVO querySameDayProduction(DateRequest query); |
| | | } |
New file |
| | |
| | | package com.mes.largenscreen.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.largenscreen.entity.DateRequest; |
| | | import com.mes.largenscreen.mapper.LargenScreenMapper; |
| | | import com.mes.largenscreen.service.LargenScreenService; |
| | | import com.mes.tools.PageUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 14:28 |
| | | * @Description: |
| | | */ |
| | | @Service |
| | | public class LargenScreenServiceImpl implements LargenScreenService { |
| | | |
| | | @Resource |
| | | private LargenScreenMapper largenScreenMapper; |
| | | |
| | | @Override |
| | | public Page<DailyProductionVO> queryDailyProduction(DateRequest query) { |
| | | if (StringUtils.isEmpty(query.getBeginDate())) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | query.setBeginDate(sdf.format(new Date())); |
| | | query.setEndDate(sdf.format(new Date())); |
| | | } |
| | | List<DailyProductionVO> list = largenScreenMapper.queryDailyProduction(query.getBeginDate(), query.getEndDate()); |
| | | return (Page<DailyProductionVO>) PageUtil.listToPage(list, query.getPageNo(), query.getPageSize()); |
| | | } |
| | | |
| | | @Override |
| | | public DailyProductionVO querySameDayProduction(DateRequest query) { |
| | | if (StringUtils.isEmpty(query.getBeginDate())) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | query.setBeginDate(sdf.format(new Date())); |
| | | query.setEndDate(sdf.format(new Date())); |
| | | } |
| | | List<DailyProductionVO> list = largenScreenMapper.queryDailyProduction(query.getBeginDate(), query.getEndDate()); |
| | | return list.get(0); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.opctask.entity.request; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.mes.base.entity.PageRequest; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (LoadGlassDeviceTaskHistory)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-06 22:23:00 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @Data |
| | | public class LoadGlassDeviceTaskHistoryRequest extends PageRequest { |
| | | /** |
| | | * 原片宽 |
| | | */ |
| | | private String rawGlassWidth; |
| | | /** |
| | | * 原片高 |
| | | */ |
| | | private String rawGlassHeight; |
| | | /** |
| | | * 原片宽 |
| | | */ |
| | | private String rawGlassThickness; |
| | | /** |
| | | * 原片高 |
| | | */ |
| | | private String rawGlassfilmsId; |
| | | /** |
| | | * 上片设备编号 |
| | | */ |
| | | private Integer station; |
| | | /** |
| | | * 上片位编号 |
| | | */ |
| | | private Integer slot; |
| | | /** |
| | | * 任务状态 0默认空任务 1执行中 2结束任务 |
| | | */ |
| | | private List<Integer> taskStateList; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @ApiModelProperty(value = "开始时间", position = 6) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "结束时间", position = 7) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endDate; |
| | | |
| | | } |
| | | |
| | |
| | | package com.mes.opctask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.opctask.entity.LoadGlassDeviceTaskHistory; |
| | | import com.mes.opctask.entity.request.LoadGlassDeviceTaskHistoryRequest; |
| | | |
| | | /** |
| | | * (LoadGlassDeviceTaskHistory)表服务接口 |
| | |
| | | */ |
| | | public interface LoadGlassDeviceTaskHistoryService extends IService<LoadGlassDeviceTaskHistory> { |
| | | |
| | | Page<LoadGlassDeviceTaskHistory> queryLoadGlassHistoryTask(LoadGlassDeviceTaskHistoryRequest request); |
| | | } |
| | | |
| | |
| | | package com.mes.opctask.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.smallbun.screw.core.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.opctask.entity.LoadGlassDeviceTaskHistory; |
| | | import com.mes.opctask.entity.request.LoadGlassDeviceTaskHistoryRequest; |
| | | import com.mes.opctask.mapper.LoadGlassDeviceTaskHistoryDao; |
| | | import com.mes.opctask.service.LoadGlassDeviceTaskHistoryService; |
| | | import com.mes.tools.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class LoadGlassDeviceTaskHistoryServiceImpl extends ServiceImpl<LoadGlassDeviceTaskHistoryDao, LoadGlassDeviceTaskHistory> implements LoadGlassDeviceTaskHistoryService { |
| | | |
| | | @Override |
| | | public Page<LoadGlassDeviceTaskHistory> queryLoadGlassHistoryTask(LoadGlassDeviceTaskHistoryRequest request){ |
| | | if (null == request.getBeginDate()) { |
| | | request.setBeginDate(DateUtil.getBeginDate()); |
| | | request.setEndDate(DateUtil.getEndDate()); |
| | | } |
| | | Page<LoadGlassDeviceTaskHistory> page = new Page<>(request.getPageNo(), request.getPageSize()); |
| | | LambdaQueryWrapper<LoadGlassDeviceTaskHistory> wrapper = new LambdaQueryWrapper<LoadGlassDeviceTaskHistory>() |
| | | .like(StringUtils.isNotBlank(request.getRawGlassWidth()), LoadGlassDeviceTaskHistory::getRawGlassWidth, request.getRawGlassWidth()) |
| | | .like(StringUtils.isNotBlank(request.getRawGlassHeight()), LoadGlassDeviceTaskHistory::getRawGlassHeight, request.getRawGlassHeight()) |
| | | .like(StringUtils.isNotBlank(request.getRawGlassWidth()), LoadGlassDeviceTaskHistory::getRawGlassWidth, request.getRawGlassWidth()) |
| | | .like(StringUtils.isNotBlank(request.getRawGlassWidth()), LoadGlassDeviceTaskHistory::getRawGlassWidth, request.getRawGlassWidth()) |
| | | .eq(request.getStation() != 0, LoadGlassDeviceTaskHistory::getStation, request.getStation()) |
| | | .eq(request.getSlot() != 0, LoadGlassDeviceTaskHistory::getSlot, request.getSlot()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()), LoadGlassDeviceTaskHistory::getTaskState, request.getTaskStateList()) |
| | | .between(LoadGlassDeviceTaskHistory::getCreateTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(LoadGlassDeviceTaskHistory::getCreateTime); |
| | | return this.page(page, wrapper); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.pp.entity.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class FlowCardDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 项目名称 |
| | | */ |
| | | private String productName; |
| | | |
| | | /** |
| | | * 玻璃名称 |
| | | */ |
| | | private String glassChild; |
| | | |
| | | /** |
| | | * 订单类型 |
| | | */ |
| | | private String orderType; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String processId; |
| | | |
| | | /** |
| | | * 订单序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 订单数量 |
| | | */ |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * 报工数量 |
| | | */ |
| | | private String reportWorkQuantity; |
| | | |
| | | /** |
| | | * 报工数量 |
| | | */ |
| | | private String reportWorkQuantityCount; |
| | | |
| | | /** |
| | | * 报工时间 |
| | | */ |
| | | private String reportWorkTime; |
| | | |
| | | /** |
| | | * 破损数量 |
| | | */ |
| | | private String broken_num; |
| | | |
| | | /** |
| | | * 库存数量 |
| | | */ |
| | | private Integer inventory; |
| | | |
| | | /** |
| | | * 库存面积 |
| | | */ |
| | | private Double inventoryArea; |
| | | |
| | | /** |
| | | * 发货数量 |
| | | */ |
| | | private Integer shippedQuantity; |
| | | |
| | | /** |
| | | * 玻璃No |
| | | */ |
| | | private String glassNumber; |
| | | |
| | | } |
| | |
| | | |
| | | // 3、数据源配置 |
| | | DataSourceConfig dsc = new DataSourceConfig(); |
| | | dsc.setUrl("jdbc:mysql://10.153.19.150:3306/yiwumes?serverTimezone=GMT%2b8"); |
| | | dsc.setUrl("jdbc:mysql://localhost:3306/north_glass_mes?serverTimezone=GMT%2b8"); |
| | | dsc.setDriverName("com.mysql.cj.jdbc.Driver"); |
| | | dsc.setUsername("root"); |
| | | dsc.setPassword("beibo.123/"); |
| | |
| | | // 4、包配置 |
| | | PackageConfig pc = new PackageConfig(); |
| | | pc.setParent("com.mes"); |
| | | pc.setModuleName("raw_glass_storage_station"); //模块名 |
| | | pc.setModuleName("loadglassdevicetaskhistory"); //模块名 |
| | | pc.setController("controller"); |
| | | pc.setService("service"); |
| | | pc.setMapper("mapper"); |
| | |
| | | |
| | | // strategy.setInclude("raw_glass_storage_details"); |
| | | // strategy.setInclude("raw_glass_storage_station"); |
| | | strategy.setInclude("raw_glass_storage_station"); |
| | | strategy.setInclude("load_glass_device_task_history"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
New file |
| | |
| | | package com.mes.tools; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/3/12 15:29 |
| | | * @Description: |
| | | */ |
| | | public class PageUtil { |
| | | |
| | | public static IPage listToPage(List list, int pageNum, int pageSize) { |
| | | List pageList = new ArrayList<>(); |
| | | int curIdx = pageNum > 1 ? (pageNum - 1) * pageSize : 0; |
| | | for (int i = 0; i < pageSize && curIdx + i < list.size(); i++) { |
| | | pageList.add(list.get(curIdx + i)); |
| | | } |
| | | Page page = new Page(pageNum, pageSize); |
| | | page.setRecords(pageList); |
| | | page.setTotal(list.size()); |
| | | return page; |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.mes.largenscreen.mapper.LargenScreenMapper"> |
| | | |
| | | <resultMap id="baseMap" type="com.mes.largenscreen.entity.DailyProductionVO"> |
| | | <result column="date" property="date"/> |
| | | <result column="count_out_one" property="countOutOne"/> |
| | | <result column="total_area_out_one" property="totalAreaOutOne"/> |
| | | <result column="count_out_two" property="countOutTwo"/> |
| | | <result column="total_area_out_two" property="totalAreaOutTwo"/> |
| | | <result column="count_in" property="countIn"/> |
| | | <result column="total_area_in" property="totalAreaIn"/> |
| | | <result column="count_out" property="countOut"/> |
| | | <result column="total_area_out" property="totalAreaOut"/> |
| | | <result column="hollow_count_out_one" property="hollowCountOutOne"/> |
| | | <result column="hollow_total_area_out_one" property="hollowTotalAreaOutOne"/> |
| | | <result column="hollow_count_out_two" property="hollowCountOutTwo"/> |
| | | <result column="hollow_total_area_out_two" property="hollowTotalAreaOutTwo"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryDailyProduction" resultMap="baseMap"> |
| | | WITH RECURSIVE |
| | | date_series AS ( |
| | | SELECT #{beginDate} AS date |
| | | UNION ALL |
| | | SELECT DATE_ADD(date, INTERVAL 1 DAY) |
| | | FROM date_series |
| | | WHERE date <= DATE_SUB(#{endDate}, INTERVAL 1 DAY) |
| | | ), |
| | | one_edg_temp as ( |
| | | select STR_TO_DATE(t.create_time, '%Y-%m-%d') as product_date, |
| | | count(t.glass_id_out) as |
| | | count_out_one, |
| | | round(sum(t1.width * t1.height) / 1000000, 2) as total_area_out_one |
| | | from edg_storage_device_task_history t |
| | | inner join glass_info t1 on t.glass_id_in = t1.glass_id |
| | | where t.task_type in |
| | | (2, 3) |
| | | and STR_TO_DATE(t.create_time, '%Y-%m-%d') BETWEEN #{beginDate} and #{endDate} |
| | | and device_id = 1 |
| | | group by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | order by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | ), |
| | | two_edg_temp as ( |
| | | select STR_TO_DATE(t.create_time, '%Y-%m-%d') as product_date, |
| | | count(t.glass_id_out) as |
| | | count_out_two, |
| | | round(sum(t1.width * t1.height) / 1000000, 2) as total_area_out_two |
| | | from edg_storage_device_task_history t |
| | | inner join glass_info t1 on t.glass_id_in = t1.glass_id |
| | | where t.task_type in |
| | | (2, 3) |
| | | and STR_TO_DATE(t.create_time, '%Y-%m-%d') BETWEEN #{beginDate} and #{endDate} |
| | | and device_id = 2 |
| | | group by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | order by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | ), |
| | | big_storage_in_temp as ( |
| | | select STR_TO_DATE(t.create_time, '%Y-%m-%d') as product_date, |
| | | count(t.glass_id) as |
| | | count_in, |
| | | round(sum(t1.width * t1.height) / 1000000, 2) as total_area_in |
| | | from big_storage_cage_history_task t |
| | | INNER JOIN glass_info t1 on t.glass_id = t1.glass_id |
| | | where t.task_type = 1 |
| | | and STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | BETWEEN #{beginDate} and #{endDate} |
| | | group by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | order by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | ), |
| | | big_storage_out_temp as ( |
| | | select STR_TO_DATE(t.create_time, '%Y-%m-%d') as product_date, |
| | | count(t.glass_id) as |
| | | count_out, |
| | | round(sum(t1.width * t1.height) / 1000000, 2) as total_area_out |
| | | from big_storage_cage_history_task t |
| | | INNER JOIN glass_info t1 on t.glass_id = t1.glass_id |
| | | where t.task_type = 2 |
| | | and STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | BETWEEN #{beginDate} and #{endDate} |
| | | group by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | order by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | ), |
| | | hollow_out_one_temp as ( |
| | | select STR_TO_DATE(t.create_time, '%Y-%m-%d') as product_date, |
| | | count(t.glass_id) as |
| | | hollow_count_out_one, |
| | | round(sum(t1.width * t1.height) / 1000000, 2) as hollow_total_area_out_one |
| | | from hollow_big_storage_cage_history_task t |
| | | INNER JOIN glass_info t1 on t.glass_id = t1.glass_id |
| | | where t.task_type = |
| | | 5 |
| | | and t.target_slot = 930 |
| | | and STR_TO_DATE(t.create_time, '%Y-%m-%d') BETWEEN #{beginDate} and #{endDate} |
| | | group by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | order by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | ), |
| | | hollow_out_two_temp as ( |
| | | select STR_TO_DATE(t.create_time, '%Y-%m-%d') as product_date, |
| | | count(t.glass_id) as |
| | | hollow_count_out_two, |
| | | round(sum(t1.width * t1.height) / 1000000, 2) as hollow_total_area_out_two |
| | | from hollow_big_storage_cage_history_task t |
| | | INNER JOIN glass_info t1 on t.glass_id = t1.glass_id |
| | | where t.task_type = |
| | | 5 |
| | | and t.target_slot = 931 |
| | | and STR_TO_DATE(t.create_time, '%Y-%m-%d') BETWEEN #{beginDate} and #{endDate} |
| | | group by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | order by STR_TO_DATE(t.create_time, '%Y-%m-%d') |
| | | ) |
| | | select t.date, |
| | | ifnull(t1.count_out_one, 0) count_out_one, |
| | | ifnull(t1.total_area_out_one, 0) total_area_out_one, |
| | | ifnull(t2.count_out_two, 0) count_out_two, |
| | | ifnull(t2.total_area_out_two, 0) total_area_out_two, |
| | | ifnull(t3.count_in, 0) count_in, |
| | | ifnull(t3.total_area_in, 0) total_area_in, |
| | | ifnull(t4.count_out, 0) count_out, |
| | | ifnull(t4.total_area_out, 0) total_area_out, |
| | | ifnull(t5.hollow_count_out_one, 0) hollow_count_out_one, |
| | | ifnull(t5.hollow_total_area_out_one, 0) |
| | | hollow_total_area_out_one, |
| | | ifnull(t6.hollow_count_out_two, 0) hollow_count_out_two, |
| | | ifnull(t6.hollow_total_area_out_two, 0) |
| | | hollow_total_area_out_two |
| | | from date_series t |
| | | left join one_edg_temp t1 on t.date = t1.product_date |
| | | left join two_edg_temp t2 on t.date = |
| | | t2.product_date |
| | | left join big_storage_in_temp t3 on t.date = t3.product_date |
| | | left join big_storage_out_temp t4 on t.date = |
| | | t4.product_date |
| | | left join hollow_out_one_temp t5 on t.date = t5.product_date |
| | | left join hollow_out_two_temp t6 on t.date = |
| | | t6.product_date |
| | | order by t.date |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import com.mes.common.config.Const; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.edgstoragecage.entity.vo.CutDrawingVO; |
| | | import com.mes.edgstoragecage.entity.vo.EdgStorageCageVO; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTask; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.largenscreen.service.LargenScreenService; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTaskHistory; |
| | | import com.mes.opctask.service.EdgStorageDeviceTaskHistoryService; |
| | | import com.mes.opctask.service.EdgStorageDeviceTaskService; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.CompletionStage; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | EdgStorageDeviceTaskHistoryService edgStorageDeviceTaskHistoryService; |
| | | @Resource |
| | | EngineeringService engineeringService; |
| | | @Resource |
| | | LargenScreenService largenScreenService; |
| | | |
| | | |
| | | private static final String EDG_STORAGE_DEVICE_ONE_TASK = "edg_storage_device_one_task"; |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 30000) |
| | | public void querySameDayProductionTask() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | DailyProductionVO productionVO = largenScreenService.querySameDayProduction(null); |
| | | jsonObject.append("productionVO", productionVO); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreenProduction"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("largenScreenProduction is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | .eq(StringUtils.checkValNotNull(request.getTaskState()), EdgStorageDeviceTaskHistory::getTaskState, request.getTaskState()) |
| | | .eq(StringUtils.checkValNotNull(request.getTaskType()), EdgStorageDeviceTaskHistory::getTaskType, request.getTaskType()) |
| | | .between(StringUtils.checkValNotNull(request.getStartTime()), EdgStorageDeviceTaskHistory::getCreateTime, request.getStartTime(), |
| | | request.getEndTime()).orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 20"); |
| | | request.getEndTime()).orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime); |
| | | if (StringUtils.isNotBlank(request.getGlassId())) { |
| | | wrapper.and(e -> e.like(EdgStorageDeviceTaskHistory::getGlassIdIn, request.getGlassId()) |
| | | .or().like(EdgStorageDeviceTaskHistory::getGlassIdOut, request.getGlassId())); |
| | |
| | | import com.mes.bigstoragecagetask.entity.BigStorageTaskVO; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | |
| | | BigStorageTaskVO task = new BigStorageTaskVO(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | int isExistCount = bigStorageCageDetailsService.count(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, task.getGlassId()) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); |
| | | if (isExistCount > 0 && "0".equals(targetSlotWord.getValue())) { |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (isExistCount > 0) { |
| | | task.setIsSame(1); |
| | | } else { |
| | | task.setIsSame(0); |
| | |
| | | List<RawGlassStorageDetails> stationTwoList = rawGlassStorageDetailList.stream().filter(item -> item.getDeviceId() == 6).collect(Collectors.toList()); |
| | | jsonObject.append("stationOne", stationOneList); |
| | | jsonObject.append("stationTwo", stationTwoList); |
| | | |
| | | //是否开始工程 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | jsonObject.append("engineering", engineering); |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | String inkageStatus = plcParameterObject.getPlcParameter("InkageStatus").getValue(); |
| | | // String inkageStatus ="1"; |
| | | jsonObject.append("InkageStatus", inkageStatus); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //是否开始工程 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | jsonObject.append("engineering", engineering); |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("loadGlassIsRun is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // @Scheduled(fixedDelay = 1000) |
| | | // public void loadGlassIsRun() { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // |
| | | // ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun"); |
| | | // if (sendwServer != null) { |
| | | // for (WebSocketServer webserver : sendwServer) { |
| | | // if (webserver != null) { |
| | | // webserver.sendMessage(jsonObject.toString()); |
| | | // } else { |
| | | // log.info("loadGlassIsRun is closed"); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | public void overTask(String loadStatus, int state) { |
| | | |
New file |
| | |
| | | package com.mes.loadglassdevicetaskhistory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mes.opctask.entity.LoadGlassDeviceTaskHistory; |
| | | import com.mes.opctask.entity.request.LoadGlassDeviceTaskHistoryRequest; |
| | | import com.mes.opctask.service.LoadGlassDeviceTaskHistoryService; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2025-03-12 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/loadglassdevicetaskhistory") |
| | | public class LoadGlassDeviceTaskHistoryController { |
| | | |
| | | @Autowired |
| | | private LoadGlassDeviceTaskHistoryService loadGlassDeviceTaskHistoryService; |
| | | |
| | | @ApiOperation("按照查询条件查询上片历史任务") |
| | | @PostMapping("/queryLoadGlassHistoryTask") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<Page<LoadGlassDeviceTaskHistory>> queryBigStorageCageHistoryTask(@RequestBody @Validated LoadGlassDeviceTaskHistoryRequest request) { |
| | | return Result.build(200, "查询成功", loadGlassDeviceTaskHistoryService.queryLoadGlassHistoryTask(request)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | public Result<List<HollowBigStorageAndDetailsDTO>> queryHollowBigStorageCageDetail(@RequestBody HollowBigStorageDetailsQueryVO query) { |
| | | return Result.build(200, "查询成功", hollowBigStorageCageService.queryHollowBigStorageCageDetail(query)); |
| | | } |
| | | |
| | | @ApiOperation("复位:重置理片笼基础信息1、清除笼内状态为0的脏数据;2将空格子的尺寸置为初始尺寸 3、将不在笼内的流程卡的关系表重置") |
| | | @PostMapping("/resetCage") |
| | | public Result<Boolean> resetCage() { |
| | | return Result.build(200, "重置成功", hollowBigStorageCageService.resetCage()); |
| | | } |
| | | } |
| | | |
| | |
| | | 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<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer(); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Boolean updateHollowStorageCageDisabled(int slot, int enableState); |
| | | |
| | | List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer(); |
| | | } |
| | | |
| | |
| | | Map<Integer, List<HollowBigStorageCage>> queryHollowbigStorageCageDetail(); |
| | | |
| | | List<Map<String, Object>> selectBigStorageCageUsage(); |
| | | |
| | | /** |
| | | * 复位:重置理片笼基础信息1、清除笼内状态为0的脏数据;2将空格子的尺寸置为初始尺寸 3、将不在笼内的流程卡的关系表重置 |
| | | * @return |
| | | */ |
| | | Boolean resetCage(); |
| | | } |
| | | |
| | |
| | | .eq(HollowBigStorageCage::getSlot, slot)); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer() { |
| | | return baseMapper.queryFlowCardIdsAndLayer(); |
| | | } |
| | | |
| | | private List<HollowBigStorageAndDetailsDTO> hollowBigStorageCageDetailsChild(String glassId, Integer deviceId, Integer slot, int state) { |
| | | //将对应格子号的玻璃id置为101 |
| | | this.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | |
| | | package com.mes.hollow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.hollow.entity.HollowBigStorageCage; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO; |
| | | import com.mes.hollow.entity.dto.HollowBigStorageAndDetailsDTO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | import com.mes.hollow.mapper.HollowBigStorageCageMapper; |
| | | import com.mes.hollow.mapper.HollowGlassRelationInfoMapper; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | | import com.mes.hollow.service.HollowBigStorageCageService; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Resource |
| | | private HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService; |
| | | @Resource |
| | | private HollowGlassRelationInfoMapper hollowGlassRelationInfoMapper; |
| | | |
| | | @Override |
| | | public List<HollowBigStorageAndDetailsDTO> queryHollowBigStorageCageDetail(HollowBigStorageDetailsQueryVO query) { |
| | | MPJLambdaWrapper<HollowBigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | |
| | | .groupBy("device_id"); |
| | | return baseMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean resetCage() { |
| | | // 复位:重置理片笼基础信息1、清除笼内状态为0的脏数据; |
| | | hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW)); |
| | | // 2将空格子的尺寸置为初始尺寸 |
| | | this.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, slotWidth) |
| | | .notIn(HollowBigStorageCage::getSlot, "select distinct slot from hollow_big_storage_cage_details where state in( 100 , 102 , 103 ,104)")); |
| | | // 3、将不在笼内的流程卡的关系表重置 |
| | | // 仅获取理片笼内的流程卡信息避免玻璃 |
| | | List<FlowCardVirtualSlotDTO> list = hollowBigStorageCageDetailsService.queryFlowCardIdsAndLayer(); |
| | | for (FlowCardVirtualSlotDTO item : list) { |
| | | hollowGlassRelationInfoMapper.clearDirtyFlowCardData(item.getFlowCardId(), item.getLayer()); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | |
| | |
| | | BigStorageTaskVO task = new BigStorageTaskVO(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | int isExistCount = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>().in(HollowBigStorageCageDetails::getGlassId, task.getGlassId()) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); |
| | | if (isExistCount > 0 && "0".equals(targetSlotWord.getValue() + "")) { |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (isExistCount > 0) { |
| | | task.setIsSame(1); |
| | | } else { |
| | | task.setIsSame(0); |
| | |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | //理片笼使用情况汇总 |
| | | HollowBigStorageDetailsQueryVO hollowBigStorageDetailsQueryVO=new HollowBigStorageDetailsQueryVO(); |
| | | List<FlowCardGlassInfoDTO> bigStorageCageUsageSummary= hollowGlassRelationInfoService.queryHollowAllFlowCardSummary(hollowBigStorageDetailsQueryVO); |
| | | HollowBigStorageDetailsQueryVO hollowBigStorageDetailsQueryVO = new HollowBigStorageDetailsQueryVO(); |
| | | List<FlowCardGlassInfoDTO> bigStorageCageUsageSummary = hollowGlassRelationInfoService.queryHollowAllFlowCardSummary(hollowBigStorageDetailsQueryVO); |
| | | jsonObject.append("bigStorageCageUsageSummary", bigStorageCageUsageSummary); |
| | | } |
| | | |
| | |
| | | <select id="hollowIsAll" resultMap="baseMap"> |
| | | WITH sum_flow_layer_count AS ( SELECT flow_card_id, layer, min( films_id ) AS films_id, min(thickness) as |
| | | thickness,count(*) AS sum_count FROM hollow_glass_relation_info GROUP BY flow_card_id, layer ), |
| | | real_flow_layer_count AS ( SELECT flow_card_id, layer, count(*) AS real_count, count(distinct slot) as slot_count FROM |
| | | real_flow_layer_count AS ( SELECT flow_card_id, layer, count(*) AS real_count, count(distinct slot) as |
| | | slot_count FROM |
| | | hollow_big_storage_cage_details t WHERE state = 100 GROUP BY flow_card_id, layer ), |
| | | damage_flow_layer_count AS ( SELECT process_id AS flow_card_id, technology_number AS layer, count(*) as |
| | | damage_count FROM damage where type in(8,9) GROUP BY process_id, technology_number ), |
| | |
| | | </select> |
| | | <select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO"> |
| | | select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count |
| | | from hollow_big_storage_cage hbsc left join hollow_big_storage_cage_details hbscd |
| | | on hbsc.slot=hbscd.slot and hbscd.state in (100, 102, 103, 104) |
| | | from hollow_big_storage_cage hbsc |
| | | left join hollow_big_storage_cage_details hbscd |
| | | on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104) |
| | | group by hbsc.device_id, hbsc.slot |
| | | order by hbsc.device_id, hbsc.slot |
| | | </select> |
| | |
| | | inner join hollow_sequence_temp t1 on t.hollow_sequence = t1.hollow_sequence |
| | | ORDER BY t.hollow_sequence |
| | | </select> |
| | | <select id="queryFlowCardIdsAndLayer" resultType="com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO"> |
| | | select flow_card_id, layer |
| | | from hollow_big_storage_cage_details |
| | | where state in (100, 102, 103, 104) |
| | | group by flow_card_id, layer |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <update id="clearDirtyFlowCardData"> |
| | | update hollow_glass_relation_info |
| | | set glass_id = null, |
| | | tempering_layout_id = null, |
| | | set glass_id = null, |
| | | tempering_layout_id = null, |
| | | tempering_feed_sequence = null, |
| | | engineer_id = null, |
| | | state = 0 |
| | | engineer_id = null, |
| | | state = 0 |
| | | where flow_card_id = #{flowCardId} |
| | | and layer = #{layer} |
| | | and glass_id not in ( |
| | | select glass_id |
| | | from hollow_big_storage_cage_details |
| | | where flow_card_id = #{flowCardId} and layer = #{layer} and state = 100 |
| | | where flow_card_id = #{flowCardId} |
| | | and layer = #{layer} |
| | | and state in (100, 102, 103, 104) |
| | | ) |
| | | </update> |
| | | </mapper> |