45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
package com.sercurityControl.proteam.service.impl;
|
|
|
|
import com.alibaba.nacos.common.utils.UuidUtils;
|
|
import com.sercurityControl.proteam.domain.ty.MqImageVo;
|
|
import com.sercurityControl.proteam.mapper.MqImageSbConsumerMapper;
|
|
import com.sercurityControl.proteam.service.MqImageSbConsumerService;
|
|
import com.sercurityControl.proteam.util.DateTimeHelper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.bytedeco.leptonica.NUMA;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
/**
|
|
* @author HeiZi
|
|
*/
|
|
@Service
|
|
@Slf4j
|
|
public class MqImageSbConsumerServiceImpl implements MqImageSbConsumerService {
|
|
|
|
public int maxLength=2;
|
|
|
|
@Autowired
|
|
private MqImageSbConsumerMapper mapper;
|
|
|
|
@Override
|
|
public void insertMqMessage(MqImageVo vo) {
|
|
try{
|
|
int num=8;
|
|
// int num=mapper.getDevCode(vo.getDevCode().trim());
|
|
int imageNum=mapper.getImageNum(vo.getDevCode());
|
|
if (num>0 && imageNum<=maxLength){
|
|
vo.setId(UuidUtils.generateUuid().toUpperCase());
|
|
vo.setDelFlag("0");
|
|
vo.setCreateTime(DateTimeHelper.getNowDate());
|
|
mapper.insertMqMessage(vo);
|
|
}
|
|
}catch (Exception e){
|
|
// log.error(e.toString(),e);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|