no message
							parent
							
								
									6ca2b6ae23
								
							
						
					
					
						commit
						db602f669f
					
				| 
						 | 
				
			
			@ -23,7 +23,6 @@ import com.youchain.basicdata.domain.Stock;
 | 
			
		|||
import com.youchain.basicdata.service.StockService;
 | 
			
		||||
import com.youchain.basicdata.service.dto.StockQueryCriteria;
 | 
			
		||||
import com.youchain.config.FileProperties;
 | 
			
		||||
import com.youchain.config.thread.ThreadPoolExecutorUtil;
 | 
			
		||||
import com.youchain.exception.handler.ApiResult;
 | 
			
		||||
import com.youchain.modules.system.domain.Dept;
 | 
			
		||||
import com.youchain.utils.*;
 | 
			
		||||
| 
						 | 
				
			
			@ -202,10 +201,10 @@ public class StockController {
 | 
			
		|||
        return new ResponseEntity<>(stockService.getItemCode(stockCode), HttpStatus.OK);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping(value = "/stockMsg")
 | 
			
		||||
    @GetMapping(value = "/stockMsg")
 | 
			
		||||
    @AnonymousAccess
 | 
			
		||||
    public ResponseEntity<Object> stockMsg() {
 | 
			
		||||
        String stockMsg = stockService.stockMsg();
 | 
			
		||||
    public ResponseEntity<Object> stockMsg(String msg) {
 | 
			
		||||
        String stockMsg = stockService.stockMsg(msg);
 | 
			
		||||
        return new ResponseEntity<>(stockMsg, HttpStatus.OK);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -207,6 +207,6 @@ public interface StockService {
 | 
			
		|||
    /**
 | 
			
		||||
     * 消息推送
 | 
			
		||||
     */
 | 
			
		||||
    String stockMsg();
 | 
			
		||||
    String stockMsg(String msg);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,7 +52,6 @@ import org.springframework.data.domain.Pageable;
 | 
			
		|||
import java.sql.Timestamp;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.concurrent.ConcurrentHashMap;
 | 
			
		||||
import java.util.regex.Matcher;
 | 
			
		||||
import java.util.regex.Pattern;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
| 
						 | 
				
			
			@ -631,13 +630,16 @@ public class StockServiceImpl implements StockService {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String stockMsg() {
 | 
			
		||||
    public String stockMsg(String msg) {
 | 
			
		||||
        try {
 | 
			
		||||
            WebSocketServer.sendInfo(new SocketMsg("容器未解绑,请及时处理!", MsgType.INFO), "stock");
 | 
			
		||||
            SocketMsg socketMsg = new SocketMsg(msg, MsgType.INFO);
 | 
			
		||||
            WebSocketServer.sendInfo(socketMsg, "stock");
 | 
			
		||||
            String message = JSONObject.toJSONString(socketMsg);
 | 
			
		||||
            return message;
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            e.printStackTrace();
 | 
			
		||||
        }
 | 
			
		||||
        return "ok";
 | 
			
		||||
        return "error";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,13 +50,13 @@ public class LicenseValidate {
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
    public static LicenseCheck getSystemPrice(){
 | 
			
		||||
 | 
			
		||||
        LicenseCheck licenseCheck=null;
 | 
			
		||||
        FileProperties properties= SpringContextHolder.getBean(FileProperties.class);
 | 
			
		||||
        String devicePath =properties.getPath().getPath()+"key/"+"device.key";
 | 
			
		||||
        String deviceInfoJson =readDeviceFile();
 | 
			
		||||
        if(StringUtils.isNotBlank(deviceInfoJson)){
 | 
			
		||||
            try{
 | 
			
		||||
                LicenseCheck licenseCheck =JSONUtil.toBean(deviceInfoJson,LicenseCheck.class);
 | 
			
		||||
                licenseCheck =JSONUtil.toBean(deviceInfoJson,LicenseCheck.class);
 | 
			
		||||
                BasicFileAttributes attributes = Files.readAttributes(Paths.get(devicePath), BasicFileAttributes.class);
 | 
			
		||||
                String  creationTime = attributes.creationTime().toString();
 | 
			
		||||
                String lastModifiedTime = attributes.lastModifiedTime().toString();
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ public class LicenseValidate {
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
        createDeviceFileOrRead();
 | 
			
		||||
        return null;
 | 
			
		||||
        return licenseCheck;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void validate()  throws Exception{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,10 +1,13 @@
 | 
			
		|||
package com.youchain.modules.license.domain;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author 92525
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class LicenseCheck implements Serializable {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -25,43 +28,4 @@ public class LicenseCheck implements Serializable {
 | 
			
		|||
     */
 | 
			
		||||
    private String createTime;
 | 
			
		||||
 | 
			
		||||
    public String getCreateTime() {
 | 
			
		||||
        return createTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setCreateTime(String createTime) {
 | 
			
		||||
        this.createTime = createTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getEndTime() {
 | 
			
		||||
        return endTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setEndTime(String endTime) {
 | 
			
		||||
        this.endTime = endTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LicenseCheck(){
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public String getCpuSerial() {
 | 
			
		||||
        return cpuSerial;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setCpuSerial(String cpuSerial) {
 | 
			
		||||
        this.cpuSerial = cpuSerial;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getMainBoardSerial() {
 | 
			
		||||
        return mainBoardSerial;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMainBoardSerial(String mainBoardSerial) {
 | 
			
		||||
        this.mainBoardSerial = mainBoardSerial;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue