| | |
| | | int msg = pushMsgService.startTask(serid, rid,type); |
| | | map.put("res", msg); |
| | | map.put("type", type); |
| | | taskqdService.updateRtype("0",rid); |
| | | return R.data(map); |
| | | } |
| | | |
| | |
| | | public interface TaskqdMapper extends BaseMapper<Taskqd> { |
| | | //抢单任务 |
| | | void updatet(Integer id, Integer num, String serid,String captain,String team); |
| | | void updateRtype(String type,String rid); |
| | | List<Taskqd> selectList(Integer id); |
| | | List<Map<String, Object>> queryReceiver(String serid); |
| | | List<TaskqdVO> selectLi(String type, String serid,String jurisdiction); |
| | |
| | | </if> |
| | | where id = #{id} |
| | | </update> |
| | | <update id="updateRtype"> |
| | | update sys_taskqd |
| | | SET rtype=#{type} |
| | | where id = #{rid} |
| | | </update> |
| | | |
| | | |
| | | <!--日常任务列表--> |
| | |
| | | */ |
| | | public interface ITaskqdService extends IService<Taskqd> { |
| | | void updatet(Integer id, Integer num, String serid,String captain,String team); |
| | | void updateRtype(String type,String rid); |
| | | List<Taskqd> selectList(Integer id); |
| | | List<Map<String, Object>> queryReceiver(String serid); |
| | | List<TaskqdVO> selectLi(String type, String serid,String jurisdiction); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateRtype(String type,String rid) { |
| | | baseMapper.updateRtype(type,rid); |
| | | } |
| | | |
| | | @Override |
| | | public List<Taskqd> selectList(Integer id) { |
| | | return baseMapper.selectList(id); |
| | | } |
| | |
| | | ChannelSupervise.addChannel(ctx.channel(),id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // TextWebSocketFrame tws = new TextWebSocketFrame(new Date().toString() |
| | |
| | | package org.springblade.modules.webscoket.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.channel.Channel; |
| | | import io.netty.channel.group.ChannelGroup; |
| | | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; |
| | | import org.springblade.modules.nettyServer.NettyConfig; |
| | | import org.springblade.modules.webscoket.service.IPushMsgService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author lq |
| | |
| | | public int startTask(String serid, String rid,String type) { |
| | | //返回值 |
| | | int res = 0; |
| | | Channel channel = NettyConfig.getUserChannelMap().get(serid); |
| | | String[] list = serid.split(","); |
| | | for (int i = 0; i <list.length ; i++) { |
| | | if (!list[i].equals("")){ |
| | | Channel channel = NettyConfig.getUserChannelMap().get(list[i]); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("type", type); |
| | | jsonObject.put("rid", rid); |
| | |
| | | channel.writeAndFlush(new TextWebSocketFrame(String.valueOf(jsonObject))); |
| | | res = 1; |
| | | } |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |