|
@ -9,17 +9,25 @@ import com.yihu.wlyy.service.common.util.ManageUtilService;
|
|
import com.yihu.wlyy.service.common.util.SignTeamAndGroupRunnable;
|
|
import com.yihu.wlyy.service.common.util.SignTeamAndGroupRunnable;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.hash.HashMapper;
|
|
import org.springframework.data.redis.hash.HashMapper;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.io.OutputStreamWriter;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by lyr on 2016/09/13.
|
|
* Created by lyr on 2016/09/13.
|
|
@ -41,6 +49,8 @@ public class ManagerUtilController extends BaseController {
|
|
StatisticsService statisticsService;
|
|
StatisticsService statisticsService;
|
|
@Autowired
|
|
@Autowired
|
|
ManageUtilService manageUtilService;
|
|
ManageUtilService manageUtilService;
|
|
|
|
@Autowired
|
|
|
|
JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
/*********************************************患者疾病相关******************************************/
|
|
/*********************************************患者疾病相关******************************************/
|
|
/**
|
|
/**
|
|
@ -145,7 +155,7 @@ public class ManagerUtilController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/sign_set_group_team")
|
|
@RequestMapping(value = "/sign_set_group_team")
|
|
public String signSetGroupAndTeam(){
|
|
|
|
|
|
public String signSetGroupAndTeam() {
|
|
try {
|
|
try {
|
|
manageUtilService.signPatientSetGroup();
|
|
manageUtilService.signPatientSetGroup();
|
|
return write(200, "更新成功");
|
|
return write(200, "更新成功");
|
|
@ -160,7 +170,7 @@ public class ManagerUtilController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/sign_set_group_team_page")
|
|
@RequestMapping(value = "/sign_set_group_team_page")
|
|
public String signSetGroupAndTeamPage(int page){
|
|
|
|
|
|
public String signSetGroupAndTeamPage(int page) {
|
|
try {
|
|
try {
|
|
manageUtilService.setSignTeamAndGroupByPage(page);
|
|
manageUtilService.setSignTeamAndGroupByPage(page);
|
|
return write(200, "更新成功");
|
|
return write(200, "更新成功");
|
|
@ -175,7 +185,7 @@ public class ManagerUtilController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/sign_set_group_team_id")
|
|
@RequestMapping(value = "/sign_set_group_team_id")
|
|
public String signSetGroupAndTeamId(Long id){
|
|
|
|
|
|
public String signSetGroupAndTeamId(Long id) {
|
|
try {
|
|
try {
|
|
manageUtilService.setSignTeamAndGroupById(id);
|
|
manageUtilService.setSignTeamAndGroupById(id);
|
|
return write(200, "更新成功");
|
|
return write(200, "更新成功");
|
|
@ -190,14 +200,14 @@ public class ManagerUtilController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/sign_error_page_id")
|
|
@RequestMapping(value = "/sign_error_page_id")
|
|
public String getErrorPage(int type){
|
|
|
|
|
|
public String getErrorPage(int type) {
|
|
try {
|
|
try {
|
|
if(type == 1){
|
|
|
|
return write(200, "查询成功","data",ManageUtilService.page);
|
|
|
|
}else if(type == 2){
|
|
|
|
return write(200, "查询成功","data",ManageUtilService.errorPages);
|
|
|
|
} else{
|
|
|
|
return write(200, "查询成功","data",ManageUtilService.errorSigns);
|
|
|
|
|
|
if (type == 1) {
|
|
|
|
return write(200, "查询成功", "data", ManageUtilService.page);
|
|
|
|
} else if (type == 2) {
|
|
|
|
return write(200, "查询成功", "data", ManageUtilService.errorPages);
|
|
|
|
} else {
|
|
|
|
return write(200, "查询成功", "data", ManageUtilService.errorSigns);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
@ -210,10 +220,10 @@ public class ManagerUtilController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/sign_team_group_thread")
|
|
@RequestMapping(value = "/sign_team_group_thread")
|
|
public String getErrorPage(long start,long end){
|
|
|
|
|
|
public String getErrorPage(long start, long end) {
|
|
try {
|
|
try {
|
|
new Thread(new SignTeamAndGroupRunnable(start,end)).start();
|
|
|
|
return write(200,"启动成功");
|
|
|
|
|
|
new Thread(new SignTeamAndGroupRunnable(start, end)).start();
|
|
|
|
return write(200, "启动成功");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, "启动失败");
|
|
return error(-1, "启动失败");
|
|
}
|
|
}
|
|
@ -226,12 +236,54 @@ public class ManagerUtilController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/tranform_edu_article")
|
|
@RequestMapping(value = "/tranform_edu_article")
|
|
public String tranformEduArticle(){
|
|
|
|
|
|
public String tranformEduArticle() {
|
|
try {
|
|
try {
|
|
manageUtilService.transformEduArticle();
|
|
manageUtilService.transformEduArticle();
|
|
return write(200,"启动成功");
|
|
|
|
|
|
return write(200, "启动成功");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, "启动失败");
|
|
return error(-1, "启动失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/patient")
|
|
|
|
public String getPatientInfo() {
|
|
|
|
try {
|
|
|
|
OutputStream out = new FileOutputStream("D:\\city.properties");
|
|
|
|
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out));
|
|
|
|
|
|
|
|
try {
|
|
|
|
String sql = "select code, name from dm_city";
|
|
|
|
List<Map<String, Object>> patients = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
|
|
for (Map<String, Object> map : patients) {
|
|
|
|
writer.write(map.get("code").toString() + "=" + map.get("name").toString());
|
|
|
|
writer.newLine();
|
|
|
|
}
|
|
|
|
// JSONObject log = new JSONObject();
|
|
|
|
//
|
|
|
|
// log.put("time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date()));
|
|
|
|
// log.put("logType", 2);
|
|
|
|
// log.put("caller", "");
|
|
|
|
//
|
|
|
|
// JSONObject data = new JSONObject();
|
|
|
|
//
|
|
|
|
// data.put("businessType", 6);
|
|
|
|
// data.put("patient", map.get("code"));
|
|
|
|
// data.put("data", new JSONObject(map));
|
|
|
|
//
|
|
|
|
// log.put("data", data);
|
|
|
|
writer.flush();
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new Exception(e.getMessage());
|
|
|
|
} finally {
|
|
|
|
writer.close();
|
|
|
|
out.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
return write(200, "成功");
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return error(-1, "失败");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|