Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
| | |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.entity.request.BigStorageCageHistoryRequest; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | public Result<Page<BigStorageCageHistoryTask>> queryBigStorageCageHistoryTask(@RequestBody @Validated BigStorageCageHistoryRequest request) { |
| | | return Result.build(200, "查询成功", bigStorageCageHistoryTaskService.queryBigStorageCageHistoryTask(request)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询本条线历史指定日期的日生产数据", notes = "查询本条线历史指定日期的日生产数据") |
| | | @PostMapping("/queryBigDailyProduction") |
| | | public Result<DailyProductionVO> queryBigDailyProduction(@RequestBody BigStorageCageHistoryRequest request) { |
| | | return Result.success(bigStorageCageHistoryTaskService.queryBigDailyProduction(request)); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表数据库访问层 |
| | |
| | | */ |
| | | public interface BigStorageCageHistoryTaskMapper extends BaseMapper<BigStorageCageHistoryTask> { |
| | | |
| | | DailyProductionVO queryBigDailyProduction(@Param("beginDate") String beginDate, @Param("endDate") String endDate); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.entity.request.BigStorageCageHistoryRequest; |
| | | |
| | | import java.util.List; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表服务接口 |
| | |
| | | public interface BigStorageCageHistoryTaskService extends IService<BigStorageCageHistoryTask> { |
| | | |
| | | Page<BigStorageCageHistoryTask> queryBigStorageCageHistoryTask(BigStorageCageHistoryRequest request); |
| | | |
| | | DailyProductionVO queryBigDailyProduction(BigStorageCageHistoryRequest request); |
| | | } |
| | | |
| | |
| | | import com.mes.bigstoragecagetask.entity.request.BigStorageCageHistoryRequest; |
| | | import com.mes.bigstoragecagetask.mapper.BigStorageCageHistoryTaskMapper; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.tools.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表服务实现类 |
| | |
| | | .orderByDesc(BigStorageCageHistoryTask::getCreateTime); |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public DailyProductionVO queryBigDailyProduction(BigStorageCageHistoryRequest request) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String beginDate = null; |
| | | String endDate = null; |
| | | if (com.baomidou.mybatisplus.core.toolkit.StringUtils.checkValNotNull(request.getBeginDate())) { |
| | | beginDate = sdf.format(request.getBeginDate()); |
| | | endDate = sdf.format(request.getEndDate()); |
| | | } |
| | | return baseMapper.queryBigDailyProduction(beginDate, endDate); |
| | | } |
| | | } |
| | | |
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.bigstoragecagetask.mapper.BigStorageCageHistoryTaskMapper"> |
| | | |
| | | <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="queryBigDailyProduction" resultMap="baseMap"> |
| | | with big_storage_in_temp as ( |
| | | select 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 |
| | | <if test="beginDate != null and beginDate != ''"> |
| | | AND STR_TO_DATE( t.create_time, '%Y-%m-%d' ) BETWEEN #{beginDate} |
| | | AND #{endDate} |
| | | </if> |
| | | ), |
| | | big_storage_out_temp as ( |
| | | select 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 |
| | | <if test="beginDate != null and beginDate != ''"> |
| | | AND STR_TO_DATE( t.create_time, '%Y-%m-%d' ) BETWEEN #{beginDate} |
| | | AND #{endDate} |
| | | </if> |
| | | ) |
| | | select * |
| | | from big_storage_in_temp |
| | | INNER join big_storage_out_temp on 1 = 1 |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | glassAndFrame.setFrameList(frameList); |
| | | glassAndFrameList.add(glassAndFrame); |
| | | }); |
| | | Collections.sort(glassAndFrameList, (s1, s2) -> Integer.parseInt(s1.getItemNum()) - Integer.parseInt(s2.getItemNum())); |
| | | details.setGlassAndFrameList(glassAndFrameList); |
| | | |
| | | |
| | |
| | | if (930 == request.getCell()) { |
| | | Map<Integer, List<HollowBigStorageCageDetails>> listMap = hollowBigStorageCageDetailsList.stream() |
| | | .collect(Collectors.groupingBy(HollowBigStorageCageDetails::getHollowSequence)); |
| | | List<List<HollowGlassQueueInfo>> disorderList = new ArrayList<>(); |
| | | for (Map.Entry<Integer, List<HollowBigStorageCageDetails>> entry : listMap.entrySet()) { |
| | | //创建队列接收不满足成对情况下:一对玻璃分几次上车的次序问题 |
| | | List<HollowGlassQueueInfo> tempList = new ArrayList<>(); |
| | |
| | | for (HollowBigStorageCageDetails item : reverse) { |
| | | remainWidth = remainWidth - (int) Math.max(item.getWidth(), item.getHeight()); |
| | | if (remainWidth < 0) { |
| | | hollowQueues.addAll(CollectionUtil.reverse(tempList)); |
| | | disorderList.add(CollectionUtil.reverse(tempList)); |
| | | tempList = new ArrayList<>(); |
| | | remainWidth = carWidth - (int) Math.max(item.getWidth(), item.getHeight()); |
| | | } |
| | |
| | | tempList.add(queueInfo); |
| | | remainWidth = remainWidth - glassGap; |
| | | } |
| | | hollowQueues.addAll(CollectionUtil.reverse(tempList)); |
| | | disorderList.add(CollectionUtil.reverse(tempList)); |
| | | HollowBigStorageCageDetails cageDetails = entry.getValue().get(0); |
| | | if (cageDetails.getIsPair() == 1) { |
| | | isPairCount = isPairCount - cageDetails.getTotalLayer(); |
| | |
| | | } |
| | | } |
| | | } |
| | | //防止玻璃中空线玻璃无序,将玻璃按照顺序重新排序 |
| | | Collections.sort(disorderList, (s1, s2) -> s1.get(0).getHollowSequence() - s2.get(0).getHollowSequence()); |
| | | for (List<HollowGlassQueueInfo> list : disorderList) { |
| | | hollowQueues.addAll(list); |
| | | } |
| | | } else { |
| | | loop: |
| | | for (HollowBigStorageCageDetails item : hollowBigStorageCageDetailsList) { |
| | |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | import com.mes.hollowtask.entity.request.HollowBigStorageCageHistoryRequest; |
| | | import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表控制层 |
| | |
| | | public Result<Page<HollowBigStorageCageHistoryTask>> queryHollowBigStorageCageHistoryTask(@RequestBody @Validated HollowBigStorageCageHistoryRequest request) { |
| | | return Result.build(200, "查询成功", hollowBigStorageCageHistoryTaskService.queryHollowBigStorageCageHistoryTask(request)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询本条线历史指定日期的日生产数据", notes = "查询本条线历史指定日期的日生产数据") |
| | | @PostMapping("/queryHollowDailyProduction") |
| | | public Result<DailyProductionVO> queryHollowDailyProduction(@RequestBody HollowBigStorageCageHistoryRequest request) { |
| | | return Result.success(hollowBigStorageCageHistoryTaskService.queryHollowDailyProduction(request)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表数据库访问层 |
| | |
| | | */ |
| | | public interface HollowBigStorageCageHistoryTaskMapper extends BaseMapper<HollowBigStorageCageHistoryTask> { |
| | | |
| | | DailyProductionVO queryHollowDailyProduction(@Param("beginDate") String beginDate, @Param("endDate") String endDate); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.hollowtask.entity.HollowBigStorageCageHistoryTask; |
| | | import com.mes.hollowtask.entity.request.HollowBigStorageCageHistoryRequest; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表服务接口 |
| | |
| | | public interface HollowBigStorageCageHistoryTaskService extends IService<HollowBigStorageCageHistoryTask> { |
| | | |
| | | Page<HollowBigStorageCageHistoryTask> queryHollowBigStorageCageHistoryTask(HollowBigStorageCageHistoryRequest request); |
| | | |
| | | DailyProductionVO queryHollowDailyProduction(HollowBigStorageCageHistoryRequest request); |
| | | } |
| | | |
| | |
| | | import com.mes.hollowtask.entity.request.HollowBigStorageCageHistoryRequest; |
| | | import com.mes.hollowtask.mapper.HollowBigStorageCageHistoryTaskMapper; |
| | | import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.tools.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageHistoryTask)表服务实现类 |
| | |
| | | } |
| | | LambdaQueryWrapper<HollowBigStorageCageHistoryTask> wrapper = new LambdaQueryWrapper<HollowBigStorageCageHistoryTask>() |
| | | .like(StringUtils.isBlank(request.getGlassId()), HollowBigStorageCageHistoryTask::getGlassId, request.getGlassId()) |
| | | .eq(request.getStartSlot() !=0, HollowBigStorageCageHistoryTask::getStartSlot, request.getStartSlot()) |
| | | .eq(request.getTargetSlot() !=0, HollowBigStorageCageHistoryTask::getTargetSlot, request.getTargetSlot()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()) , HollowBigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()) , HollowBigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) |
| | | .eq(request.getStartSlot() != 0, HollowBigStorageCageHistoryTask::getStartSlot, request.getStartSlot()) |
| | | .eq(request.getTargetSlot() != 0, HollowBigStorageCageHistoryTask::getTargetSlot, request.getTargetSlot()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()), HollowBigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()), HollowBigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) |
| | | .between(HollowBigStorageCageHistoryTask::getCreateTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(HollowBigStorageCageHistoryTask::getCreateTime); |
| | | return this.page(page,wrapper); |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public DailyProductionVO queryHollowDailyProduction(HollowBigStorageCageHistoryRequest request) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String beginDate = null; |
| | | String endDate = null; |
| | | if (com.baomidou.mybatisplus.core.toolkit.StringUtils.checkValNotNull(request.getBeginDate())) { |
| | | beginDate = sdf.format(request.getBeginDate()); |
| | | endDate = sdf.format(request.getEndDate()); |
| | | } |
| | | return baseMapper.queryHollowDailyProduction(beginDate, endDate); |
| | | } |
| | | } |
| | | |
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.hollowtask.mapper.HollowBigStorageCageHistoryTaskMapper"> |
| | | |
| | | <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="queryHollowDailyProduction" resultMap="baseMap"> |
| | | with hollow_out_one_temp as ( |
| | | select 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 |
| | | <if test="beginDate != null and beginDate != ''"> |
| | | AND STR_TO_DATE( t.create_time, '%Y-%m-%d' ) BETWEEN #{beginDate} |
| | | AND #{endDate} |
| | | </if> |
| | | ), |
| | | hollow_out_two_temp as ( |
| | | select 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 |
| | | <if test="beginDate != null and beginDate != ''"> |
| | | AND STR_TO_DATE( t.create_time, '%Y-%m-%d' ) BETWEEN #{beginDate} |
| | | AND #{endDate} |
| | | </if> |
| | | ) |
| | | select * |
| | | from hollow_out_one_temp |
| | | inner join hollow_out_two_temp on 1 = 1 |
| | | </select> |
| | | </mapper> |