Merge branch 'master' of http://117.34.109.166:18448/r/mdc_yituo
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | 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 org.jeecg.modules.mdc.service.IEquipmentElectricStatisticalService; |
| | | import org.jeecg.modules.mdc.vo.EquipmentElectricStatisticalVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤çµæµç»è®¡ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "设å¤çµæµç»è®¡") |
| | | @RestController |
| | | @RequestMapping("/mdc/equipmentElectricStatistical") |
| | | public class EquipmentElectricStatisticalController extends JeecgController<EquipmentElectricStatistical, IEquipmentElectricStatisticalService> { |
| | | |
| | | @Resource |
| | | private IEquipmentElectricStatisticalService equipmentElectricStatisticalService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param equipmentElectricStatisticalVo |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤çµæµç»è®¡-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "设å¤çµæµç»è®¡-å页å表æ¥è¯¢", notes = "设å¤çµæµç»è®¡-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EquipmentElectricStatisticalVo equipmentElectricStatisticalVo, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | Page<EquipmentElectricStatistical> page = new Page<EquipmentElectricStatistical>(pageNo, pageSize); |
| | | IPage<EquipmentElectricStatistical> pageList = equipmentElectricStatisticalService.pageList(userId, page, equipmentElectricStatisticalVo, req); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param equipmentElectricStatisticalVo |
| | | */ |
| | | @AutoLog(value = "设å¤çµæµç»è®¡-导åº") |
| | | @ApiOperation(value = "设å¤çµæµç»è®¡-导åº", notes = "设å¤çµæµç»è®¡-导åº") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | return equipmentElectricStatisticalService.exportXls(userId, equipmentElectricStatisticalVo); |
| | | } |
| | | |
| | | /** |
| | | * çµæµè´è½½å¯¹æ¯ |
| | | * |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤çµæµç»è®¡-çµæµè´è½½å¯¹æ¯") |
| | | @ApiOperation(value = "设å¤çµæµç»è®¡-çµæµè´è½½å¯¹æ¯", notes = "设å¤çµæµç»è®¡-çµæµè´è½½å¯¹æ¯") |
| | | @GetMapping(value = "/getElectricValue") |
| | | public Result<?> getElectricValue(EquipmentElectricStatisticalVo equipmentElectricStatisticalVo) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | List<EquipmentElectricStatisticalDto> resultList = equipmentElectricStatisticalService.getElectricValue(userId, equipmentElectricStatisticalVo); |
| | | return Result.OK(resultList); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | 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; |
| | | import org.jeecg.modules.mdc.vo.EquipmentSpindleStatisticalVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @Description: 设å¤è´è½½ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "设å¤è´è½½") |
| | | @RestController |
| | | @RequestMapping("/mdc/equipmentSpindleStatistical") |
| | | public class EquipmentSpindleStatisticalController extends JeecgController<EquipmentSpindleStatistical, IEquipmentSpindleStatisticalService> { |
| | | |
| | | @Resource |
| | | private IEquipmentSpindleStatisticalService equipmentSpindleStatisticalService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤è´è½½-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "设å¤è´è½½-å页å表æ¥è¯¢", notes = "设å¤è´è½½-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | Page<EquipmentSpindleStatistical> page = new Page<EquipmentSpindleStatistical>(pageNo, pageSize); |
| | | IPage<EquipmentSpindleStatistical> pageList = equipmentSpindleStatisticalService.pageList(userId, page, equipmentSpindleStatisticalVo, req); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param equipmentSpindleStatisticalVo |
| | | */ |
| | | @AutoLog(value = "设å¤è´è½½-导åº") |
| | | @ApiOperation(value = "设å¤è´è½½-导åº", notes = "设å¤è´è½½-导åº") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | return equipmentSpindleStatisticalService.exportXls(userId, equipmentSpindleStatisticalVo); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/16 16:11 |
| | | */ |
| | | @Data |
| | | public class EquipmentElectricStatisticalDto extends EquipmentElectricStatistical { |
| | | |
| | | @ApiModelProperty(value = "æ¥æ") |
| | | private String dayDate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | 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-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("equipment_electric_statistical") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "equipment_electric_statistical对象", description = "设å¤çµæµç»è®¡") |
| | | public class EquipmentElectricStatistical implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7635486686927678464L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentid; |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Excel(name = "设å¤åç§°", width = 15) |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String equipmentname; |
| | | /** |
| | | * åæ ç±»å 1,X;2,Y;3,Z;4,A;5,B; |
| | | */ |
| | | @Excel(name = "åæ ç±»å", width = 15) |
| | | @ApiModelProperty(value = "åæ ç±»å 1,X;2,Y;3,Z;4,A;5,B;") |
| | | private Integer axistype; |
| | | /** |
| | | * åæ å¼ |
| | | */ |
| | | @Excel(name = "åæ å¼", width = 15) |
| | | @ApiModelProperty(value = "åæ å¼") |
| | | private String axisvalue; |
| | | /** |
| | | * æå¤§çµæµå¼ |
| | | */ |
| | | @Excel(name = "æå¤§çµæµ", width = 15) |
| | | @ApiModelProperty(value = "æå¤§çµæµ") |
| | | private String electricvalue; |
| | | /** |
| | | * 对åºä¸»è½´è´è½½ |
| | | */ |
| | | @Excel(name = "主轴è´è½½", width = 15) |
| | | @ApiModelProperty(value = "主轴è´è½½") |
| | | private String spindleload; |
| | | /** |
| | | * 对åºä¸»è½´è½¬é |
| | | */ |
| | | @Excel(name = "主轴转é", width = 15) |
| | | @ApiModelProperty(value = "主轴转é") |
| | | private String spindlespeed; |
| | | /** |
| | | * æå¤§çµæµçééæ¶é´ |
| | | */ |
| | | @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 electrictime; |
| | | /** |
| | | * æå¤§çµæµå¯¹åºåæ çééæ¶é´ |
| | | */ |
| | | @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 axistime; |
| | | /** |
| | | * æå¤§çµæµå¯¹åºä¸»è½´è½¬éçééæ¶é´ |
| | | */ |
| | | @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 spindletime; |
| | | /** |
| | | * ç»è®¡æ¥æ |
| | | */ |
| | | @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 createdate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | 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.util.Date; |
| | | |
| | | /** |
| | | * @Description: 设å¤è´è½½ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("equipment_spindle_statistical") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "equipment_spindle_statistical对象", description = "设å¤è´è½½") |
| | | public class EquipmentSpindleStatistical { |
| | | |
| | | private static final long serialVersionUID = 685063684783288830L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentid; |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Excel(name = "设å¤åç§°", width = 15) |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String equipmentname; |
| | | /** |
| | | * 主轴è´è½½ |
| | | */ |
| | | @Excel(name = "主轴è´è½½", width = 15) |
| | | @ApiModelProperty(value = "主轴è´è½½") |
| | | private String spindleload; |
| | | /** |
| | | * 主轴转é |
| | | */ |
| | | @Excel(name = "主轴转é", width = 15) |
| | | @ApiModelProperty(value = "主轴转é") |
| | | private String spindlespeed; |
| | | /** |
| | | * Xåæ å¼ |
| | | */ |
| | | @Excel(name = "Xåæ å¼", width = 15) |
| | | @ApiModelProperty(value = "Xåæ å¼") |
| | | private String axisx; |
| | | /** |
| | | * Yåæ å¼ |
| | | */ |
| | | @Excel(name = "Yåæ å¼", width = 15) |
| | | @ApiModelProperty(value = "Yåæ å¼") |
| | | private String axisy; |
| | | /** |
| | | * Zåæ å¼ |
| | | */ |
| | | @Excel(name = "Zåæ å¼", width = 15) |
| | | @ApiModelProperty(value = "Zåæ å¼") |
| | | private String axisz; |
| | | /** |
| | | * Aåæ å¼ |
| | | */ |
| | | @Excel(name = "Aåæ å¼", width = 15) |
| | | @ApiModelProperty(value = "Aåæ å¼") |
| | | private String axisa; |
| | | /** |
| | | * Båæ å¼ |
| | | */ |
| | | @Excel(name = "Båæ å¼", width = 15) |
| | | @ApiModelProperty(value = "Båæ å¼") |
| | | private String axisb; |
| | | /** |
| | | * 主轴è´è½½ééæ¶é´ |
| | | */ |
| | | @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 spindletime; |
| | | /** |
| | | * åæ ééæ¶é´ |
| | | */ |
| | | @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 axistime; |
| | | /** |
| | | * ç»è®¡æ¥æ |
| | | */ |
| | | @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 createdate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.dto.EquipmentElectricStatisticalDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | import org.jeecg.modules.mdc.vo.EquipmentElectricStatisticalVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤çµæµç»è®¡ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EquipmentElectricStatisticalMapper extends BaseMapper<EquipmentElectricStatistical> { |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param page |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | IPage<EquipmentElectricStatistical> pageList(Page<EquipmentElectricStatistical> page, @Param("equipmentElectricStatisticalVo") EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | List<EquipmentElectricStatistical> list(@Param("equipmentElectricStatisticalVo") EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | |
| | | /** |
| | | * çµæµè´è½½å¯¹æ¯ |
| | | * |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | List<EquipmentElectricStatisticalDto> getElectricValue(@Param("equipmentElectricStatisticalVo") EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical; |
| | | import org.jeecg.modules.mdc.vo.EquipmentSpindleStatisticalVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤è´è½½ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EquipmentSpindleStatisticalMapper extends BaseMapper<EquipmentSpindleStatistical> { |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param page |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @return |
| | | */ |
| | | IPage<EquipmentSpindleStatistical> pageList(Page<EquipmentSpindleStatistical> page, @Param("equipmentSpindleStatisticalVo") EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo); |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @return |
| | | */ |
| | | List<EquipmentSpindleStatistical> list(@Param("equipmentSpindleStatisticalVo") EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.EquipmentElectricStatisticalMapper"> |
| | | |
| | | <select id="pageList" resultType="org.jeecg.modules.mdc.entity.EquipmentElectricStatistical"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | equipment_electric_statistical |
| | | <where> |
| | | <if test="equipmentElectricStatisticalVo.equipmentId != null and equipmentElectricStatisticalVo.equipmentId != ''"> |
| | | AND equipmentID LIKE CONCAT(CONCAT('%',#{equipmentElectricStatisticalVo.equipmentId}),'%') |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.equipmentName != null and equipmentElectricStatisticalVo.equipmentName != ''"> |
| | | AND equipmentName LIKE CONCAT(CONCAT('%',#{equipmentElectricStatisticalVo.equipmentName}),'%') |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.axistype != null and equipmentElectricStatisticalVo.axistype != ''"> |
| | | AND axisType = #{equipmentElectricStatisticalVo.axistype} |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.createDate != null and equipmentElectricStatisticalVo.createDate != ''"> |
| | | AND createDate = #{equipmentElectricStatisticalVo.createDate} |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.equipmentIdList != null and equipmentElectricStatisticalVo.equipmentIdList.size() > 0"> |
| | | AND equipmentID IN |
| | | <foreach collection="equipmentElectricStatisticalVo.equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | |
| | | <select id="list" resultType="org.jeecg.modules.mdc.entity.EquipmentElectricStatistical"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | equipment_electric_statistical |
| | | <where> |
| | | <if test="equipmentElectricStatisticalVo.equipmentId != null and equipmentElectricStatisticalVo.equipmentId != ''"> |
| | | AND equipmentID LIKE CONCAT(CONCAT('%',#{equipmentElectricStatisticalVo.equipmentId}),'%') |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.equipmentName != null and equipmentElectricStatisticalVo.equipmentName != ''"> |
| | | AND equipmentName LIKE CONCAT(CONCAT('%',#{equipmentElectricStatisticalVo.equipmentName}),'%') |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.axistype != null and equipmentElectricStatisticalVo.axistype != ''"> |
| | | AND axisType = #{equipmentElectricStatisticalVo.axistype} |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.createDate != null and equipmentElectricStatisticalVo.createDate != ''"> |
| | | AND createDate = #{equipmentElectricStatisticalVo.createDate} |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.equipmentIdList != null and equipmentElectricStatisticalVo.equipmentIdList.size() > 0"> |
| | | AND equipmentID IN |
| | | <foreach collection="equipmentElectricStatisticalVo.equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | |
| | | <select id="getElectricValue" resultType="org.jeecg.modules.mdc.dto.EquipmentElectricStatisticalDto"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | equipment_electric_statistical |
| | | <where> |
| | | <if test="equipmentElectricStatisticalVo.equipmentId != null and equipmentElectricStatisticalVo.equipmentId != ''"> |
| | | AND equipmentID LIKE CONCAT(CONCAT('%',#{equipmentElectricStatisticalVo.equipmentId}),'%') |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.equipmentName != null and equipmentElectricStatisticalVo.equipmentName != ''"> |
| | | AND equipmentName LIKE CONCAT(CONCAT('%',#{equipmentElectricStatisticalVo.equipmentName}),'%') |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.axistype != null and equipmentElectricStatisticalVo.axistype != ''"> |
| | | AND axisType = #{equipmentElectricStatisticalVo.axistype} |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.startDate != null and equipmentElectricStatisticalVo.startDate != '' and equipmentElectricStatisticalVo.endDate != null and equipmentElectricStatisticalVo.endDate != ''"> |
| | | AND createDate BETWEEN #{equipmentElectricStatisticalVo.startDate} AND #{ equipmentElectricStatisticalVo.endDate } |
| | | </if> |
| | | <if test="equipmentElectricStatisticalVo.equipmentIdList != null and equipmentElectricStatisticalVo.equipmentIdList.size() > 0"> |
| | | AND equipmentID IN |
| | | <foreach collection="equipmentElectricStatisticalVo.equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY id ASC |
| | | </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.EquipmentSpindleStatisticalMapper"> |
| | | |
| | | <select id="pageList" resultType="org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | equipment_spindle_statistical |
| | | <where> |
| | | <if test="equipmentSpindleStatisticalVo.equipmentId != null and equipmentSpindleStatisticalVo.equipmentId != ''"> |
| | | AND equipmentID LIKE CONCAT(CONCAT('%',#{equipmentSpindleStatisticalVo.equipmentId}),'%') |
| | | </if> |
| | | <if test="equipmentSpindleStatisticalVo.equipmentName != null and equipmentSpindleStatisticalVo.equipmentName != ''"> |
| | | AND equipmentName LIKE CONCAT(CONCAT('%',#{equipmentSpindleStatisticalVo.equipmentName}),'%') |
| | | </if> |
| | | <if test="equipmentSpindleStatisticalVo.createDate != null and equipmentSpindleStatisticalVo.createDate != ''"> |
| | | AND createDate = #{equipmentSpindleStatisticalVo.createDate} |
| | | </if> |
| | | <if test="equipmentSpindleStatisticalVo.equipmentIdList != null and equipmentSpindleStatisticalVo.equipmentIdList.size() > 0"> |
| | | AND equipmentID IN |
| | | <foreach collection="equipmentSpindleStatisticalVo.equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | |
| | | <select id="list" resultType="org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | equipment_spindle_statistical |
| | | <where> |
| | | <if test="equipmentSpindleStatisticalVo.equipmentId != null and equipmentSpindleStatisticalVo.equipmentId != ''"> |
| | | AND equipmentID LIKE CONCAT(CONCAT('%',#{equipmentSpindleStatisticalVo.equipmentId}),'%') |
| | | </if> |
| | | <if test="equipmentSpindleStatisticalVo.equipmentName != null and equipmentSpindleStatisticalVo.equipmentName != ''"> |
| | | AND equipmentName LIKE CONCAT(CONCAT('%',#{equipmentSpindleStatisticalVo.equipmentName}),'%') |
| | | </if> |
| | | <if test="equipmentSpindleStatisticalVo.createDate != null and equipmentSpindleStatisticalVo.createDate != ''"> |
| | | AND createDate = #{equipmentSpindleStatisticalVo.createDate} |
| | | </if> |
| | | <if test="equipmentSpindleStatisticalVo.equipmentIdList != null and equipmentSpindleStatisticalVo.equipmentIdList.size() > 0"> |
| | | AND equipmentID IN |
| | | <foreach collection="equipmentSpindleStatisticalVo.equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.dto.EquipmentElectricStatisticalDto; |
| | | import org.jeecg.modules.mdc.entity.EquipmentElectricStatistical; |
| | | import org.jeecg.modules.mdc.vo.EquipmentElectricStatisticalVo; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤çµæµç»è®¡ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEquipmentElectricStatisticalService extends IService<EquipmentElectricStatistical> { |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param userId |
| | | * @param page |
| | | * @param equipmentElectricStatisticalVo |
| | | * @param req |
| | | * @return |
| | | */ |
| | | IPage<EquipmentElectricStatistical> pageList(String userId, Page<EquipmentElectricStatistical> page, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo, HttpServletRequest req); |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param userId |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | ModelAndView exportXls(String userId, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | |
| | | /** |
| | | * çµæµè´è½½å¯¹æ¯ |
| | | * |
| | | * @param userId |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | List<EquipmentElectricStatisticalDto> getElectricValue(String userId, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical; |
| | | import org.jeecg.modules.mdc.vo.EquipmentSpindleStatisticalVo; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @Description: 设å¤è´è½½ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEquipmentSpindleStatisticalService extends IService<EquipmentSpindleStatistical> { |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param userId |
| | | * @param page |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @param req |
| | | * @return |
| | | */ |
| | | IPage<EquipmentSpindleStatistical> pageList(String userId, Page<EquipmentSpindleStatistical> page, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo, HttpServletRequest req); |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param userId |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @return |
| | | */ |
| | | ModelAndView exportXls(String userId, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 org.jeecg.modules.mdc.service.IEquipmentElectricStatisticalService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.EquipmentElectricStatisticalVo; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤çµæµç»è®¡ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EquipmentElectricStatisticalServiceImpl extends ServiceImpl<EquipmentElectricStatisticalMapper, EquipmentElectricStatistical> implements IEquipmentElectricStatisticalService { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | @Override |
| | | public IPage<EquipmentElectricStatistical> pageList(String userId, Page<EquipmentElectricStatistical> page, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo, HttpServletRequest req) { |
| | | List<String> equipmentIds = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(equipmentElectricStatisticalVo.getParentId()) && StringUtils.isEmpty(equipmentElectricStatisticalVo.getEquipmentId())) { |
| | | if ("2".equals(equipmentElectricStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, equipmentElectricStatisticalVo.getParentId()); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, equipmentElectricStatisticalVo.getParentId()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(equipmentElectricStatisticalVo.getEquipmentId())) { |
| | | //åå°è®¾å¤ä¿¡æ¯ |
| | | equipmentElectricStatisticalVo.setEquipmentIdList(Collections.singletonList(equipmentElectricStatisticalVo.getEquipmentId())); |
| | | } else { |
| | | //æ¥è¯¢ç¨æ·æ¥æçææè®¾å¤ä¿¡æ¯ |
| | | if ("2".equals(equipmentElectricStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null); |
| | | } |
| | | } |
| | | |
| | | if (equipmentElectricStatisticalVo.getEquipmentIdList() == null || equipmentElectricStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | equipmentElectricStatisticalVo.setEquipmentIdList(equipmentIds); |
| | | } |
| | | |
| | | if (equipmentElectricStatisticalVo.getEquipmentIdList() == null || equipmentElectricStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | return null; |
| | | } |
| | | return this.baseMapper.pageList(page, equipmentElectricStatisticalVo); |
| | | } |
| | | |
| | | @Override |
| | | public ModelAndView exportXls(String userId, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo) { |
| | | List<String> equipmentIds = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(equipmentElectricStatisticalVo.getParentId()) && StringUtils.isEmpty(equipmentElectricStatisticalVo.getEquipmentId())) { |
| | | if ("2".equals(equipmentElectricStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, equipmentElectricStatisticalVo.getParentId()); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, equipmentElectricStatisticalVo.getParentId()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(equipmentElectricStatisticalVo.getEquipmentId())) { |
| | | //åå°è®¾å¤ä¿¡æ¯ |
| | | equipmentElectricStatisticalVo.setEquipmentIdList(Collections.singletonList(equipmentElectricStatisticalVo.getEquipmentId())); |
| | | } else { |
| | | //æ¥è¯¢ç¨æ·æ¥æçææè®¾å¤ä¿¡æ¯ |
| | | if ("2".equals(equipmentElectricStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null); |
| | | } |
| | | } |
| | | |
| | | if (equipmentElectricStatisticalVo.getEquipmentIdList() == null || equipmentElectricStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | equipmentElectricStatisticalVo.setEquipmentIdList(equipmentIds); |
| | | } |
| | | |
| | | if (equipmentElectricStatisticalVo.getEquipmentIdList() == null || equipmentElectricStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | return null; |
| | | } |
| | | // Step.2 AutoPoi 导åºExcel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | List<EquipmentElectricStatistical> equipmentElectricStatisticals = this.baseMapper.list(equipmentElectricStatisticalVo); |
| | | // å¯¼åºæä»¶åç§° |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "设å¤çµæµç»è®¡å表"); |
| | | mv.addObject(NormalExcelConstants.CLASS, EquipmentElectricStatistical.class); |
| | | //è·åå½åç»å½ç¨æ· |
| | | //update-begin---author:wangshuai ---date:20211227 forï¼[JTC-116]导åºäººåæ»äº------------ |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("设å¤çµæµç»è®¡åè¡¨æ°æ®", "导åºäºº:" + user.getRealname(), "设å¤çµæµç»è®¡")); |
| | | //update-end---author:wangshuai ---date:20211227 forï¼[JTC-116]导åºäººåæ»äº------------ |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, equipmentElectricStatisticals); |
| | | return mv; |
| | | } |
| | | |
| | | /** |
| | | * çµæµè´è½½å¯¹æ¯ |
| | | * |
| | | * @param userId |
| | | * @param equipmentElectricStatisticalVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EquipmentElectricStatisticalDto> getElectricValue(String userId, EquipmentElectricStatisticalVo equipmentElectricStatisticalVo) { |
| | | List<EquipmentElectricStatisticalDto> equipmentElectricStatisticals = this.baseMapper.getElectricValue(equipmentElectricStatisticalVo); |
| | | if (equipmentElectricStatisticals != null && !equipmentElectricStatisticals.isEmpty()) { |
| | | for (EquipmentElectricStatisticalDto equipmentElectricStatistical : equipmentElectricStatisticals) { |
| | | equipmentElectricStatistical.setDayDate(DateUtils.format(equipmentElectricStatistical.getCreatedate(), DateUtils.STR_DATE)); |
| | | } |
| | | } |
| | | return equipmentElectricStatisticals; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.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 org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.vo.EquipmentSpindleStatisticalVo; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤è´è½½ |
| | | * @Author: lius |
| | | * @Date: 2024-07-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EquipmentSpindleStatisticalServiceImpl extends ServiceImpl<EquipmentSpindleStatisticalMapper, EquipmentSpindleStatistical> implements IEquipmentSpindleStatisticalService { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param userId |
| | | * @param page |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<EquipmentSpindleStatistical> pageList(String userId, Page<EquipmentSpindleStatistical> page, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo, HttpServletRequest req) { |
| | | List<String> equipmentIds = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(equipmentSpindleStatisticalVo.getParentId()) && StringUtils.isEmpty(equipmentSpindleStatisticalVo.getEquipmentId())) { |
| | | if ("2".equals(equipmentSpindleStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, equipmentSpindleStatisticalVo.getParentId()); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, equipmentSpindleStatisticalVo.getParentId()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(equipmentSpindleStatisticalVo.getEquipmentId())) { |
| | | //åå°è®¾å¤ä¿¡æ¯ |
| | | equipmentSpindleStatisticalVo.setEquipmentIdList(Collections.singletonList(equipmentSpindleStatisticalVo.getEquipmentId())); |
| | | } else { |
| | | //æ¥è¯¢ç¨æ·æ¥æçææè®¾å¤ä¿¡æ¯ |
| | | if ("2".equals(equipmentSpindleStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null); |
| | | } |
| | | } |
| | | |
| | | if (equipmentSpindleStatisticalVo.getEquipmentIdList() == null || equipmentSpindleStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | equipmentSpindleStatisticalVo.setEquipmentIdList(equipmentIds); |
| | | } |
| | | |
| | | if (equipmentSpindleStatisticalVo.getEquipmentIdList() == null || equipmentSpindleStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | return null; |
| | | } |
| | | return this.baseMapper.pageList(page, equipmentSpindleStatisticalVo); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param userId |
| | | * @param equipmentSpindleStatisticalVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ModelAndView exportXls(String userId, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo) { |
| | | List<String> equipmentIds = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(equipmentSpindleStatisticalVo.getParentId()) && StringUtils.isEmpty(equipmentSpindleStatisticalVo.getEquipmentId())) { |
| | | if ("2".equals(equipmentSpindleStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, equipmentSpindleStatisticalVo.getParentId()); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, equipmentSpindleStatisticalVo.getParentId()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(equipmentSpindleStatisticalVo.getEquipmentId())) { |
| | | //åå°è®¾å¤ä¿¡æ¯ |
| | | equipmentSpindleStatisticalVo.setEquipmentIdList(Collections.singletonList(equipmentSpindleStatisticalVo.getEquipmentId())); |
| | | } else { |
| | | //æ¥è¯¢ç¨æ·æ¥æçææè®¾å¤ä¿¡æ¯ |
| | | if ("2".equals(equipmentSpindleStatisticalVo.getTypeTree())) { |
| | | //é¨é¨å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null); |
| | | } else { |
| | | //产线å±çº§ |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null); |
| | | } |
| | | } |
| | | |
| | | if (equipmentSpindleStatisticalVo.getEquipmentIdList() == null || equipmentSpindleStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | equipmentSpindleStatisticalVo.setEquipmentIdList(equipmentIds); |
| | | } |
| | | |
| | | if (equipmentSpindleStatisticalVo.getEquipmentIdList() == null || equipmentSpindleStatisticalVo.getEquipmentIdList().isEmpty()) { |
| | | return null; |
| | | } |
| | | // Step.2 AutoPoi 导åºExcel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | List<EquipmentSpindleStatistical> equipmentSpindleStatisticals = this.baseMapper.list(equipmentSpindleStatisticalVo); |
| | | // å¯¼åºæä»¶åç§° |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "设å¤è´è½½å表"); |
| | | mv.addObject(NormalExcelConstants.CLASS, EquipmentSpindleStatistical.class); |
| | | //è·åå½åç»å½ç¨æ· |
| | | //update-begin---author:wangshuai ---date:20211227 forï¼[JTC-116]导åºäººåæ»äº------------ |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("设å¤è´è½½åè¡¨æ°æ®", "导åºäºº:" + user.getRealname(), "设å¤è´è½½")); |
| | | //update-end---author:wangshuai ---date:20211227 forï¼[JTC-116]导åºäººåæ»äº------------ |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, equipmentSpindleStatisticals); |
| | | return mv; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/16 10:40 |
| | | */ |
| | | @Data |
| | | public class EquipmentElectricStatisticalVo { |
| | | /** |
| | | * æ¥æ -> yyyy-MM-dd |
| | | */ |
| | | @ApiModelProperty(value = "æ¥æ(yyyy-MM-dd)") |
| | | private String createDate; |
| | | /** |
| | | * å¼å§æ¥æ -> yyyy-MM-dd |
| | | */ |
| | | @ApiModelProperty(value = "æ¥æ(yyyy-MM-dd)") |
| | | private String startDate; |
| | | /** |
| | | * ç»ææ¥æ -> yyyy-MM-dd |
| | | */ |
| | | @ApiModelProperty(value = "æ¥æ(yyyy-MM-dd)") |
| | | private String endDate; |
| | | /** |
| | | * åæ ç±»å 1,X;2,Y;3,Z;4,A;5,B; |
| | | */ |
| | | @ApiModelProperty(value = "åæ ç±»å 1,X;2,Y;3,Z;4,A;5,B;") |
| | | private Integer axistype; |
| | | /** |
| | | * æ ç±»å -> 1:车é´å±çº§ 2:é¨é¨å±çº§ |
| | | */ |
| | | @ApiModelProperty(value = "æ ç±»å") |
| | | private String typeTree; |
| | | /** |
| | | * å±çº§ID |
| | | */ |
| | | @ApiModelProperty(value = "å±çº§ID") |
| | | private String parentId; |
| | | /** |
| | | * 设å¤Id |
| | | */ |
| | | @ApiModelProperty(value = "设å¤Id") |
| | | private String equipmentId; |
| | | /** |
| | | * 设å¤Id |
| | | */ |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String equipmentName; |
| | | /** |
| | | * 设å¤ids |
| | | */ |
| | | @ApiModelProperty(value = "设å¤ids") |
| | | private List<String> equipmentIdList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/7/16 14:42 |
| | | */ |
| | | @Data |
| | | public class EquipmentSpindleStatisticalVo { |
| | | /** |
| | | * æ¥æ -> yyyy-MM-dd |
| | | */ |
| | | @ApiModelProperty(value = "æ¥æ(yyyy-MM-dd)") |
| | | private String createDate; |
| | | /** |
| | | * æ ç±»å -> 1:车é´å±çº§ 2:é¨é¨å±çº§ |
| | | */ |
| | | @ApiModelProperty(value = "æ ç±»å") |
| | | private String typeTree; |
| | | /** |
| | | * å±çº§ID |
| | | */ |
| | | @ApiModelProperty(value = "å±çº§ID") |
| | | private String parentId; |
| | | /** |
| | | * 设å¤Id |
| | | */ |
| | | @ApiModelProperty(value = "设å¤Id") |
| | | private String equipmentId; |
| | | /** |
| | | * 设å¤Id |
| | | */ |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String equipmentName; |
| | | /** |
| | | * 设å¤ids |
| | | */ |
| | | @ApiModelProperty(value = "设å¤ids") |
| | | private List<String> equipmentIdList; |
| | | } |