Commit 826a5368 by 宋珺琪

api返回结果失败处理

parent 22ba8197
......@@ -59,7 +59,7 @@ public class SkServiceController extends ApiController {
public MapRestResult save(SkService skService) throws IOException {
skService.setXxzjbh(KeyUtil.getUUIDKey("FW"));
skService.setCjsj(new Date());
skService.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(skService.getServicetype(),"ZF"));
// skService.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(skService.getServicetype(),"ZF"));
boolean save = skServiceService.save(skService);
if (save) {
......
......@@ -5,6 +5,7 @@ import com.founder.commonutils.util.JwtUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.TextMessage;
import javax.annotation.PostConstruct;
import javax.websocket.*;
......@@ -85,7 +86,9 @@ public class WebSocketServer {
public static void SendMessage(Session session, String message) {
try {
// session.getBasicRemote().sendText(String.format("%s (From Server,Session ID=%s)",message,session.getId()));
if (session.isOpen()){
session.getBasicRemote().sendText(message);
}
} catch (IOException e) {
log.error("发送消息出错:{}", e.getMessage());
e.printStackTrace();
......@@ -102,11 +105,23 @@ public class WebSocketServer {
try {
for (Session session : map.values()) {
log.info("服务端群发给客户端[{}]发送消息{}", session.getId(), message);
synchronized (session) {
SendMessage(session,message);
}
}
} catch (Exception e) {
log.error("服务端发送消息给客户端失败", e);
}
/*
try {
for (Session session : map.values()) {
log.info("服务端群发给客户端[{}]发送消息{}", session.getId(), message);
session.getBasicRemote().sendText(message);
}
} catch (Exception e) {
log.error("服务端发送消息给客户端失败", e);
}
*/
/* for (Session session : SessionSet) {
if(session.isOpen()){
......
......@@ -9,6 +9,7 @@ import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.publicapi.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -178,6 +179,13 @@ public class OrderController {
Map<String,Object> mapResult = new HashMap<>();
Map<String,Object> objectMap = new HashMap<>();
try{
if (StringUtils.isEmpty(orderCode)){
mapResult.put("data","");
mapResult.put("msg","获取申请详情失败");
mapResult.put("status",200);
mapResult.put("count","");
return mapResult;
}
TbstApproveOrder tbstApproveOrder = new TbstApproveOrder();
tbstApproveOrder.setOrderCode(orderCode);
objectMap = orderService.getSqdDteail(tbstApproveOrder);
......
......@@ -110,7 +110,7 @@ public class SkServiceSqController {
if (updateById) {
return new MapRestResult();
} else {
return new MapRestResult().error();
return new MapRestResult(200,"此xxzjbh不存在",null);
}
}
}
......@@ -300,8 +300,16 @@ public class UserServiceImpl implements UserService {
roleId=DLYJ_ROLEID;
}
TbStApproveUserRole userRoleInfo = userMapper.getUserRoleInfoByRoleId(agentUser.getId(),roleId);
if (userRoleInfo!= null){
paramMap.put("id",userRoleInfo.getId());
paramMap.put("scbz","1");
}else {
resultMap.put("msg","获取id失败");
resultMap.put("data","");
resultMap.put("status",200);
return resultMap;
}
int r =userMapper.deleteApproveUserRole(paramMap);
if(r>0){
resultMap.put("msg","success");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment