一些问题修改
This commit is contained in:
parent
b181c48583
commit
380bd86a8e
@ -64,6 +64,8 @@ public class UserConstants
|
|||||||
/** InnerLink组件标识 */
|
/** InnerLink组件标识 */
|
||||||
public final static String INNER_LINK = "InnerLink";
|
public final static String INNER_LINK = "InnerLink";
|
||||||
|
|
||||||
|
public final static String WEBSOCKET_HEARTBEAT = "-heartbeat-";
|
||||||
|
|
||||||
/** 校验返回结果码 */
|
/** 校验返回结果码 */
|
||||||
public final static String UNIQUE = "0";
|
public final static String UNIQUE = "0";
|
||||||
public final static String NOT_UNIQUE = "1";
|
public final static String NOT_UNIQUE = "1";
|
||||||
|
@ -12,6 +12,7 @@ import javax.websocket.server.ServerEndpoint;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.ktg.common.constant.UserConstants;
|
||||||
import com.ktg.common.core.domain.entity.SysUser;
|
import com.ktg.common.core.domain.entity.SysUser;
|
||||||
import com.ktg.common.core.domain.model.LoginUser;
|
import com.ktg.common.core.domain.model.LoginUser;
|
||||||
import com.ktg.common.utils.StringUtils;
|
import com.ktg.common.utils.StringUtils;
|
||||||
@ -124,15 +125,18 @@ public class WebSocketServer
|
|||||||
@OnMessage
|
@OnMessage
|
||||||
public void onMessage(String message, Session session)
|
public void onMessage(String message, Session session)
|
||||||
{
|
{
|
||||||
try{
|
if(!UserConstants.WEBSOCKET_HEARTBEAT.equals(message)){
|
||||||
SysMessage msg = JSON.parseObject(message, new TypeReference<SysMessage>(){});
|
try{
|
||||||
if(StringUtils.isNotNull(msg.getRecipientName())){
|
SysMessage msg = JSON.parseObject(message, new TypeReference<SysMessage>(){});
|
||||||
//这里必须传递username
|
if(StringUtils.isNotNull(msg.getRecipientName())){
|
||||||
WebSocketUsers.sendMesssageToUserByName(msg.getRecipientName(),message);
|
//这里必须传递username
|
||||||
|
WebSocketUsers.sendMesssageToUserByName(msg.getRecipientName(),message);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
LOGGER.error("\n 错误的websocket信息格式 - {}", message);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
|
||||||
LOGGER.error("\n 错误的websocket信息格式 - {}", message);
|
|
||||||
}
|
}
|
||||||
|
LOGGER.debug("\n 收到客户端发送的消息 - {}", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,10 @@ public class MdProductBomController extends BaseController
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody MdProductBom mdProductBom)
|
public AjaxResult add(@RequestBody MdProductBom mdProductBom)
|
||||||
{
|
{
|
||||||
|
if(mdProductBom.getBomItemId() == mdProductBom.getItemId()){
|
||||||
|
return AjaxResult.error("产品不能作为自身的BOM物料!");
|
||||||
|
}
|
||||||
|
|
||||||
return toAjax(mdProductBomService.insertMdProductBom(mdProductBom));
|
return toAjax(mdProductBomService.insertMdProductBom(mdProductBom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public class ProTaskController extends BaseController
|
|||||||
}
|
}
|
||||||
BigDecimal produced = workorder.getQuantityProduced();
|
BigDecimal produced = workorder.getQuantityProduced();
|
||||||
BigDecimal quantitiy = workorder.getQuantity();
|
BigDecimal quantitiy = workorder.getQuantity();
|
||||||
wdata.setProgress( produced.divide(quantitiy).floatValue());
|
wdata.setProgress( produced.divide(quantitiy,BigDecimal.ROUND_HALF_UP).floatValue());
|
||||||
wdata.setDuration(0L);
|
wdata.setDuration(0L);
|
||||||
wdata.setType(UserConstants.GANTT_TASK_TYPE_PROJECT);
|
wdata.setType(UserConstants.GANTT_TASK_TYPE_PROJECT);
|
||||||
ganttData.add(wdata);
|
ganttData.add(wdata);
|
||||||
|
Loading…
Reference in New Issue
Block a user