From 388d87d5534a056268777cd37d877075bc79929c Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 15 五月 2025 10:54:28 +0800 Subject: [PATCH] 产量列表 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentDayScheduleServiceImpl.java | 34 ++++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java | 15 ++- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDayScheduleMapper.xml | 21 +++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentDayScheduleVo.java | 16 ++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java | 8 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentDaySchedule.java | 12 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDaySummaryMapper.xml | 2 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentDayScheduleMapper.java | 5 + lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java | 8 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentDayScheduleService.java | 4 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentDayScheduleController.java | 56 ++++++++++++++ 11 files changed, 175 insertions(+), 6 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentDayScheduleController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentDayScheduleController.java new file mode 100644 index 0000000..58f9b13 --- /dev/null +++ b/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); + } +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentDaySchedule.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentDaySchedule.java index 0856c72..301cea6 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentDaySchedule.java +++ b/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 姝e父 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; } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentDayScheduleMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentDayScheduleMapper.java index d63150b..c97aa73 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentDayScheduleMapper.java +++ b/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); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDayScheduleMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDayScheduleMapper.xml index 864dff2..60b9386 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDayScheduleMapper.xml +++ b/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> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDaySummaryMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDaySummaryMapper.xml index 8e7dbf1..14fc4c1 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentDaySummaryMapper.xml +++ b/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> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentDayScheduleService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentDayScheduleService.java index 906ba4d..f7e22f1 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentDayScheduleService.java +++ b/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); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentDayScheduleServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentDayScheduleServiceImpl.java index 07e78b8..7b91e0c 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentDayScheduleServiceImpl.java +++ b/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; + } } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentDayScheduleVo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentDayScheduleVo.java new file mode 100644 index 0000000..82d724b --- /dev/null +++ b/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; +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java index 5852dc8..affc0d5 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java +++ b/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); + } + } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java index 8d768a5..a0c7d02 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java +++ b/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); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java index 98d6757..6f34ebc 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java +++ b/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) { -- Gitblit v1.9.3