|
|
@ -18,7 +18,6 @@ package com.logpm.basicdata.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.nacos.common.utils.StringUtils; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -44,7 +43,6 @@ import com.logpm.warehouse.vo.WarehouseTraybarCode; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import org.springblade.common.constant.CodeNumConstant; |
|
|
|
import org.springblade.common.constant.CodeNumConstant; |
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
|
|
|
import org.springblade.common.utils.QRCodeUtil; |
|
|
|
import org.springblade.common.utils.QRCodeUtil; |
|
|
|
import org.springblade.common.utils.TemplateUtil; |
|
|
|
import org.springblade.common.utils.TemplateUtil; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
@ -53,15 +51,10 @@ import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import sun.misc.BASE64Encoder; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.FileInputStream; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
@ -233,9 +226,9 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe |
|
|
|
WarehouseTrayQRCode trayQRCode = baseMapper.getTray(id); |
|
|
|
WarehouseTrayQRCode trayQRCode = baseMapper.getTray(id); |
|
|
|
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(trayQRCode), Map.class); |
|
|
|
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(trayQRCode), Map.class); |
|
|
|
String filename = QRCodeUtil.createCodeToFile(trayQRCode.getTrayCode()); |
|
|
|
String filename = QRCodeUtil.createCodeToFile(trayQRCode.getTrayCode()); |
|
|
|
map.put("qrCode", getEmpAutograph(filename)); |
|
|
|
map.put("qrCode", QRCodeUtil.getEmpAutograph(filename)); |
|
|
|
String fileTypeName = QRCodeUtil.createCodeToFileType(trayQRCode.getTrayCode()); |
|
|
|
String fileTypeName = QRCodeUtil.createCodeToFileType(trayQRCode.getTrayCode()); |
|
|
|
map.put("imgType", getEmpAutograph(fileTypeName)); |
|
|
|
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName)); |
|
|
|
map.put("tenant","汇通物流"); |
|
|
|
map.put("tenant","汇通物流"); |
|
|
|
data.add(map); |
|
|
|
data.add(map); |
|
|
|
} |
|
|
|
} |
|
|
@ -243,29 +236,7 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe |
|
|
|
return warehouseTraybarCode; |
|
|
|
return warehouseTraybarCode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getEmpAutograph(String filePath) { |
|
|
|
|
|
|
|
String img = null; |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(filePath)) { |
|
|
|
|
|
|
|
InputStream in = null; |
|
|
|
|
|
|
|
byte[] picdata = null; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
in = new FileInputStream(filePath); |
|
|
|
|
|
|
|
picdata = new byte[in.available()]; |
|
|
|
|
|
|
|
in.read(picdata); |
|
|
|
|
|
|
|
BASE64Encoder encoder = new BASE64Encoder(); |
|
|
|
|
|
|
|
img = encoder.encode(picdata); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
in.close(); |
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return "data:image/png;base64," + img; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|