| | |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringPool; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.WebsocketConst; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.board.vo.EquAndon; |
| | | import org.jeecg.modules.mdc.dto.MdcEquProDto; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | import org.jeecg.modules.mdc.mapper.AndonOrderMapper; |
| | |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.AndonOrderWebSocketVo; |
| | | import org.jeecg.modules.message.websocket.WebSocket; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | /** |
| | | * @Description: andon_order |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-11 |
| | | * @Date: 2025-06-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | |
| | | private WebSocket webSocket; |
| | | @Resource |
| | | private ISysUserService userService; |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | |
| | | @Override |
| | | public void procedureCall(AndonOrder andonOrder) { |
| | | if (StringUtils.isBlank(andonOrder.getEquipmentId())) { |
| | |
| | | webSocket.sendMessage(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 安灯问题列表 |
| | | */ |
| | | @Override |
| | | public List<EquAndon> equAndonList(List<String> equipmentIdList) { |
| | | List<EquAndon> result = new ArrayList<>(); |
| | | List<AndonOrder> andonOrderList = this.baseMapper.equAndonList(equipmentIdList); |
| | | if (andonOrderList != null && !andonOrderList.isEmpty()) { |
| | | andonOrderList.forEach(andonOrder -> { |
| | | EquAndon equAndon = new EquAndon(); |
| | | equAndon.setEquipmentId(andonOrder.getEquipmentId()); |
| | | StringBuilder infoBuilder = new StringBuilder(); |
| | | infoBuilder.append("安灯类型: ").append(sysDictService.queryDictTextByKey("andon_type",andonOrder.getAndonType())).append("\n"); |
| | | infoBuilder.append("安灯人: ").append(sysDictService.queryTableDictTextByKey("sys_user", "realname", "id", andonOrder.getOperator())).append("\n"); |
| | | infoBuilder.append("安灯时间: ").append(DateUtils.format(andonOrder.getOperateTime(), DateUtils.STR_DATE_TIME_SMALL)).append("\n"); |
| | | infoBuilder.append("安灯状态: ").append(sysDictService.queryDictTextByKey("order_status",andonOrder.getOrderStatus())).append("\n"); |
| | | equAndon.setAndonInfo(infoBuilder.toString()); |
| | | result.add(equAndon); |
| | | }); |
| | | } |
| | | return result; |
| | | } |
| | | } |