Compare commits
No commits in common. "10e3cea687d1e2d616a31d88cc64e4c4c03b7f80" and "8c16585ae6ec8358198d56f0bfee8996c910c52c" have entirely different histories.
10e3cea687
...
8c16585ae6
@ -65,9 +65,9 @@ public class WeChatServiceImpl implements WeChatService {
|
|||||||
@Override
|
@Override
|
||||||
public LoginVo authorizeLogin(String code, HttpServletRequest request) {
|
public LoginVo authorizeLogin(String code, HttpServletRequest request) {
|
||||||
LoginVo loginVo = new LoginVo();
|
LoginVo loginVo = new LoginVo();
|
||||||
WeChatMiniAuthorizeVo response = miniAuthCode(code);
|
// WeChatMiniAuthorizeVo response = miniAuthCode(code);
|
||||||
// WeChatMiniAuthorizeVo response = new WeChatMiniAuthorizeVo();
|
WeChatMiniAuthorizeVo response = new WeChatMiniAuthorizeVo();
|
||||||
// response.setOpenId("123456");
|
response.setOpenId("123456");
|
||||||
String openId = response.getOpenId();
|
String openId = response.getOpenId();
|
||||||
String type = "login";
|
String type = "login";
|
||||||
BusUser BusUser = BusUserMapper.getUserByOpenId(openId);
|
BusUser BusUser = BusUserMapper.getUserByOpenId(openId);
|
||||||
|
@ -21,13 +21,16 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import me.zhengjie.modules.system.service.webstocket.res.WebSocketResPrintInfo;
|
import me.zhengjie.modules.system.domain.dto.BusTreeVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description /
|
* @description /
|
||||||
@ -72,9 +75,6 @@ public class BusDevice implements Serializable {
|
|||||||
@ApiModelProperty(value = "打印状态(-1默认/断开,0空闲,1归零中,2下降中,3曝光中,4抬升中,5正在执行暂停动作中,6已暂停,7正在执行停止动作中,8已停止,9打印完成,10文件检测中,11加液中,12铲件中)")
|
@ApiModelProperty(value = "打印状态(-1默认/断开,0空闲,1归零中,2下降中,3曝光中,4抬升中,5正在执行暂停动作中,6已暂停,7正在执行停止动作中,8已停止,9打印完成,10文件检测中,11加液中,12铲件中)")
|
||||||
private Integer printStatus;
|
private Integer printStatus;
|
||||||
|
|
||||||
@ApiModelProperty(value = "打印信息")
|
|
||||||
private String printJson;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "异常状态(-1默认/断开,0正常,1文件校验失败,2设备或加密错误,3打印准备过程出错,4打印出错,5加液失败,6铲件失败,7图片异物)")
|
@ApiModelProperty(value = "异常状态(-1默认/断开,0正常,1文件校验失败,2设备或加密错误,3打印准备过程出错,4打印出错,5加液失败,6铲件失败,7图片异物)")
|
||||||
private Integer errorStatus;
|
private Integer errorStatus;
|
||||||
|
|
||||||
@ -96,10 +96,6 @@ public class BusDevice implements Serializable {
|
|||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
private Timestamp updateTime;
|
private Timestamp updateTime;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
@ApiModelProperty(value = "打印信息")
|
|
||||||
private WebSocketResPrintInfo printInfo;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<BusDeviceCommand> commandList;
|
private List<BusDeviceCommand> commandList;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public interface BusDeviceMapper extends BaseMapper<BusDevice> {
|
|||||||
|
|
||||||
List<BusTreeVo> getDevice();
|
List<BusTreeVo> getDevice();
|
||||||
|
|
||||||
void updateDeviceStatus(@Param("deviceSn") String deviceSn, @Param("status") Integer status, @Param("printStatus") Integer printStatus, @Param("errorStatus") Integer errorStatus, @Param("remark") String remark, @Param("printJson") String printJson);
|
void updateDeviceStatus(@Param("deviceSn") String deviceSn, @Param("status") Integer status, @Param("printStatus") Integer printStatus, @Param("errorStatus") Integer errorStatus, @Param("remark") String remark);
|
||||||
|
|
||||||
IPage<BusDevice> myDeviceList(@Param("userId") Long userId, Page<Object> page);
|
IPage<BusDevice> myDeviceList(@Param("userId") Long userId, Page<Object> page);
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public interface BusDeviceService extends IService<BusDevice> {
|
|||||||
/**
|
/**
|
||||||
* 修改设备状态
|
* 修改设备状态
|
||||||
*/
|
*/
|
||||||
void updateDeviceStatus(String deviceSn, CurrentStatusEnum e1, PrintInfoStatusEnum e2, ErrorStatusEnum e3, String remark, String printJson);
|
void updateDeviceStatus(String deviceSn, CurrentStatusEnum e1, PrintInfoStatusEnum e2, ErrorStatusEnum e3, String remark);
|
||||||
|
|
||||||
PageResult<BusDevice> myDeviceList(Long userId, Page<Object> page);
|
PageResult<BusDevice> myDeviceList(Long userId, Page<Object> page);
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.zhengjie.modules.system.service.impl;
|
package me.zhengjie.modules.system.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
import me.zhengjie.modules.front.domain.dto.DeviceLogCriteria;
|
import me.zhengjie.modules.front.domain.dto.DeviceLogCriteria;
|
||||||
@ -32,7 +31,6 @@ import me.zhengjie.modules.system.service.BusDeviceService;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import me.zhengjie.modules.system.service.webstocket.res.WebSocketResPrintInfo;
|
|
||||||
import me.zhengjie.utils.*;
|
import me.zhengjie.utils.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
@ -66,10 +64,7 @@ public class BusDeviceServiceImpl extends ServiceImpl<BusDeviceMapper, BusDevice
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BusDevice getByDeviceCode(String deviceCode) {
|
public BusDevice getByDeviceCode(String deviceCode) {
|
||||||
BusDevice device = busDeviceMapper.selectOne(new QueryWrapper<BusDevice>().eq("device_code", deviceCode));
|
return busDeviceMapper.selectOne(new QueryWrapper<BusDevice>().eq("device_code", deviceCode));
|
||||||
if (null != device) { device.setPrintInfo(JSON.parseObject(device.getPrintJson(), WebSocketResPrintInfo.class)); }
|
|
||||||
device.setPrintJson(null);
|
|
||||||
return device;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -84,8 +79,8 @@ public class BusDeviceServiceImpl extends ServiceImpl<BusDeviceMapper, BusDevice
|
|||||||
|
|
||||||
@Async
|
@Async
|
||||||
@Override
|
@Override
|
||||||
public void updateDeviceStatus(String deviceSn, CurrentStatusEnum e1, PrintInfoStatusEnum e2, ErrorStatusEnum e3, String remark, String printJson) {
|
public void updateDeviceStatus(String deviceSn, CurrentStatusEnum e1, PrintInfoStatusEnum e2, ErrorStatusEnum e3, String remark) {
|
||||||
busDeviceMapper.updateDeviceStatus(deviceSn, e1.getCode(), e2.getCode(), e3.getCode(), remark, printJson);
|
busDeviceMapper.updateDeviceStatus(deviceSn, e1.getCode(), e2.getCode(), e3.getCode(), remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
|
@ -90,7 +90,7 @@ public class WebSocketSdcpServiceImpl extends WebSocketService {
|
|||||||
PrintInfoStatusEnum print = PrintInfoStatusEnum.SDCP_PRINT_STATUS_DEFAULT;
|
PrintInfoStatusEnum print = PrintInfoStatusEnum.SDCP_PRINT_STATUS_DEFAULT;
|
||||||
ErrorStatusEnum error = ErrorStatusEnum.SDCP_PRINT_ERROR_DEFAULT;
|
ErrorStatusEnum error = ErrorStatusEnum.SDCP_PRINT_ERROR_DEFAULT;
|
||||||
String remark = "已关闭连接";
|
String remark = "已关闭连接";
|
||||||
myDeviceService.updateDeviceStatus(null, status, print, error, remark, null);
|
myDeviceService.updateDeviceStatus(null, status, print, error, remark);
|
||||||
sendVueMessage(JSON.toJSONString(new SocketMsg(new HashMap<>() , remark, MsgEnum.CLOSE)), null, null);
|
sendVueMessage(JSON.toJSONString(new SocketMsg(new HashMap<>() , remark, MsgEnum.CLOSE)), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ public class WebSocketSdcpServiceImpl extends WebSocketService {
|
|||||||
PrintInfoStatusEnum print = PrintInfoStatusEnum.getEnumByNum(resStatus.getPrintInfo().getStatus());;
|
PrintInfoStatusEnum print = PrintInfoStatusEnum.getEnumByNum(resStatus.getPrintInfo().getStatus());;
|
||||||
ErrorStatusEnum error = ErrorStatusEnum.getEnumByNum(resStatus.getPrintInfo().getErrorNumber());
|
ErrorStatusEnum error = ErrorStatusEnum.getEnumByNum(resStatus.getPrintInfo().getErrorNumber());
|
||||||
remark = "状态已更新";
|
remark = "状态已更新";
|
||||||
myDeviceService.updateDeviceStatus(deviceSn, status, print, error, remark, JSON.toJSONString(resDTO.getStatus().getPrintInfo()));
|
myDeviceService.updateDeviceStatus(deviceSn, status, print, error, remark);
|
||||||
sendVueMessage(JSON.toJSONString(new SocketMsg(commandResult, remark, MsgEnum.STATUS)), null, null);
|
sendVueMessage(JSON.toJSONString(new SocketMsg(commandResult, remark, MsgEnum.STATUS)), null, null);
|
||||||
return;
|
return;
|
||||||
} else if (method == MethodEnum.attributes) {
|
} else if (method == MethodEnum.attributes) {
|
||||||
@ -361,7 +361,7 @@ public class WebSocketSdcpServiceImpl extends WebSocketService {
|
|||||||
PrintInfoStatusEnum print = PrintInfoStatusEnum.getEnumByNum(resStatus.getPrintInfo().getStatus());;
|
PrintInfoStatusEnum print = PrintInfoStatusEnum.getEnumByNum(resStatus.getPrintInfo().getStatus());;
|
||||||
ErrorStatusEnum error = ErrorStatusEnum.getEnumByNum(resStatus.getPrintInfo().getErrorNumber());
|
ErrorStatusEnum error = ErrorStatusEnum.getEnumByNum(resStatus.getPrintInfo().getErrorNumber());
|
||||||
remark = "设备发生异常";
|
remark = "设备发生异常";
|
||||||
myDeviceService.updateDeviceStatus(deviceSn, status, print, error, remark, null);
|
myDeviceService.updateDeviceStatus(deviceSn, status, print, error, remark);
|
||||||
sendVueMessage(JSON.toJSONString(new SocketMsg(commandResult, remark, MsgEnum.STATUS)), null, null);
|
sendVueMessage(JSON.toJSONString(new SocketMsg(commandResult, remark, MsgEnum.STATUS)), null, null);
|
||||||
return;
|
return;
|
||||||
} else if (method == MethodEnum.notice) {
|
} else if (method == MethodEnum.notice) {
|
||||||
|
@ -181,7 +181,7 @@ public class WebSocketVueServiceImpl extends WebSocketService {
|
|||||||
// {"Topic":"sdcp/request/12345678","command":"PAUSE"}
|
// {"Topic":"sdcp/request/12345678","command":"PAUSE"}
|
||||||
else if (command.equals(CapabilitieEnum.PAUSE.name())) {
|
else if (command.equals(CapabilitieEnum.PAUSE.name())) {
|
||||||
BusDevice device = myDeviceService.getByDeviceCode(deviceSn);
|
BusDevice device = myDeviceService.getByDeviceCode(deviceSn);
|
||||||
if (!(device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_PRINTING.getCode()) && device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_PREPARE.getCode()))) {
|
if (!device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_PREPARE.getCode())) {
|
||||||
Map<String, Object> commandResult = new HashMap<>();
|
Map<String, Object> commandResult = new HashMap<>();
|
||||||
commandResult.put("deviceSn", deviceSn);
|
commandResult.put("deviceSn", deviceSn);
|
||||||
sendVueMessage(session, JSON.toJSONString(new SocketMsg(commandResult, "当前状态无法操作暂停", MsgEnum.ERROR)));
|
sendVueMessage(session, JSON.toJSONString(new SocketMsg(commandResult, "当前状态无法操作暂停", MsgEnum.ERROR)));
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package me.zhengjie.modules.system.service.webstocket.res;
|
package me.zhengjie.modules.system.service.webstocket.res;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -9,31 +8,22 @@ import java.io.Serializable;
|
|||||||
public class WebSocketResPrintInfo implements Serializable {
|
public class WebSocketResPrintInfo implements Serializable {
|
||||||
|
|
||||||
// 打印子状态
|
// 打印子状态
|
||||||
@ApiModelProperty(value = "打印子状态")
|
|
||||||
private Integer Status;
|
private Integer Status;
|
||||||
// 当前打印层数
|
// 当前打印层数
|
||||||
@ApiModelProperty(value = "当前打印层数")
|
|
||||||
private Integer CurrentLayer;
|
private Integer CurrentLayer;
|
||||||
// 打印任务总层数
|
// 打印任务总层数
|
||||||
@ApiModelProperty(value = "打印任务总层数")
|
|
||||||
private Integer TotalLayer;
|
private Integer TotalLayer;
|
||||||
// 当前已打印时间(ms)
|
// 当前已打印时间(ms)
|
||||||
@ApiModelProperty(value = "当前已打印时间(ms)")
|
|
||||||
private Integer CurrentTicks;
|
private Integer CurrentTicks;
|
||||||
// 总打印时间(ms)
|
// 总打印时间(ms)
|
||||||
@ApiModelProperty(value = "总打印时间(ms)")
|
|
||||||
private Integer TotalTicks;
|
private Integer TotalTicks;
|
||||||
// 打印文件名称
|
// 打印文件名称
|
||||||
@ApiModelProperty(value = "打印文件名称")
|
|
||||||
private String Filename;
|
private String Filename;
|
||||||
// 错误码,参考后文 ErrorEnum
|
// 错误码,参考后文 ErrorEnum
|
||||||
@ApiModelProperty(value = "错误码")
|
|
||||||
private Integer ErrorNumber;
|
private Integer ErrorNumber;
|
||||||
// 当前任务数量
|
// 当前任务数量
|
||||||
@ApiModelProperty(value = "当前任务数量")
|
|
||||||
private Integer Task;
|
private Integer Task;
|
||||||
// 总共任务数量
|
// 总共任务数量
|
||||||
@ApiModelProperty(value = "总共任务数量")
|
|
||||||
private Integer Total;
|
private Integer Total;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateDeviceStatus">
|
<update id="updateDeviceStatus">
|
||||||
update bus_device set status = #{status}, print_status = #{printStatus}, error_status = #{errorStatus}, remark = #{remark}, print_json = #{printJson}
|
update bus_device set status = #{status}, print_status = #{printStatus}, error_status = #{errorStatus}, remark = #{remark}
|
||||||
<where><if test="deviceSn != null and deviceSn != ''"> device_sn = #{deviceSn} </if></where>
|
<where><if test="deviceSn != null and deviceSn != ''"> device_sn = #{deviceSn} </if></where>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user