init version hrs for new gitea
This commit is contained in:
120
src/main/java/com/saye/hrs/controller/BlackListController.java
Normal file
120
src/main/java/com/saye/hrs/controller/BlackListController.java
Normal file
@@ -0,0 +1,120 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.service.BlackListService;
|
||||
import com.saye.hrs.service.system.ServiceParamsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 黑名单管理
|
||||
* @author: Mr.zs
|
||||
* @create: 2024-04-11 19:53
|
||||
**/
|
||||
@Controller
|
||||
@RequestMapping("/blackList")
|
||||
public class BlackListController {
|
||||
|
||||
@Autowired
|
||||
BlackListService blackListService;
|
||||
|
||||
@Autowired
|
||||
ServiceParamsService serviceParamsService;
|
||||
|
||||
@RequestMapping("toBlackList")
|
||||
public String toBlackList(ModelMap modelMap, Model model) {
|
||||
|
||||
List<HashMap<Object, Object>> is_blackList = serviceParamsService.findParamValByParamCode("is_blackList");
|
||||
String isBlackList = "";
|
||||
for (HashMap<Object, Object> objectObjectHashMap : is_blackList) {
|
||||
isBlackList = objectObjectHashMap.get("PARAM_VAL").toString();
|
||||
}
|
||||
model.addAttribute("isBlackList", isBlackList);
|
||||
return "/blacklist/blackList";
|
||||
}
|
||||
|
||||
@RequestMapping("/findAllBlackList")
|
||||
@ResponseBody
|
||||
public TemplatePage findAllBlackList(Integer page, Integer limit, String cardNo) {
|
||||
|
||||
HashMap<Object, Object> searchMap = new HashMap<>();
|
||||
searchMap.put("cardNo", cardNo);
|
||||
// searchMap.put("isThird", isThird);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<>(blackListService.findAllBlackList(searchMap));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
@RequestMapping("/modifyBlackList")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> modifyBlackList(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
|
||||
try {
|
||||
blackListService.modifyBlackList(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改黑名单失败";
|
||||
LogUtil.error(this.getClass(), "修改黑名单失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/delBlackList")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> delBlackList(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
|
||||
try {
|
||||
blackListService.delBlackList(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除黑名单失败";
|
||||
LogUtil.error(this.getClass(), "删除黑名单失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/changeBlackListStatus")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> changeBlackListStatus(@RequestBody HashMap<String, String> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
// HashMap<String, String> operateMap = new HashMap<>();
|
||||
// operateMap.put("param_code", map.get("param_code").toString());
|
||||
// operateMap.put("param_val", map.get("param_val").toString());
|
||||
try {
|
||||
serviceParamsService.updateServiceParamsValBycode(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改黑名单状态失败";
|
||||
LogUtil.error(this.getClass(), "修改黑名单状态失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.saye.hrs.service.CountAuthService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Mr.zs
|
||||
* @date 2025/2/8
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/api")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CountAuthController {
|
||||
|
||||
private final CountAuthService countAuthService;
|
||||
|
||||
// 查询有权限的用户列表
|
||||
@RequestMapping("/getAutho")
|
||||
@ResponseBody
|
||||
public HashMap<String, Object> getAutho() {
|
||||
HashMap<String, Object> resMap = new HashMap<>();
|
||||
resMap.put("code", 200);
|
||||
resMap.put("msg", "查询有权限的用户列表");
|
||||
List<String> list = countAuthService.getAutherList();
|
||||
if (list != null) {
|
||||
resMap.put("data", list);
|
||||
return resMap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 查询用户的权限列表
|
||||
@RequestMapping("/getAuthoList")
|
||||
@ResponseBody
|
||||
public Object getAuthoList(String openid) {
|
||||
HashMap<String, Object> resMap = new HashMap<>();
|
||||
resMap.put("code", 200);
|
||||
resMap.put("msg", "查询用户的权限列表");
|
||||
List<String> list = countAuthService.getAuthoList(openid);
|
||||
if (list != null) {
|
||||
resMap.put("data", list);
|
||||
return resMap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 查询用户的科室权限列表
|
||||
@RequestMapping("/getDeptAuthList")
|
||||
@ResponseBody
|
||||
public Object getDeptAuthList(String openid) {
|
||||
HashMap<String, Object> resMap = new HashMap<>();
|
||||
resMap.put("code", 200);
|
||||
resMap.put("msg", "查询用户的权限列表");
|
||||
List<String> depts = countAuthService.getDeptAuthList(openid);
|
||||
|
||||
String result = Joiner.on(",").skipNulls().join(depts);
|
||||
System.out.println("list " + result);
|
||||
if (depts != null) {
|
||||
resMap.put("data", result);
|
||||
return resMap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
180
src/main/java/com/saye/hrs/controller/DoctorController.java
Normal file
180
src/main/java/com/saye/hrs/controller/DoctorController.java
Normal file
@@ -0,0 +1,180 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.service.HospitalService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.saye.hrs.service.DoctorService;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author dqzhang
|
||||
* @since 2021-09-16 15:17:12
|
||||
*/
|
||||
@RequestMapping("doctor")
|
||||
@Controller
|
||||
public class DoctorController {
|
||||
|
||||
@Resource
|
||||
private DoctorService doctorService;
|
||||
@Resource
|
||||
private HospitalService hospitalService;
|
||||
|
||||
/**
|
||||
* 跳转页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toDoctor")
|
||||
public String toUserManager(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
return "hospital/doctor";
|
||||
}
|
||||
/**
|
||||
* 分页查询列表
|
||||
* @param page limit
|
||||
* @param
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findDoctorPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findDoctorPageList(Integer page,Integer limit) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.doctorService.findDoctorList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
* @param map
|
||||
* @return 单条数据
|
||||
*/
|
||||
@RequestMapping("/findDoctorById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findDoctorById(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.doctorService.findDoctorById(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/insertDoctor")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> insertDoctor(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.doctorService.insertDoctor(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增失败";
|
||||
LogUtil.error(this.getClass(), "新增失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/updateDoctor")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateDoctor(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.doctorService.updateDoctor(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改失败";
|
||||
LogUtil.error(this.getClass(), "修改失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/deleteDoctorById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteDoctorById(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.doctorService.deleteDoctorById(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/toDoctorSc")
|
||||
public String toDoctorSc(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
return "hospital/doctorSc";
|
||||
}
|
||||
|
||||
/** 去医生排班页面
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toDoctorSchedual")
|
||||
public String toDoctorSchedual(ModelMap modelMap){
|
||||
modelMap.addAttribute("list", this.hospitalService.findHospitalList(new HashMap<Object, Object>()));
|
||||
//查询所有角色
|
||||
return "hospital/doctorSchedual";
|
||||
}
|
||||
|
||||
/** 查询医生排班列表
|
||||
* @param hospital_id week
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findDoctorSchedualList")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> findDoctorSchedualList(String hospital_id, String week) {
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
map.put("hospital_id",hospital_id);
|
||||
List<String> array = DateDUtil.findWeekDays(week);
|
||||
map.put("dayList", array);
|
||||
List<HashMap<Object, Object>> list = this.doctorService.findDoctorSchedualList(map);
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("dayList",array);
|
||||
resultMap.put("list",list);
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
635
src/main/java/com/saye/hrs/controller/HospitalController.java
Normal file
635
src/main/java/com/saye/hrs/controller/HospitalController.java
Normal file
@@ -0,0 +1,635 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.commons.uuid.UUIDGenerator;
|
||||
import com.saye.hrs.model.StatusDefine;
|
||||
import com.saye.hrs.model.Users;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.saye.hrs.service.HospitalService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author dqzhang
|
||||
* @since 2021-09-15 09:43:02
|
||||
*/
|
||||
@RequestMapping("hospital")
|
||||
@Controller
|
||||
public class HospitalController {
|
||||
|
||||
@Resource
|
||||
private HospitalService hospitalService;
|
||||
|
||||
/**
|
||||
* 跳转页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toHospital")
|
||||
public String toUserManager(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
return "hospital/hospital";
|
||||
}
|
||||
/**
|
||||
* 分页查询列表
|
||||
* @param page limit
|
||||
* @param
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findHospitalPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findHospitalPageList(Integer page,Integer limit) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.hospitalService.findHospitalList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
* @param map
|
||||
* @return 单条数据
|
||||
*/
|
||||
@RequestMapping("/findHospitalById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findHospitalById(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.hospitalService.findHospitalById(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/insertHospital")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> insertHospital(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.insertHospital(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增失败";
|
||||
LogUtil.error(this.getClass(), "新增失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/updateHospital")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateHospital(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.updateHospital(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改失败";
|
||||
LogUtil.error(this.getClass(), "修改失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/deleteHospitalById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteHospitalById(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.deleteHospitalById(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去医院介绍页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toHospitalAbout")
|
||||
public String toHospitalAbout(ModelMap modelMap){
|
||||
List<HashMap<Object, Object>> list = this.hospitalService.findHospitalList(new HashMap<Object,Object>());
|
||||
modelMap.addAttribute("list",list);
|
||||
return "hospital/hospitalAbout";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医院信息列表
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findHospitalAbout")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findHospitalAbout() {
|
||||
|
||||
return this.hospitalService.findHospitalList(new HashMap<Object,Object>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新医院介绍
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/updateHospitalAbout")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateHospitalAbout(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.updateHospitalAbout(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去医院通知页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toHospitalNotice")
|
||||
public String toHospitalNotice(ModelMap modelMap){
|
||||
|
||||
return "hospital/hospitalNotice";
|
||||
}
|
||||
|
||||
/** 查询医院通知列表
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findHospitalNoticeList")
|
||||
@ResponseBody
|
||||
public TemplatePage findHospitalNoticeList(String title) {
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
map.put("title",title);
|
||||
List<HashMap<Object, Object>> list = this.hospitalService.findHospitalNoticeList(map);
|
||||
TemplatePage templetJson = new TemplatePage();
|
||||
templetJson.setCode(0);
|
||||
templetJson.setMsg("");
|
||||
templetJson.setData(list);
|
||||
templetJson.setCount(list.size());
|
||||
return templetJson;
|
||||
}
|
||||
|
||||
/** 查询医院通知列表
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findHospitalNotice")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findHospitalNotice(String title) {
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
map.put("title",title);
|
||||
return this.hospitalService.findHospitalNoticeList(map);
|
||||
}
|
||||
|
||||
@RequestMapping("/uploadImg")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> uploadImg(MultipartFile file) {
|
||||
|
||||
HashMap<String,String> map=new HashMap<String,String>();
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
String relative_path = "";
|
||||
String uuid = UUIDGenerator.getUUID();
|
||||
try {
|
||||
|
||||
String realFileName = file.getOriginalFilename();//获取文件名称
|
||||
String suffix = realFileName.substring(realFileName.lastIndexOf(".") + 1);//获取文件后缀名
|
||||
|
||||
String create_date= DateDUtil.getCurrentDate();
|
||||
relative_path = "hospitalNotice" + "/" + create_date + "/" + System.currentTimeMillis() + "." + suffix;
|
||||
String real_path = StatusDefine.filePath + relative_path;
|
||||
Path path = Paths.get(real_path);//设置保存路径
|
||||
File f = new File(real_path);
|
||||
if (!f.getParentFile().exists()) {
|
||||
f.getParentFile().mkdirs();
|
||||
}
|
||||
byte[] bytes = file.getBytes();
|
||||
Files.write(path, bytes);
|
||||
} catch (IOException e) {
|
||||
errCode = "999";
|
||||
errMsg = "上传图片失败!";
|
||||
LogUtil.error(this.getClass(), errMsg+",原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resMap = new HashMap<Object,Object>();
|
||||
resMap.put("relative_path",relative_path);
|
||||
resMap.put("errCode", errCode);
|
||||
resMap.put("errMsg", errMsg);
|
||||
return resMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增医院通知
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addHospitalNotice")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> addHospitalNotice(HttpServletRequest request, @RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
map.put("user_name",user.getUserName());
|
||||
this.hospitalService.addHospitalNotice(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增医院通知失败";
|
||||
LogUtil.error(this.getClass(), "新增医院通知失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改医院通知
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateHospitalNotice")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateHospitalNotice(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.updateHospitalNotice(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改医院通知失败";
|
||||
LogUtil.error(this.getClass(), "修改医院通知失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医院通知
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteHospitalNotice")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteHospitalNotice(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.deleteHospitalNotice(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除医院通知失败";
|
||||
LogUtil.error(this.getClass(), "删除医院通知失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去健康百科页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toHospitalArticle")
|
||||
public String toHospitalArticle(ModelMap modelMap){
|
||||
|
||||
return "hospital/hospitalArticle";
|
||||
}
|
||||
|
||||
/** 查询健康百科列表
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findHospitalArticleList")
|
||||
@ResponseBody
|
||||
public TemplatePage findHospitalArticleList(String title) {
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
map.put("title",title);
|
||||
List<HashMap<Object, Object>> list = this.hospitalService.findHospitalArticleList(map);
|
||||
TemplatePage templetJson = new TemplatePage();
|
||||
templetJson.setCode(0);
|
||||
templetJson.setMsg("");
|
||||
templetJson.setData(list);
|
||||
templetJson.setCount(list.size());
|
||||
return templetJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增健康百科
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addHospitalArticle")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> addHospitalArticle(HttpServletRequest request,@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.addHospitalArticle(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增健康百科失败";
|
||||
LogUtil.error(this.getClass(), "新增健康百科失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改健康百科
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateHospitalArticle")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateHospitalArticle(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.updateHospitalArticle(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改健康百科失败";
|
||||
LogUtil.error(this.getClass(), "修改健康百科失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除健康百科
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteHospitalArticle")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteHospitalArticle(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.deleteHospitalArticle(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除健康百科失败";
|
||||
LogUtil.error(this.getClass(), "删除健康百科失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 去就医指南配置页面
|
||||
* @author dqzhang
|
||||
* @created 2021年11月15日 下午4:04:23
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toMedicalGuide")
|
||||
public String toMedicalGuide(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
return "hospital/medicalGuide";
|
||||
}
|
||||
|
||||
/** 查询健康百科列表
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findMedicalGuideList")
|
||||
@ResponseBody
|
||||
public TemplatePage findMedicalGuideList(String name) {
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
map.put("name",name);
|
||||
List<HashMap<Object, Object>> list = this.hospitalService.findMedicalGuideList(map);
|
||||
TemplatePage templetJson = new TemplatePage();
|
||||
templetJson.setCode(0);
|
||||
templetJson.setMsg("");
|
||||
templetJson.setData(list);
|
||||
templetJson.setCount(list.size());
|
||||
return templetJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增就医指南
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addMedicalGuide")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> addMedicalGuide(HttpServletRequest request,@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
map.put("user_name",user.getUserName());
|
||||
this.hospitalService.addMedicalGuide(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增就医指南失败";
|
||||
LogUtil.error(this.getClass(), "新增就医指南失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改就医指南
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateMedicalGuide")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateMedicalGuide(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.updateMedicalGuide(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改就医指南失败";
|
||||
LogUtil.error(this.getClass(), "修改就医指南失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除就医指南
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteMedicalGuide")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteMedicalGuide(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.deleteMedicalGuide(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除就医指南失败";
|
||||
LogUtil.error(this.getClass(), "删除就医指南失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/** 查询医院楼层信息
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findHospitalFloorList")
|
||||
@ResponseBody
|
||||
public TemplatePage findHospitalFloorList(String hospital_id) {
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
map.put("HOSPITAL_ID",hospital_id);
|
||||
List<HashMap<Object, Object>> list = this.hospitalService.findHospitalFloorList(map);
|
||||
TemplatePage templetJson = new TemplatePage();
|
||||
templetJson.setCode(0);
|
||||
templetJson.setMsg("");
|
||||
templetJson.setData(list);
|
||||
templetJson.setCount(list.size());
|
||||
return templetJson;
|
||||
}
|
||||
|
||||
/** 新增医院楼层信息
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addHospitalFloor")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addHospitalFloor(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.addHospitalFloor(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增楼层信息失败";
|
||||
LogUtil.error(this.getClass(), "新增楼层信息失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/** 修改医院楼层信息
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateHospitalFloor")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> updateHospitalFloor(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.updateHospitalFloor(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改楼层信息失败";
|
||||
LogUtil.error(this.getClass(), "修改楼层信息失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/** 删除医院楼层信息
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteHospitalFloor")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> deleteHospitalFloor(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.hospitalService.deleteHospitalFloor(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除楼层失败";
|
||||
LogUtil.error(this.getClass(), "删除楼层失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
566
src/main/java/com/saye/hrs/controller/HttpController.java
Normal file
566
src/main/java/com/saye/hrs/controller/HttpController.java
Normal file
@@ -0,0 +1,566 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import com.saye.hrs.service.HospitalService;
|
||||
import com.saye.hrs.service.OrderService;
|
||||
import com.saye.hrs.service.PatientService;
|
||||
import com.saye.hrs.service.system.LoggerService;
|
||||
import com.saye.hrs.service.system.ServiceParamsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RequestMapping("api")
|
||||
@Controller
|
||||
public class HttpController {
|
||||
|
||||
@Resource
|
||||
private PatientService patientService;
|
||||
@Resource
|
||||
private HospitalService hospitalService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private ServiceParamsService serviceParamsService;
|
||||
@Autowired
|
||||
private LoggerService loggerService;
|
||||
/**
|
||||
* 根据openid获取患者信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/getPatientByOpenid")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object,Object>> getPatientByOpenid(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
|
||||
List<HashMap<Object,Object>> list = this.patientService.findPatientByOpenid(map);
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
* @param map
|
||||
* @return 单条数据
|
||||
*/
|
||||
@RequestMapping("/findPatientById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findPatientById(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.patientService.findPatientById(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据openid获取住院患者信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/getZyPatientByOpenid")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object,Object>> getZyPatientByOpenid(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
return this.patientService.getZyPatientByOpenid(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信用户绑定患者
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/patientBindWXUser")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> patientBindWXUser(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.patientService.patientBindWXUser(map);
|
||||
}catch(Exception e){
|
||||
errCode = "999";
|
||||
errMsg = e.toString();
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信用户绑定患者
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/zyPatientBindWXUser")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> zyPatientBindWXUser(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.patientService.zyPatientBindWXUser(map);
|
||||
}catch(Exception e){
|
||||
errCode = "999";
|
||||
errMsg = e.toString();
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**设为默认
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/setPatientTypeByOpenid")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> setPatientTypeByOpenid(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.patientService.setPatientTypeByOpenid(map);
|
||||
}catch(Exception e){
|
||||
errCode = "999";
|
||||
errMsg = e.toString();
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信用户解除绑定患者
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/patientUnbindWXUser")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> patientUnbindWXUser(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.patientService.patientUnbindWXUser(map);
|
||||
}catch(Exception e){
|
||||
errCode = "999";
|
||||
errMsg = e.toString();
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改患者信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/updatePatientByOpenid")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updatePatientByOpenid(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.patientService.updatePatientByOpenid(map);
|
||||
}catch(Exception e){
|
||||
errCode = "999";
|
||||
errMsg = e.toString();
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/** 查询医院信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/findHospital")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findHospital() throws Exception{
|
||||
|
||||
return this.hospitalService.findHospitalList(new HashMap<Object,Object>()).get(0);
|
||||
}
|
||||
|
||||
/** 查询医院通知列表
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findHospitalNotice")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findHospitalNotice(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.hospitalService.findHospitalNoticeList(map);
|
||||
}
|
||||
|
||||
/**查询医院信息列表
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findHospitalAbout")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findHospitalAbout() {
|
||||
|
||||
return this.hospitalService.findHospitalList(new HashMap<Object,Object>());
|
||||
}
|
||||
|
||||
/**查询预约须知
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findOrderNotice")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> findOrderNotice() {
|
||||
|
||||
return this.orderService.findOrderNotice();
|
||||
}
|
||||
|
||||
/** 查询就医指导
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/findMedicalGuide")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object,Object>> findMedicalGuide() throws Exception{
|
||||
return this.hospitalService.findMedicalGuide();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就医指导明细
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/findMedicalGuideById")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object,Object>> findMedicalGuideById(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
return this.hospitalService.findMedicalGuideById(map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询医院健康百科
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/findHospitalArticle")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findHospitalArticle(@RequestBody HashMap map) throws Exception{
|
||||
return this.hospitalService.findHospitalArticleList(map);
|
||||
}
|
||||
|
||||
/**问题反馈
|
||||
* @return
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/problemFeedback")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> problemFeedback(@RequestBody Map map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.hospitalService.problemFeedback(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "系统异常!";
|
||||
LogUtil.error(this.getClass(), "问题反馈异常:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查询消息通知
|
||||
* @author dqzhang
|
||||
* @created 2021年11月23日 下午2:59:02
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/findMessageNotice")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findMessageNotice(@RequestBody HashMap<Object, Object> map) throws Exception{
|
||||
|
||||
map.put("status", "0");
|
||||
return this.hospitalService.findMessageNotice(map);
|
||||
}
|
||||
@RequestMapping("/findAllMessageNotice")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findMessageAllNotice(@RequestBody HashMap<Object, Object> map) throws Exception {
|
||||
return this.hospitalService.findMessageNotice(map);
|
||||
}
|
||||
/**
|
||||
* @description 设置消息已读
|
||||
* @author dqzhang
|
||||
* @created 2021年11月23日 下午2:58:43
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/setMessageNoticeRead")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> setMessageNoticeRead(@RequestBody Map map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.hospitalService.setMessageNoticeRead(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "系统异常!";
|
||||
LogUtil.error(this.getClass(), "设置消息已读失败:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
/**
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @description 设置消息已读
|
||||
* @author dqzhang
|
||||
* @created 2021年11月23日 下午2:58:43
|
||||
*/
|
||||
@RequestMapping("/setMessageNoticeAllRead")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> setMessageNoticeAllRead(@RequestBody Map map) throws Exception {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.hospitalService.setMessageNoticeAllRead(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "系统异常!";
|
||||
LogUtil.error(this.getClass(), "设置消息已读失败:" + e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 写入银商下单接口信息
|
||||
* @author dqzhang
|
||||
* @created 2021年11月22日 下午3:43:14
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/addPayRequest")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addPayRequest(@RequestBody Map map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
map.put("create_time", DateDUtil.DateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||
this.hospitalService.addPayRequest(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "写入下单信息失败!";
|
||||
LogUtil.error(this.getClass(), "写入下单信息失败:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 支付成功写入his充值接口
|
||||
* @author dqzhang
|
||||
* @created 2021年11月22日 下午3:43:14
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/addHisRecharge")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addHisRecharge(@RequestBody Map map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
String hisStatus = "";
|
||||
try {
|
||||
HashMap<Object, Object> respMap = this.hospitalService.addHisRecharge(map);
|
||||
hisStatus = StringDUtil.changeNullToEmpty(respMap.get("hisStatus"));
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "支付成功,调用调用充值接口失败!";
|
||||
LogUtil.error(this.getClass(), "写入his充值接口失败:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
resultMap.put("hisStatus", hisStatus);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 预约成功记录写入数据库
|
||||
* @author dqzhang
|
||||
* @created 2021年11月23日 下午3:06:26
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/insertOrder")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> insertOrder(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.orderService.insertOrder(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "预约失败!";
|
||||
LogUtil.error(this.getClass(), "预约成功记录写入数据库失败:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 取消预约
|
||||
* @author dqzhang
|
||||
* @created 2021年11月23日 下午3:59:40
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cancelOrder")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> cancelOrder(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.orderService.cancelOrder(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "取消预约!";
|
||||
LogUtil.error(this.getClass(), "取消预约失败:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置微信小程序最后登录时间
|
||||
* @author dqzhang
|
||||
* @created 2021年11月24日 上午10:04:10
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/setWXLoginTime")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> setWXLoginTime(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
this.orderService.setWXLoginTime(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "更新最后登录时间!";
|
||||
LogUtil.error(this.getClass(), "更新最后登录时间失败:"+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查询待支付订单
|
||||
* @author dqzhang
|
||||
* @created 2021年11月30日 上午8:59:50
|
||||
* @param
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/findRechargeWait")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> findRechargeWait() throws Exception{
|
||||
|
||||
return this.orderService.findRechargeWait();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 新增退款记录
|
||||
* @author dqzhang
|
||||
* @created 2021年11月24日 上午10:04:10
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/addRefund")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addRefund(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
map.put("create_time", DateDUtil.DateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||
this.orderService.addRefund(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增退款记录失败!";
|
||||
LogUtil.error(this.getClass(), errMsg+e.toString());
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取退款时间
|
||||
* @author dqzhang
|
||||
* @created 2022年2月7日 下午2:33:39
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/getRefundTime")
|
||||
@ResponseBody
|
||||
public String getRefundTime() throws Exception{
|
||||
List<HashMap<Object, Object>> list = serviceParamsService.findParamValByParamCode("REFUND_TIME");
|
||||
if(list.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
return StringDUtil.changeNullToEmpty(list.get(0).get("PARAM_VAL"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 写入充值不成功且退款失败的消息提醒
|
||||
* @author dqzhang
|
||||
* @created 2022年2月7日 下午2:37:15
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/addRefundMessageNotice")
|
||||
@ResponseBody
|
||||
public void addRefundMessageNotice(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
this.orderService.addRefundMessageNotice(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 添加his日志
|
||||
* @author dqzhang
|
||||
* @created 2022年2月7日 下午2:37:15
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/addHisLog")
|
||||
@ResponseBody
|
||||
public void addHisLog(@RequestBody HashMap<Object,Object> map) throws Exception{
|
||||
this.loggerService.addHisLog(map);
|
||||
}
|
||||
}
|
||||
134
src/main/java/com/saye/hrs/controller/IssueController.java
Normal file
134
src/main/java/com/saye/hrs/controller/IssueController.java
Normal file
@@ -0,0 +1,134 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.model.BodyDivision;
|
||||
import com.saye.hrs.service.IssueService;
|
||||
import com.saye.hrs.service.SymptomService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 导诊问题管理
|
||||
* @author: Mr.zs
|
||||
* @create: 2024-04-09 13:02
|
||||
**/
|
||||
@Controller
|
||||
@RequestMapping("/issue")
|
||||
public class IssueController {
|
||||
|
||||
@Autowired
|
||||
IssueService issueService;
|
||||
|
||||
@Autowired
|
||||
SymptomService symptomService;
|
||||
|
||||
@RequestMapping("/toIssue")
|
||||
public String toIssue(ModelMap modelMap) {
|
||||
List<BodyDivision> bodyDivisions = symptomService.findAllBodyArea();
|
||||
modelMap.put("bodyAreaList", bodyDivisions);
|
||||
return "guidance/issue";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/findAllQuestions")
|
||||
@ResponseBody
|
||||
public TemplatePage findAllQuestions(Integer page, Integer limit, String questions, String symptomName, String bodyArea, String gender, String adultOrChild) {
|
||||
System.out.println("questions is :" + questions);
|
||||
HashMap<Object, Object> searchMap = new HashMap<>();
|
||||
searchMap.put("questions", questions);
|
||||
searchMap.put("symptom", symptomName);
|
||||
searchMap.put("bodyArea", bodyArea);
|
||||
searchMap.put("gender", gender);
|
||||
searchMap.put("adultOrChild", adultOrChild);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<>(issueService.findAllQuestions(searchMap));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
@RequestMapping("/getSymptomByAreaType")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> getSymptomByAreaType(ModelMap modelMap, String bodyAreaType) {
|
||||
HashMap<Object, Object> resultMap = new HashMap<>();
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
HashMap<Object, Object> searchMap = new HashMap<>();
|
||||
searchMap.put("bodyAreaType", bodyAreaType);
|
||||
try {
|
||||
List<HashMap<Object, Object>> result = symptomService.getSymptomByAreaType(searchMap);
|
||||
resultMap.put("data", result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
errCode = "999";
|
||||
errMsg = "查询症状失败,原因:" + e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/addQuestions")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addQuestions(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
issueService.addQuestions(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增问题信息失败";
|
||||
LogUtil.error(this.getClass(), "新增问题信息失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/delQuestions")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> delQuestions(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
issueService.delQuestions(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除问题信息失败";
|
||||
LogUtil.error(this.getClass(), "删除问题信息失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/modifyQuestions")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> modifyQuestions(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
issueService.modifyQuestions(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改问题信息失败";
|
||||
LogUtil.error(this.getClass(), "修改问题信息失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import com.saye.hrs.service.BlackListService;
|
||||
import com.saye.hrs.service.MissedAppointRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @description: 爽约记录管理
|
||||
* @author: Mr.zs
|
||||
* @create: 2024-04-11 19:47
|
||||
**/
|
||||
@Controller
|
||||
@RequestMapping("/missedAppointRecord")
|
||||
public class MissedAppointRecordController {
|
||||
|
||||
|
||||
@Autowired
|
||||
BlackListService blackListService;
|
||||
|
||||
@Autowired
|
||||
MissedAppointRecordService missedAppointRecordService;
|
||||
|
||||
|
||||
@RequestMapping("/toMissedAppointRecord")
|
||||
public String toMissedAppointRecord(ModelMap modelMap) {
|
||||
|
||||
|
||||
return "/blacklist/missedAppointRecord";
|
||||
}
|
||||
|
||||
@RequestMapping("/findAllMissedAppointRecord")
|
||||
@ResponseBody
|
||||
public TemplatePage findAllMissedAppointRecord(Integer page, Integer limit, String cardNo, String startTime, String endTime, String isThird) {
|
||||
HashMap<Object, Object> searchMap = new HashMap<>();
|
||||
searchMap.put("cardNo", cardNo);
|
||||
if (StringDUtil.isNotBlank(startTime)) {
|
||||
searchMap.put("startTime", startTime.replace("-", ""));
|
||||
}
|
||||
if (StringDUtil.isNotBlank(endTime)) {
|
||||
searchMap.put("endTime", endTime.replace("-", ""));
|
||||
}
|
||||
searchMap.put("isThird", isThird);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<>(missedAppointRecordService.findAllMissedAppointRecord(searchMap));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
@RequestMapping("/addBlackList")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addBlackList(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
Integer i = blackListService.fetchCountByCardNo(map);
|
||||
if (i > 0) {
|
||||
errCode = "999";
|
||||
errMsg = "该人员已被添加";
|
||||
} else {
|
||||
blackListService.addBlackList(map);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "添加黑名单失败";
|
||||
LogUtil.error(this.getClass(), "添加黑名单失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
}
|
||||
153
src/main/java/com/saye/hrs/controller/OfficeController.java
Normal file
153
src/main/java/com/saye/hrs/controller/OfficeController.java
Normal file
@@ -0,0 +1,153 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.saye.hrs.service.OfficeService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author dqzhang
|
||||
* @since 2021-09-16 08:46:32
|
||||
*/
|
||||
@RequestMapping("office")
|
||||
@Controller
|
||||
public class OfficeController {
|
||||
|
||||
@Resource
|
||||
private OfficeService officeService;
|
||||
|
||||
/**
|
||||
* 跳转页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toOffice")
|
||||
public String toUserManager(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
return "hospital/office";
|
||||
}
|
||||
/**
|
||||
* 分页查询列表
|
||||
* @param
|
||||
* @param
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findOfficePageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findOfficePageList() {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
List<HashMap<Object, Object>> list = this.officeService.findOfficeList(map);
|
||||
TemplatePage templetJson = new TemplatePage();
|
||||
templetJson.setCode(0);
|
||||
templetJson.setMsg("");
|
||||
templetJson.setData(list);
|
||||
templetJson.setCount(list.size());
|
||||
return templetJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
* @param map
|
||||
* @return 单条数据
|
||||
*/
|
||||
@RequestMapping("/findOfficeById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findOfficeById(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.officeService.findOfficeById(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/insertOffice")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> insertOffice(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.officeService.insertOffice(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增失败";
|
||||
LogUtil.error(this.getClass(), "新增失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/updateOffice")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateOffice(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.officeService.updateOffice(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改失败";
|
||||
LogUtil.error(this.getClass(), "修改失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/deleteOfficeById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteOfficeById(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.officeService.deleteOfficeById(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List list = new ArrayList();
|
||||
list.add("aaa");
|
||||
list.add(0,"dsa");
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
||||
|
||||
284
src/main/java/com/saye/hrs/controller/OrderController.java
Normal file
284
src/main/java/com/saye/hrs/controller/OrderController.java
Normal file
@@ -0,0 +1,284 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.excel.ExportXLSX;
|
||||
import com.saye.hrs.commons.excel.HashMapConversionImpl;
|
||||
import com.saye.hrs.commons.excel.IConversionByExport;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import com.saye.hrs.model.StatusDefine;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.saye.hrs.service.OrderService;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author dqzhang
|
||||
* @since 2021-09-16 16:26:19
|
||||
*/
|
||||
@RequestMapping("order")
|
||||
@Controller
|
||||
public class OrderController {
|
||||
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
/**
|
||||
* 跳转页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toOrder")
|
||||
public String toUserManager(ModelMap modelMap){
|
||||
//查询科室
|
||||
List<HashMap<Object, Object>> distinctOrderOffice = this.orderService.findDistinctOrderOffice();
|
||||
modelMap.addAttribute("list", distinctOrderOffice);
|
||||
//查询所有角色
|
||||
return "order/order";
|
||||
}
|
||||
/**
|
||||
* 分页查询列表
|
||||
* @param page limit
|
||||
* @param
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findOrderPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findOrderPageList(Integer page,Integer limit,String name,String startTime,String endTime,String ksdm) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
map.put("name",name);
|
||||
map.put("startTime",startTime.replace("-",""));
|
||||
map.put("endTime",endTime.replace("-",""));
|
||||
map.put("ksdm",ksdm);
|
||||
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.orderService.findOrderList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
* @param map
|
||||
* @return 单条数据
|
||||
*/
|
||||
@RequestMapping("/findOrderById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findOrderById(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.orderService.findOrderById(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/insertOrder")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> insertOrder(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.orderService.insertOrder(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增失败";
|
||||
LogUtil.error(this.getClass(), "新增失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/updateOrder")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateOrder(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.orderService.updateOrder(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改失败";
|
||||
LogUtil.error(this.getClass(), "修改失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/deleteOrderById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deleteOrderById(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.orderService.deleteOrderById(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去预约须知页面
|
||||
*/
|
||||
@RequestMapping("/toOrderNotice")
|
||||
public String toOrderNotice(ModelMap modelMap){
|
||||
|
||||
return "order/orderNotice";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查询预约须知
|
||||
* @author dqzhang
|
||||
* @created 2022年4月26日 下午1:54:59
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findOrderNotice")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> findOrderNotice() {
|
||||
|
||||
return this.orderService.findOrderNotice();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 更新预约须知
|
||||
* @author dqzhang
|
||||
* @created 2022年4月26日 下午5:00:08
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateOrderNotice")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updateOrderNotice(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.orderService.updateOrderNotice(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改失败";
|
||||
LogUtil.error(this.getClass(), "修改失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 导出预约挂号明细
|
||||
* @author thuang
|
||||
* @date 2023/04/07 15:12
|
||||
* @version 1.0
|
||||
*/
|
||||
@RequestMapping("/exportOrderDetail")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> exportOrderDetail(@RequestBody HashMap<Object, Object> map){
|
||||
HashMap<Object, Object> responseMap=new HashMap<Object, Object>();
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
String dlName = "";
|
||||
String fileName="";
|
||||
|
||||
String dowloadName = StringDUtil.changeNullToEmpty(map.get("dowloadName"));
|
||||
|
||||
try{
|
||||
String startTime = StringDUtil.changeNullToEmpty(map.get("startTime"));
|
||||
String endTime = StringDUtil.changeNullToEmpty(map.get("endTime"));
|
||||
map.put("startTime",startTime.replace("-",""));
|
||||
map.put("endTime",endTime.replace("-",""));
|
||||
|
||||
List<HashMap<Object, Object>> list = this.orderService.findOrderList(map);
|
||||
|
||||
|
||||
if (list.size()>0) {
|
||||
//定义标题头和文件名
|
||||
String[] DISTANCE_HEADERNAME = {"科室名称","预约日期","预约序号","时间段","患者姓名","就诊卡","身份证"};
|
||||
String[] sqlKey = {"KSMC","YYRQ","YYHX","SJD","TRUE_NAME","MEDICAL_CARD","ID_CARD"};
|
||||
|
||||
List<Object> rulList = new ArrayList<Object>(list);
|
||||
|
||||
//创建工作表
|
||||
ExportXLSX exportXLS = new ExportXLSX(DISTANCE_HEADERNAME, sqlKey, ExportXLSX.A3, false);
|
||||
|
||||
exportXLS.setTitleName(dowloadName);
|
||||
|
||||
IConversionByExport conversion = new HashMapConversionImpl();
|
||||
exportXLS.setConversion(conversion);
|
||||
|
||||
exportXLS.setData(rulList);
|
||||
|
||||
exportXLS.modifyWidthOfHeader("5000", 0);
|
||||
exportXLS.modifyWidthOfHeader("5000", 1);
|
||||
exportXLS.modifyWidthOfHeader("5000", 2);
|
||||
exportXLS.modifyWidthOfHeader("5000", 3);
|
||||
exportXLS.modifyWidthOfHeader("5000", 4);
|
||||
exportXLS.modifyWidthOfHeader("5000", 5);
|
||||
exportXLS.modifyWidthOfHeader("5000", 6);
|
||||
|
||||
// 文件名称
|
||||
//产生4位长度的随机码(由字母和数字组成)
|
||||
String randomStr = StringDUtil.generateRandomCodeForLength(4);
|
||||
dlName = DateDUtil.DateToStr(DateDUtil.yyyyMMddHHmmss, new Date()) + randomStr;
|
||||
fileName = dlName + ".xlsx";
|
||||
|
||||
String uploadPath = StatusDefine.filePath + "/order/";
|
||||
File uploadPathFile = new File(uploadPath);
|
||||
if(!uploadPathFile.exists()) uploadPathFile.mkdirs();
|
||||
|
||||
String savePath = uploadPath + fileName ;
|
||||
exportXLS.execGenerateExcel(savePath);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "未知异常:" + ExceptionDUtil.getDetailExceptionMsg(e);
|
||||
LogUtil.error(this.getClass(), "@@@系统出错!【" + errMsg + "】");
|
||||
}
|
||||
|
||||
responseMap.put("errCode", errCode);
|
||||
responseMap.put("errMsg", errMsg);
|
||||
responseMap.put("dlName", "order/"+fileName);
|
||||
return responseMap;
|
||||
}
|
||||
}
|
||||
|
||||
278
src/main/java/com/saye/hrs/controller/PatientController.java
Normal file
278
src/main/java/com/saye/hrs/controller/PatientController.java
Normal file
@@ -0,0 +1,278 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.saye.hrs.service.PatientService;
|
||||
import java.util.HashMap;
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author dqzhang
|
||||
* @since 2021-09-27 10:24:47
|
||||
*/
|
||||
@RequestMapping("patient")
|
||||
@Controller
|
||||
public class PatientController {
|
||||
|
||||
@Resource
|
||||
private PatientService patientService;
|
||||
|
||||
/**
|
||||
* 跳转页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toPatient")
|
||||
public String toUserManager(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
return "Patient/Patient";
|
||||
}
|
||||
/**
|
||||
* 分页查询列表
|
||||
* @param page limit
|
||||
* @param
|
||||
* @return 查询结果
|
||||
*/
|
||||
@RequestMapping("/findPatientPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findPatientPageList(Integer page,Integer limit) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.patientService.findPatientList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
* @param map
|
||||
* @return 单条数据
|
||||
*/
|
||||
@RequestMapping("/findPatientById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findPatientById(@RequestBody HashMap<Object,Object> map) {
|
||||
return this.patientService.findPatientById(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据(貌似没有用)
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/insertPatient")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> insertPatient(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.patientService.insertPatient(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增失败";
|
||||
LogUtil.error(this.getClass(), "新增失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/updatePatient")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> updatePatient(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.patientService.updatePatient(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改失败";
|
||||
LogUtil.error(this.getClass(), "修改失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param map
|
||||
* @return map
|
||||
*/
|
||||
@RequestMapping("/deletePatientById")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> deletePatientById(@RequestBody HashMap<Object,Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try{
|
||||
this.patientService.deletePatientById(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到患者消费记录页面
|
||||
* @param modelMap
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toPatientConsume")
|
||||
public String toPatientConsume(ModelMap modelMap){
|
||||
|
||||
return "patient/patientConsume";
|
||||
}
|
||||
/**
|
||||
* 跳转到患者消费记录页面
|
||||
*/
|
||||
@RequestMapping("/toPatientRecharge")
|
||||
public String toPatientRecharge(ModelMap modelMap){
|
||||
|
||||
return "patient/patientRecharge";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到患者住院消费记录页面
|
||||
*/
|
||||
@RequestMapping("/toZyPatientRecharge")
|
||||
public String toZyPatientRecharge(ModelMap modelMap){
|
||||
|
||||
return "patient/zyPatientRecharge";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description跳转到患者消费记录页面
|
||||
*/
|
||||
@RequestMapping("/toPatientRefund")
|
||||
public String toPatientRefund(ModelMap modelMap){
|
||||
|
||||
return "patient/patientRefund";
|
||||
}
|
||||
/**
|
||||
* @description 分页查询患者消费列表
|
||||
*/
|
||||
@RequestMapping("/findPatientAccountPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findPatientAccountPageList(Integer page,Integer limit,String type) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
map.put("type", type);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.patientService.findPatientAccountPageList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 分页查询患者消费列表
|
||||
*/
|
||||
@RequestMapping("/findZyPatientAccountPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findZyPatientAccountPageList(Integer page,Integer limit,String type) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
map.put("type", type);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.patientService.findZyPatientAccountPageList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description跳转到银联商务退款记录页面
|
||||
*/
|
||||
@RequestMapping("/toRefund")
|
||||
public String toRefund(ModelMap modelMap){
|
||||
|
||||
return "patient/refund";
|
||||
}
|
||||
/**
|
||||
* @description 分页查询银联商务退款信息
|
||||
*/
|
||||
@RequestMapping("/findRefundPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findRefundPageList(Integer page,Integer limit) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.patientService.findRefundList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description跳转到银联商务充值记录页面
|
||||
*/
|
||||
@RequestMapping("/toPayRequest")
|
||||
public String toPayRequest(ModelMap modelMap){
|
||||
|
||||
return "patient/payRequest";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 分页查询银联商务充值记录
|
||||
*/
|
||||
@RequestMapping("/findPayRequestPageList")
|
||||
@ResponseBody
|
||||
public TemplatePage findPayRequestPageList(Integer page,Integer limit) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.patientService.findPayRequestList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 去绑定患者日志页面
|
||||
* @author dqzhang
|
||||
* @created 2021年12月17日 下午3:43:39
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toBindCardLog")
|
||||
public String toBindCardLog(ModelMap modelMap){
|
||||
|
||||
return "patient/bindCardLog";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 一句话描述方法作用
|
||||
* @author dqzhang
|
||||
* @created 2021年12月17日 下午3:51:09
|
||||
* @param page
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findBindCardLogList")
|
||||
@ResponseBody
|
||||
public TemplatePage findBindCardLogList(Integer page,Integer limit,String start_date,String end_date,String status) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
map.put("start_date", start_date);
|
||||
map.put("end_date", end_date);
|
||||
map.put("status", status);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object,Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(this.patientService.findBindCardLogList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
157
src/main/java/com/saye/hrs/controller/SymptomController.java
Normal file
157
src/main/java/com/saye/hrs/controller/SymptomController.java
Normal file
@@ -0,0 +1,157 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.model.BodyDivision;
|
||||
import com.saye.hrs.service.SymptomService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description: 智能导诊症状管理
|
||||
* @author: Mr.zs
|
||||
* @create: 2024-04-09 12:49
|
||||
**/
|
||||
@Controller
|
||||
@RequestMapping("/symptom")
|
||||
@Slf4j
|
||||
public class SymptomController {
|
||||
|
||||
|
||||
@Autowired
|
||||
SymptomService symptomService;
|
||||
|
||||
@RequestMapping("/toSymptomManager")
|
||||
public String toSymptomManager(ModelMap modelMap) {
|
||||
// List<BodyDivision> bodyDivisions = symptomService.findAllBodyArea();
|
||||
// modelMap.put("bodyAreaList", bodyDivisions);
|
||||
return "guidance/symptomManager";
|
||||
}
|
||||
|
||||
@RequestMapping("/findAllSymptom")
|
||||
@ResponseBody
|
||||
public TemplatePage findAllSymptom(Integer page, Integer limit, String symptom, String bodyArea, String gender, String adultOrChild) {
|
||||
Map<String, String> searchMap = new HashMap<>();
|
||||
searchMap.put("symptom", symptom);
|
||||
searchMap.put("bodyArea", bodyArea);
|
||||
searchMap.put("gender", gender);
|
||||
searchMap.put("adultOrChild", adultOrChild);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<>(symptomService.findAllSymptom(searchMap));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
@PostMapping("/addSymptom")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> addSymptom(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
|
||||
String bodyArea = "";
|
||||
|
||||
List<BodyDivision> bodyDivisions = symptomService.findAllBodyArea();
|
||||
Integer i = symptomService.findMaxId();
|
||||
Integer newId = i + 1;
|
||||
|
||||
map.put("childId", newId + "_" + map.get("bodyAreaType").toString());
|
||||
for (BodyDivision bodyDivision : bodyDivisions) {
|
||||
if (bodyDivision.getBODY_AREA_TYPE().equals(map.get("bodyAreaType"))) {
|
||||
bodyArea = bodyDivision.getBODY_AREA();
|
||||
}
|
||||
}
|
||||
map.put("bodyArea", bodyArea);
|
||||
try {
|
||||
symptomService.addSymptom(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "新增症状失败";
|
||||
LogUtil.error(this.getClass(), "新增症状失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
// @RequestMapping("/findAllBodyArea")
|
||||
// @ResponseBody
|
||||
// public List<HashMap<Object,Object>> findAllBodyArea (){
|
||||
//
|
||||
// }
|
||||
|
||||
@RequestMapping("/modifySymptom")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> modifySymptom(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
|
||||
try {
|
||||
symptomService.modifySymptom(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改症状失败";
|
||||
LogUtil.error(this.getClass(), "修改症状失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/delSymptom")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> delSymptom(@RequestBody HashMap<Object, Object> map) {
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
|
||||
try {
|
||||
symptomService.delSymptom(map);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改症状失败";
|
||||
LogUtil.error(this.getClass(), "修改症状失败,原因:" + ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/getAreaTypeBySexAdult")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> getAreaTypeBySexAdult(@RequestBody HashMap<String, String> searchMap) {
|
||||
HashMap<Object, Object> resultMap = new HashMap<>();
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
log.info("searchMap is :" + searchMap);
|
||||
// Map<String, String> searchMap = new HashMap<>();
|
||||
// searchMap.put("sex", sex);
|
||||
// searchMap.put("isAdult", isAdult);
|
||||
try {
|
||||
List<BodyDivision> bodyDivisions = symptomService.findAreaTypeBySexAdult(searchMap);
|
||||
resultMap.put("data", bodyDivisions);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
errCode = "999";
|
||||
errMsg = "查询身体区域失败,原因:" + e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
|
||||
}
|
||||
}
|
||||
37
src/main/java/com/saye/hrs/controller/UEditorController.java
Normal file
37
src/main/java/com/saye/hrs/controller/UEditorController.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.baidu.ueditor.ActionEnter;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* Created by ldb on 2017/4/9.
|
||||
*/
|
||||
@Controller
|
||||
public class UEditorController {
|
||||
|
||||
@RequestMapping("/index1")
|
||||
private String showPage(){
|
||||
return "demo";
|
||||
}
|
||||
|
||||
@RequestMapping(value="/config")
|
||||
public void config(HttpServletRequest request, HttpServletResponse response) {
|
||||
response.setContentType("application/json");
|
||||
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
||||
try {
|
||||
String exec = new ActionEnter(request, rootPath).exec();
|
||||
PrintWriter writer = response.getWriter();
|
||||
writer.write(exec);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
251
src/main/java/com/saye/hrs/controller/WxPayController.java
Normal file
251
src/main/java/com/saye/hrs/controller/WxPayController.java
Normal file
@@ -0,0 +1,251 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.model.WxResult;
|
||||
import com.saye.hrs.model.WxybResult;
|
||||
import com.saye.hrs.service.WxPayService;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/***
|
||||
* @title WxPayController
|
||||
* @description TODO 请填写注释
|
||||
* @author thuang
|
||||
* @create 2023/8/15 9:34
|
||||
**/
|
||||
@RestController
|
||||
public class WxPayController {
|
||||
|
||||
@Resource
|
||||
private WxPayService wxPayService;
|
||||
|
||||
@PostMapping("/api/addWxPayInfo")
|
||||
public HashMap<Object,Object> addWxPayInfo(@RequestBody WxResult reqDTO){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
|
||||
wxPayService.addWxPayInfo(reqDTO);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="保存微信门诊及医保支付记录失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/findWxPayInfo")
|
||||
public HashMap<Object,Object> findWxPayInfo(@RequestBody WxResult reqDTO){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
|
||||
WxResult map = wxPayService.findWxPayInfo(reqDTO);
|
||||
resultMap.put("data",map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询微信门诊及医保支付记录失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/api/addWxybPayInfo")
|
||||
public HashMap<Object,Object> addWxybPayInfo(@RequestBody WxybResult reqDTO){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
wxPayService.addWxybPayInfo(reqDTO);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="保存微信医保支付记录失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/findWxybPayInfo")
|
||||
public HashMap<Object,Object> findWxybPayInfo(@RequestBody WxybResult reqDTO){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
WxybResult map = wxPayService.findWxybPayInfo(reqDTO);
|
||||
resultMap.put("data",map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询微信医保支付记录失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/getWxNotSendInfo")
|
||||
public HashMap<Object,Object> getWxNotSendInfo(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
List<WxResult> list = wxPayService.getWxNotSendInfo(map);
|
||||
resultMap.put("List",list);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询微信未支付记录失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/getWxybNotSendInfo")
|
||||
public HashMap<Object,Object> getWxybNotSendInfo(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
List<WxybResult> list = wxPayService.getWxybNotSendInfo(map);
|
||||
resultMap.put("List",list);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询微信医保未支付记录失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/addOrderInfo")
|
||||
public HashMap<Object,Object> addOrderInfo(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
wxPayService.addOrderInfo(map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="保存订单支付状态失败,原因:"+e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/updateOrderInfoPay")
|
||||
public HashMap<Object,Object> updateOrderInfoPay(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
wxPayService.updateOrderInfoPay(map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="保存订单支付状态失败,原因:"+e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/updateYBOrderInfoPay")
|
||||
public HashMap<Object,Object> updateYBOrderInfoPay(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
wxPayService.updateYBOrderInfoPay(map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="更新订单支付状态失败,原因:"+e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/updateOrderInfoComplete")
|
||||
public HashMap<Object,Object> updateOrderInfoComplete(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
wxPayService.updateOrderInfoComplete(map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="更新订单状态为完成失败,原因:"+e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/findOrderInfo")
|
||||
public HashMap<Object,Object> findOrderInfo(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
List<HashMap<Object,Object>> list = wxPayService.findOrderInfo(map);
|
||||
resultMap.put("list",list);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询未完成订单内容失败,原因:"+e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/api/updateOrderInfoEnd")
|
||||
public HashMap<Object,Object> updateOrderInfoEnd(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object,Object> resultMap=new HashMap<>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
wxPayService.updateOrderInfoEnd(map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询未完成订单内容失败,原因:"+e.getMessage();
|
||||
}
|
||||
resultMap.put("errCode",errCode);
|
||||
resultMap.put("errMsg",errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.JsonResult;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import com.saye.hrs.commons.uuid.UUIDGenerator;
|
||||
import com.saye.hrs.model.Dicinfo;
|
||||
import com.saye.hrs.model.ResourceInfo;
|
||||
import com.saye.hrs.model.Users;
|
||||
import com.saye.hrs.service.system.DicinfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
public class DicinfoController {
|
||||
|
||||
@Autowired
|
||||
private DicinfoService dicinfoService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 跳转到字典管理页面
|
||||
* @author qfqi
|
||||
* @created 2019年12月23日 下午1:47:21
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toDicinfoManager")
|
||||
public String toDepartManager(ModelMap modelMap){
|
||||
|
||||
String parentCode="0";
|
||||
List<Dicinfo> list= dicinfoService.findDicinfoTreeNodeList(parentCode);
|
||||
ResourceInfo resource = new ResourceInfo();
|
||||
resource.setTitle("字典");
|
||||
resource.setId("0");
|
||||
for (Dicinfo dicinfo : list) {
|
||||
//生成主节点
|
||||
ResourceInfo resourceInfo = new ResourceInfo();
|
||||
resourceInfo.setTitle(dicinfo.getDicname());
|
||||
resourceInfo.setId(dicinfo.getDiccode());
|
||||
resourceInfo.setSysid(dicinfo.getParentCode());
|
||||
resource.getChildren().add(resourceInfo);
|
||||
}
|
||||
String jsonString = JSONObject.toJSONString(resource);
|
||||
modelMap.addAttribute("departInfo", jsonString);
|
||||
return "system/dicinfoManage";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 新增字典
|
||||
* @author qfqi
|
||||
* @created 2019年12月19日 下午5:20:28
|
||||
* @param requestMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/dicinfoManager/addDicinfoManager")
|
||||
@ResponseBody
|
||||
public JsonResult addDicinfoManager(HttpServletRequest request, String dicname,String diccode,String dicvalue,String parentCode,String sortNo){
|
||||
HashMap<String,String> map=new HashMap<String,String>();
|
||||
JsonResult j=new JsonResult();
|
||||
map.put("dicname", dicname);
|
||||
map.put("dicvalue", dicvalue);
|
||||
map.put("parentCode", parentCode);
|
||||
map.put("sortNo", sortNo);
|
||||
|
||||
|
||||
if(diccode!=null && !"".equals(diccode)){
|
||||
//代表新增的是字典树父级 需要验证字点编码是否重复
|
||||
map.put("diccode", diccode);
|
||||
List<Dicinfo> list= dicinfoService.findDicinfoBydiccode(diccode);
|
||||
if(list.size()>0){
|
||||
//代表在相同的父类下有相同的value值,
|
||||
j.setState(false);
|
||||
j.setMessage("字典编码重复,请重新输入!");
|
||||
return j;
|
||||
}
|
||||
}else{
|
||||
//代表新增的是子类,需要查询该父类下是否存在相同的val值
|
||||
map.put("diccode", UUIDGenerator.getUUID());
|
||||
List<Dicinfo> list= dicinfoService.findDicinfoTreeByCode(map);
|
||||
if(list.size()>0){
|
||||
//代表在相同的父类下有相同的value值,
|
||||
j.setState(false);
|
||||
j.setMessage("字典值重复,请重新输入!");
|
||||
return j;
|
||||
}
|
||||
}
|
||||
int result=0;
|
||||
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
result = dicinfoService.addDicinfo(map);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"新增字典:map:"+map.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "新增字典失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("新增成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("新增失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @description 修改字典名称
|
||||
* @author qfqi
|
||||
* @created 2019年12月19日 下午5:50:45
|
||||
* @param requestMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/dicinfoManager/updateDicinfoManager")
|
||||
@ResponseBody
|
||||
public JsonResult updateDicinfoManager(HttpServletRequest request, String diccode,String dicname,String parentCode,String dicvalue,String sortNo){
|
||||
HashMap<String,String> map=new HashMap<String,String>();
|
||||
JsonResult j=new JsonResult();
|
||||
map.put("dicname", dicname);
|
||||
map.put("diccode", diccode);
|
||||
map.put("modifyTime", DateDUtil.getTheCurrentTime());
|
||||
map.put("dicvalue", dicvalue);
|
||||
map.put("parentCode", parentCode);
|
||||
map.put("sortNo", sortNo);
|
||||
|
||||
|
||||
int result=0;
|
||||
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
result = dicinfoService.modifyDicinfo(map);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"修改字典:map:"+map.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "修改字典失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("修改成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("修改失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 删除字典
|
||||
* @author qfqi
|
||||
* @created 2019年12月19日 下午5:50:25
|
||||
* @param requestMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/dicinfoManager/deleteDicinfoManager")
|
||||
@ResponseBody
|
||||
public JsonResult deleteDicinfoManager(HttpServletRequest request, @RequestBody Map requestMap){
|
||||
String diccode= StringDUtil.changeNullToEmpty(requestMap.get("diccode"));
|
||||
int result=0;
|
||||
JsonResult j=new JsonResult();
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
result = dicinfoService.deleteDicinfo(diccode);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"删除字典:diccode:"+diccode);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "删除字典失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("删除成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("删除失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
//根据父id分页查询字典
|
||||
@RequestMapping("/dicinfoManager/selectDicinfoManager")
|
||||
@ResponseBody
|
||||
public TemplatePage selectDicinfoManager(String parentCode,Integer page,Integer limit){
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<Dicinfo> appsPageInfo = new PageInfo<Dicinfo>(dicinfoService.findDicinfoTreeNodeList(parentCode));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
//根据上级编码查询所有数据
|
||||
@RequestMapping("/dicinfoManager/selectDicinfoListByCode")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> selectDicinfoListByCode(String parent_code){
|
||||
|
||||
List<HashMap<Object, Object>> list = this.dicinfoService.selectDicinfoListByCode(parent_code);
|
||||
return list;
|
||||
}
|
||||
|
||||
//根据条件分页查询字典
|
||||
@RequestMapping("/dicinfoManager/selectDicinfoPageListByCondition")
|
||||
@ResponseBody
|
||||
public TemplatePage selectDicinfoPageListByCondition(String parentCode,String dicname,Integer page,Integer limit){
|
||||
|
||||
HashMap<String, String> map = new HashMap<String,String>();
|
||||
map.put("parentCode", parentCode);
|
||||
map.put("dicname", dicname);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<HashMap<Object, Object>>(dicinfoService.selectDicinfoListByCondition(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
//根据条件查询所有字典
|
||||
@RequestMapping("/dicinfoManager/selectDicinfoListByCondition")
|
||||
@ResponseBody
|
||||
public List<HashMap<Object, Object>> selectDicinfoListByCondition(@RequestBody HashMap<String, String> map){
|
||||
|
||||
List<HashMap<Object, Object>> list = this.dicinfoService.selectDicinfoListByCondition(map);
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @description 获取最大字典顺序
|
||||
* @author qfqi
|
||||
* @created 2021年1月13日 下午2:56:03
|
||||
* @param requestMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/dicinfoManager/getMaxDicValue")
|
||||
@ResponseBody
|
||||
public JsonResult getMaxDicValue(@RequestBody Map requestMap){
|
||||
String diccode= StringDUtil.changeNullToEmpty(requestMap.get("diccode"));
|
||||
|
||||
JsonResult j=new JsonResult();
|
||||
try {
|
||||
HashMap<String, String> map = new HashMap<String,String>();
|
||||
map.put("parentCode", diccode);
|
||||
HashMap<Object, Object> result = dicinfoService.getMaxDicValue(map);
|
||||
j.setState(true);
|
||||
j.setData(result.get("MAXDICVALUE"));
|
||||
j.setMessage("成功!");
|
||||
} catch (Exception e) {
|
||||
j.setState(false);
|
||||
j.setMessage("查询字典最大值失败!");
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "查询字典最大值失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.model.Logger;
|
||||
import com.saye.hrs.service.system.LoggerService;
|
||||
|
||||
@Controller
|
||||
public class LoggerController {
|
||||
|
||||
@Autowired
|
||||
private LoggerService loggerService;
|
||||
|
||||
/**
|
||||
* @description 到日志管理页面
|
||||
* @author thuang
|
||||
* @created 2019年11月13日 下午5:27:29
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toLogger")
|
||||
public String toLogger(ModelMap modelMap){
|
||||
|
||||
return "system/logger";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查询所有日志数据
|
||||
* @author thuang
|
||||
* @created 2019年11月13日 下午5:41:56
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findLogger")
|
||||
@ResponseBody
|
||||
public HashMap<String, Object> findLogger(String loggerType,String startTime,String endTime,Integer page,Integer limit ){
|
||||
HashMap<Object, Object> map=new HashMap<Object, Object>();
|
||||
map.put("loggerType", loggerType);
|
||||
map.put("startTime", startTime);
|
||||
map.put("endTime", endTime);
|
||||
|
||||
HashMap<String, Object> responseMap = new HashMap<String,Object>();
|
||||
try {
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<Logger> appsPageInfo = new PageInfo<Logger>(loggerService.findLogger(map));
|
||||
responseMap.put("code", 0);
|
||||
responseMap.put("msg", "");
|
||||
responseMap.put("count", appsPageInfo.getTotal());
|
||||
responseMap.put("data", appsPageInfo.getList());
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "查询所有日志数据失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
|
||||
}
|
||||
|
||||
return responseMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 去his日志页面
|
||||
* @author dqzhang
|
||||
* @created 2022年2月25日 上午9:26:19
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toHisLog")
|
||||
public String toHisLog(ModelMap modelMap){
|
||||
Date date = new Date();
|
||||
modelMap.addAttribute("startTime",DateDUtil.getPlusDays("yyyy-MM-dd", date, -7));
|
||||
modelMap.addAttribute("endTime",DateDUtil.DateToStr("yyyy-MM-dd", date));
|
||||
return "system/hisLog";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查询所有his日志数据
|
||||
* @author thuang
|
||||
* @created 2019年11月13日 下午5:41:56
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/findHisLog")
|
||||
@ResponseBody
|
||||
public TemplatePage findHisLogList(String title,String startTime,String endTime,Integer page,Integer limit ){
|
||||
HashMap<Object, Object> map=new HashMap<Object, Object>();
|
||||
map.put("title", title);
|
||||
map.put("startTime", startTime);
|
||||
map.put("endTime", endTime);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<HashMap<Object, Object>>(loggerService.findHisLogList(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import com.saye.hrs.model.ResourceInfo;
|
||||
import com.saye.hrs.model.StatusDefine;
|
||||
import com.saye.hrs.model.Users;
|
||||
import com.saye.hrs.service.OrderService;
|
||||
import com.saye.hrs.service.system.MenuService;
|
||||
import com.saye.hrs.service.system.ServiceParamsService;
|
||||
import com.saye.hrs.service.system.UsersService;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.shiro.crypto.hash.Md5Hash;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@Controller
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private ServiceParamsService serviceParamsService;
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
/**
|
||||
* @description 去登录页面
|
||||
* @author dqzhang
|
||||
* @created 2019年11月13日 下午4:22:48
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toLogin")
|
||||
public String toLogin(ModelMap map) {
|
||||
|
||||
List<HashMap<Object, Object>> list = serviceParamsService.findParamValByParamCode("prj_name");
|
||||
map.addAttribute("prj_name",list.get(0).get("PARAM_VAL"));
|
||||
return "login";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 登录
|
||||
* @author dqzhang
|
||||
* @created 2019年11月13日 下午5:03:11
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> login(HttpServletRequest request,@RequestBody Map map) {
|
||||
|
||||
String username = StringDUtil.removeSpaces(map.get("username"));
|
||||
String password = StringDUtil.removeSpaces(map.get("password"));
|
||||
String vercode = StringDUtil.removeSpaces(map.get("vercode"));
|
||||
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
String code = (String) request.getSession().getAttribute("verify_code");
|
||||
if(!code.equalsIgnoreCase(vercode)) {
|
||||
errCode = "CodeError";
|
||||
errMsg = "验证码不正确!";
|
||||
}
|
||||
if("0".equals(errCode)) {
|
||||
List<Users> list = usersService.searchByName(username);
|
||||
if(list.isEmpty()){
|
||||
errCode = "userError";
|
||||
errMsg = "用户名或密码错误!";
|
||||
}
|
||||
if("0".equals(errCode)) {
|
||||
Users user = list.get(0);
|
||||
String encryptPassword = new Md5Hash(password,"hrs",2).toString();
|
||||
if(user.getPassword().equals(encryptPassword)) {
|
||||
LogUtil.info(getClass(), "用户:"+username+"登录系统");
|
||||
request.getSession().setAttribute("user",user);
|
||||
}else{
|
||||
errCode = "userError";
|
||||
errMsg = "用户名或密码错误!";
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errCode = e.getLocalizedMessage();
|
||||
errMsg = "未知异常!";
|
||||
LogUtil.error(this.getClass(), "登录失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 首页
|
||||
* @author dqzhang
|
||||
* @created 2019年11月13日 下午5:10:21
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/index")
|
||||
public String index(HttpServletRequest request,ModelMap modelMap) throws Exception {
|
||||
|
||||
HashMap<Object,Object> map = new HashMap<Object,Object>();
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String user_id = user.getUserId();
|
||||
map.put("user_id", user_id);
|
||||
ResourceInfo resourceInfo=null;
|
||||
modelMap.addAttribute("expired",false);
|
||||
try {
|
||||
//上次密码修改时间
|
||||
resourceInfo = this.menuService.getMenuByRole(map);
|
||||
String userTrueName = user.getTrueName();
|
||||
String userName = user.getUserName();
|
||||
modelMap.addAttribute("userTrueName",userTrueName);
|
||||
modelMap.addAttribute("userName",userName);
|
||||
modelMap.addAttribute("userId",user_id);
|
||||
|
||||
List<HashMap<Object, Object>> list = serviceParamsService.findParamValByParamCode("prj_name");
|
||||
modelMap.addAttribute("prj_name",list.get(0).get("PARAM_VAL"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "跳转首页失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
modelMap.addAttribute("resourceInfo", resourceInfo.getChildren());
|
||||
return "index";
|
||||
}
|
||||
|
||||
@RequestMapping("/logout")
|
||||
public void logout(HttpServletRequest request,HttpServletResponse response) throws IOException {
|
||||
|
||||
if(request.getSession().getAttribute("user")!=null) {
|
||||
request.getSession().invalidate();
|
||||
}
|
||||
response.sendRedirect("/toLogin");
|
||||
}
|
||||
|
||||
@RequestMapping("/home")
|
||||
public String home() throws IOException {
|
||||
return "home";
|
||||
}
|
||||
|
||||
@RequestMapping("/findHomeData")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findHomeData() throws IOException {
|
||||
//String s ="{\"fwrs\":1,\"rechargeOrder\":[{\"NUM\":3,\"NOWDATE\":\"20211124\"},{\"NUM\":1,\"NOWDATE\":\"20211125\"},{\"NUM\":0,\"NOWDATE\":\"20211126\"},{\"NUM\":5,\"NOWDATE\":\"20211127\"},{\"NUM\":0,\"NOWDATE\":\"20211128\"},{\"NUM\":0,\"NOWDATE\":\"20211129\"},{\"NUM\":0,\"NOWDATE\":\"20211130\"}],\"bkrs\":1,\"yyrs\":1,\"weekOrder\":[{\"NUM\":3,\"NOWDATE\":\"20211124\"},{\"NUM\":6,\"NOWDATE\":\"20211125\"},{\"NUM\":0,\"NOWDATE\":\"20211126\"},{\"NUM\":0,\"NOWDATE\":\"20211127\"},{\"NUM\":0,\"NOWDATE\":\"20211128\"},{\"NUM\":0,\"NOWDATE\":\"20211129\"},{\"NUM\":0,\"NOWDATE\":\"20211130\"}],\"czzh\":1,\"office\":[{\"NUM\":1,\"KSMC\":null}]}";
|
||||
return this.orderService.findHomeData();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取验证码
|
||||
* @author dqzhang
|
||||
* @created 2019年11月27日 下午3:15:32
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/getCode")
|
||||
public void verify(HttpServletRequest request,HttpServletResponse response) throws Exception {
|
||||
|
||||
String name = request.getParameter("name");
|
||||
String str = request.getQueryString();
|
||||
BufferedReader bufferedReader = request.getReader();
|
||||
char[] c = new char[100];
|
||||
IOUtils.read(bufferedReader,c);
|
||||
|
||||
System.out.println("bodyStr = " + new String(c));
|
||||
|
||||
response.setContentType("image/jpeg");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setDateHeader("Expires", 0L);
|
||||
HttpSession session = request.getSession();
|
||||
|
||||
int width = 73;
|
||||
int height = 27;
|
||||
BufferedImage image = new BufferedImage(width, height, 1);
|
||||
|
||||
Graphics g = image.getGraphics();
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
g.setColor(getRandColor(200, 250));
|
||||
g.fillRect(0, 0, width, height);
|
||||
|
||||
g.setFont(new Font("Times New Roman", 0, 24));
|
||||
|
||||
g.setColor(getRandColor(160, 200));
|
||||
for (int i = 0; i < 155; i++) {
|
||||
int x = random.nextInt(width);
|
||||
int y = random.nextInt(height);
|
||||
int xl = random.nextInt(12);
|
||||
int yl = random.nextInt(12);
|
||||
g.drawLine(x, y, x + xl, y + yl);
|
||||
}
|
||||
|
||||
String sRand = "";
|
||||
for (int i = 0; i < 4; i++) {
|
||||
String rand = randomInt(1).toUpperCase();
|
||||
sRand = sRand + rand;
|
||||
|
||||
g.setColor(new Color(20 + random.nextInt(110), 20 + random
|
||||
.nextInt(110), 20 + random.nextInt(110)));
|
||||
g.drawString(rand, 13 * i + 6, 24);
|
||||
}
|
||||
if (StringDUtil.changeNullToEmpty(name).equals(""))
|
||||
session.setAttribute("verify_code", sRand);
|
||||
else {
|
||||
session.setAttribute(name, sRand);
|
||||
}
|
||||
|
||||
g.dispose();
|
||||
ServletOutputStream responseOutputStream = response.getOutputStream();
|
||||
|
||||
ImageIO.write(image, "JPEG", responseOutputStream);
|
||||
|
||||
responseOutputStream.flush();
|
||||
responseOutputStream.close();
|
||||
}
|
||||
|
||||
private Color getRandColor(int fc, int bc) {
|
||||
Random random = new Random();
|
||||
if (fc > 255)
|
||||
fc = 255;
|
||||
if (bc > 255)
|
||||
bc = 255;
|
||||
int r = fc + random.nextInt(bc - fc);
|
||||
int g = fc + random.nextInt(bc - fc);
|
||||
int b = fc + random.nextInt(bc - fc);
|
||||
return new Color(r, g, b);
|
||||
}
|
||||
|
||||
public static final String randomInt(int length) {
|
||||
if (length < 1) {
|
||||
return null;
|
||||
}
|
||||
Random randGen = new Random();
|
||||
char[] numbersAndLetters = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray();
|
||||
char[] randBuffer = new char[length];
|
||||
for (int i = 0; i < randBuffer.length; i++) {
|
||||
randBuffer[i] = numbersAndLetters[randGen.nextInt(36)];
|
||||
}
|
||||
return new String(randBuffer);
|
||||
}
|
||||
|
||||
@RequestMapping("/toDemo")
|
||||
public String toDemo(ModelMap map) {
|
||||
|
||||
return "demo";
|
||||
}
|
||||
}
|
||||
194
src/main/java/com/saye/hrs/controller/system/RoleController.java
Normal file
194
src/main/java/com/saye/hrs/controller/system/RoleController.java
Normal file
@@ -0,0 +1,194 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.JsonResult;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.model.MenuRole;
|
||||
import com.saye.hrs.model.ResourceInfo;
|
||||
import com.saye.hrs.model.Role;
|
||||
import com.saye.hrs.model.Users;
|
||||
import com.saye.hrs.service.system.MenuService;
|
||||
import com.saye.hrs.service.system.RoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
public class RoleController {
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
|
||||
/**
|
||||
* @description 到角色管理页面
|
||||
* @author thuang
|
||||
* @created 2019年11月11日 上午10:50:40
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toRoleManager")
|
||||
public String toRoleManager(ModelMap modelMap){
|
||||
|
||||
HashMap<Object,Object> responseMap = new HashMap<Object,Object>();
|
||||
responseMap.put("firstNode", "0");
|
||||
ResourceInfo resourceInfo=null;
|
||||
try {
|
||||
resourceInfo = this.menuService.getMenuByRole(responseMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
modelMap.addAttribute("resourceInfo", resourceInfo);
|
||||
return "system/roleManager";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 查询列表
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:07:41
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/searchRole")
|
||||
@ResponseBody
|
||||
public HashMap<String, Object> searchRole(String roleName, String date, Integer page, Integer limit){
|
||||
|
||||
HashMap<String,String> map=new HashMap<String,String>();
|
||||
map.put("roleName", roleName);
|
||||
map.put("date", date);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<Role> appsPageInfo = new PageInfo<Role>(roleService.searchRole(map));
|
||||
HashMap<String, Object> map1 = new HashMap<String,Object>();
|
||||
map1.put("code", 0);
|
||||
map1.put("msg", "你好");
|
||||
map1.put("count", appsPageInfo.getTotal());
|
||||
map1.put("data", appsPageInfo.getList());
|
||||
return map1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 添加角色
|
||||
* @author thuang
|
||||
* @created 2019年11月11日 下午3:58:24
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/insertRoles")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> insertRoles(HttpServletRequest request,@RequestBody HashMap<String, String> map){
|
||||
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
//新增角色
|
||||
try {
|
||||
map.put("createTime", DateDUtil.getTheCurrentTime());
|
||||
roleService.addRole(map);
|
||||
LogUtil.info(this.getClass(),"用户"+ user.getTrueName()+"添加角色:map:"+map.toString());
|
||||
} catch (Exception e) {
|
||||
errCode="999";
|
||||
errMsg=e.getMessage();
|
||||
LogUtil.error(this.getClass(), "新增角色失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 删除用户角色
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:07:54
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteRole")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> deleteRole(HttpServletRequest request, String roleId){
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
try {
|
||||
roleService.deleteRole(roleId);
|
||||
LogUtil.info(this.getClass(),"用户"+ user.getTrueName()+"删除角色:roleId:"+roleId);
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "删除失败";
|
||||
LogUtil.error(this.getClass(), "删除角色失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 根据角色id获取角色权限菜单id
|
||||
* @author thuang
|
||||
* @created 2019年11月12日 上午9:51:08
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getSelectMenuId")
|
||||
@ResponseBody
|
||||
public List<String> getSelectMenuId(String roleId){
|
||||
|
||||
HashMap<Object, Object> map=new HashMap<Object, Object>();
|
||||
map.put("roleId",roleId);
|
||||
List<MenuRole> menuIdByRoleId = menuService.getMenuIdByRoleId(map);
|
||||
List<String> menuIdList=new ArrayList<String>();
|
||||
for (int i = 0; i < menuIdByRoleId.size(); i++) {
|
||||
MenuRole menuRole = menuIdByRoleId.get(i);
|
||||
menuIdList.add(menuRole.getMenuId());
|
||||
}
|
||||
return menuIdList;
|
||||
}
|
||||
|
||||
@RequestMapping("/getMenuList")
|
||||
@ResponseBody
|
||||
public ArrayList<ResourceInfo> getMenuList() throws Exception {
|
||||
|
||||
ResourceInfo resourceInfo=null;
|
||||
resourceInfo = menuService.getMenuByRole(new HashMap<Object, Object>());
|
||||
return resourceInfo.getChildren();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 修改用户角色权限信息
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:08:05
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/modifyRoleResource")
|
||||
@ResponseBody
|
||||
public JsonResult modifyRoleResource(HttpServletRequest request,@RequestBody HashMap<String, String> map) {
|
||||
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
int result=roleService.modifyRoleResource(map);
|
||||
LogUtil.info(this.getClass(),"用户"+ user.getTrueName()+"修改用户角色权限信息:map:"+map.toString());
|
||||
JsonResult j=new JsonResult();
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("修改成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("修改失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.saye.hrs.commons.JsonResult;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.model.ServiceParams;
|
||||
import com.saye.hrs.model.Users;
|
||||
import com.saye.hrs.service.system.ServiceParamsService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Controller
|
||||
public class ServiceParamsController {
|
||||
|
||||
@Autowired
|
||||
private ServiceParamsService serviceParamsService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 跳转到业务参数列表
|
||||
* @author qfqi
|
||||
* @created 2019年12月18日 上午11:27:48
|
||||
* @param modelMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toServiceParams")
|
||||
public String toServiceParams(ModelMap modelMap){
|
||||
|
||||
return "system/serviceParams";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 多条件查询业务参数列表
|
||||
* @author qfqi
|
||||
* @created 2019年12月18日 上午11:35:20
|
||||
* @param paramName
|
||||
* @param page
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/serviceParams/selectServiceParams")
|
||||
@ResponseBody
|
||||
public TemplatePage selectServiceParams(String paramName, Integer page, Integer limit){
|
||||
HashMap<String,String> map=new HashMap<String,String>();
|
||||
map.put("paramName", paramName);
|
||||
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<ServiceParams> appsPageInfo = new PageInfo<ServiceParams>(serviceParamsService.selectServiceParams(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 新增业务参数列表
|
||||
* @author qfqi
|
||||
* @created 2019年12月18日 下午3:59:34
|
||||
* @param sp
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/serviceParams/insertServiceParams")
|
||||
@ResponseBody
|
||||
public JsonResult insertServiceParams(HttpServletRequest request, ServiceParams sp){
|
||||
|
||||
int result=0;
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String userName = user.getUserName();
|
||||
String userTrueName = user.getTrueName();
|
||||
sp.setModifyUserName(userName);
|
||||
sp.setModifyTrueName(userTrueName);
|
||||
result = serviceParamsService.insertServiceParams(sp);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"新增业务参数列表:ServiceParams:"+sp.toString());
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "新增业务参数失败,原因:"+ ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
JsonResult j=new JsonResult();
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("新增成功!");
|
||||
}else if(result==-1){
|
||||
j.setState(false);
|
||||
j.setMessage("参数编码已存在!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("新增失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 修改业务参数列表
|
||||
* @author qfqi
|
||||
* @created 2019年12月18日 下午3:59:51
|
||||
* @param sp
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/serviceParams/updateServiceParams")
|
||||
@ResponseBody
|
||||
public JsonResult updateServiceParams(HttpServletRequest request,ServiceParams sp){
|
||||
int result=0;
|
||||
JsonResult j=new JsonResult();
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String userName = user.getUserName();
|
||||
String userTrueName = user.getTrueName();
|
||||
sp.setModifyUserName(userName);
|
||||
sp.setModifyTrueName(userTrueName);
|
||||
sp.setModifyTime(DateDUtil.getCurrentTime());
|
||||
|
||||
// 进行判断,如果是修改的假期提醒时间则进行加入计时器
|
||||
if(sp.getParamCode().equals("HOLIDAY_REMINDER")){
|
||||
HashMap<String,String> map=new HashMap<String,String>();
|
||||
map.put("paramId", sp.getParamId());
|
||||
map.put("remindTime", sp.getParamVal().split("-")[0]);
|
||||
String regex="^(?:0|[0-2][0-9]?|30)$";
|
||||
if(sp.getParamVal().split("-")[0].matches(regex)){
|
||||
j.setState(false);
|
||||
j.setMessage("修改失败!提醒日期不能大于30或小于0");
|
||||
return j;
|
||||
}
|
||||
}
|
||||
result = serviceParamsService.updateServiceParams(sp);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"修改业务参数列表:ServiceParams:"+sp.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "修改业务参数失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("修改成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("修改失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 删除业务参数列表
|
||||
* @author qfqi
|
||||
* @created 2019年12月18日 下午4:00:18
|
||||
* @param paramId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/serviceParams/deleteServiceParams")
|
||||
@ResponseBody
|
||||
public JsonResult deleteServiceParams(String paramId){
|
||||
int result=0;
|
||||
try {
|
||||
Users user = (Users) SecurityUtils.getSubject().getPrincipal();
|
||||
result = serviceParamsService.deleteServiceParams(paramId);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"删除业务参数列表:paramId:"+paramId);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "删除业务参数失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
JsonResult j=new JsonResult();
|
||||
if(result>0){
|
||||
j.setState(true);
|
||||
j.setMessage("删除成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("删除失败!");
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,640 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.saye.hrs.commons.JsonResult;
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.commons.log.ExceptionDUtil;
|
||||
import com.saye.hrs.commons.log.LogUtil;
|
||||
import com.saye.hrs.commons.page.PageUtil;
|
||||
import com.saye.hrs.commons.page.TemplatePage;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import com.saye.hrs.model.*;
|
||||
import com.saye.hrs.service.system.RoleService;
|
||||
import com.saye.hrs.service.system.UsersService;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.crypto.hash.Md5Hash;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Controller
|
||||
public class UsersController {
|
||||
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
/**
|
||||
* @description 到用户管理页面
|
||||
* @author thuang
|
||||
* @created 2019年11月15日 上午10:12:12
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toUserManager")
|
||||
public String toUserManager(ModelMap modelMap){
|
||||
|
||||
//查询所有角色
|
||||
List<Role> roleList = this.roleService.findRoleList();
|
||||
modelMap.addAttribute("roleList",roleList);
|
||||
return "system/userManager";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description user表分页查询
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:06:12
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/selectUser")
|
||||
@ResponseBody
|
||||
public TemplatePage searchUsers(String trueName, String isactive, String roleId, Integer page, Integer limit) {
|
||||
HashMap<Object,Object> map=new HashMap<Object,Object>();
|
||||
map.put("trueName", trueName);
|
||||
map.put("isactive", isactive);
|
||||
map.put("roleId", roleId);
|
||||
PageHelper.startPage(page, limit);
|
||||
PageInfo<Users> appsPageInfo = new PageInfo<Users>(usersService.searchUsers(map));
|
||||
return PageUtil.loadJsonPage(appsPageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 新增用户
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:05:10
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/insertUsers")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> insertUsers(HttpServletRequest request, @RequestBody HashMap<Object, Object> requestMap){
|
||||
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
|
||||
String userName = user.getUserName();
|
||||
String userTrueName = user.getTrueName();
|
||||
|
||||
requestMap.put("modifyUserName", userName);
|
||||
requestMap.put("modifyTrueName", userTrueName);
|
||||
|
||||
usersService.insertUser(requestMap);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"新增用户的方法:requestMap:"+requestMap.toString());
|
||||
} catch (Exception e) {
|
||||
errCode = "0";
|
||||
errMsg = "添加失败,"+ExceptionDUtil.getDetailExceptionMsg(e);
|
||||
LogUtil.error(this.getClass(), "新增用户失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 修改用户
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:04:28
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/modifyUsers")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> modifyUsers(HttpServletRequest request, @RequestBody HashMap<Object, Object> requestMap){
|
||||
String errCode = "0";
|
||||
String errMsg = "";
|
||||
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
|
||||
String userName = user.getUserName();
|
||||
String userTrueName = user.getTrueName();
|
||||
requestMap.put("userName", userName);
|
||||
requestMap.put("userTrueName", userTrueName);
|
||||
String createTime = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss);
|
||||
String createDate = DateDUtil.getCurrentDate();
|
||||
requestMap.put("createTime", createTime);
|
||||
requestMap.put("createDate", createDate);
|
||||
try {
|
||||
usersService.modifyUsers(requestMap);
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"修改用户的方法:requestMap:"+requestMap.toString());
|
||||
} catch (Exception e) {
|
||||
errCode = "999";
|
||||
errMsg = "修改用户失败!";
|
||||
LogUtil.error(this.getClass(), "修改用户失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
HashMap<Object,Object> resultMap = new HashMap<Object,Object>();
|
||||
resultMap.put("errCode", errCode);
|
||||
resultMap.put("errMsg", errMsg);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 密码重置
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:06:37
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/reSetPassword")
|
||||
@ResponseBody
|
||||
public JsonResult reSetPassword(HttpServletRequest request, @RequestBody HashMap<Object, Object> requestMap){
|
||||
|
||||
JsonResult j=new JsonResult();
|
||||
try {
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
|
||||
String userName = user.getUserName();
|
||||
String userTrueName = user.getTrueName();
|
||||
|
||||
requestMap.put("modifyUserName", userName);
|
||||
requestMap.put("modifyTrueName", userTrueName);
|
||||
String createTime = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss);
|
||||
String createDate = DateDUtil.getCurrentDate();
|
||||
requestMap.put("createTime", createTime);
|
||||
requestMap.put("createDate", createDate);
|
||||
//产生6位长度的随机密码(由字母和数字组成)
|
||||
String password = StringDUtil.generateRandomCodeForLength(6);
|
||||
String addPasswordMd5 = new Md5Hash(password,"hrs",2).toString();
|
||||
requestMap.put("password", addPasswordMd5);
|
||||
|
||||
int result=usersService.reSetPassword(requestMap);
|
||||
|
||||
if(result>0){
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"重置用户的密码方法:requestMap:"+requestMap.toString());
|
||||
j.setState(true);
|
||||
j.setMessage("修改成功!");
|
||||
j.setData(password);
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("修改失败!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
j.setState(false);
|
||||
j.setMessage(e.getMessage());
|
||||
LogUtil.error(this.getClass(), "密码重置失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
return j;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @description 启用/禁用
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:06:54
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/unableUser")
|
||||
@ResponseBody
|
||||
public JsonResult unableUser(HttpServletRequest request, @RequestBody HashMap<Object, Object> requestMap){
|
||||
JsonResult j=new JsonResult();
|
||||
try{
|
||||
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String userName = user.getUserName();
|
||||
String userTrueName = user.getTrueName();
|
||||
|
||||
requestMap.put("modifyUserName", userName);
|
||||
requestMap.put("modifyTrueName", userTrueName);
|
||||
String createTime = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss);
|
||||
String createDate = DateDUtil.getCurrentDate();
|
||||
requestMap.put("createTime", createTime);
|
||||
requestMap.put("createDate", createDate);
|
||||
|
||||
int result=usersService.unableUser(requestMap);
|
||||
|
||||
if(result>0){
|
||||
LogUtil.debug(this.getClass(),"用户"+ user.getTrueName()+"启用禁用用户的方法:requestMap:"+requestMap.toString());
|
||||
j.setState(true);
|
||||
j.setMessage("修改成功!");
|
||||
}else{
|
||||
j.setState(false);
|
||||
j.setMessage("修改失败!");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
j.setState(false);
|
||||
j.setMessage(e.getMessage());
|
||||
LogUtil.error(this.getClass(), "禁用启用失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 查询角色
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:07:09
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping("/findRoleList")
|
||||
// @ResponseBody
|
||||
// public JsonResult findRoleList(){
|
||||
// List<Role> list =roleService.findRoleList();
|
||||
// JsonResult j=new JsonResult();
|
||||
// j.setState(true);
|
||||
// j.setMessage("查询成功");
|
||||
// j.setData(list);
|
||||
// return j;
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 新增用户名验证
|
||||
* @author qfqi
|
||||
* @created 2019年11月5日 下午3:07:22
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/searchByName")
|
||||
@ResponseBody
|
||||
public JsonResult searchByName(String userName){
|
||||
List<Users> list=usersService.searchByName(userName);
|
||||
JsonResult j=new JsonResult();
|
||||
j.setState(true);
|
||||
j.setMessage("查询成功");
|
||||
j.setData(list);
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改密码
|
||||
* @author thuang
|
||||
* @created 2019年11月27日 下午6:13:05
|
||||
* @param requestMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/modifyPassword")
|
||||
@ResponseBody
|
||||
public JsonResult modifyPassword(HttpServletRequest request, @RequestBody HashMap<Object, Object> requestMap){
|
||||
|
||||
String password = StringDUtil.changeNullToEmpty(requestMap.get("password"));
|
||||
String key = StringDUtil.removeSpaces(requestMap.get("key"));
|
||||
String initVector = StringDUtil.removeSpaces(requestMap.get("initVector"));
|
||||
JsonResult j=new JsonResult();
|
||||
try {
|
||||
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String username = user.getUserName();
|
||||
String passwordMd5 = new Md5Hash(password,"hrs",2).toString();
|
||||
String addPasswordMd5 = new Md5Hash(password,"hrs",2).toString();
|
||||
|
||||
String modifyTime = DateDUtil.getTheCurrentTime();
|
||||
this.usersService.modifyPassword(username,passwordMd5,modifyTime);
|
||||
j.setState(true);
|
||||
j.setMessage("更改密码成功");
|
||||
LogUtil.debug(this.getClass(),"用户修改用户的密码方法:requestMap:"+requestMap.toString());
|
||||
} catch (Exception e) {
|
||||
j.setState(false);
|
||||
j.setMessage("更改密码失败");
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "修改密码失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 导入人员信息
|
||||
* @author thuang
|
||||
* @date 2021/5/19 9:57
|
||||
* @version 1.0
|
||||
*/
|
||||
@RequestMapping("/uploadUsers")
|
||||
@ResponseBody
|
||||
public HashMap<Object, Object> uploadUsers(@RequestParam("spareFile") MultipartFile file, HttpServletRequest request, HttpServletResponse response)throws Exception{
|
||||
HashMap<Object, Object> responseMap=new HashMap<Object, Object>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
if (!file.isEmpty()) {
|
||||
XSSFWorkbook workbook =null;
|
||||
|
||||
//创建Excel,读取文件内容
|
||||
workbook = new XSSFWorkbook(file.getInputStream());
|
||||
|
||||
//获取第一个工作表
|
||||
XSSFSheet sheet = workbook.getSheetAt(0);
|
||||
//获取sheet中第一行行号
|
||||
int firstRowNum = sheet.getFirstRowNum();
|
||||
//获取sheet中最后一行行号
|
||||
int lastRowNum = sheet.getLastRowNum();
|
||||
|
||||
try {
|
||||
//查询部门
|
||||
HashMap<String,HashMap<Object,Object>> departTreeMap=new HashMap<>();
|
||||
HashMap<String,List<HashMap<Object,Object>>> parentIdMap=new HashMap<>();
|
||||
HashMap<String,HashMap<Object,Object>> departIdMap=new HashMap<>();
|
||||
//处理部门组织方便查询
|
||||
for (String key : parentIdMap.keySet()){
|
||||
List<HashMap<Object, Object>> list = parentIdMap.get(key);
|
||||
HashMap<Object, Object> map = departIdMap.get(key);
|
||||
|
||||
map.put("childen",list);
|
||||
}
|
||||
|
||||
//时间
|
||||
String create_time = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss);
|
||||
String create_date = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd);
|
||||
|
||||
//添加人员
|
||||
Users user = (Users) request.getSession().getAttribute("user");
|
||||
String modify_user_name = user.getUserName();
|
||||
String modify_true_name = user.getTrueName();
|
||||
|
||||
//循环插入数据
|
||||
int errNum=0;
|
||||
List<String> errNumList=new ArrayList<String>();
|
||||
List<HashMap<Object,Object>> addList=new ArrayList<>();
|
||||
for(int i=firstRowNum+2;i<=lastRowNum;i++){//因为表格中第一行为标题,第二行为列标题
|
||||
XSSFRow row = sheet.getRow(i);
|
||||
HashMap<Object, Object> addMap=new HashMap<Object, Object>();
|
||||
//用户id
|
||||
XSSFCell user_id = row.getCell(0);
|
||||
if(user_id==null){
|
||||
errNum++;
|
||||
errNumList.add(""+(i+1));
|
||||
continue;
|
||||
}else {
|
||||
user_id.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("user_id",user_id.getStringCellValue());
|
||||
addMap.put("user_name",user_id.getStringCellValue());
|
||||
}
|
||||
|
||||
//姓名
|
||||
XSSFCell true_name = row.getCell(1);
|
||||
if(true_name==null){
|
||||
errNum++;
|
||||
errNumList.add(""+(i+1));
|
||||
continue;
|
||||
}else {
|
||||
true_name.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("true_name",true_name.getStringCellValue());
|
||||
}
|
||||
|
||||
//性别
|
||||
XSSFCell sex = row.getCell(2);
|
||||
if(sex==null){
|
||||
addMap.put("sex","");
|
||||
}else {
|
||||
sex.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("sex",sex.getStringCellValue());
|
||||
}
|
||||
|
||||
//公司
|
||||
String companyId="";
|
||||
XSSFCell company = row.getCell(3);
|
||||
if(company==null){
|
||||
errNum++;
|
||||
errNumList.add(""+(i+1));
|
||||
continue;
|
||||
}else {
|
||||
company.setCellType(Cell.CELL_TYPE_STRING);
|
||||
String companyStr = company.getStringCellValue();
|
||||
|
||||
//第一层是最上一级
|
||||
boolean isHas=false;
|
||||
for(String key:departTreeMap.keySet()){
|
||||
HashMap<Object, Object> hashMap = departTreeMap.get(key);
|
||||
List<HashMap<Object,Object>> departList = (List<HashMap<Object,Object>>)hashMap.get("childen");
|
||||
//要循环的级别
|
||||
for (int j=0;j<departList.size();j++){
|
||||
HashMap<Object, Object> departObj = departList.get(j);
|
||||
String depart_id = StringDUtil.changeNullToEmpty(departObj.get("DEPART_ID"));
|
||||
String depart_name = StringDUtil.changeNullToEmpty(departObj.get("DEPART_NAME"));
|
||||
if(companyStr.equals(depart_name)){
|
||||
addMap.put("company",depart_id);
|
||||
companyId=depart_id;
|
||||
isHas=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//判断对错 错的错误记录加1
|
||||
if (!isHas){
|
||||
errNum++;
|
||||
errNumList.add(""+(i+1));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//部门
|
||||
XSSFCell depart = row.getCell(4);
|
||||
if(depart==null){
|
||||
errNum++;
|
||||
errNumList.add(""+(i+1));
|
||||
continue;
|
||||
}else {
|
||||
depart.setCellType(Cell.CELL_TYPE_STRING);
|
||||
String departStr = depart.getStringCellValue();
|
||||
|
||||
//从部门树中找到部门
|
||||
HashMap<Object, Object> hashMap = departIdMap.get(companyId);
|
||||
List<HashMap<Object,Object>> departList = (List<HashMap<Object,Object>>)hashMap.get("childen");
|
||||
List<String> data=new ArrayList<>();
|
||||
getDepartIdByMapTree(data,departStr,departList);
|
||||
|
||||
if (data.size()>0){
|
||||
addMap.put("depart_id",data.get(0));
|
||||
}else{
|
||||
errNum++;
|
||||
errNumList.add(""+(i+1));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//岗位
|
||||
XSSFCell post = row.getCell(5);
|
||||
if(post==null){
|
||||
addMap.put("post","");
|
||||
}else {
|
||||
post.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("post",post.getStringCellValue());
|
||||
}
|
||||
|
||||
//政治面貌
|
||||
XSSFCell policital_status = row.getCell(6);
|
||||
if(policital_status==null){
|
||||
addMap.put("policital_status","");
|
||||
}else {
|
||||
policital_status.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("policital_status",policital_status.getStringCellValue());
|
||||
}
|
||||
|
||||
//专业技术资格
|
||||
XSSFCell positional_titles = row.getCell(7);
|
||||
if(positional_titles==null){
|
||||
addMap.put("positional_titles","");
|
||||
}else {
|
||||
positional_titles.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("positional_titles",positional_titles.getStringCellValue());
|
||||
}
|
||||
|
||||
//学历
|
||||
XSSFCell education = row.getCell(8);
|
||||
if(education==null){
|
||||
addMap.put("education","");
|
||||
}else {
|
||||
education.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("education",education.getStringCellValue());
|
||||
}
|
||||
|
||||
//职业技能名称
|
||||
XSSFCell vocational_name = row.getCell(9);
|
||||
if(vocational_name==null){
|
||||
addMap.put("vocational_name","");
|
||||
}else {
|
||||
vocational_name.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("vocational_name",vocational_name.getStringCellValue());
|
||||
}
|
||||
|
||||
//职业技术等级级别
|
||||
XSSFCell level = row.getCell(10);
|
||||
if(level==null){
|
||||
addMap.put("level","");
|
||||
}else {
|
||||
level.setCellType(Cell.CELL_TYPE_STRING);
|
||||
addMap.put("level",level.getStringCellValue());
|
||||
}
|
||||
|
||||
|
||||
//把固定的参数添加到map 默认密码先设置123
|
||||
addMap.put("password",new Md5Hash("123","hrs",2).toString());
|
||||
addMap.put("isactive", "1");
|
||||
addMap.put("modify_user_name", modify_user_name);
|
||||
addMap.put("modify_true_name", modify_true_name);
|
||||
addMap.put("create_time", create_time);
|
||||
addMap.put("create_date", create_date);
|
||||
|
||||
addList.add(addMap);
|
||||
}
|
||||
|
||||
if(errNum>0){
|
||||
errCode="999";
|
||||
errMsg="导入失败,有"+errNum+"行导入错误";
|
||||
responseMap.put("errNumList", errNumList);
|
||||
}else{
|
||||
try {
|
||||
usersService.insertExcelUsers(addList);//往数据库插入数据
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(this.getClass(), "上传人员列表失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errCode="999";
|
||||
errMsg="上传备件列表失败!"+e.getMessage();
|
||||
e.printStackTrace();
|
||||
LogUtil.error(this.getClass(), "上传人员列表失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||||
} finally {
|
||||
workbook.close();
|
||||
}
|
||||
}
|
||||
|
||||
responseMap.put("errCode", errCode);
|
||||
responseMap.put("errMsg", errMsg);
|
||||
|
||||
return responseMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 根据部门id查询相关人员
|
||||
* @author thuang
|
||||
* @date 2021/8/3 10:15
|
||||
* @version 1.0
|
||||
*/
|
||||
@RequestMapping("/findUserByDepartId")
|
||||
@ResponseBody
|
||||
public HashMap<Object,Object> findUserByDepartId(@RequestBody HashMap<Object,Object> map){
|
||||
HashMap<Object, Object> responseMap=new HashMap<Object, Object>();
|
||||
String errCode="0";
|
||||
String errMsg="";
|
||||
|
||||
try {
|
||||
String departIds = StringDUtil.changeNullToEmpty(map.get("departIds"));
|
||||
|
||||
//如果是空的就直接返回个空集合 不查询
|
||||
if ("".equals(departIds)){
|
||||
responseMap.put("userList",new ArrayList<>());
|
||||
}else {
|
||||
String[] split = departIds.split(",");
|
||||
|
||||
List<String> idList=new ArrayList<>();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
idList.add(split[i]);
|
||||
}
|
||||
|
||||
List<HashMap<Object, Object>> userByDepartIds = usersService.findUserByDepartIds(idList);
|
||||
|
||||
//循环数据生成所要格式 list 中 {name,value}
|
||||
List<HashMap<Object, Object>> userList =new ArrayList<>();
|
||||
for (int i = 0; i < userByDepartIds.size(); i++) {
|
||||
HashMap<Object, Object> hashMap = userByDepartIds.get(i);
|
||||
HashMap<Object, Object> selectObj=new HashMap<>();
|
||||
|
||||
selectObj.put("name",hashMap.get("TRUE_NAME"));
|
||||
selectObj.put("value",hashMap.get("USER_ID"));
|
||||
userList.add(selectObj);
|
||||
}
|
||||
responseMap.put("userList",userList);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
errCode="999";
|
||||
errMsg="查询部门相关人员失败,原因:"+e.getMessage();
|
||||
}
|
||||
|
||||
responseMap.put("errCode", errCode);
|
||||
responseMap.put("errMsg", errMsg);
|
||||
|
||||
return responseMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 从上面生成的部门Map中根据部门名称获取部门id
|
||||
* @author thuang
|
||||
* @date 2021/7/14 13:45
|
||||
* @version 1.0
|
||||
* @param data
|
||||
*/
|
||||
public void getDepartIdByMapTree(List<String> data, String departStr, List<HashMap<Object, Object>> departList){
|
||||
|
||||
for (int i=0;i<departList.size();i++){
|
||||
HashMap<Object, Object> departObj = departList.get(i);
|
||||
|
||||
String depart_id = StringDUtil.changeNullToEmpty(departObj.get("DEPART_ID"));
|
||||
String depart_name = StringDUtil.changeNullToEmpty(departObj.get("DEPART_NAME"));
|
||||
List<HashMap<Object,Object>> departChildenList = (List<HashMap<Object,Object>>)departObj.get("childen");
|
||||
|
||||
if(departStr.equals(depart_name)){
|
||||
data.add(depart_id);
|
||||
return;
|
||||
}
|
||||
if(departChildenList!=null && departChildenList.size()>0){
|
||||
getDepartIdByMapTree(data,departStr,departChildenList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.saye.hrs.controller.system;
|
||||
|
||||
import com.saye.hrs.commons.date.DateDUtil;
|
||||
import com.saye.hrs.model.StatusDefine;
|
||||
import com.saye.hrs.commons.string.StringDUtil;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* @author thuang
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2021/5/24 13:56
|
||||
*/
|
||||
@Controller
|
||||
public class downloadController {
|
||||
|
||||
@RequestMapping("/download")
|
||||
public void downloadFile(HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||
|
||||
try {
|
||||
String fileName = StringDUtil.changeNullToEmpty(request.getParameter("fileName"));
|
||||
String dowloadName = StringDUtil.changeNullToEmpty(request.getParameter("dowloadName"));
|
||||
//过滤相对路径../
|
||||
int lastIndex = fileName.lastIndexOf(".");
|
||||
//fileName = fileName.substring(0, lastIndex).replaceAll(".", "")+fileName.substring(lastIndex);
|
||||
String savePath = StatusDefine.filePath + fileName ;
|
||||
File file = new File(savePath);
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
response.setContentType("application/force-download");
|
||||
response.addHeader("Content-disposition", "attachment;fileName=" + URLEncoder.encode(dowloadName+ DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd)+".xlsx", "UTF-8"));
|
||||
OutputStream os = response.getOutputStream();
|
||||
byte[] buf = new byte[1024];
|
||||
int len = 0;
|
||||
while((len = fis.read(buf)) != -1) {
|
||||
os.write(buf, 0, len);
|
||||
}
|
||||
fis.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user