| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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.AndonOrder; |
| | | import org.jeecg.modules.mdc.service.IAndonOrderService; |
| | | import org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<AndonOrder> queryWrapper = QueryGenerator.initQueryWrapper(andonOrder, req.getParameterMap()); |
| | | Page<AndonOrder> page = new Page<AndonOrder>(pageNo, pageSize); |
| | | IPage<AndonOrder> pageList = andonOrderService.page(page, queryWrapper); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | IPage<AndonOrder> pageList= new Page<>(); |
| | | if (StringUtils.isNotBlank(userId)) { |
| | | pageList = andonOrderService.pageList(userId, andonOrder, pageNo, pageSize, req); |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | |
| | |
| | | List<AndonOrder> equAndonList(@Param("equipmentIdList") List<String> equipmentIdList); |
| | | |
| | | List<AndonOrder> untreatedAndonList(); |
| | | |
| | | IPage<AndonOrder> pageList(IPage<AndonOrder> pageData, @Param("andonOrder") AndonOrder andonOrder, @Param("userId") String userId); |
| | | } |
| | |
| | | ORDER BY |
| | | ao.create_time |
| | | </select> |
| | | <select id="pageList" resultType="org.jeecg.modules.mdc.entity.AndonOrder"> |
| | | SELECT |
| | | id, |
| | | equipment_id, |
| | | andon_type, |
| | | operator, |
| | | operate_time, |
| | | responder, |
| | | response_time, |
| | | processor, |
| | | process_time, |
| | | order_status, |
| | | problem_descreption, |
| | | resolution_descreption, |
| | | image_files, |
| | | del_flag, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | call_reason, |
| | | plant_name |
| | | FROM |
| | | andon_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND (operator = #{userId} OR responder = #{userId} OR processor = #{userId}) |
| | | <if test="andonOrder.equipmentId != null and andonOrder.equipmentId != '' "> |
| | | AND equipment_id LIKE CONCAT(CONCAT('%',#{andonOrder.equipmentId}),'%') |
| | | </if> |
| | | <if test="andonOrder.andonType != null and andonOrder.andonType != '' "> |
| | | AND andon_type = #{andonOrder.andonType} |
| | | </if> |
| | | <if test="andonOrder.orderStatus != null and andonOrder.orderStatus != '' "> |
| | | AND order_status = #{andonOrder.orderStatus} |
| | | </if> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.board.vo.EquAndon; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | import org.jeecg.modules.mdc.vo.AndonOrderWebSocketVo; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | void responseData(List<String> ids); |
| | | |
| | | void dealWith(AndonOrder andonOrder); |
| | | |
| | | IPage<AndonOrder> pageList(String userId, AndonOrder andonOrder, Integer pageNo, Integer pageSize, HttpServletRequest req); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringPool; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.WebsocketConst; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.AndonOrderWebSocketVo; |
| | | import org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo; |
| | | import org.jeecg.modules.message.websocket.WebSocket; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | this.updateById(andonOrder); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AndonOrder> pageList(String userId, AndonOrder andonOrder, Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | | IPage<AndonOrder> pageData = new Page<>(pageNo, pageSize); |
| | | return this.baseMapper.pageList(pageData, andonOrder, userId); |
| | | } |
| | | } |