Browse Source

【人员二维码导出】【bug】【判断人员编号,密码是否为空】

wub 6 years ago
parent
commit
1973e5ac89
1 changed files with 8 additions and 6 deletions
  1. 8 6
      src/com/uas/mes/hr/service/impl/ScanCodeLoginServiceImpl.java

+ 8 - 6
src/com/uas/mes/hr/service/impl/ScanCodeLoginServiceImpl.java

@@ -29,15 +29,17 @@ public class ScanCodeLoginServiceImpl implements ScanCodeLoginService {
 		for (String string : split) {
 			//Object EM_QRCODE = baseDao.getFieldDataByCondition("employee", "EM_QRCODE", "em_id="+string);
 			Object[] datas = baseDao.getFieldsDataByCondition("employee", "em_code,em_password,em_qrcode", "em_id="+string);
-			if (datas[2]!=null) {
-				String[] split2 = datas[2].toString().split(",");
-				if (!MD5Util.MD5(datas[1].toString()).equals(split2[1])) {
+			if (datas[1]!= null && datas[0]!= null) {
+				if (datas[2]!=null) {
+					String[] split2 = datas[2].toString().split(",");
+					if (!MD5Util.MD5(datas[1].toString()).equals(split2[1])) {
+						String sql="update employee set EM_QRCODE='("+datas[0]+","+MD5Util.MD5(datas[1].toString())+")' where em_id="+string;
+						baseDao.execute(sql);
+					}
+				}else {
 					String sql="update employee set EM_QRCODE='("+datas[0]+","+MD5Util.MD5(datas[1].toString())+")' where em_id="+string;
 					baseDao.execute(sql);
 				}
-			}else {
-				String sql="update employee set EM_QRCODE='("+datas[0]+","+MD5Util.MD5(datas[1].toString())+")' where em_id="+string;
-				baseDao.execute(sql);
 			}
 		}
 		String rs = "("+substring+")";