|
@ -8,6 +8,7 @@ import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.util.HttpUtil;
|
|
|
import com.yihu.wlyy.util.QrcodeUtil;
|
|
|
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.json.JSONArray;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@ -46,13 +47,17 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
|
|
|
@Autowired
|
|
|
private PrescriptionExpressageService prescriptionExpressageService;
|
|
|
|
|
|
@Autowired
|
|
|
private com.yihu.wlyy.util.CommonUtil CommonUtil;
|
|
|
@Value("${fastDFS.fastdfs_file_url}")
|
|
|
private String fastdfs_file_url;
|
|
|
@Value("${neiwang.enable}")
|
|
|
private Boolean isneiwang = false; //如果不是内网项目要转到到内网wlyy在上传
|
|
|
|
|
|
private static Object obj = new Object();
|
|
|
private static Object obj2 = new Object();
|
|
|
|
|
|
@Value("${fastDFS.fastdfs_file_url}")
|
|
|
String fastdfs_file_url;
|
|
|
|
|
|
//获取居民端取药码列表
|
|
|
public JSONArray findByStatusAndTime(Integer timeType, String patientCode, Integer status, Integer page, Integer pagesize,Integer type) {
|
|
|
// 分页信息
|
|
@ -172,12 +177,39 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
// 生成二维码
|
|
|
// InputStream ipt = QrcodeUtil.createQrcode(Base64.encode(code.getBytes()),300,"png");
|
|
|
InputStream ipt = QrcodeUtil.createQrcode(code,300,"png");
|
|
|
ObjectNode imgNode = FastDFSUtil.upload(ipt,"png","QRCode_"+System.currentTimeMillis());
|
|
|
|
|
|
// Prescription类 取药类型:1 自取 2快递配送 3健管师配送
|
|
|
String fileUrl = fastdfs_file_url + imgNode.get("groupName").toString().replaceAll("\"","")
|
|
|
+ "/" + imgNode.get("remoteFileName").toString().replaceAll("\"","");
|
|
|
|
|
|
String fileUrl = "";
|
|
|
|
|
|
if (isneiwang) {
|
|
|
// 圖片列表
|
|
|
List<String> tempPaths = new ArrayList<String>();
|
|
|
try {
|
|
|
ObjectNode imgNode = FastDFSUtil.upload(ipt,"png","QRCode_"+System.currentTimeMillis());
|
|
|
com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(imgNode.toString());
|
|
|
tempPaths.add(json.getString("fid"));
|
|
|
String urls = "";
|
|
|
for (String image : tempPaths) {
|
|
|
if (urls.length() == 0) {
|
|
|
urls = image;
|
|
|
} else {
|
|
|
urls += "," + image;
|
|
|
}
|
|
|
}
|
|
|
fileUrl = fastdfs_file_url + urls;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
} else {
|
|
|
try {
|
|
|
fileUrl = fastdfs_file_url + CommonUtil.PrescriptionQRCodetoNeiWang(ipt);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//新增居民处方取码记录
|
|
|
PrescriptionDispensaryCode prescriptionDispensaryCode = new PrescriptionDispensaryCode();
|
|
@ -205,12 +237,39 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
//String jgsID= "";//配送员用户ID后4位
|
|
|
// String jgsCode = code+"1234";//code+jgsID.substring(jgsID.length()-4);
|
|
|
// 生成二维码
|
|
|
// InputStream ipt = QrcodeUtil.createQrcode(Base64.encode(jgsCode.getBytes()),300,"png");
|
|
|
InputStream ipt = QrcodeUtil.createQrcode(jgsCode,300,"png");
|
|
|
ObjectNode imgNode = FastDFSUtil.upload(ipt,"png","QRCode_"+System.currentTimeMillis());
|
|
|
InputStream ipt = QrcodeUtil.createQrcode(code,300,"png");
|
|
|
|
|
|
// Prescription类 取药类型:1 自取 2快递配送 3健管师配送
|
|
|
String fileUrl = fastdfs_file_url + imgNode.get("groupName").toString().replaceAll("\"","")
|
|
|
+ "/" + imgNode.get("remoteFileName").toString().replaceAll("\"","");
|
|
|
|
|
|
String fileUrl = "";
|
|
|
|
|
|
if (isneiwang) {
|
|
|
// 圖片列表
|
|
|
List<String> tempPaths = new ArrayList<String>();
|
|
|
try {
|
|
|
ObjectNode imgNode = FastDFSUtil.upload(ipt,"png","QRCode_"+System.currentTimeMillis());
|
|
|
com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(imgNode.toString());
|
|
|
tempPaths.add(json.getString("fid"));
|
|
|
String urls = "";
|
|
|
for (String image : tempPaths) {
|
|
|
if (urls.length() == 0) {
|
|
|
urls = image;
|
|
|
} else {
|
|
|
urls += "," + image;
|
|
|
}
|
|
|
}
|
|
|
fileUrl = fastdfs_file_url + urls;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
} else {
|
|
|
try {
|
|
|
fileUrl = fastdfs_file_url + CommonUtil.PrescriptionQRCodetoNeiWang(ipt);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//新增配送员处方取码记录
|
|
|
PrescriptionDispensaryCode prescriptionDispensaryCode = new PrescriptionDispensaryCode();
|
|
|
prescriptionDispensaryCode.setCode(jgsCode);
|