细节调整

master
lixin 4 years ago
parent fb0aeb3347
commit a244e7080e

@ -134,27 +134,16 @@
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>application-*.*</exclude>
<exclude>META-INF/**</exclude>
<exclude>static/**</exclude>
<exclude>template/**</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>application-druid.yml</include>
<include>META-INF/**</include>
<include>static/**</include>
<include>template/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>application.*</include>
<include>application-druid.*</include>
<include>application-${active.env}.*</include>
</includes>
</resource>

@ -6,6 +6,7 @@
</head>
<body>
<div class="main-content">
[[${user.dept.deptName}]]
<form class="form-horizontal" id="form-user-edit" th:object="${user}">
<input name="userId" type="hidden" th:field="*{userId}" />
<input name="deptId" type="hidden" th:field="*{deptId}" id="treeId"/>
@ -133,7 +134,7 @@
<th:block th:include="include :: select2-js" />
<script type="text/javascript">
var prefix = ctx + "system/user";
$("#form-user-edit").validate({
onkeyup: false,
rules:{
@ -186,7 +187,7 @@
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var data = $("#form-user-edit").serializeArray();
@ -212,7 +213,7 @@
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
var body = layer.getChildFrame('body', index);

@ -138,4 +138,10 @@ public class WxUserController extends BaseController
public AjaxResult triggerStatus(Long id){
return toAjax(wxUserService.triggerStatus(id));
}
@GetMapping( "/searchByName")
@ResponseBody
public AjaxResult searchByName(String uname){
return AjaxResult.success(wxUserService.searchByName(uname));
}
}

@ -0,0 +1,18 @@
package com.ruoyi.wx.dto;
import com.ruoyi.wx.domain.MrRecordOrder;
public class MrRecordOrderDTO extends MrRecordOrder {
/**
*
*/
private String applicantName;
public String getApplicantName() {
return applicantName;
}
public void setApplicantName(String applicantName) {
this.applicantName = applicantName;
}
}

@ -79,4 +79,6 @@ public interface IWxUserService
boolean checkUser(Long id);
boolean triggerStatus(Long id);
List<WxUser> searchByName(String uname);
}

@ -204,4 +204,11 @@ public class WxUserServiceImpl implements IWxUserService {
}
return true;
}
@Override
public List<WxUser> searchByName(String uname) {
WxUser wxUser=new WxUser();
wxUser.setName(uname);
return wxUserMapper.selectWxUserList(wxUser);
}
}

@ -1,56 +1,80 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.wx.mapper.MrRecordOrderMapper">
<resultMap type="MrRecordOrder" id="MrRecordOrderResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="mrNumber" column="mr_number" />
<result property="patientName" column="patient_name" />
<result property="dischargeDate" column="discharge_date" />
<result property="times" column="times" />
<result property="applicantId" column="applicant_id" />
<result property="hospital" column="hospital" />
<result property="address" column="address" />
<result property="downloadUrl" column="download_url" />
<result property="unzipPwd" column="unzip_pwd" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="id" column="id"/>
<result property="type" column="type"/>
<result property="mrNumber" column="mr_number"/>
<result property="patientName" column="patient_name"/>
<result property="dischargeDate" column="discharge_date"/>
<result property="times" column="times"/>
<result property="applicantId" column="applicant_id"/>
<result property="hospital" column="hospital"/>
<result property="address" column="address"/>
<result property="downloadUrl" column="download_url"/>
<result property="unzipPwd" column="unzip_pwd"/>
<result property="status" column="status"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="delivery" column="delivery"/>
<result property="trackingNumber" column="tracking_number"/>
</resultMap>
<resultMap id="MrRecordOrderDto" type="com.ruoyi.wx.dto.MrRecordOrderDTO" extends="MrRecordOrderResult"></resultMap>
<sql id="selectMrRecordOrderVo">
select id, type, mr_number, patient_name, delivery, tracking_number, discharge_date, times, applicant_id, hospital, address, download_url, unzip_pwd, status, create_time, update_time from mr_record_order
select id,
type,
mr_number,
patient_name,
delivery,
tracking_number,
discharge_date,
times,
applicant_id,
hospital,
address,
download_url,
unzip_pwd,
status,
create_time,
update_time
from mr_record_order
</sql>
<select id="selectMrRecordOrderList" parameterType="MrRecordOrder" resultMap="MrRecordOrderResult">
<include refid="selectMrRecordOrderVo"/>
<where>
<if test="type != null "> and type = #{type}</if>
<if test="mrNumber != null and mrNumber != ''"> and mr_number = #{mrNumber}</if>
<if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
<if test="dischargeDate != null "> and discharge_date = #{dischargeDate}</if>
<if test="times != null "> and times = #{times}</if>
<if test="applicantId != null "> and applicant_id = #{applicantId}</if>
<if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="downloadUrl != null and downloadUrl != ''"> and download_url = #{downloadUrl}</if>
<if test="unzipPwd != null and unzipPwd != ''"> and unzip_pwd = #{unzipPwd}</if>
<if test="status != null "> and status = #{status}</if>
<select id="selectMrRecordOrderList" parameterType="MrRecordOrder" resultMap="MrRecordOrderDto">
select ro.*,wu.name applicationName
from mr_record_order ro,wx_user wu
<where>
wu.id = ro.applicantId
<if test="type != null ">and type = #{type}</if>
<if test="mrNumber != null and mrNumber != ''">and mr_number = #{mrNumber}</if>
<if test="patientName != null and patientName != ''">and patient_name like concat('%', #{patientName},
'%')
</if>
<if test="dischargeDate != null ">and discharge_date = #{dischargeDate}</if>
<if test="times != null ">and times = #{times}</if>
<if test="applicantId != null ">and applicant_id = #{applicantId}</if>
<if test="hospital != null and hospital != ''">and hospital = #{hospital}</if>
<if test="address != null and address != ''">and address = #{address}</if>
<if test="downloadUrl != null and downloadUrl != ''">and download_url = #{downloadUrl}</if>
<if test="unzipPwd != null and unzipPwd != ''">and unzip_pwd = #{unzipPwd}</if>
<if test="status != null ">and status = #{status}</if>
<if test="delivery!=null and delivery != ''">and delivery like concat('%',#{delivery},'%')</if>
<if test="trackingNumber!=null and trackingNumber != ''">and tracking_number like concat('%',#{trackingNumber},'%')</if>
<if test="trackingNumber!=null and trackingNumber != ''">and tracking_number like
concat('%',#{trackingNumber},'%')
</if>
</where>
order by `status`,create_time DESC
</select>
<select id="searchList" resultType="com.ruoyi.wx.dto.RecordOrderDTO">
select o.id,if(o.type=0,'原件寄回','电子扫描件') type,o.mr_number mrNumber,o.patient_name patientName,o.discharge_date dischargeDate,o.times,o.hospital,o.address,if(o.`status`=0,'申请中','已完成') status,o.download_url downUrl
select o.id,if(o.type=0,'原件寄回','电子扫描件') type,o.mr_number mrNumber,o.patient_name patientName,o.discharge_date
dischargeDate,o.times,o.hospital,o.address,if(o.`status`=0,'申请中','已完成') status,o.download_url downUrl
from mr_record_order o
where o.applicant_id = #{userId}
where o.applicant_id = #{userId}
<if test="keyword!=null and keyword!=''">
and (o.mr_number like CONCAT('%',#{keyword},'%') or o.patient_name like CONCAT('%',#{keyword},'%'))
</if>
@ -60,12 +84,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by o.`status`,o.create_time DESC
limit ${startRow},${endRow}
</select>
<select id="selectMrRecordOrderById" parameterType="Long" resultMap="MrRecordOrderResult">
<include refid="selectMrRecordOrderVo"/>
where id = #{id}
</select>
<insert id="insertMrRecordOrder" parameterType="MrRecordOrder" useGeneratedKeys="true" keyProperty="id">
insert into mr_record_order
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -84,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="delivery!=null and delivery != ''">delivery,</if>
<if test="trackingNumber!=null and trackingNumber != ''">tracking_number,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="mrNumber != null and mrNumber != ''">#{mrNumber},</if>
@ -101,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="delivery!=null and delivery != ''">#{delivery},</if>
<if test="trackingNumber!=null and trackingNumber != ''">#{trackingNumber}</if>
</trim>
</trim>
</insert>
<update id="updateMrRecordOrder" parameterType="MrRecordOrder">
@ -127,23 +151,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteMrRecordOrderById" parameterType="Long">
delete from mr_record_order where id = #{id}
delete
from mr_record_order
where id = #{id}
</delete>
<delete id="deleteMrRecordOrderByIds" parameterType="String">
delete from mr_record_order where id in
delete from mr_record_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getUrlHeaders" resultType="map">
select url,headers from code_url where code=#{code}
select url, headers
from code_url
where code = #{code}
</select>
<insert id="saveCodeUrl">
insert into code_url (code,url,headers)values(#{code},#{url},#{headers})
insert into code_url (code, url, headers)
values (#{code}, #{url}, #{headers})
</insert>
</mapper>

@ -46,7 +46,8 @@
<label class="col-sm-3 control-label is-required">申请人:</label>
<div class="col-sm-8">
<div class="input-group">
<input type="text" class="form-control" name="applicantId" id="baidu">
<input type="text" class="form-control" id="applicant">
<input type="hidden" name="applicantId" id="applicantId">
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
@ -58,12 +59,6 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">医院名称:</label>
<div class="col-sm-8">
<input name="hospital" class="form-control" type="text" required>
</div>
</div>
<div class="form-group order-type1">
<label class="col-sm-3 control-label">寄送地址:</label>
<div class="col-sm-8">
@ -115,17 +110,44 @@
});
//百度搜索测试
var testBsSuggest = $("#baidu").bsSuggest({
url: ctx + "demo/form/userModel?t="+(new Date()).getTime()+"&keyword=",
var testBsSuggest = $("#applicant").bsSuggest({
url: ctx + "wx/user/searchByName?t="+(new Date()).getTime()+"&uname=",
allowNoKeyword: false, //是否允许无关键字时请求数据
getDataMethod: "url", //获取数据的方式,总是从 URL 获取
showBtn: false,
idField: "userId",
keyField: "userName"
}).on('onDataRequestSuccess', function (e, result) {
console.log('onDataRequestSuccess: ', result);
idField: "id",
keyField: "name",
effectiveFieldsAlias: {
id: "主键",
name: "姓名",
hospital: "医院",
phone: "手机号码"
},
processData: function (json) {
var i, len, data = {
value: []
};
if (!json || !json.data || json.data.length == 0) {
return false;
}
console.log(json);
len = json.data.length;
for (i = 0; i < len; i++) {
data.value.push({
"id": json.data[i].id,
"name": json.data[i].name,
"hospital": json.data[i].hospital,
"phone": json.data[i].phone
});
}
console.log(data);
return data;
}
}).on('onSetSelectValue', function (e, keyword) {
console.log('onSetSelectValue: ', keyword);
$("#applicantId").val(keyword.id);
}).on('onUnsetSelectValue', function (e) {
console.log("onUnsetSelectValue");
});

Loading…
Cancel
Save