Просмотр исходного кода

git-svn-id: https://192.168.57.71/svn/lyggkj@56 1a6f6e3a-4066-fe46-b609-79c204482ece

ld_liufl 9 лет назад
Родитель
Сommit
9effb43c1e

+ 1 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Constants.java

@@ -854,6 +854,6 @@ public class Constants {
 
 	// ************************二维码类型********************************************
 	public final static String QRCODE_CG = "CG|";// 储罐
-	public final static String QRCODE_RYJBXX = "CG|";// 储罐
+	public final static String QRCODE_RYJBXX = "RY|";// 人员
 	
 }

+ 4 - 4
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Utils.java

@@ -755,7 +755,7 @@ public abstract class Utils {
 			}
 		}
 		Graphics2D g = (Graphics2D) img.getGraphics();
-		g.rotate(Math.PI / 2, length / 2, length / 2);
+		//g.rotate(Math.PI / 2, length / 2, length / 2);
 		g.setColor(new Color(0, 0, 0));
 		g.setFont(new Font("宋体", Font.PLAIN, 14));
 		// 二维码
@@ -776,7 +776,7 @@ public abstract class Utils {
 			qrcodeHandler.setQrcodeEncodeMode('B');
 			// 设置二维码版本,取值范围1-40,值越大尺寸越大,可存储的信息越大
 			qrcodeHandler.setQrcodeVersion(version);
-			byte[] contentBytes = content.getBytes("gb2312");
+			byte[] contentBytes = content.getBytes("utf-8");
 			gs.setColor(Color.BLACK);
 			// 设置偏移量 不设置可能导致解析出错
 			int pixoff = 2;
@@ -811,8 +811,8 @@ public abstract class Utils {
 			gs.dispose();
 			qrImg.flush();
 
-			g.drawImage(qrImg.getScaledInstance(width, length,
-					Image.SCALE_DEFAULT), 6, 6, null);
+			g.drawImage(qrImg.getScaledInstance(width-5, length-5,
+					Image.SCALE_DEFAULT), 5, 5, null);
 		} catch (Exception e) {
 			e.printStackTrace();
 		}