|
@ -22,10 +22,13 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.jdbc.core.RowMapper;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import java.sql.ResultSet;
|
|
|
|
import java.sql.SQLException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -200,11 +203,25 @@ public class DataHandingService {
|
|
boolean flag = true;
|
|
boolean flag = true;
|
|
try {
|
|
try {
|
|
String sql = " select * from wlyy_doctor where check_password is not null and check_password <> ''";
|
|
String sql = " select * from wlyy_doctor where check_password is not null and check_password <> ''";
|
|
List<Doctor> list = jdbcTemplate.queryForList(sql,Doctor.class);
|
|
|
|
|
|
// List<Doctor> list = jdbcTemplate.query(sql, new RowMapper<Doctor>() {
|
|
|
|
// @Override
|
|
|
|
// public Doctor mapRow(ResultSet resultSet, int i) throws SQLException {
|
|
|
|
// Doctor doctor = new Doctor();
|
|
|
|
// doctor.setId(resultSet.getLong("id"));
|
|
|
|
// doctor.setCode(resultSet.getString("code"));
|
|
|
|
// doctor.setCheckPassword(resultSet.getString("check_password"));
|
|
|
|
// return doctor;
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
List<Doctor> result = new ArrayList<>();
|
|
List<Doctor> result = new ArrayList<>();
|
|
list.stream().forEach(one->{
|
|
list.stream().forEach(one->{
|
|
one.setCheckPassword(Base64Utils.encryptBASE64(one.getCheckPassword()));
|
|
|
|
result.add(one);
|
|
|
|
|
|
Doctor d = doctorDao.findByCode(one.get("code")!=null?one.get("code").toString():"");
|
|
|
|
if(d!=null){
|
|
|
|
|
|
|
|
d.setCheckPassword(Base64Utils.encryptBASE64(d.getCheckPassword()));
|
|
|
|
result.add(d);
|
|
|
|
}
|
|
});
|
|
});
|
|
doctorDao.save(result);
|
|
doctorDao.save(result);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|