lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentDayScheduleController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,56 @@ package org.jeecg.modules.mdc.controller; /** * @Author: Lius * @CreateTime: 2025-05-14 * @Description: */ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; import org.jeecg.modules.mdc.service.IMdcEquipmentDayScheduleService; import org.jeecg.modules.mdc.vo.MdcEquipmentDayScheduleVo; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @Slf4j @Api(tags = "è®¾å¤æ¥è®¡å") @RestController @RequestMapping("/mdc/mdcEquipmentOverFla") public class MdcEquipmentDayScheduleController extends JeecgController<MdcEquipmentDaySchedule, IMdcEquipmentDayScheduleService> { @Resource private IMdcEquipmentDayScheduleService mdcEquipmentDayScheduleService; /** * å页å表æ¥è¯¢ * * @param mdcEquipmentDayScheduleVo * @param pageNo * @param pageSize * @param req * @return */ @AutoLog(value = "è®¾å¤æ¥è®¡å-å页å表æ¥è¯¢") @ApiOperation(value = "è®¾å¤æ¥è®¡å-å页å表æ¥è¯¢", notes = "è®¾å¤æ¥è®¡å-å页å表æ¥è¯¢") @GetMapping(value = "/list") public Result<?> queryPageList(MdcEquipmentDayScheduleVo mdcEquipmentDayScheduleVo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { Page<MdcEquipmentDaySchedule> page = new Page<MdcEquipmentDaySchedule>(pageNo, pageSize); IPage<MdcEquipmentDaySchedule> pageList = mdcEquipmentDayScheduleService.pageList(mdcEquipmentDayScheduleVo, page); return Result.OK(pageList); } } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentDaySchedule.java
@@ -1,5 +1,6 @@ package org.jeecg.modules.mdc.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -9,6 +10,7 @@ import org.jeecg.common.system.base.entity.JeecgEntity; import java.io.Serializable; import java.math.BigDecimal; @Data @TableName("mdc_equipment_day_schedule") @@ -97,6 +99,14 @@ /** * 1 æ£å¸¸ 2 åæ¶ 3 å é¤ */ @ApiModelProperty(value = "æ§å¶ç³»ç»ç±»å") @ApiModelProperty(value = "ç¶æ") private String taskType; @TableField(exist = false) @ApiModelProperty(value = "宿ç¾åæ¯") private BigDecimal qualifiedRate = BigDecimal.ZERO; @TableField(exist = false) @ApiModelProperty(value = "æ¯å¦å®æ") private String qualifiedStatus; } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentDayScheduleMapper.java
@@ -1,7 +1,12 @@ package org.jeecg.modules.mdc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; import org.jeecg.modules.mdc.vo.MdcEquipmentDayScheduleVo; public interface MdcEquipmentDayScheduleMapper extends BaseMapper<MdcEquipmentDaySchedule> { IPage<MdcEquipmentDaySchedule> pageList(@Param("vo") MdcEquipmentDayScheduleVo mdcEquipmentDayScheduleVo, Page<MdcEquipmentDaySchedule> page); } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDayScheduleMapper.xml
@@ -2,4 +2,25 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentDayScheduleMapper"> <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule"> SELECT t4.id id, t4.production_name dept, t1.mds_item_code mdsItemCode, t1.batch_num batchNum, t1.qualified_qty qualified_qty FROM mdc_equipment_day_schedule t1 INNER JOIN mdc_equipment t2 ON t1.equipment_id = t2.equipment_id INNER JOIN mdc_production_equipment t3 ON t2.id = t3.equipment_id INNER JOIN mdc_production t4 ON t3.production_id = t4.id WHERE TO_CHAR(t1.dispatch_date, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM') AND t4.parent_id = #{vo.productionId} <if test="vo.proChildId != null and vo.proChildId != ''"> AND t4.id = #{vo.proChildId} </if> ORDER BY t1.dispatch_date DESC </select> </mapper> lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDaySummaryMapper.xml
@@ -13,6 +13,6 @@ INNER JOIN mdc_production t4 ON t3.production_id = t4.id WHERE t4.parent_id = #{productionId} AND TO_CHAR(t1.create_time, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM'); AND TO_CHAR(t1.create_time, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM') </select> </mapper> lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentDayScheduleService.java
@@ -1,7 +1,11 @@ package org.jeecg.modules.mdc.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; import org.jeecg.modules.mdc.vo.MdcEquipmentDayScheduleVo; public interface IMdcEquipmentDayScheduleService extends IService<MdcEquipmentDaySchedule> { IPage<MdcEquipmentDaySchedule> pageList(MdcEquipmentDayScheduleVo mdcEquipmentDayScheduleVo, Page<MdcEquipmentDaySchedule> page); } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentDayScheduleServiceImpl.java
@@ -1,10 +1,19 @@ package org.jeecg.modules.mdc.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; import org.jeecg.modules.mdc.mapper.MdcEquipmentDayScheduleMapper; import org.jeecg.modules.mdc.service.IMdcEquipmentDayScheduleService; import org.jeecg.modules.mdc.vo.MdcEquipmentDayScheduleVo; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.service.IMdcProductionService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; /** * @Author: Lius @@ -13,4 +22,29 @@ */ @Service public class MdcEquipmentDayScheduleServiceImpl extends ServiceImpl<MdcEquipmentDayScheduleMapper, MdcEquipmentDaySchedule> implements IMdcEquipmentDayScheduleService { @Resource private IMdcProductionService mdcProductionService; @Override public IPage<MdcEquipmentDaySchedule> pageList(MdcEquipmentDayScheduleVo mdcEquipmentDayScheduleVo, Page<MdcEquipmentDaySchedule> page) { IPage<MdcEquipmentDaySchedule> mdcEquipmentDayScheduleIPage = this.baseMapper.pageList(mdcEquipmentDayScheduleVo, page); if (mdcEquipmentDayScheduleIPage.getRecords() != null && !mdcEquipmentDayScheduleIPage.getRecords().isEmpty()) { MdcProduction mdcProduction = mdcProductionService.getById(mdcEquipmentDayScheduleVo.getProductionId()); mdcEquipmentDayScheduleIPage.getRecords().forEach(mdcEquipmentDaySchedule -> { mdcEquipmentDaySchedule.setWorkshop(mdcProduction.getProductionName()); BigDecimal batchNum = new BigDecimal(mdcEquipmentDaySchedule.getBatchNum()); BigDecimal qualifiedQty = new BigDecimal(mdcEquipmentDaySchedule.getQualifiedQty()); if (batchNum.compareTo(BigDecimal.ZERO) != 0) { mdcEquipmentDaySchedule.setQualifiedRate(qualifiedQty.multiply(new BigDecimal("100")).divide(batchNum, 2, RoundingMode.HALF_UP)); } if (batchNum.compareTo(qualifiedQty) > 0) { mdcEquipmentDaySchedule.setQualifiedStatus("æªå®æ"); } else { mdcEquipmentDaySchedule.setQualifiedStatus("已宿"); } }); } return mdcEquipmentDayScheduleIPage; } } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentDayScheduleVo.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ package org.jeecg.modules.mdc.vo; import lombok.Data; import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; /** * @Author: Lius * @CreateTime: 2025-05-14 * @Description: */ @Data public class MdcEquipmentDayScheduleVo extends MdcEquipmentDaySchedule { private String productionId; private String proChildId; } lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java
@@ -7,6 +7,7 @@ import org.jeecg.modules.screen.dto.AlarmInfoDto; import org.jeecg.modules.screen.dto.EquipmentStatusOverview; import org.jeecg.modules.screen.service.MdcLargeScreenService; import org.jeecg.modules.system.entity.MdcProduction; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -64,4 +65,11 @@ return Result.OK(result); } @ApiOperation(value = "大å±çæ¿-工段å表", notes = "大å±çæ¿-工段å表") @GetMapping("/productionList") public Result<List<MdcProduction>> productionList(String productionId) { List<MdcProduction> result = mdcLargeScreenService.productionList(productionId); return Result.OK(result); } } lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java
@@ -2,6 +2,7 @@ import org.jeecg.modules.screen.dto.AlarmInfoDto; import org.jeecg.modules.screen.dto.EquipmentStatusOverview; import org.jeecg.modules.system.entity.MdcProduction; import java.util.List; import java.util.Map; @@ -52,4 +53,11 @@ * @return */ List<AlarmInfoDto> getAlarmInfo(String productionId); /** * 工段å表 * @param productionId * @return */ List<MdcProduction> productionList(String productionId); } lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java
@@ -20,10 +20,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.*; import java.util.stream.Collectors; /** @@ -242,6 +239,16 @@ } /** * 工段å表 * @param productionId * @return */ @Override public List<MdcProduction> productionList(String productionId) { return mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, productionId).eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0)); } /** * å建åç产çæåº¦å©ç¨ç DTO */ private UtilizationRateDto createUtilizationMonthDto(MdcProduction mdcProduction, List<String[]> dateLists) {