已重命名1个文件
已添加55个文件
已修改26个文件
已删除2个文件
| | |
| | | Integer AUTO_FLAG_Y = 1; |
| | | Integer AUTO_FLAG_N = 2; |
| | | |
| | | /** |
| | | * åæ è½´ç±»å |
| | | */ |
| | | String AXIS_TYPE = "axis_type"; |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | |
| | | 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.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.dto.EquipmentElectricStatisticalDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | |
| | | 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.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical; |
| | | import org.jeecg.modules.mdc.service.IEquipmentSpindleStatisticalService; |
| | |
| | | @RequestMapping("/mdc/home") |
| | | public class MdcHomeController { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | // @Resource |
| | | // private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | @Resource |
| | | private IMdcProductionService mdcProductionService; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/24 15:10 |
| | | */ |
| | | @Data |
| | | public class CurrentElectricHistoryDto { |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | private Date collectTime; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentID; |
| | | /** |
| | | * xè½´çµæµ |
| | | */ |
| | | private String xCurrent; |
| | | /** |
| | | * yè½´çµæµ |
| | | */ |
| | | private String yCurrent; |
| | | /** |
| | | * zè½´çµæµ |
| | | */ |
| | | private String zCurrent; |
| | | /** |
| | | * aè½´çµæµ |
| | | */ |
| | | private String aCurrent; |
| | | /** |
| | | * bè½´çµæµ |
| | | */ |
| | | private String bCurrent; |
| | | /** |
| | | * daoè§£ææ°æ®ä½¿ç¨ |
| | | */ |
| | | private String currentValue; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/24 15:41 |
| | | */ |
| | | @Data |
| | | public class EquipmentMachiningHistoryDto { |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | private Date collectTime; |
| | | /** |
| | | * 设å¤ID |
| | | */ |
| | | private String equipmentID; |
| | | /** |
| | | * 主轴è´è½½ |
| | | */ |
| | | private String spindleLoad; |
| | | /** |
| | | * 主轴转é |
| | | */ |
| | | private String spindleSpeed; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/29 11:40 |
| | | */ |
| | | @Data |
| | | public class MachineXYZHistoryDto { |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | private Date collectTime; |
| | | /** |
| | | * 设å¤ID |
| | | */ |
| | | private String equipmentID; |
| | | /** |
| | | * Xè½´åæ å¼ |
| | | */ |
| | | private String xMachine; |
| | | /** |
| | | * Yè½´åæ å¼ |
| | | */ |
| | | private String yMachine; |
| | | /** |
| | | * Zè½´åæ å¼ |
| | | */ |
| | | private String zMachine; |
| | | /** |
| | | * Aè½´åæ å¼ |
| | | */ |
| | | private String aMachine; |
| | | /** |
| | | * Bè½´åæ å¼ |
| | | */ |
| | | private String bMachine; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * @Description: 设å¤åæ å¼è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-18 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("CurrentXYZ_History") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CurrentXYZ_History对象", description = "设å¤åæ å¼è¡¨") |
| | | public class CurrentXYZHistory { |
| | | |
| | | /** |
| | | * equipmentid |
| | | */ |
| | | @ApiModelProperty(value = "equipmentid") |
| | | private String equipmentid; |
| | | /** |
| | | * collecttime |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "collecttime") |
| | | private java.util.Date collecttime; |
| | | /** |
| | | * xcurrent |
| | | */ |
| | | @ApiModelProperty(value = "xcurrent") |
| | | private String xcurrent; |
| | | /** |
| | | * ycurrent |
| | | */ |
| | | @ApiModelProperty(value = "ycurrent") |
| | | private String ycurrent; |
| | | /** |
| | | * zcurrent |
| | | */ |
| | | @ApiModelProperty(value = "zcurrent") |
| | | private String zcurrent; |
| | | /** |
| | | * acurrent |
| | | */ |
| | | @ApiModelProperty(value = "acurrent") |
| | | private String acurrent; |
| | | /** |
| | | * bcurrent |
| | | */ |
| | | @ApiModelProperty(value = "bcurrent") |
| | | private String bcurrent; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("EquipmentMachining") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "EquipmentMachining对象", description = "设å¤è½¬éè´è½½è¡¨") |
| | | public class EquipmentMachining implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6265153727180497096L; |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentid; |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | @Excel(name = "ééæ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "ééæ¶é´") |
| | | private Date collecttime; |
| | | /** |
| | | * p3 |
| | | */ |
| | | @Excel(name = "p3", width = 15) |
| | | @ApiModelProperty(value = "p3") |
| | | private String p3; |
| | | /** |
| | | * p4 |
| | | */ |
| | | @Excel(name = "p4", width = 15) |
| | | @ApiModelProperty(value = "p4") |
| | | private String p4; |
| | | /** |
| | | * p5 |
| | | */ |
| | | @Excel(name = "p5", width = 15) |
| | | @ApiModelProperty(value = "p5") |
| | | private String p5; |
| | | /** |
| | | * p6 |
| | | */ |
| | | @Excel(name = "p6", width = 15) |
| | | @ApiModelProperty(value = "p6") |
| | | private String p6; |
| | | /** |
| | | * p7 |
| | | */ |
| | | @Excel(name = "p7", width = 15) |
| | | @ApiModelProperty(value = "p7") |
| | | private String p7; |
| | | /** |
| | | * p8 |
| | | */ |
| | | @Excel(name = "p8", width = 15) |
| | | @ApiModelProperty(value = "p8") |
| | | private String p8; |
| | | /** |
| | | * p9 |
| | | */ |
| | | @Excel(name = "p9", width = 15) |
| | | @ApiModelProperty(value = "p9") |
| | | private String p9; |
| | | /** |
| | | * p10 |
| | | */ |
| | | @Excel(name = "p10", width = 15) |
| | | @ApiModelProperty(value = "p10") |
| | | private String p10; |
| | | /** |
| | | * p11 |
| | | */ |
| | | @Excel(name = "p11", width = 15) |
| | | @ApiModelProperty(value = "p11") |
| | | private String p11; |
| | | /** |
| | | * p12 |
| | | */ |
| | | @Excel(name = "p12", width = 15) |
| | | @ApiModelProperty(value = "p12") |
| | | private String p12; |
| | | /** |
| | | * p13 |
| | | */ |
| | | @Excel(name = "p13", width = 15) |
| | | @ApiModelProperty(value = "p13") |
| | | private String p13; |
| | | /** |
| | | * p14 |
| | | */ |
| | | @Excel(name = "p14", width = 15) |
| | | @ApiModelProperty(value = "p14") |
| | | private String p14; |
| | | /** |
| | | * p15 |
| | | */ |
| | | @Excel(name = "p15", width = 15) |
| | | @ApiModelProperty(value = "p15") |
| | | private String p15; |
| | | /** |
| | | * p16 |
| | | */ |
| | | @Excel(name = "p16", width = 15) |
| | | @ApiModelProperty(value = "p16") |
| | | private String p16; |
| | | /** |
| | | * p17 |
| | | */ |
| | | @Excel(name = "p17", width = 15) |
| | | @ApiModelProperty(value = "p17") |
| | | private String p17; |
| | | /** |
| | | * p18 |
| | | */ |
| | | @Excel(name = "p18", width = 15) |
| | | @ApiModelProperty(value = "p18") |
| | | private String p18; |
| | | /** |
| | | * p19 |
| | | */ |
| | | @Excel(name = "p19", width = 15) |
| | | @ApiModelProperty(value = "p19") |
| | | private String p19; |
| | | /** |
| | | * p20 |
| | | */ |
| | | @Excel(name = "p20", width = 15) |
| | | @ApiModelProperty(value = "p20") |
| | | private String p20; |
| | | /** |
| | | * p21 |
| | | */ |
| | | @Excel(name = "p21", width = 15) |
| | | @ApiModelProperty(value = "p21") |
| | | private String p21; |
| | | /** |
| | | * p22 |
| | | */ |
| | | @Excel(name = "p22", width = 15) |
| | | @ApiModelProperty(value = "p22") |
| | | private String p22; |
| | | /** |
| | | * p23 |
| | | */ |
| | | @Excel(name = "p23", width = 15) |
| | | @ApiModelProperty(value = "p23") |
| | | private String p23; |
| | | /** |
| | | * p24 |
| | | */ |
| | | @Excel(name = "p24", width = 15) |
| | | @ApiModelProperty(value = "p24") |
| | | private String p24; |
| | | /** |
| | | * p25 |
| | | */ |
| | | @Excel(name = "p25", width = 15) |
| | | @ApiModelProperty(value = "p25") |
| | | private String p25; |
| | | /** |
| | | * p26 |
| | | */ |
| | | @Excel(name = "p26", width = 15) |
| | | @ApiModelProperty(value = "p26") |
| | | private String p26; |
| | | /** |
| | | * p27 |
| | | */ |
| | | @Excel(name = "p27", width = 15) |
| | | @ApiModelProperty(value = "p27") |
| | | private String p27; |
| | | /** |
| | | * p28 |
| | | */ |
| | | @Excel(name = "p28", width = 15) |
| | | @ApiModelProperty(value = "p28") |
| | | private String p28; |
| | | /** |
| | | * p29 |
| | | */ |
| | | @Excel(name = "p29", width = 15) |
| | | @ApiModelProperty(value = "p29") |
| | | private String p29; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½åå²è¡¨ |
| | | * @Author: Lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("EquipmentMachining_History") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "EquipmentMachining_History对象", description = "设å¤è½¬éè´è½½åå²è¡¨") |
| | | public class EquipmentMachiningHistory implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 564127289735401596L; |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentid; |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | @Excel(name = "ééæ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "ééæ¶é´") |
| | | private Date collecttime; |
| | | /** |
| | | * 主轴è´è½½ |
| | | */ |
| | | @Excel(name = "主轴è´è½½", width = 15) |
| | | @ApiModelProperty(value = "主轴è´è½½") |
| | | private String spindleload; |
| | | /** |
| | | * 主轴转é |
| | | */ |
| | | @Excel(name = "主轴转é", width = 15) |
| | | @ApiModelProperty(value = "主轴转é") |
| | | private String spindlespeed; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: åå²è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-29 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("MachineXYZ_History") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "MachineXYZ_History对象", description = "åå²è¡¨") |
| | | public class MachineXYZHistory implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 5921084425438371855L; |
| | | |
| | | /** |
| | | * 设å¤ID |
| | | */ |
| | | @ApiModelProperty(value = "设å¤ID") |
| | | private String equipmentid; |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "ééæ¶é´") |
| | | private Date collecttime; |
| | | /** |
| | | * Xè½´åæ å¼ |
| | | */ |
| | | @ApiModelProperty(value = "Xè½´åæ å¼") |
| | | private String xmachine; |
| | | /** |
| | | * Yè½´åæ å¼ |
| | | */ |
| | | @ApiModelProperty(value = "Yè½´åæ å¼") |
| | | private String ymachine; |
| | | /** |
| | | * Zè½´åæ å¼ |
| | | */ |
| | | @ApiModelProperty(value = "Zè½´åæ å¼") |
| | | private String zmachine; |
| | | /** |
| | | * Aè½´åæ å¼ |
| | | */ |
| | | @ApiModelProperty(value = "Aè½´åæ å¼") |
| | | private String amachine; |
| | | /** |
| | | * Bè½´åæ å¼ |
| | | */ |
| | | @ApiModelProperty(value = "Bè½´åæ å¼") |
| | | private String bmachine; |
| | | } |
| | |
| | | log.info("设å¤ç¶æé¿ææ å忥è¦ä»»å¡ RunningEquipmentStatusJob start! æ¶é´:" + DateUtils.getNow()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | List<MdcEquipment> equipmentList = mdcEquipmentService.list(new LambdaQueryWrapper<>()); |
| | | List<MdcEquipment> equipmentList = mdcEquipmentService.list(); |
| | | // List<MdcEquipment> equipmentList = mdcEquipmentService.list(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, "3140045")); |
| | | // è·åå©ç¨çå¤å®å¤©æ° |
| | | List<DictModel> dictModelList1 = sysDictService.queryEnableDictItemsByCode(CommonConstant.DICT_EQUIPMENT_RATE_JUDGE); |
| | |
| | | } else { |
| | | date = DateUtils.format(DateUtils.getNow(), DateUtils.STR_DATE); |
| | | } |
| | | List<MdcEquipment> equipmentList = mdcEquipmentService.list(new LambdaQueryWrapper<>()); |
| | | List<MdcEquipment> equipmentList = mdcEquipmentService.list(); |
| | | MdcSystemParameters mdcSystemParameters = mdcSystemParametersService.getOne(new LambdaQueryWrapper<MdcSystemParameters>().eq(MdcSystemParameters::getCode, "equip_log_statis_time")); |
| | | if (mdcSystemParameters == null) { |
| | | throw new JobExecutionException("mdc_system_parameters è¡¨ä¸æ°æ®ç¼ºå¤±"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.mdc.dto.CurrentElectricHistoryDto; |
| | | import org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto; |
| | | import org.jeecg.modules.mdc.dto.MachineXYZHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.Equipment; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | import org.jeecg.modules.mdc.service.*; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设å¤è¿è¡æå¤§çµæµç»è®¡ |
| | | * |
| | | * @author Lius |
| | | * @date 2024/7/18 15:59 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class StatisticalElectricJob implements Job { |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IEquipmentService equipmentService; |
| | | |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | |
| | | @Resource |
| | | private IEquipmentElectricStatisticalService equipmentElectricStatisticalService; |
| | | |
| | | @Resource |
| | | private ICurrentXYZHistoryService currentXYZHistoryService; |
| | | |
| | | @Resource |
| | | private IMachineXYZHistoryService machineXYZHistoryService; |
| | | |
| | | @Resource |
| | | private IEquipmentMachiningHistoryService equipmentMachiningHistoryService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("设å¤è¿è¡æå¤§çµæµç»è®¡ StatisticalElectricJob start! æ¶é´:" + DateUtils.getNow()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | List<Equipment> equipmentList = equipmentService.list(); |
| | | if (equipmentList != null && !equipmentList.isEmpty()) { |
| | | Date initDate = null; |
| | | EquipmentElectricStatistical electricStatistical; |
| | | List<EquipmentElectricStatistical> resultList = new ArrayList<>(); |
| | | List<DictModel> dictList = sysDictService.queryEnableDictItemsByCode(CommonConstant.AXIS_TYPE); |
| | | if (dictList != null && !dictList.isEmpty()) { |
| | | for (Equipment equipment : equipmentList) { |
| | | Date lastDate = equipmentElectricStatisticalService.getMaxDate(equipment.getEquipmentid()); |
| | | if (lastDate == null) { |
| | | Date minCollectTime = currentXYZHistoryService.getMinDate(equipment.getEquipmentid()); |
| | | if (minCollectTime == null) { |
| | | continue; |
| | | } |
| | | initDate = DateUtils.removeTime(minCollectTime); |
| | | } |
| | | for (DictModel dictModel : dictList) { |
| | | electricStatistical = new EquipmentElectricStatistical(); |
| | | Integer axisType = Integer.parseInt(dictModel.getValue()); |
| | | CurrentElectricHistoryDto currentElectricHistoryDto = currentXYZHistoryService.getMaxElectric(equipment.getEquipmentid(), axisType, initDate, DateUtils.plusTime(initDate, 1)); |
| | | if (currentElectricHistoryDto == null || currentElectricHistoryDto.getEquipmentID() == null || currentElectricHistoryDto.getCollectTime() == null) { |
| | | initDate = DateUtils.plusTime(initDate, 1); |
| | | continue; |
| | | } |
| | | electricStatistical.setAxistype(axisType); |
| | | electricStatistical.setEquipmentid(equipment.getEquipmentid()); |
| | | electricStatistical.setEquipmentname(equipment.getEquipmentname()); |
| | | electricStatistical.setElectrictime(currentElectricHistoryDto.getCollectTime()); |
| | | electricStatistical.setElectricvalue(currentElectricHistoryDto.getCurrentValue()); |
| | | electricStatistical.setCreatedate(initDate); |
| | | EquipmentMachiningHistoryDto machiningHistoryDto = equipmentMachiningHistoryService.getNearTimeSpindleLoad(equipment.getEquipmentid(), initDate, DateUtils.plusTime(initDate, 1), currentElectricHistoryDto.getCollectTime()); |
| | | if (machiningHistoryDto != null) { |
| | | electricStatistical.setSpindlespeed(machiningHistoryDto.getSpindleSpeed()); |
| | | electricStatistical.setSpindleload(machiningHistoryDto.getSpindleLoad()); |
| | | electricStatistical.setSpindletime(machiningHistoryDto.getCollectTime()); |
| | | } |
| | | MachineXYZHistoryDto machineXYZHistoryDto = machineXYZHistoryService.getNearAxisType(equipment.getEquipmentid(), initDate, DateUtils.plusTime(initDate, 1), currentElectricHistoryDto.getCollectTime()); |
| | | if (machineXYZHistoryDto != null) { |
| | | electricStatistical.setAxistime(machineXYZHistoryDto.getCollectTime()); |
| | | if (axisType == 1) { |
| | | electricStatistical.setAxisvalue(machineXYZHistoryDto.getXMachine()); |
| | | } else if (axisType == 2) { |
| | | electricStatistical.setAxisvalue(machineXYZHistoryDto.getYMachine()); |
| | | } else if (axisType == 3) { |
| | | electricStatistical.setAxisvalue(machineXYZHistoryDto.getZMachine()); |
| | | } else if (axisType == 4) { |
| | | electricStatistical.setAxisvalue(machineXYZHistoryDto.getAMachine()); |
| | | } else if (axisType == 5) { |
| | | electricStatistical.setAxisvalue(machineXYZHistoryDto.getBMachine()); |
| | | } |
| | | } |
| | | resultList.add(electricStatistical); |
| | | } |
| | | } |
| | | } |
| | | if(!resultList.isEmpty()) { |
| | | equipmentElectricStatisticalService.saveBatch(resultList); |
| | | } |
| | | } |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("设å¤è¿è¡æå¤§çµæµç»è®¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto; |
| | | import org.jeecg.modules.mdc.dto.MachineXYZHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.Equipment; |
| | | import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical; |
| | | import org.jeecg.modules.mdc.service.IEquipmentMachiningHistoryService; |
| | | import org.jeecg.modules.mdc.service.IEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IEquipmentSpindleStatisticalService; |
| | | import org.jeecg.modules.mdc.service.IMachineXYZHistoryService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设å¤è¿è¡æå¤§ä¸»è½´è´è½½ç»è®¡ |
| | | * |
| | | * @author Lius |
| | | * @date 2024/7/18 15:59 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class StatisticalSpindleJob implements Job { |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IEquipmentService equipmentService; |
| | | |
| | | @Resource |
| | | private IEquipmentSpindleStatisticalService equipmentSpindleStatisticalService; |
| | | |
| | | @Resource |
| | | private IEquipmentMachiningHistoryService equipmentMachiningHistoryService; |
| | | |
| | | @Resource |
| | | private IMachineXYZHistoryService machineXYZHistoryService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("设å¤è¿è¡æå¤§ä¸»è½´è´è½½ç»è®¡ StatisticalSpindleJob start! æ¶é´:" + DateUtils.getNow()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | List<Equipment> equipmentList = equipmentService.list(); |
| | | if (equipmentList != null && !equipmentList.isEmpty()) { |
| | | Date initDate = null; |
| | | EquipmentSpindleStatistical spindleStatistical; |
| | | List<EquipmentSpindleStatistical> resultList = new ArrayList<>(); |
| | | for (Equipment equipment : equipmentList) { |
| | | Date lastDate = equipmentSpindleStatisticalService.getMaxDate(equipment.getEquipmentid()); |
| | | if (lastDate == null) { |
| | | Date minCollectTime = equipmentMachiningHistoryService.getMinDate(equipment.getEquipmentid()); |
| | | if (minCollectTime == null) { |
| | | continue; |
| | | } |
| | | initDate = DateUtils.removeTime(minCollectTime); |
| | | } |
| | | |
| | | spindleStatistical = new EquipmentSpindleStatistical(); |
| | | EquipmentMachiningHistoryDto machiningHistoryDto = equipmentMachiningHistoryService.getMaxSpindleLoad(equipment.getEquipmentid(), initDate, DateUtils.plusTime(initDate, 1)); |
| | | if(machiningHistoryDto == null || machiningHistoryDto.getEquipmentID() == null || machiningHistoryDto.getCollectTime() == null) { |
| | | continue; |
| | | } |
| | | spindleStatistical.setCreatedate(initDate); |
| | | spindleStatistical.setSpindlespeed(machiningHistoryDto.getSpindleSpeed()); |
| | | spindleStatistical.setEquipmentid(equipment.getEquipmentid()); |
| | | spindleStatistical.setEquipmentname(equipment.getEquipmentname()); |
| | | spindleStatistical.setSpindleload(machiningHistoryDto.getSpindleLoad()); |
| | | spindleStatistical.setSpindletime(machiningHistoryDto.getCollectTime()); |
| | | MachineXYZHistoryDto machineXYZHistoryDto = machineXYZHistoryService.getNearAxisType(equipment.getEquipmentid(), initDate, DateUtils.plusTime(initDate, 1), machiningHistoryDto.getCollectTime()); |
| | | if(machineXYZHistoryDto != null) { |
| | | spindleStatistical.setAxistime(machineXYZHistoryDto.getCollectTime()); |
| | | spindleStatistical.setAxisx(machineXYZHistoryDto.getXMachine()); |
| | | spindleStatistical.setAxisy(machineXYZHistoryDto.getYMachine()); |
| | | spindleStatistical.setAxisz(machineXYZHistoryDto.getZMachine()); |
| | | spindleStatistical.setAxisa(machineXYZHistoryDto.getAMachine()); |
| | | spindleStatistical.setAxisb(machineXYZHistoryDto.getBMachine()); |
| | | } |
| | | resultList.add(spindleStatistical); |
| | | } |
| | | if (!resultList.isEmpty()) { |
| | | equipmentSpindleStatisticalService.saveBatch(resultList); |
| | | } |
| | | } |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("设å¤è¿è¡æå¤§ä¸»è½´è´è½½ç»è®¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.dto.CurrentElectricHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.CurrentXYZHistory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤åæ å¼è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-18 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface CurrentXYZHistoryMapper extends BaseMapper<CurrentXYZHistory> { |
| | | |
| | | /** |
| | | * è·åæ°æ®çæå°æ¶é´ |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMinDate(@Param("equipmentId") String equipmentId); |
| | | |
| | | /** |
| | | * è·åæå°è®¾å¤æä¸ªåæ çæå¤§çµæµ |
| | | * |
| | | * @param equipmentId |
| | | * @param axisType |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | CurrentElectricHistoryDto getMaxElectric(@Param("equipmentId") String equipmentId, @Param("axisType") Integer axisType, @Param("startDate") Date startDate, @Param("endDate") Date endDate); |
| | | } |
| | |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | import org.jeecg.modules.mdc.vo.EquipmentElectricStatisticalVo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<EquipmentElectricStatisticalDto> getElectricValue(@Param("equipmentElectricStatisticalVo") EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMaxDate(@Param("equipmentId") String equipmentId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentMachiningHistory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½åå²è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EquipmentMachiningHistoryMapper extends BaseMapper<EquipmentMachiningHistory> { |
| | | |
| | | /** |
| | | * è·åæä¸ªæ¶é´éè¿ç主轴转éå主轴è´è½½ |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @param nearTime |
| | | * @return |
| | | */ |
| | | EquipmentMachiningHistoryDto getNearTimeSpindleLoad(@Param("equipmentId") String equipmentId, @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("nearTime") Date nearTime); |
| | | |
| | | /** |
| | | * è·åæ°æ®çæå°æ¶é´ |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMinDate(@Param("equipmentId") String equipmentId); |
| | | |
| | | /** |
| | | * è·åè®¾å¤ææ®µæ¶é´å
çæå¤§ä¸»è½´è´è½½æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | EquipmentMachiningHistoryDto getMaxSpindleLoad(@Param("equipmentId") String equipmentId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.mdc.entity.EquipmentMachining; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EquipmentMachiningMapper extends BaseMapper<EquipmentMachining> { |
| | | |
| | | } |
| | |
| | | import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical; |
| | | import org.jeecg.modules.mdc.vo.EquipmentSpindleStatisticalVo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<EquipmentSpindleStatistical> list(@Param("equipmentSpindleStatisticalVo") EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMaxDate(@Param("equipmentId") String equipmentId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.dto.MachineXYZHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.MachineXYZHistory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/29 14:36 |
| | | */ |
| | | public interface MachineXYZHistoryMapper extends BaseMapper<MachineXYZHistory> { |
| | | /** |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @param nearTime |
| | | * @return |
| | | */ |
| | | MachineXYZHistoryDto getNearAxisType(@Param("equipmentId") String equipmentId, @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("nearTime") Date nearTime); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdc.mapper.CurrentXYZHistoryMapper"> |
| | | |
| | | <!--è·åæ°æ®çæå°æ¶é´--> |
| | | <select id="getMinDate" resultType="java.util.Date"> |
| | | select MIN(CollectTime) CollectTime from CurrentXYZ_History where equipmentID = #{ equipmentId } |
| | | </select> |
| | | |
| | | <!--è·åæå°è®¾å¤æä¸ªåæ çæå¤§çµæµ--> |
| | | <select id="getMaxElectric" resultType="org.jeecg.modules.mdc.dto.CurrentElectricHistoryDto"> |
| | | <if test="axisType != null and axisType != '' and axisType == 1"> |
| | | SELECT |
| | | n.XCurrent currentValue, |
| | | m.EquipmentID, |
| | | n.CollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MAX( ABS( CONVERT ( DECIMAL ( 18, 3 ), XCurrent ) ) ) currentValue, |
| | | MIN ( EquipmentID ) EquipmentID |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 2"> |
| | | SELECT |
| | | n.YCurrent currentValue, |
| | | m.EquipmentID, |
| | | n.CollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MAX( ABS( CONVERT ( DECIMAL ( 18, 3 ), YCurrent ) ) ) currentValue, |
| | | MIN ( EquipmentID ) EquipmentID |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 3"> |
| | | SELECT |
| | | n.ZCurrent currentValue, |
| | | m.EquipmentID, |
| | | n.C |
| | | ollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MAX( ABS( CONVERT ( DECIMAL ( 18, 3 ), ZCurrent ) ) ) currentValue, |
| | | MIN ( EquipmentID ) EquipmentID |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 4"> |
| | | SELECT |
| | | n.ACurrent currentValue, |
| | | m.EquipmentID, |
| | | n.CollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MAX( ABS( CONVERT ( DECIMAL ( 18, 3 ), ACurrent ) ) ) currentValue, |
| | | MIN ( EquipmentID ) EquipmentID |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 5"> |
| | | SELECT |
| | | n.BCurrent currentValue, |
| | | m.EquipmentID, |
| | | n.CollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MAX( ABS( CONVERT ( DECIMAL ( 18, 3 ), BCurrent ) ) ) currentValue, |
| | | MIN ( EquipmentID ) EquipmentID |
| | | </if> |
| | | FROM |
| | | CurrentXYZ_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) m |
| | | LEFT JOIN ( |
| | | SELECT |
| | | EquipmentID, |
| | | CollectTime, |
| | | ABS( CONVERT ( DECIMAL ( 18, 3 ), XCurrent ) ) xValue, |
| | | XCurrent, |
| | | ABS( CONVERT ( DECIMAL ( 18, 3 ), YCurrent ) ) yValue, |
| | | YCurrent, |
| | | ABS( CONVERT ( DECIMAL ( 18, 3 ), ZCurrent ) ) zValue, |
| | | ZCurrent, |
| | | ABS( CONVERT ( DECIMAL ( 18, 3 ), ACurrent ) ) aValue, |
| | | ACurrent, |
| | | ABS( CONVERT ( DECIMAL ( 18, 3 ), BCurrent ) ) bValue, |
| | | BCurrent |
| | | FROM |
| | | CurrentXYZ_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) n ON m.EquipmentID= n.EquipmentID |
| | | <if test="axisType != null and axisType != '' and axisType == 1"> |
| | | AND m.currentValue= n.xValue |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 2"> |
| | | AND m.currentValue= n.yValue |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 3"> |
| | | AND m.currentValue= n.zValue |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 4"> |
| | | AND m.currentValue= n.aValue |
| | | </if> |
| | | <if test="axisType != null and axisType != '' and axisType == 5"> |
| | | AND m.currentValue= n.bValue |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | |
| | | <!--æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ®--> |
| | | <select id="getMaxDate" resultType="java.util.Date"> |
| | | SELECT MAX( createDate ) createDate FROM equipment_electric_statistical WHERE equipmentID = #{equipmentId} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdc.mapper.EquipmentMachiningHistoryMapper"> |
| | | |
| | | <!--è·åæä¸ªæ¶é´éè¿ç主轴转éå主轴è´è½½--> |
| | | <select id="getNearTimeSpindleLoad" resultType="org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto"> |
| | | SELECT |
| | | t1.CollectTime collectTime, |
| | | t1.EquipmentID equipmentID, |
| | | t2.SpindleLoad spindleLoad, |
| | | t2.SpindleSpeed spindleSpeed |
| | | FROM |
| | | ( |
| | | SELECT |
| | | m.diff, |
| | | m.EquipmentID, |
| | | n.CollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MIN( p.diff ) diff, |
| | | MIN( p.EquipmentID ) EquipmentID |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ABS( DATEDIFF( millisecond, CollectTime, #{nearTime} ) ) diff, |
| | | CollectTime, |
| | | EquipmentID |
| | | FROM |
| | | EquipmentMachining_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) p |
| | | ) m |
| | | LEFT JOIN ( |
| | | SELECT |
| | | ABS( DATEDIFF( millisecond, CollectTime, #{nearTime} ) ) diff, |
| | | CollectTime, |
| | | EquipmentID |
| | | FROM |
| | | EquipmentMachining_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) n ON m.EquipmentID = n.EquipmentID |
| | | AND m.diff = n.diff |
| | | ) t1 |
| | | LEFT JOIN ( SELECT EquipmentID, CollectTime, SpindleLoad, SpindleSpeed FROM EquipmentMachining_History WHERE CollectTime >= #{startDate} AND CollectTime < #{endDate} AND EquipmentID = #{equipmentId} ) t2 ON t1.EquipmentID = t2.EquipmentID |
| | | AND t1.CollectTime = t2.CollectTime |
| | | </select> |
| | | |
| | | <select id="getMinDate" resultType="java.util.Date"> |
| | | SELECT MIN(CollectTime) CollectTime FROM EquipmentMachining_History WHERE EquipmentID = #{equipmentId} |
| | | </select> |
| | | |
| | | |
| | | <select id="getMaxSpindleLoad" resultType="org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto"> |
| | | SELECT |
| | | n.SpindleLoad, |
| | | m.EquipmentID, |
| | | n.CollectTime, |
| | | n.SpindleSpeed |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MAX ( ABS( CONVERT ( DECIMAL ( 8, 3 ), SpindleLoad ) ) ) SpindleLoad, |
| | | MAX ( EquipmentID ) EquipmentID |
| | | FROM |
| | | EquipmentMachining_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) m |
| | | LEFT JOIN ( |
| | | SELECT |
| | | EquipmentID, |
| | | CollectTime, |
| | | ABS( CONVERT ( DECIMAL ( 8, 3 ), SpindleLoad ) ) loadValue, |
| | | SpindleLoad, |
| | | SpindleSpeed |
| | | FROM |
| | | EquipmentMachining_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) n ON m.SpindleLoad= n.loadValue |
| | | AND m.EquipmentID= n.EquipmentID |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdc.mapper.EquipmentMachiningMapper"> |
| | | |
| | | </mapper> |
| | |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | |
| | | <select id="getMaxDate" resultType="java.util.Date"> |
| | | SELECT MAX( createDate ) createDate FROM equipment_spindle_statistical WHERE equipmentID = #{equipmentId} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdc.mapper.MachineXYZHistoryMapper"> |
| | | |
| | | <select id="getNearAxisType" resultType="org.jeecg.modules.mdc.dto.MachineXYZHistoryDto"> |
| | | SELECT |
| | | t1.CollectTime, |
| | | t1.EquipmentID, |
| | | t2.XMachine, |
| | | t2.YMachine, |
| | | t2.ZMachine, |
| | | t2.AMachine, |
| | | t2.BMachine |
| | | FROM |
| | | ( |
| | | SELECT |
| | | m.diff, |
| | | m.EquipmentID, |
| | | n.CollectTime |
| | | FROM |
| | | ( |
| | | SELECT |
| | | MIN ( p.diff ) diff, |
| | | MIN ( p.EquipmentID ) EquipmentID |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ABS( DATEDIFF( millisecond, CollectTime, #{nearTime} ) ) diff, |
| | | CollectTime, |
| | | EquipmentID |
| | | FROM |
| | | MachineXYZ_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) p |
| | | ) m |
| | | LEFT JOIN ( |
| | | SELECT |
| | | ABS( DATEDIFF( millisecond, CollectTime, #{nearTime} ) ) diff, |
| | | CollectTime, |
| | | EquipmentID |
| | | FROM |
| | | MachineXYZ_History |
| | | WHERE |
| | | CollectTime >= #{startDate} |
| | | AND CollectTime < #{endDate} |
| | | AND EquipmentID = #{equipmentId} |
| | | ) n ON m.EquipmentID = n.EquipmentID |
| | | AND m.diff = n.diff |
| | | ) t1 |
| | | LEFT JOIN ( SELECT CollectTime, EquipmentID, XMachine, YMachine, ZMachine, AMachine, BMachine FROM MachineXYZ_History WHERE CollectTime >= #{startDate} AND CollectTime < #{endDate} AND EquipmentID = #{equipmentId} ) t2 ON t1.EquipmentID= t2.EquipmentID |
| | | AND t1.CollectTime= t2.CollectTime |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.dto.CurrentElectricHistoryDto; |
| | | import org.jeecg.modules.mdc.dto.MachineXYZHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.CurrentXYZHistory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤åæ å¼è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-18 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface ICurrentXYZHistoryService extends IService<CurrentXYZHistory> { |
| | | |
| | | /** |
| | | * è·åæ°æ®çæå°æ¶é´ |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMinDate(String equipmentId); |
| | | |
| | | /** |
| | | * è·åæå°è®¾å¤æä¸ªåæ çæå¤§çµæµ |
| | | * |
| | | * @param equipmentId |
| | | * @param axisType |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | CurrentElectricHistoryDto getMaxElectric(String equipmentId, Integer axisType, Date startDate, Date endDate); |
| | | |
| | | } |
| | |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<EquipmentElectricStatisticalDto> getElectricValue(String userId, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMaxDate(String equipmentId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentMachiningHistory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½åå²è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEquipmentMachiningHistoryService extends IService<EquipmentMachiningHistory> { |
| | | |
| | | /** |
| | | * è·åæä¸ªæ¶é´éè¿ç主轴转éå主轴è´è½½ |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @param nearTime |
| | | * @return |
| | | */ |
| | | EquipmentMachiningHistoryDto getNearTimeSpindleLoad(String equipmentId, Date startDate, Date endDate, Date nearTime); |
| | | |
| | | /** |
| | | * è·åæ°æ®çæå°æ¶é´ |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMinDate(String equipmentId); |
| | | |
| | | /** |
| | | * è·åè®¾å¤ææ®µæ¶é´å
çæå¤§ä¸»è½´è´è½½æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | EquipmentMachiningHistoryDto getMaxSpindleLoad(String equipmentId, Date startDate, Date endDate); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.entity.EquipmentMachining; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEquipmentMachiningService extends IService<EquipmentMachining> { |
| | | |
| | | } |
| | |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è´è½½ |
| | |
| | | * @return |
| | | */ |
| | | ModelAndView exportXls(String userId, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | Date getMaxDate(String equipmentId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.dto.MachineXYZHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.MachineXYZHistory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/29 14:22 |
| | | */ |
| | | public interface IMachineXYZHistoryService extends IService<MachineXYZHistory> { |
| | | |
| | | /** |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @param nearTime |
| | | * @return |
| | | */ |
| | | MachineXYZHistoryDto getNearAxisType(String equipmentId, Date startDate, Date endDate, Date nearTime); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.dto.CurrentElectricHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.CurrentXYZHistory; |
| | | import org.jeecg.modules.mdc.mapper.CurrentXYZHistoryMapper; |
| | | import org.jeecg.modules.mdc.service.ICurrentXYZHistoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤åæ å¼è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-18 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class CurrentXYZHistoryServiceImpl extends ServiceImpl<CurrentXYZHistoryMapper, CurrentXYZHistory> implements ICurrentXYZHistoryService { |
| | | |
| | | /** |
| | | * è·åæ°æ®çæå°æ¶é´ |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Date getMinDate(String equipmentId) { |
| | | return this.baseMapper.getMinDate(equipmentId); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå°è®¾å¤æä¸ªåæ çæå¤§çµæµ |
| | | * |
| | | * @param equipmentId |
| | | * @param axisType |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | @Override |
| | | public CurrentElectricHistoryDto getMaxElectric(String equipmentId, Integer axisType, Date startDate, Date endDate) { |
| | | return this.baseMapper.getMaxElectric(equipmentId, axisType, startDate, endDate); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | 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.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.dto.EquipmentAlarmDto; |
| | | import org.jeecg.modules.mdc.dto.EquipmentElectricStatisticalDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | import org.jeecg.modules.mdc.mapper.EquipmentElectricStatisticalMapper; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | return equipmentElectricStatisticals; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Date getMaxDate(String equipmentId) { |
| | | return this.baseMapper.getMaxDate(equipmentId); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.dto.EquipmentMachiningHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentMachiningHistory; |
| | | import org.jeecg.modules.mdc.mapper.EquipmentMachiningHistoryMapper; |
| | | import org.jeecg.modules.mdc.service.IEquipmentMachiningHistoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½åå²è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EquipmentMachiningHistoryServiceImpl extends ServiceImpl<EquipmentMachiningHistoryMapper, EquipmentMachiningHistory> implements IEquipmentMachiningHistoryService { |
| | | |
| | | /** |
| | | * è·åæä¸ªæ¶é´éè¿ç主轴转éå主轴è´è½½ |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @param nearTime |
| | | * @return |
| | | */ |
| | | @Override |
| | | public EquipmentMachiningHistoryDto getNearTimeSpindleLoad(String equipmentId, Date startDate, Date endDate, Date nearTime) { |
| | | return this.baseMapper.getNearTimeSpindleLoad(equipmentId, startDate, endDate, nearTime); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ°æ®çæå°æ¶é´ |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Date getMinDate(String equipmentId) { |
| | | return this.baseMapper.getMinDate(equipmentId); |
| | | } |
| | | |
| | | /** |
| | | * è·åè®¾å¤ææ®µæ¶é´å
çæå¤§ä¸»è½´è´è½½æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return |
| | | */ |
| | | @Override |
| | | public EquipmentMachiningHistoryDto getMaxSpindleLoad(String equipmentId, Date startDate, Date endDate) { |
| | | return this.baseMapper.getMaxSpindleLoad(equipmentId, startDate, endDate); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.entity.EquipmentMachining; |
| | | import org.jeecg.modules.mdc.mapper.EquipmentMachiningMapper; |
| | | import org.jeecg.modules.mdc.service.IEquipmentMachiningService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Description: 设å¤è½¬éè´è½½è¡¨ |
| | | * @Author: lius |
| | | * @Date: 2024-07-24 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EquipmentMachiningServiceImpl extends ServiceImpl<EquipmentMachiningMapper, EquipmentMachining> implements IEquipmentMachiningService { |
| | | |
| | | } |
| | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical; |
| | | import org.jeecg.modules.mdc.mapper.EquipmentSpindleStatisticalMapper; |
| | | import org.jeecg.modules.mdc.service.IEquipmentSpindleStatisticalService; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, equipmentSpindleStatisticals); |
| | | return mv; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤idè·åææ°ä¸æ¡æ°æ® |
| | | * |
| | | * @param equipmentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Date getMaxDate(String equipmentId) { |
| | | return this.baseMapper.getMaxDate(equipmentId); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.dto.MachineXYZHistoryDto; |
| | | import org.jeecg.modules.mdc.entity.MachineXYZHistory; |
| | | import org.jeecg.modules.mdc.mapper.MachineXYZHistoryMapper; |
| | | import org.jeecg.modules.mdc.service.IMachineXYZHistoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/29 14:34 |
| | | */ |
| | | @Service |
| | | public class MachineXYZHistoryServiceImpl extends ServiceImpl<MachineXYZHistoryMapper, MachineXYZHistory> implements IMachineXYZHistoryService { |
| | | |
| | | /** |
| | | * |
| | | * @param equipmentId |
| | | * @param startDate |
| | | * @param endDate |
| | | * @param nearTime |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MachineXYZHistoryDto getNearAxisType(String equipmentId, Date startDate, Date endDate, Date nearTime) { |
| | | return this.baseMapper.getNearAxisType(equipmentId, startDate, endDate, nearTime); |
| | | } |
| | | } |
ÎļþÃû´Ó lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/controller/ClassMonthlyscheduleController.java ÐÞ¸Ä |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.mdcJc.entity.ClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.mapper.ClassMonthlyscheduleMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Api(tags = "éæ") |
| | | @RestController |
| | | @RequestMapping("/mdcJc/mdcAlarmInfo") |
| | | public class ClassMonthlyscheduleController extends JeecgController<ClassMonthlyschedule,IClassMonthlyscheduleService> { |
| | | public class ClassMonthlyScheduleController extends JeecgController<ClassMonthlyschedule, IClassMonthlyScheduleService> { |
| | | |
| | | @Autowired |
| | | private IClassMonthlyscheduleService classMonthlyscheduleService; |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | @ApiOperation(value = "mes", notes = "mes") |
| | | @GetMapping("/findListClass") |
| | | public Result<?> findListClass() { |
| | | classMonthlyscheduleService.findListClass("2024-06"); |
| | | classMonthlyScheduleService.findListClass("2024-06"); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("mdcJc_OnLine_Queue") |
| | | @TableName("mdcJc_OnLineQueue") |
| | | @ApiModel(value = "èªå¨çº¿ä¸çº¿") |
| | | public class MdcOnLineQueue implements Serializable { |
| | | private static final long serialVersionUID = -4733120585358211415L; |
| | |
| | | |
| | | @TableField(value = "id") |
| | | private Integer id; |
| | | @TableField(value = "devCode") |
| | | private String devCode; |
| | | @TableField(value = "partBarCode") |
| | | private String partBarCode; |
| | | @TableField(value = "productNo") |
| | | private String productNo; |
| | | @TableField(value = "productName") |
| | | private String productName; |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField(value = "scanTime") |
| | | private Date scanTime; |
| | | @TableField(value = "remark") |
| | |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | @TableField(value = "createTime") |
| | | private Date createTime; |
| | | } |
| | |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private String mdc_id; |
| | | |
| | | @TableField(value = "ID") |
| | | @TableField(value = "id") |
| | | private Integer id; |
| | | @TableField(value = "PlanDate") |
| | | /** |
| | | * è®¡åæ¥æ |
| | | */ |
| | | @TableField(value = "planDate") |
| | | private String planDate; |
| | | @TableField(value = "ProductNo") |
| | | /** |
| | | * é¶é¨ä»¶å· |
| | | */ |
| | | @TableField(value = "productNo") |
| | | private String productNo; |
| | | @TableField(value = "ProductName") |
| | | /** |
| | | * é¶é¨ä»¶åç§° |
| | | */ |
| | | @TableField(value = "productName") |
| | | private String productName; |
| | | @TableField(value = "OrderID") |
| | | /** |
| | | * å·¥åå· |
| | | */ |
| | | @TableField(value = "orderId") |
| | | private String orderId; |
| | | @TableField(value = "ProcedureName") |
| | | /** |
| | | * å·¥ååç§° |
| | | */ |
| | | @TableField(value = "procedureName") |
| | | private String procedureName; |
| | | @TableField(value = "Clazz") |
| | | /** |
| | | * çç» |
| | | */ |
| | | @TableField(value = "clazz") |
| | | private String clazz; |
| | | @TableField(value = "PlanCount") |
| | | /** |
| | | * 计åé |
| | | */ |
| | | @TableField(value = "planCount") |
| | | private Integer planCount; |
| | | @TableField(value = "CompletionCount") |
| | | /** |
| | | * 宿é |
| | | */ |
| | | @TableField(value = "completionCount") |
| | | private Integer completionCount; |
| | | @TableField(value = "QualifiedCount") |
| | | /** |
| | | * åæ ¼é |
| | | */ |
| | | @TableField(value = "qualifiedCount") |
| | | private Integer qualifiedCount; |
| | | @TableField(value = "ProcessRoute") |
| | | /** |
| | | * å·¥èºè·¯çº¿ |
| | | */ |
| | | @TableField(value = "processRoute") |
| | | private String processRoute; |
| | | @TableField(value = "EquipmentID") |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @TableField(value = "equipmentId") |
| | | private String equipmentId; |
| | | @TableField(value = "IsAutomaticLine") |
| | | /** |
| | | * èªå¨çº¿æ è¯ |
| | | */ |
| | | @TableField(value = "isAutomaticLine") |
| | | private String isAutomaticLine; |
| | | |
| | | /** |
| | | * åå»ºæ¥æ |
| | | */ |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("mdcJc_UnderLine_Queue") |
| | | @TableName("mdcJc_UnderLineQueue") |
| | | @ApiModel(value = "èªå¨çº¿ä¸çº¿éåMES") |
| | | public class MdcUnderLineQueue implements Serializable { |
| | | |
| | |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | @TableField(value = "createTime") |
| | | private Date createTime; |
| | | } |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("T_ProductDayschedule") |
| | | @ApiModel(value = "彿é¶é¨ä»¶è®¡åè¿åº¦") |
| | | @ApiModel(value = "彿¥é¶é¨ä»¶è®¡åè¿åº¦") |
| | | public class ProductDayschedule { |
| | | @TableField(value = "ID") |
| | | private Integer id; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdcJc.service.IMdcOnLineQueueService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/12 10:35 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class OnLineQueueJob implements Job { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcOnLineQueueService mdcOnLineQueueService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("èªå¨ä¸çº¿ä»»å¡ OnLineQueueJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | |
| | | mdcOnLineQueueService.saveOnLineQueueList(); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("èªå¨ä¸çº¿ä»»å¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdcJc.service.IMdcQualityMonthService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/12 10:34 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class QualityMonthJob implements Job { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcQualityMonthService mdcQualityMonthService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("é¶é¨ä»¶æç产éä»»å¡ QualityMonthJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | |
| | | mdcQualityMonthService.saveQualityMonth(); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("é¶é¨ä»¶æç产éä»»å¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdcJc.service.IMdcClassMonthService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/12 10:31 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class ScheduleClassMonthJob implements Job { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcClassMonthService mdcClassMonthService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("æçç»å®ææ
åµä»»å¡ ScheduleClassMonthJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | |
| | | mdcClassMonthService.saveOrUpdateClassMonthSchedule(); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("æçç»å®ææ
åµä»»å¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdcJc.service.IMdcProductDayScheduleService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/12 10:34 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class ScheduleProductDayJob implements Job { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcProductDayScheduleService mdcProductDayScheduleService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("计ç®å½æ¥é¶é¨ä»¶ä»»å¡ ScheduleProductDayJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | |
| | | mdcProductDayScheduleService.scheduleProductDayList(); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("计ç®å½æ¥é¶é¨ä»¶ä»»å¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdcJc.service.IMdcProductMonthScheduleService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/12 10:30 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class ScheduleProductMonthJob implements Job { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcProductMonthScheduleService mdcProductMonthScheduleService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("计ç®å½æé¶é¨ä»¶ä»»å¡ ScheduleProductMonthJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | |
| | | mdcProductMonthScheduleService.scheduleProductMonthList(); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("计ç®å½æé¶é¨ä»¶ä»»å¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdcJc.service.IMdcUnderLineQueueService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/12 10:35 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class UnderLineQueueJob implements Job { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcUnderLineQueueService mdcUnderLineQueueService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("èªå¨ä¸çº¿ä»»å¡ UnderLineQueueJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | |
| | | mdcUnderLineQueueService.saveUnderLineQueue(); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | // åéæ¶æ¯éç¥ |
| | | sysAnnouncementService.jobSendMessage("èªå¨ä¸çº¿ä»»å¡", quartzLog.getExceptionDetail()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdcJc.entity.ClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.ProductMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.QualityMonth; |
| | | import org.jeecg.modules.mdcJc.entity.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | /** |
| | | * 彿é¶é¨ä»¶è®¡åè¿åº¦ä¿¡æ¯ |
| | | * |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æåæ ¼åä¸åæ ¼ |
| | | * |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | List<QualityMonth> findListQualityMonth(@Param("dateTime") String dateTime); |
| | | |
| | | /** |
| | | * 彿¥é¶é¨ä»¶ |
| | | * |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | List<ProductDayschedule> findListProductDay(@Param("dateTime") String dateTime); |
| | | |
| | | /** |
| | | * èªå¨çº¿ä¸çº¿ |
| | | * |
| | | * @return |
| | | */ |
| | | List<OnLineQueue> onLineQueueList(); |
| | | |
| | | /** |
| | | * èªå¨çº¿ä¸çº¿ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<OnLineQueue> findListOnLineQueue(@Param("id") Integer id); |
| | | |
| | | /** |
| | | * èªå¨çº¿ä¸çº¿ |
| | | * |
| | | * @return |
| | | */ |
| | | List<UnderLineQueue> underLineQueueList(); |
| | | |
| | | /** |
| | | * èªå¨çº¿ä¸çº¿ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<UnderLineQueue> findListUnderLineQueue(@Param("id") Integer id); |
| | | |
| | | /** |
| | | * è·åæ¨æ¥æ°æ® |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | | MdcProductDayschedule findYesterdayData(@Param("date") String date); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.mdcJc.entity.MdcOnLineQueue; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/8 15:04 |
| | | */ |
| | | public interface MdcOnLineQueueMapper extends BaseMapper<MdcOnLineQueue> { |
| | | MdcOnLineQueue findLastOne(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/30 15:17 |
| | | */ |
| | | public interface MdcProductDayscheduleMapper extends BaseMapper<MdcProductDayschedule> { |
| | | |
| | | List<String> selectDateList(@Param("dateTime") String dateTime); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.mdcJc.entity.MdcUnderLineQueue; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/8 15:07 |
| | | */ |
| | | public interface MdcUnderLineQueueMapper extends BaseMapper<MdcUnderLineQueue> { |
| | | MdcUnderLineQueue findLastOne(); |
| | | } |
| | |
| | | SELECT * FROM T_Quality_monthy WHERE NY = #{ dateTime } |
| | | </select> |
| | | |
| | | <select id="findListProductDay" resultType="org.jeecg.modules.mdcJc.entity.ProductDayschedule"> |
| | | SELECT * FROM T_ProductDayschedule WHERE PlanDate = #{ dateTime } |
| | | </select> |
| | | |
| | | <select id="onLineQueueList" resultType="org.jeecg.modules.mdcJc.entity.OnLineQueue"> |
| | | SELECT * FROM T_OnLine_Queue |
| | | </select> |
| | | |
| | | <select id="findListOnLineQueue" resultType="org.jeecg.modules.mdcJc.entity.OnLineQueue"> |
| | | SELECT * FROM T_OnLine_Queue WHERE ID > #{id} |
| | | </select> |
| | | |
| | | <select id="underLineQueueList" resultType="org.jeecg.modules.mdcJc.entity.UnderLineQueue"> |
| | | SELECT * FROM T_UnderLine_Queue |
| | | </select> |
| | | |
| | | <select id="findListUnderLineQueue" resultType="org.jeecg.modules.mdcJc.entity.UnderLineQueue"> |
| | | SELECT * FROM T_UnderLine_Queue WHERE ID > #{id} |
| | | </select> |
| | | |
| | | <select id="findYesterdayData" resultType="org.jeecg.modules.mdcJc.entity.MdcProductDayschedule"> |
| | | SELECT |
| | | SUM(planCount) planDate, |
| | | SUM ( completionCount ) completionCount, |
| | | SUM ( qualifiedCount ) qualifiedCount |
| | | FROM |
| | | mdcJc_ProductDayschedule |
| | | WHERE |
| | | planDate = #{date} |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdcJc.mapper.MdcOnLineQueueMapper"> |
| | | |
| | | <select id="findLastOne" resultType="org.jeecg.modules.mdcJc.entity.MdcOnLineQueue"> |
| | | SELECT TOP 1 * FROM mdcJc_OnLineQueue ORDER BY id DESC |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdcJc.mapper.MdcProductDayscheduleMapper"> |
| | | |
| | | |
| | | <select id="selectDateList" resultType="java.lang.String"> |
| | | SELECT mdc_id FROM mdcJc_ProductDayschedule WHERE planDate = #{ dateTime } |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.mdcJc.mapper.MdcUnderLineQueueMapper"> |
| | | |
| | | |
| | | <select id="findLastOne" resultType="org.jeecg.modules.mdcJc.entity.MdcUnderLineQueue"> |
| | | SELECT TOP 1 * FROM mdcJc_UnderLineQueue ORDER BY id DESC |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdcJc.entity.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author clown |
| | | * * @date 2024/7/15 |
| | | */ |
| | | public interface IClassMonthlyScheduleService extends IService<ClassMonthlyschedule> { |
| | | |
| | | |
| | | /** |
| | | * 彿é¶é¨ä»¶ |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | List<ProductMonthlyschedule> findListProductMonth(String dateTime); |
| | | |
| | | /** |
| | | * æ¥è¯¢æä¸ªææ°æ® æçç»å®ææ
åµ |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | List<ClassMonthlyschedule> findListClass(String dateTime); |
| | | |
| | | |
| | | /** |
| | | * æåæ ¼åä¸åæ ¼ |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | List<QualityMonth> findListQualityMonth( String dateTime); |
| | | |
| | | /** |
| | | * 彿¥é¶é¨ä»¶ |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | List<ProductDayschedule> findListProductDay(String dateTime); |
| | | |
| | | /** |
| | | * èªå¨çº¿ä¸çº¿éå |
| | | * @return |
| | | */ |
| | | List<OnLineQueue> onLineQueueList(); |
| | | |
| | | /** |
| | | * ä¸çº¿éå |
| | | * @return |
| | | */ |
| | | List<OnLineQueue> findListOnLineQueue(Integer id); |
| | | |
| | | /** |
| | | * ä¸çº¿éå |
| | | * @return |
| | | */ |
| | | List<UnderLineQueue> underLineQueueList(); |
| | | |
| | | /** |
| | | * ä¸çº¿éå |
| | | * @return |
| | | */ |
| | | List<UnderLineQueue> findListUnderLineQueue(Integer id); |
| | | |
| | | /** |
| | | * è·åæ¨æ¥æ°æ® |
| | | * @param date |
| | | * @return |
| | | */ |
| | | MdcProductDayschedule findYesterdayData(String date); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdcJc.entity.MdcOnLineQueue; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/8 15:00 |
| | | */ |
| | | public interface IMdcOnLineQueueService extends IService<MdcOnLineQueue> { |
| | | |
| | | /** |
| | | * èªå¨ä¸çº¿ |
| | | * @return |
| | | */ |
| | | boolean saveOnLineQueueList(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/30 15:14 |
| | | */ |
| | | public interface IMdcProductDayScheduleService extends IService<MdcProductDayschedule> { |
| | | |
| | | /** |
| | | * 彿¥é¶é¨ä»¶ |
| | | * |
| | | * @return |
| | | */ |
| | | boolean scheduleProductDayList(); |
| | | |
| | | /** |
| | | * è·åæ¨æ¥è®¡åé¶é¨ä»¶æ°é |
| | | * |
| | | * @return |
| | | */ |
| | | MdcProductDayschedule findYesterdayData(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdcJc.entity.MdcUnderLineQueue; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/8 15:08 |
| | | */ |
| | | public interface IMdcUnderLineQueueService extends IService<MdcUnderLineQueue> { |
| | | |
| | | /** |
| | | * èªå¨ä¸çº¿ |
| | | * @return |
| | | */ |
| | | boolean saveUnderLineQueue(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdcJc.entity.*; |
| | | import org.jeecg.modules.mdcJc.mapper.ClassMonthlyscheduleMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author clown |
| | | * * @date 2024/7/15 |
| | | */ |
| | | |
| | | @Service |
| | | @DS("mesSoAdb") |
| | | public class ClassMonthlyScheduleServiceImpl extends ServiceImpl<ClassMonthlyscheduleMapper,ClassMonthlyschedule> implements IClassMonthlyScheduleService { |
| | | |
| | | @Override |
| | | public List<ClassMonthlyschedule> findListClass(String dateTime) { |
| | | return super.baseMapper.findListClass(dateTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductMonthlyschedule> findListProductMonth(String dateTime) { |
| | | return super.baseMapper.findListProductMonth(dateTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityMonth> findListQualityMonth(String dateTime) { |
| | | return super.baseMapper.findListQualityMonth(dateTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductDayschedule> findListProductDay(String dateTime) { |
| | | return super.baseMapper.findListProductDay(dateTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<OnLineQueue> onLineQueueList() { |
| | | return super.baseMapper.onLineQueueList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<OnLineQueue> findListOnLineQueue(Integer id) { |
| | | return super.baseMapper.findListOnLineQueue(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnderLineQueue> underLineQueueList() { |
| | | return super.baseMapper.underLineQueueList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnderLineQueue> findListUnderLineQueue(Integer id) { |
| | | return super.baseMapper.findListUnderLineQueue(id); |
| | | } |
| | | |
| | | @Override |
| | | public MdcProductDayschedule findYesterdayData(String date) { |
| | | return this.baseMapper.findYesterdayData(date); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.jeecg.modules.mdcJc.entity.ClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.MdcClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.mapper.MdcClassMonthlyscheduleMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcClassMonthService; |
| | | import org.jeecg.modules.utils.BeanMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class MdcClassMonthServiceImpl extends ServiceImpl<MdcClassMonthlyscheduleMapper,MdcClassMonthlyschedule> implements IMdcClassMonthService { |
| | | |
| | | @Autowired |
| | | private IClassMonthlyscheduleService classMonthlyscheduleService; |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | @Override |
| | | public boolean saveOrUpdateClassMonthSchedule() { |
| | | String date = DateUtils.format(DateUtils.getNow(),DateUtils.STR_YEAR_MONTH); |
| | | List<ClassMonthlyschedule> list = classMonthlyscheduleService.findListClass(date); |
| | | List<ClassMonthlyschedule> list = classMonthlyScheduleService.findListClass(date); |
| | | if (list == null || list.isEmpty()) { |
| | | return true; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdcJc.entity.MdcOnLineQueue; |
| | | import org.jeecg.modules.mdcJc.entity.OnLineQueue; |
| | | import org.jeecg.modules.mdcJc.mapper.MdcOnLineQueueMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcOnLineQueueService; |
| | | import org.jeecg.modules.utils.BeanMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/8 15:02 |
| | | */ |
| | | @Service |
| | | public class MdcOnLineQueueServiceImpl extends ServiceImpl<MdcOnLineQueueMapper, MdcOnLineQueue> implements IMdcOnLineQueueService { |
| | | |
| | | @Resource |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | /** |
| | | * èªå¨ä¸çº¿ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveOnLineQueueList() { |
| | | MdcOnLineQueue mdcOnLineQueue = this.baseMapper.findLastOne(); |
| | | List<OnLineQueue> onLineQueueList = new ArrayList<>(); |
| | | if (mdcOnLineQueue == null) { |
| | | // 馿¬¡ |
| | | onLineQueueList = classMonthlyScheduleService.onLineQueueList(); |
| | | } else { |
| | | onLineQueueList = classMonthlyScheduleService.findListOnLineQueue(mdcOnLineQueue.getId()); |
| | | } |
| | | if (onLineQueueList == null || onLineQueueList.isEmpty()) { |
| | | return true; |
| | | } |
| | | List<MdcOnLineQueue> mesO = new ArrayList<>(); |
| | | for (OnLineQueue o : onLineQueueList) { |
| | | MdcOnLineQueue mdc = new MdcOnLineQueue(); |
| | | BeanMapper.copy(o, mdc); |
| | | mesO.add(mdc); |
| | | } |
| | | return this.saveBatch(mesO); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; |
| | | import org.jeecg.modules.mdcJc.entity.ProductDayschedule; |
| | | import org.jeecg.modules.mdcJc.mapper.MdcProductDayscheduleMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcProductDayScheduleService; |
| | | import org.jeecg.modules.utils.BeanMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/30 15:14 |
| | | */ |
| | | @Service |
| | | public class MdcProductDayScheduleServiceImpl extends ServiceImpl<MdcProductDayscheduleMapper, MdcProductDayschedule> implements IMdcProductDayScheduleService { |
| | | |
| | | @Resource |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | |
| | | @Override |
| | | public boolean scheduleProductDayList() { |
| | | String date = DateUtils.format(DateUtils.getNow(),DateUtils.STR_DATE); |
| | | List<ProductDayschedule> list = classMonthlyScheduleService.findListProductDay(date); |
| | | if (list == null || list.isEmpty()) { |
| | | return true; |
| | | } |
| | | List<String> mdcListIds = super.baseMapper.selectDateList(date); |
| | | if (mdcListIds != null && !mdcListIds.isEmpty()) { |
| | | this.removeBatchByIds(mdcListIds); |
| | | } |
| | | List<MdcProductDayschedule> mesC = new ArrayList<>(); |
| | | for (ProductDayschedule c : list) { |
| | | MdcProductDayschedule mdc = new MdcProductDayschedule(); |
| | | BeanMapper.copy(c, mdc); |
| | | mesC.add(mdc); |
| | | } |
| | | boolean b = this.saveBatch(mesC); |
| | | return b; |
| | | } |
| | | |
| | | @Override |
| | | public MdcProductDayschedule findYesterdayData() { |
| | | String date = LocalDate.now().plusDays(-1).toString(); |
| | | return classMonthlyScheduleService.findYesterdayData(date); |
| | | } |
| | | } |
| | |
| | | import org.jeecg.modules.mdcJc.entity.MdcProductMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.ProductMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.mapper.MdcProductMonthScheduleMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcProductMonthScheduleService; |
| | | import org.jeecg.modules.utils.BeanMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class MdcProductMonthScheduleServiceImp extends ServiceImpl<MdcProductMonthScheduleMapper,MdcProductMonthlyschedule> implements IMdcProductMonthScheduleService { |
| | | |
| | | @Autowired |
| | | private IClassMonthlyscheduleService classMonthlyscheduleService; |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | @Override |
| | | public boolean scheduleProductMonthList() { |
| | | String date = DateUtils.format(DateUtils.getNow(),DateUtils.STR_YEAR_MONTH); |
| | | List<ProductMonthlyschedule> list = classMonthlyscheduleService.findListProductMonth(date); |
| | | List<ProductMonthlyschedule> list = classMonthlyScheduleService.findListProductMonth(date); |
| | | if (list == null || list.isEmpty()) { |
| | | return true; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdcJc.entity.ClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.MdcClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.MdcQualityMonth; |
| | | import org.jeecg.modules.mdcJc.entity.QualityMonth; |
| | | import org.jeecg.modules.mdcJc.mapper.MdcQualityMonthMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcQualityMonthService; |
| | | import org.jeecg.modules.utils.BeanMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class MdcQualityMonthServiceImpl extends ServiceImpl<MdcQualityMonthMapper,MdcQualityMonth> implements IMdcQualityMonthService { |
| | | |
| | | @Autowired |
| | | private IClassMonthlyscheduleService classMonthlyscheduleService; |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | @Override |
| | | public boolean saveQualityMonth() { |
| | | String date = DateUtils.format(DateUtils.getNow(),DateUtils.STR_YEAR_MONTH); |
| | | List<QualityMonth> list = classMonthlyscheduleService.findListQualityMonth(date); |
| | | List<QualityMonth> list = classMonthlyScheduleService.findListQualityMonth(date); |
| | | if (list == null || list.isEmpty()) { |
| | | return true; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdcJc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdcJc.entity.MdcUnderLineQueue; |
| | | import org.jeecg.modules.mdcJc.entity.UnderLineQueue; |
| | | import org.jeecg.modules.mdcJc.mapper.MdcUnderLineQueueMapper; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcUnderLineQueueService; |
| | | import org.jeecg.modules.utils.BeanMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/8 15:09 |
| | | */ |
| | | @Service |
| | | public class MdcUnderLineQueueServiceImpl extends ServiceImpl<MdcUnderLineQueueMapper, MdcUnderLineQueue> implements IMdcUnderLineQueueService { |
| | | |
| | | @Resource |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | /** |
| | | * èªå¨ä¸çº¿ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveUnderLineQueue() { |
| | | MdcUnderLineQueue mdcUnderLineQueue = this.baseMapper.findLastOne(); |
| | | List<UnderLineQueue> underLineQueueList = new ArrayList<>(); |
| | | if (mdcUnderLineQueue == null) { |
| | | // 馿¬¡ |
| | | underLineQueueList = classMonthlyScheduleService.underLineQueueList(); |
| | | } else { |
| | | underLineQueueList = classMonthlyScheduleService.findListUnderLineQueue(mdcUnderLineQueue.getId()); |
| | | } |
| | | if (underLineQueueList == null || underLineQueueList.isEmpty()) { |
| | | return true; |
| | | } |
| | | List<MdcUnderLineQueue> mdcU = new ArrayList<>(); |
| | | for (UnderLineQueue u : underLineQueueList) { |
| | | MdcUnderLineQueue mdc = new MdcUnderLineQueue(); |
| | | BeanMapper.copy(u, mdc); |
| | | mdcU.add(mdc); |
| | | } |
| | | return this.saveBatch(mdcU); |
| | | } |
| | | } |
| | |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdcJc.entity.ClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.entity.MdcClassMonthlyschedule; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMesInfoInMdcService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class MesInfoInMdcServiceImpl implements IMesInfoInMdcService { |
| | | |
| | | @Autowired |
| | | private IClassMonthlyscheduleService classMonthlyscheduleService; |
| | | private IClassMonthlyScheduleService classMonthlyScheduleService; |
| | | |
| | | @Override |
| | | public List<MdcClassMonthlyschedule> mesClass() { |
| | | String date = DateUtils.format(DateUtils.getNow(),DateUtils.STR_YEAR_MONTH); |
| | | List<ClassMonthlyschedule> list = classMonthlyscheduleService.findListClass(date); |
| | | List<ClassMonthlyschedule> list = classMonthlyScheduleService.findListClass(date); |
| | | List<MdcClassMonthlyschedule> mesC = new ArrayList<>(); |
| | | BeanUtils.copyProperties(list,mesC); |
| | | return mesC; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.controller; |
| | | |
| | | 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.modules.screen.dto.*; |
| | | import org.jeecg.modules.screen.service.MdcLargeScreenService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/16 10:44 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "æ»æ§çæ¿") |
| | | @RestController |
| | | @RequestMapping("/mdc/largeScreen") |
| | | public class MdcLargeScreenController { |
| | | |
| | | @Resource |
| | | private MdcLargeScreenService mdcLargeScreenService; |
| | | |
| | | |
| | | @ApiOperation(value = "æ»æ§çæ¿-仿¥ç产è¿åº¦", notes = "æ»æ§çæ¿-仿¥ç产è¿åº¦") |
| | | @GetMapping("/todayProductionSchedule") |
| | | public Result<?> todayProductionSchedule() { |
| | | List<TodayProductionDto> result = mdcLargeScreenService.todayProductionSchedule(); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ»æ§çæ¿-仿¥äº§ååæ ¼ç", notes = "æ»æ§çæ¿-仿¥äº§ååæ ¼ç") |
| | | @GetMapping("/todayProductionPassRate") |
| | | public Result<?> todayProductionPassRate() { |
| | | List<TodayProductionPassRateDto> result = mdcLargeScreenService.todayProductionPassRate(); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ»æ§çæ¿-仿¥çç»å®æé", notes = "æ»æ§çæ¿-仿¥çç»å®æé") |
| | | @GetMapping("/todayClazzCompletionCount") |
| | | public Result<?> todayClazzCompletionCount() { |
| | | List<ClazzCompletionCountDto> result = mdcLargeScreenService.todayClazzCompletionCount(); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ»æ§çæ¿-æ¨æ¥æ¦åµ", notes = "æ»æ§çæ¿-æ¨æ¥æ¦åµ") |
| | | @GetMapping("/yesterdayOverview") |
| | | public Result<?> yesterdayOverview() { |
| | | YesterdayOverviewDto yesterdayOverview = mdcLargeScreenService.yesterdayOverview(); |
| | | return Result.ok(yesterdayOverview); |
| | | } |
| | | |
| | | /** |
| | | * 弿ºçå©ç¨ç |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "æ»æ§çæ¿-仿¥è®¾å¤å·¥ä½æç", notes = "æ»æ§çæ¿-仿¥è®¾å¤å·¥ä½æç") |
| | | @GetMapping("/todayEquipmentRate") |
| | | public Result<?> todayEquipmentRate() { |
| | | List<EquipmentRateDto> result = mdcLargeScreenService.todayEquipmentRate(); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ»æ§çæ¿-æè®¾å¤å©ç¨ç", notes = "æ»æ§çæ¿-æè®¾å¤å©ç¨ç") |
| | | @GetMapping("/monthEquipmentUtilizationRate") |
| | | public Result<?> monthEquipmentUtilizationRate() { |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/22 10:41 |
| | | */ |
| | | @Data |
| | | public class ClazzCompletionCountDto { |
| | | /** |
| | | * çç» |
| | | */ |
| | | private String clazz; |
| | | /** |
| | | * 宿é |
| | | */ |
| | | private Integer completionCount; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/22 11:27 |
| | | */ |
| | | @Data |
| | | public class EquipmentRateDto { |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private String equipmentId; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | private String equipmentName; |
| | | |
| | | /** |
| | | * å©ç¨ç |
| | | */ |
| | | private BigDecimal utilizationRate = BigDecimal.ZERO; |
| | | /** |
| | | * 弿ºç |
| | | */ |
| | | private BigDecimal openRate = BigDecimal.ZERO; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/22 10:09 |
| | | */ |
| | | @Data |
| | | public class TodayProductionDto { |
| | | |
| | | /** |
| | | * 产线åç§° |
| | | */ |
| | | private String productionName; |
| | | |
| | | /** |
| | | * 计åé |
| | | */ |
| | | private Integer planCount; |
| | | |
| | | /** |
| | | * 宿é |
| | | */ |
| | | private Integer completionCount; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/22 10:25 |
| | | */ |
| | | @Data |
| | | public class TodayProductionPassRateDto { |
| | | |
| | | /** |
| | | * 产线åç§° |
| | | */ |
| | | private String productionName; |
| | | |
| | | /** |
| | | * 产ååæ ¼ç |
| | | */ |
| | | private BigDecimal passRate; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/20 11:44 |
| | | */ |
| | | @Data |
| | | public class YesterdayOverviewDto { |
| | | |
| | | /** |
| | | * 产ååæ ¼ç |
| | | */ |
| | | private BigDecimal passRate; |
| | | /** |
| | | * 设å¤å©ç¨ç |
| | | */ |
| | | private BigDecimal utilizationRate; |
| | | /** |
| | | * 计å宿ç |
| | | */ |
| | | private BigDecimal planCompleteRate; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; |
| | | import org.jeecg.modules.screen.dto.ClazzCompletionCountDto; |
| | | import org.jeecg.modules.screen.dto.TodayProductionDto; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/21 11:09 |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | | public interface MdcLargeScreenMapper { |
| | | |
| | | BigDecimal findEquipmentCount(@Param("date") String date); |
| | | |
| | | BigDecimal findYesterdayProcessCount(@Param("date") String date); |
| | | |
| | | List<TodayProductionDto> todayProductionSchedule(@Param("date") String date); |
| | | |
| | | List<MdcProductDayschedule> todayProductionPassRate(@Param("date") String date); |
| | | |
| | | List<ClazzCompletionCountDto> todayClazzCompletionCount(@Param("date") String date); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.screen.mapper.MdcLargeScreenMapper"> |
| | | |
| | | <select id="findEquipmentCount" resultType="java.math.BigDecimal"> |
| | | SELECT DISTINCT |
| | | COUNT(equipment_id) |
| | | FROM |
| | | mdc_equipment_statistical_info |
| | | WHERE |
| | | the_date = #{date} |
| | | </select> |
| | | |
| | | <select id="findYesterdayProcessCount" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | SUM( process_long ) |
| | | FROM |
| | | mdc_equipment_statistical_info |
| | | WHERE |
| | | the_date = #{date} |
| | | </select> |
| | | |
| | | <select id="todayProductionSchedule" resultType="org.jeecg.modules.screen.dto.TodayProductionDto"> |
| | | SELECT |
| | | productName, |
| | | SUM ( planCount ) planCount, |
| | | SUM ( completionCount ) completionCount |
| | | FROM |
| | | mdcJc_ProductDayschedule |
| | | WHERE |
| | | planDate = #{date} |
| | | GROUP BY |
| | | productName |
| | | </select> |
| | | |
| | | <select id="todayProductionPassRate" resultType="org.jeecg.modules.mdcJc.entity.MdcProductDayschedule"> |
| | | SELECT |
| | | productName, |
| | | SUM ( planCount ) planCount, |
| | | SUM ( completionCount ) completionCount, |
| | | SUM ( qualifiedCount ) qualifiedCount |
| | | FROM |
| | | mdcJc_ProductDayschedule |
| | | WHERE |
| | | planDate = #{date} |
| | | GROUP BY |
| | | productName |
| | | </select> |
| | | |
| | | <select id="todayClazzCompletionCount" resultType="org.jeecg.modules.screen.dto.ClazzCompletionCountDto"> |
| | | SELECT |
| | | clazz, |
| | | SUM ( completionCount ) completionCount |
| | | FROM |
| | | mdcJc_ProductDayschedule |
| | | WHERE |
| | | planDate = #{date} |
| | | GROUP BY |
| | | clazz |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.service; |
| | | |
| | | import org.jeecg.modules.screen.dto.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/19 16:02 |
| | | */ |
| | | public interface MdcLargeScreenService { |
| | | |
| | | /** |
| | | * æ¨æ¥æ¦åµï¼äº§ååæ ¼ç 设å¤å©ç¨ç 计å宿çï¼ |
| | | * |
| | | * @return |
| | | */ |
| | | YesterdayOverviewDto yesterdayOverview(); |
| | | |
| | | /** |
| | | * 仿¥ç产è¿åº¦ |
| | | * |
| | | * @return |
| | | */ |
| | | List<TodayProductionDto> todayProductionSchedule(); |
| | | |
| | | /** |
| | | * 仿¥äº§ååæ ¼ç |
| | | * |
| | | * @return |
| | | */ |
| | | List<TodayProductionPassRateDto> todayProductionPassRate(); |
| | | |
| | | /** |
| | | * 仿¥çç»å®æé |
| | | * |
| | | * @return |
| | | */ |
| | | List<ClazzCompletionCountDto> todayClazzCompletionCount(); |
| | | |
| | | /** |
| | | * 仿¥è®¾å¤å·¥ä½æç |
| | | * |
| | | * @return |
| | | */ |
| | | List<EquipmentRateDto> todayEquipmentRate(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.service.impl; |
| | | |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalInfoService; |
| | | import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; |
| | | import org.jeecg.modules.mdcJc.service.IMdcProductDayScheduleService; |
| | | import org.jeecg.modules.screen.dto.*; |
| | | import org.jeecg.modules.screen.mapper.MdcLargeScreenMapper; |
| | | import org.jeecg.modules.screen.service.MdcLargeScreenService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/8/20 11:36 |
| | | */ |
| | | @Service |
| | | public class MdcLargeScreenServiceImpl implements MdcLargeScreenService { |
| | | |
| | | @Resource |
| | | private IMdcProductDayScheduleService mdcProductDayScheduleService; |
| | | |
| | | @Resource |
| | | private MdcLargeScreenMapper mdcLargeScreenMapper; |
| | | |
| | | private final String yesterday = LocalDate.now().plusDays(-1).toString().replaceAll("-", ""); |
| | | |
| | | private final String today = LocalDate.now().toString().replaceAll("-", ""); |
| | | |
| | | |
| | | /** |
| | | * æ¨æ¥æ¦åµï¼äº§ååæ ¼ç 设å¤å©ç¨ç 计å宿çï¼ |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public YesterdayOverviewDto yesterdayOverview() { |
| | | YesterdayOverviewDto yesterdayOverviewDto = new YesterdayOverviewDto(); |
| | | MdcProductDayschedule mdcProductDayschedule = mdcProductDayScheduleService.findYesterdayData(); |
| | | if (mdcProductDayschedule != null) { |
| | | // 产ååæ ¼ç |
| | | yesterdayOverviewDto.setPassRate(new BigDecimal(mdcProductDayschedule.getQualifiedCount()).divide(new BigDecimal(mdcProductDayschedule.getCompletionCount()), 0, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); |
| | | // 计å宿ç |
| | | yesterdayOverviewDto.setPlanCompleteRate(new BigDecimal(mdcProductDayschedule.getCompletionCount()).divide(new BigDecimal(mdcProductDayschedule.getPlanCount()), 0, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); |
| | | } |
| | | // 设å¤å©ç¨ç |
| | | // String date = LocalDate.now().plusDays(-1).toString().replaceAll("-", ""); |
| | | BigDecimal equipmentCount = mdcLargeScreenMapper.findEquipmentCount(yesterday); |
| | | BigDecimal processCount = mdcLargeScreenMapper.findYesterdayProcessCount(yesterday); |
| | | BigDecimal utilizationRate = BigDecimal.ZERO; |
| | | if (equipmentCount != null && processCount != null) { |
| | | utilizationRate = processCount.divide(new BigDecimal("86400").multiply(equipmentCount), 0, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | yesterdayOverviewDto.setUtilizationRate(utilizationRate); |
| | | return yesterdayOverviewDto; |
| | | } |
| | | |
| | | /** |
| | | * 仿¥ç产è¿åº¦ |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TodayProductionDto> todayProductionSchedule() { |
| | | return mdcLargeScreenMapper.todayProductionSchedule(today); |
| | | } |
| | | |
| | | /** |
| | | * 仿¥äº§ååæ ¼ç |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TodayProductionPassRateDto> todayProductionPassRate() { |
| | | List<MdcProductDayschedule> list = mdcLargeScreenMapper.todayProductionPassRate(today); |
| | | List<TodayProductionPassRateDto> result = new ArrayList<>(); |
| | | if (list != null && !list.isEmpty()) { |
| | | for (MdcProductDayschedule mdcProductDayschedule : list) { |
| | | TodayProductionPassRateDto todayProductionPassRateDto = new TodayProductionPassRateDto(); |
| | | todayProductionPassRateDto.setProductionName(mdcProductDayschedule.getProductName()); |
| | | todayProductionPassRateDto.setPassRate(new BigDecimal(mdcProductDayschedule.getQualifiedCount()).divide(new BigDecimal(mdcProductDayschedule.getCompletionCount()), 0, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); |
| | | result.add(todayProductionPassRateDto); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 仿¥çç»å®æé |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ClazzCompletionCountDto> todayClazzCompletionCount() { |
| | | return mdcLargeScreenMapper.todayClazzCompletionCount(today); |
| | | } |
| | | |
| | | /** |
| | | * 仿¥è®¾å¤è¿è¡æç |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EquipmentRateDto> todayEquipmentRate() { |
| | | return null; |
| | | // return mdcLargeScreenMapper.todayEquipmentRate(); |
| | | } |
| | | } |
| | |
| | | @Test |
| | | public void test07() { |
| | | LocalDate localDate = LocalDate.now().plusDays(-1); |
| | | String date = LocalDate.now().toString(); |
| | | System.out.println(date); |
| | | // String date = LocalDate.now().toString(); |
| | | System.out.println(localDate); |
| | | } |
| | | |
| | | @Test |
| | |
| | | |
| | | import org.jeecg.JeecgSystemApplication; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcClassMonthService; |
| | | import org.jeecg.modules.mdcJc.service.IMdcProductMonthScheduleService; |
| | | import org.jeecg.modules.mdcJc.service.*; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class) |
| | | public class MesTest { |
| | | @Autowired |
| | | private IClassMonthlyscheduleService mesInfoInMdcService; |
| | | private IClassMonthlyScheduleService mesInfoInMdcService; |
| | | @Autowired |
| | | private IMdcClassMonthService mdcClassMonthService; |
| | | @Autowired |
| | | private IMdcProductMonthScheduleService mdcProductMonthScheduleService; |
| | | |
| | | @Autowired |
| | | private IMdcProductDayScheduleService mdcProductDayScheduleService; |
| | | |
| | | @Autowired |
| | | private IMdcOnLineQueueService mdcOnLineQueueService; |
| | | |
| | | @Autowired |
| | | private IMdcUnderLineQueueService mdcUnderLineQueueService; |
| | | |
| | | @Test |
| | | public void scheduleProductMonthList() { |
| | |
| | | |
| | | mesInfoInMdcService.findListClass(date); |
| | | } |
| | | |
| | | @Test |
| | | public void scheduleProductDayList() { |
| | | mdcProductDayScheduleService.scheduleProductDayList(); |
| | | } |
| | | |
| | | @Test |
| | | public void onLineQueueList() { |
| | | mdcOnLineQueueService.saveOnLineQueueList(); |
| | | } |
| | | |
| | | @Test |
| | | public void underLineQueueList() { |
| | | mdcUnderLineQueueService.saveUnderLineQueue(); |
| | | } |
| | | } |