代码更新2.0

————2021.02.01 王泽钦
master
wzqgit 5 years ago
parent 9117908e6e
commit 75fed113ac

@ -0,0 +1,55 @@
package com.emr.controller;
import com.emr.entity.Archive_Master;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.Archive_MasterService;
import com.emr.util.ExportExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("/medicalHandle")
public class MedicalHandleController {
@Autowired
private Archive_MasterService archiveMasterService;
@RequestMapping(value = "/medicalHandles")
public String faults(Model model) {
return "medicalHandlerDir/medicalHandlerList";
}
@ResponseBody
@RequestMapping(value = "/medicalHandlesList")
public OffsetLimitPage medicalHandlesList(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
OffsetLimitPage result = archiveMasterService.selectHandleDetail(archiveMasterVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/exportExcel")
public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception {
String tableThNames = "病历清单id,住院号,住院次数,名字,性别,入院科室,入院日期,出院科室,出院日期,处理人,处理时间,处理状态";
String fieldCns = "id,inpNo,visitId,name,sex,deptAdmissionTo,admissionDateTime,deptName,dischargeDateTime,handleName,handleTime,followingContent";
//构造excel的数据
List<Archive_Master_Vo> list = archiveMasterService.selectHandleDetail(archiveMasterVo);
//文件名
String fileName = "病案室处理列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//ExportExcelUtil
ExportExcelUtil exportExcelUtil = new ExportExcelUtil();
response.setContentType("application/ms-excel;charset=gbk");
//导出excel的操作
exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response);
}
}

@ -0,0 +1,55 @@
package com.emr.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.emr.entity.Power_User;
import com.emr.util.HttpClientUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
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.Iterator;
import java.util.List;
@Controller
public class PowerUserController {
@Value("${powerGetUserList}")
private String powerGetUserList;
@RequestMapping("getPowerUserList")
@ResponseBody
public Object test(HttpServletRequest request,String type){
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String handleName = user.getUserPosition();//姓名
request.setAttribute("handleName",handleName);
JSONObject jsonObject = HttpClientUtils.httpGet(powerGetUserList);
List<JSONObject> users = new ArrayList<>();
String code = jsonObject.getString("code");
if (code.equals("100")){
JSONObject data = jsonObject.getJSONObject("extend");
// return data.toString()
JSONArray userList = data.getJSONArray("userList");
if (type.equals("1")){
// return userList.toJSONString();
return userList;
}else{
for (int i = 0; i < userList.size(); i++) {
JSONObject temp = userList.getJSONObject(i);
String roleId = temp.getString("roleId");
if (roleId.equals("22")||roleId.equals("20")){
users.add(temp);
}
}
return users;
}
}else{
return "ERROR";
}
}
}

@ -0,0 +1,17 @@
package com.emr.dao;
import com.emr.entity.Archive_Master_Following;
public interface Archive_Master_FollowingMapper {
int deleteByPrimaryKey(String id);
int insert(Archive_Master_Following record);
int insertSelective(Archive_Master_Following record);
Archive_Master_Following selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(Archive_Master_Following record);
int updateByPrimaryKey(Archive_Master_Following record);
}

@ -0,0 +1,85 @@
package com.emr.entity;
import java.util.Date;
public class Archive_Master_Following {
private String id;
private String masterId;
private String followingType;
private String followingContent;
private String handleTime;
private String handleId;
private String handleName;
private String remark;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getMasterId() {
return masterId;
}
public void setMasterId(String masterId) {
this.masterId = masterId == null ? null : masterId.trim();
}
public String getFollowingType() {
return followingType;
}
public void setFollowingType(String followingType) {
this.followingType = followingType == null ? null : followingType.trim();
}
public String getFollowingContent() {
return followingContent;
}
public void setFollowingContent(String followingContent) {
this.followingContent = followingContent == null ? null : followingContent.trim();
}
public String getHandleTime() {
return handleTime;
}
public void setHandleTime(String handleTime) {
this.handleTime = handleTime;
}
public String getHandleId() {
return handleId;
}
public void setHandleId(String handleId) {
this.handleId = handleId == null ? null : handleId.trim();
}
public String getHandleName() {
return handleName;
}
public void setHandleName(String handleName) {
this.handleName = handleName == null ? null : handleName.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
}

@ -0,0 +1,7 @@
package com.emr.service;
import com.emr.entity.Archive_Master_Following;
public interface Archive_Master_FollowingService {
int insertSelective(Archive_Master_Following record);
}

@ -0,0 +1,17 @@
package com.emr.service.ipml;
import com.emr.dao.Archive_Master_FollowingMapper;
import com.emr.entity.Archive_Master_Following;
import com.emr.service.Archive_Master_FollowingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class Archive_Master_FollowingServiceImpl implements Archive_Master_FollowingService {
@Autowired
private Archive_Master_FollowingMapper archive_master_followingMapper;
@Override
public int insertSelective(Archive_Master_Following record) {
return archive_master_followingMapper.insertSelective(record);
}
}

@ -1084,8 +1084,11 @@
and f.handle_time &lt;= #{endHandleTime,jdbcType=NCHAR}+ ' 23:59:59' and f.handle_time &lt;= #{endHandleTime,jdbcType=NCHAR}+ ' 23:59:59'
</when> </when>
</choose> </choose>
<if test="handleName != null and handleName != ''"> <if test="handleId != null and handleId != ''">
and f.handle_name like '%'+#{handleName,jdbcType=NCHAR}+'%' and f.handle_id in
<foreach item="item" collection="handleId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if> </if>
<if test="followingType != null and followingType != ''"> <if test="followingType != null and followingType != ''">
and f.following_type in(#{followingType,jdbcType=NVARCHAR}) and f.following_type in(#{followingType,jdbcType=NVARCHAR})

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.emr.dao.Archive_Master_FollowingMapper">
<resultMap id="BaseResultMap" type="com.emr.entity.Archive_Master_Following">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="master_id" jdbcType="VARCHAR" property="masterId" />
<result column="following_type" jdbcType="VARCHAR" property="followingType" />
<result column="following_content" jdbcType="NVARCHAR" property="followingContent" />
<result column="handle_time" jdbcType="TIMESTAMP" property="handleTime" />
<result column="handle_id" jdbcType="VARCHAR" property="handleId" />
<result column="handle_name" jdbcType="NVARCHAR" property="handleName" />
<result column="remark" jdbcType="NVARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, master_id, following_type, following_content, handle_time, handle_id, handle_name,
remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from Archive_Master_Following
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from Archive_Master_Following
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.emr.entity.Archive_Master_Following">
insert into Archive_Master_Following (id, master_id, following_type,
following_content, handle_time, handle_id,
handle_name, remark)
values ((select replace(newid(),'-','')), #{masterId,jdbcType=VARCHAR}, #{followingType,jdbcType=VARCHAR},
#{followingContent,jdbcType=NVARCHAR}, #{handleTime,jdbcType=TIMESTAMP}, #{handleId,jdbcType=VARCHAR},
#{handleName,jdbcType=NVARCHAR}, #{remark,jdbcType=NVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.emr.entity.Archive_Master_Following">
insert into Archive_Master_Following
<trim prefix="(" suffix=")" suffixOverrides=",">
<!--<if test="id != null">-->
id,
<!--</if>-->
<if test="masterId != null">
master_id,
</if>
<if test="followingType != null">
following_type,
</if>
<if test="followingContent != null">
following_content,
</if>
<if test="handleTime != null">
handle_time,
</if>
<if test="handleId != null">
handle_id,
</if>
<if test="handleName != null">
handle_name,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<!--<if test="id != null">-->
(select replace(newid(),'-','')),
<!--</if>-->
<if test="masterId != null">
#{masterId,jdbcType=VARCHAR},
</if>
<if test="followingType != null">
#{followingType,jdbcType=VARCHAR},
</if>
<if test="followingContent != null">
#{followingContent,jdbcType=NVARCHAR},
</if>
<if test="handleTime != null">
#{handleTime,jdbcType=TIMESTAMP},
</if>
<if test="handleId != null">
#{handleId,jdbcType=VARCHAR},
</if>
<if test="handleName != null">
#{handleName,jdbcType=NVARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=NVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.Archive_Master_Following">
update Archive_Master_Following
<set>
<if test="masterId != null">
master_id = #{masterId,jdbcType=VARCHAR},
</if>
<if test="followingType != null">
following_type = #{followingType,jdbcType=VARCHAR},
</if>
<if test="followingContent != null">
following_content = #{followingContent,jdbcType=NVARCHAR},
</if>
<if test="handleTime != null">
handle_time = #{handleTime,jdbcType=TIMESTAMP},
</if>
<if test="handleId != null">
handle_id = #{handleId,jdbcType=VARCHAR},
</if>
<if test="handleName != null">
handle_name = #{handleName,jdbcType=NVARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=NVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.emr.entity.Archive_Master_Following">
update Archive_Master_Following
set master_id = #{masterId,jdbcType=VARCHAR},
following_type = #{followingType,jdbcType=VARCHAR},
following_content = #{followingContent,jdbcType=NVARCHAR},
handle_time = #{handleTime,jdbcType=TIMESTAMP},
handle_id = #{handleId,jdbcType=VARCHAR},
handle_name = #{handleName,jdbcType=NVARCHAR},
remark = #{remark,jdbcType=NVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

@ -296,6 +296,8 @@
}); });
//处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容 //处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容
function DoOnCellHtmlData(cell, row, col, data) { function DoOnCellHtmlData(cell, row, col, data) {
if (row == 0) { if (row == 0) {

Loading…
Cancel
Save