Commit 5ff91815 authored by 谢希宇's avatar 谢希宇

Submit by Strive

Date 2021/07/26
Project End
parent f9e261d6
......@@ -19,6 +19,6 @@ public class GiftboxLogDto {
private String surname;
@ExportConfig(value = "会员名", width = 100)
private String name;
@ExportConfig(value = "参与时间", width = 100,dateFormat="yyyy-MM-dd HH:mm")
@ExportConfig(value = "参与时间", width = 100, dateFormat="yyyy-MM-dd HH:mm")
private Date create_time;
}
......@@ -4,8 +4,10 @@
<resultMap id="resultMap" type="com.cftech.authentication.model.Authentication">
<id column="id" property="id"/>
<result column="id_card" property="idCard"/>
<result column="name" property="name"/>
<result column="order_id" property="orderId"/>
<result column="user_id" property="userId"/>
<result column="amount" property="amount"/>
<result column="old_amount" property="oldAmount"/>
<result column="accounts_id" property="accountsId"/>
<result column="del_flag" property="delFlag"/>
<result column="status" property="status"/>
......@@ -45,8 +47,10 @@
<sql id="sqlColumns">
id,
id_card,
name,
order_id,
user_id,
amount,
old_amount,
accounts_id,
del_flag,
status,
......@@ -67,8 +71,10 @@
values
(
#{id, jdbcType=BIGINT},
#{idCard, jdbcType=VARCHAR},
#{name, jdbcType=VARCHAR},
#{orderId, jdbcType=BIGINT},
#{userId, jdbcType=BIGINT},
#{amount, jdbcType=DOUBLE},
#{oldAmount, jdbcType=DOUBLE},
#{accountsId, jdbcType=BIGINT},
#{delFlag, jdbcType=TINYINT},
#{status, jdbcType=VARCHAR},
......@@ -108,11 +114,17 @@
<if test="id != null">
id = #{id, jdbcType=BIGINT},
</if>
<if test="idCard != null">
id_card = #{idCard, jdbcType=VARCHAR},
<if test="orderId != null">
order_id = #{orderId, jdbcType=BIGINT},
</if>
<if test="name != null">
name = #{name, jdbcType=VARCHAR},
<if test="userId != null">
user_id = #{userId, jdbcType=BIGINT},
</if>
<if test="amount != null">
amount = #{amount, jdbcType=DOUBLE},
</if>
<if test="oldAmount != null">
old_amount = #{oldAmount, jdbcType=DOUBLE},
</if>
<if test="accountsId != null">
accounts_id = #{accountsId, jdbcType=BIGINT},
......@@ -140,6 +152,8 @@
</update>
<update id="delete" parameterType="java.lang.Long">
update t_aidea_authentication set del_flag=1 where id=#{id,jdbcType=BIGINT}
update t_aidea_authentication
set del_flag=1
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -7,7 +7,7 @@ import java.io.Serializable;
import java.util.Date;
/**
* 身份验证
* 记录改价表
*
* @author Buyj
* @date: 2020-11-23 16:56
......@@ -17,25 +17,22 @@ public class Authentication implements Serializable {
/* 主键id */
private Long id;
@ExportConfig(value = "姓名", width = 100)
private String name;
/* 身份证号码 */
@ExportConfig(value = "身份证号码", width = 150)
private String idCard;
private Long orderId;
private Long userId;
private Double amount;
private Double oldAmount;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
@ExportConfig(value = "患者类型(0:三期;1:四期)", width = 200)
private String status;
/* 更新时间 */
private Date updateTime;
/* 备注 */
@ExportConfig(value = "描述", width = 150)
private String description;
/* 创建时间 */
@ExportConfig(value = "创建时间",width = 150, showLevel = 1, dateFormat = "yyyy-MM-dd HH:mm")
private Date createTime;
/* 创建人 */
private Long createBy;
......
......@@ -2,13 +2,13 @@ package com.cftech.authentication.service;
import com.cftech.authentication.model.Authentication;
import com.cftech.core.generic.GenericService;
/**
* 身份验证Service
*
* @author Buyj
* @date: 2020-11-23 16:56
*/
* 身份验证Service
*
* @author Buyj
* @date: 2020-11-23 16:56
*/
public interface AuthenticationService extends GenericService<Authentication> {
}
......@@ -11,21 +11,21 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
/**
* 身份验证ServiceImpl
*
* @author Buyj
* @date: 2020-11-23 16:56
*/
* 身份验证ServiceImpl
*
* @author Buyj
* @date: 2020-11-23 16:56
*/
@Service("authenticationService")
public class AuthenticationServiceImpl extends GenericServiceImpl<Authentication> implements AuthenticationService {
@Autowired
@Qualifier("authenticationMapper")
private AuthenticationMapper authenticationMapper;
@Autowired
@Qualifier("authenticationMapper")
private AuthenticationMapper authenticationMapper;
@Override
public GenericDao<Authentication> getGenericMapper() {
return authenticationMapper;
}
@Override
public GenericDao<Authentication> getGenericMapper() {
return authenticationMapper;
}
}
\ No newline at end of file
......@@ -105,9 +105,6 @@ public class AuthenticationController {
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountsId);
if (!StringUtils.isEmpty(authentication.getName())) {
conds.like("name", authentication.getName());
}
Sort sort = new Sort("create_time", OrderType.DESC);
List<Authentication> list = authenticationService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
......@@ -141,9 +138,6 @@ public class AuthenticationController {
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountId);
if (!StringUtils.isEmpty(authentication.getName())) {
conds.like("name", authentication.getName());
}
Sort sort = new Sort("create_time", OrderType.DESC);
List<Authentication> list = authenticationService.fetchSearchByPage(conds, sort, 0, 0);
list.forEach(item -> {
......@@ -193,23 +187,15 @@ public class AuthenticationController {
ExcelKit.$Import().setEmptyCellValue("").readExcel(storeFile, rowData -> {
Authentication authentication = new Authentication();
authentication.setAccountsId(accountId);
if (!StringUtils.isEmpty(rowData.get(0))) {
authentication.setName(rowData.get(0));
}
if (!StringUtils.isEmpty(rowData.get(1))) {
if (rowData.get(1).length() == 15 || rowData.get(1).length() == 18){
authentication.setIdCard(rowData.get(1));
}
}
if (!StringUtils.isEmpty(rowData.get(2))) {
authentication.setStatus(rowData.get(2));
}
if (!StringUtils.isEmpty(rowData.get(3))) {
authentication.setDescription(rowData.get(3));
}
if (!StringUtils.isEmpty(authentication.getIdCard())) {
authenticationService.save(authentication);
}
});
} catch (IOException e) {
retJson.put("errorNo", "1");
......
......@@ -77,12 +77,12 @@
<section class="content-header">
<h1>
咨询单报表管理
<small>咨询单报表</small>
处方单报表管理
<small>处方单报表</small>
</h1>
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>首页</a></li>
<li><a class="active">咨询单报表管理列表</a></li>
<li><a class="active">处方单报表管理列表</a></li>
</ol>
</section>
......@@ -92,7 +92,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/consultSheet/exportExcel')" method="get">
<form id="seachTableForm" action="#springUrl('/a/consultSheet/exportFromExcel')" method="get">
<div class="col-xs-2">
<input type="text" class="form-control"
......@@ -107,8 +107,7 @@
<div class="col-xs-2">
<select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option>
<option value="3">三期患者</option>
<option value="4">四期患者</option>
<option value="1">三期患者</option>
</select>
</div>
......@@ -436,15 +435,12 @@
"aTargets": [6],
"mData": "isThree",
"mRender": function (a, b, c, d) {
if (a == '0') {
if (a == '1') {
return '三期';
} else if (a == '1') {
return '四期';
} else {
return '';
}
}
},
{
"width": "50px",
......@@ -623,22 +619,6 @@
});
}
function importExcel() {
var templateExcelUrl = "#springUrl('/a/consultSheet/templateExcel')";
var importExcelUrl = "#springUrl('/a/consultSheet/importExcel')";
Cfapp.importExcel({
title: '咨询单导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
},
success: function () {
}
});
}
function clearSearch() {
$("#seachTableForm input").each(function () {
$(this).val('');
......@@ -677,7 +657,6 @@
$('#divimg img').css("margin-left", val + "%");
$('#divimg img').css("margin-top", "5%");
$('#divimg').fadeIn(200);
}
function hide() {
......
......@@ -214,45 +214,59 @@
<div class="form-group form-md-line-input col-xs-3">
<label>处方医院</label>
#if ($!{isView} == 'true')
<input type="text"
class="form-control" value="$!{data.hospital}"
readonly="readonly"
maxlength="50" placeholder="处方医院"/>
#else
<div class="input-group">
<input type="text" name="allergy" id="allergy" value="$!{data.allergy}"
class="form-control" style="display: none">
<input type="text" id="hospital" name="hospital"
value="$!{data.hospital}" class="form-control selHospital" readonly>
<span class="input-group-btn">
<button type="button" name="selHospital" id="selHospital"
class="btn btn-info btn-flat selHospital">选择</button>
</span>
</div>
#end
class="form-control" placeholder="请输入处方医院" #if ($!{isView} == 'true') readonly="readonly" #end>
<!-- <input type="text" id="hospital" name="hospital"-->
<!-- value="$!{data.hospital}" class="form-control selHospital" readonly>-->
<!-- <span class="input-group-btn">-->
<!-- <button type="button" name="selHospital" id="selHospital"-->
<!-- class="btn btn-info btn-flat selHospital">选择</button>-->
<!-- </span>-->
</div>
<div class="form-group form-md-line-input col-xs-3">
<label>处方医生</label>
#if ($!{isView} == 'true')
<input type="text"
class="form-control" value="$!{data.pharmacist}"
readonly="readonly"
maxlength="50" placeholder="处方医生"/>
#else
<div class="input-group">
<input type="text" name="pastRecords" id="pastRecords"
value="$!{data.pastRecords}" class="form-control"
style="display: none">
<input type="text" id="pharmacist" name="pharmacist"
value="$!{data.pharmacist}" class="form-control selDoctor" readonly>
<span class="input-group-btn">
<button type="button" name="selDoctor" id="selDoctor"
class="btn btn-info btn-flat selDoctor">选择</button>
</span>
value="$!{data.pastRecords}" class="form-control" placeholder="请输入处方医生" #if ($!{isView} == 'true') readonly="readonly" #end>
<!-- <input type="text" id="pharmacist" name="pharmacist"-->
<!-- value="$!{data.pharmacist}" class="form-control selDoctor" readonly>-->
<!-- <span class="input-group-btn">-->
<!-- <button type="button" name="selDoctor" id="selDoctor"-->
<!-- class="btn btn-info btn-flat selDoctor">选择</button>-->
<!-- </span>-->
</div>
#end
<div class="form-group form-md-line-input col-xs-3">
<label>随机号</label>
<input type="text" name="randomNo" id="randomNo"
#if ($!{data.isThree} == '1') value="$!{data.randomNo}" #end class="form-control" placeholder="随机号" readonly="readonly">
</div>
<div class="form-group form-md-line-input col-xs-3">
<label>入组医院</label>
<input type="text" name="firstHospital" id="firstHospital"
#if ($!{data.isThree} == '1') value="$!{data.firstHospital}" #end class="form-control" placeholder="入组医院" readonly="readonly">
</div>
<div class="form-group form-md-line-input col-xs-3">
<label>处方单<font style="color: red"></font></label>
<br/>
<div class="form-group " id="imageurl"
style="width: 120px; height: 120px; margin-left: 5px; padding: 10px; background-color: #f4f4f4; border: 1px solid #CCCCCC">
<img id="prescription"
style="cursor:zoom-in; width: 100%; height: 100% "
src="$!{data.prescription}" onclick="imgcli(this)">
</div>
</div>
<div class="form-group form-md-line-input col-xs-3">
<label>随访医院</label>
<input type="text" name="followupHospital" id="followupHospital"
#if ($!{data.isThree} == '1') value="$!{data.followupHospital}" #end class="form-control" placeholder="随访医院" readonly="readonly">
</div>
<div class="form-group form-md-line-input col-xs-6">
......@@ -280,16 +294,7 @@
<!-- </div>-->
<!-- </div>-->
<div class="form-group form-md-line-input col-xs-3">
<label>处方单<font style="color: red"></font></label>
<br/>
<div class="form-group " id="imageurl"
style="width: 120px; height: 120px; margin-left: 5px; padding: 10px; background-color: #f4f4f4; border: 1px solid #CCCCCC">
<img id="prescription"
style="cursor:zoom-in; width: 100%; height: 100% "
src="$!{data.prescription}" onclick="imgcli(this)">
</div>
</div>
</div>
......
......@@ -90,8 +90,7 @@
<div class="col-xs-2">
<select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option>
<option value="3">三期患者</option>
<option value="4">四期患者</option>
<option value="1">三期患者</option>
</select>
</div>
......@@ -124,18 +123,6 @@
</div>
</div>
<!-- <div class="col-xs-2">-->
<!-- <div class="input-group date">-->
<!-- <div class="input-group-addon">-->
<!-- <i class="fa fa-calendar"></i>-->
<!-- </div>-->
<!-- <input type="text"-->
<!-- class="form-control pull-right datepicker"-->
<!-- name="endCreateTime" placeholder="提交结束时间"-->
<!-- readonly="readonly">-->
<!-- </div>-->
<!-- </div>-->
<div class="col-xs-4">
<div class="input-group date">
<div class="input-group-addon">
......@@ -147,18 +134,6 @@
</div>
</div>
<!-- <div class="col-xs-2">-->
<!-- <div class="input-group date">-->
<!-- <div class="input-group-addon">-->
<!-- <i class="fa fa-calendar"></i>-->
<!-- </div>-->
<!-- <input type="text"-->
<!-- class="form-control pull-right datepicker"-->
<!-- name="endAuditTime" placeholder="审核结束时间"-->
<!-- readonly="readonly">-->
<!-- </div>-->
<!-- </div>-->
<div class="col-xs-4">
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
<button type="button" class="btn btn-info" onclick="clearSearch()">重置</button>
......@@ -182,6 +157,8 @@
<th>患者类型</th>
<th>药师</th>
<th>客服</th>
<th>随机号</th>
<th>入组医院</th>
<th>随访医院</th>
<th>审核状态</th>
<th>拒绝原由</th>
......@@ -317,6 +294,12 @@
{
"mData": "customerName"
},
{
"mData": "randomNo"
},
{
"mData": "firstHospital"
},
{
"mData": "followupHospital"
},
......@@ -442,11 +425,35 @@
}
},
{
"width": "80px",
"width": "50px",
"aTargets": [9],
"mData": "randomNo",
"mRender": function (a, b, c, d) {
if (c.isThree == '1') {
return a;
} else {
return null;
}
}
},
{
"width": "80px",
"aTargets": [10],
"mData": "firstHospital",
"mRender": function (a, b, c, d) {
if (c.isThree == '1') {
return a;
} else {
return null;
}
}
},
{
"width": "80px",
"aTargets": [11],
"mData": "followupHospital",
"mRender": function (a, b, c, d) {
if (a) {
if (c.isThree == '1') {
return a;
} else {
return null;
......@@ -455,7 +462,7 @@
},
{
"width": "60px",
"aTargets": [10],
"aTargets": [12],
"mData": "status",
"mRender": function (a, b, c, d) {
if (a == 0) {
......@@ -469,7 +476,7 @@
},
{
"width": "120px",
"aTargets": [11],
"aTargets": [13],
"mData": "description",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -481,7 +488,7 @@
},
{
"width": "120px",
"aTargets": [12],
"aTargets": [14],
"mData": "createTime",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -494,7 +501,7 @@
},
{
"width": "120px",
"aTargets": [13],
"aTargets": [15],
"mData": "auditTime",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -506,7 +513,7 @@
},
{
"width": "80px",
"aTargets": [14],
"aTargets": [16],
"mData": "id",
"mRender": function (a, b, c, d) {
let html = '';
......
......@@ -184,13 +184,18 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias, f.nickname nickName
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias, f.nickname nickName,
m.status isThree,
m.invitcode randomNo,
ou.org_name firstHospital
FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = 0
LEFT JOIN wx_mp_member m ON m.open_id = a.open_id AND m.del_flag = '0'
LEFT JOIN t_orgunit ou ON m.storeid = ou.id AND ou.del_flag = 0
WHERE a.id = #{id}
GROUP BY id
</select>
......@@ -209,7 +214,6 @@
LEFT JOIN t_qyuser b ON b.id = a.doctor_id AND b.del_flag = '0'
LEFT JOIN t_qyuser c ON c.id = a.service_id AND c.del_flag = '0'
LEFT JOIN wx_mp_member m ON m.open_id = a.open_id AND m.del_flag = '0'
LEFT JOIN t_aidea_authentication au ON m.cardid = au.id_card AND au.del_flag = '0'
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = '0'
<include refid="sqlWhere"/>
<if test="userid!=null">and (a.doctor_id = ${userid} or a.service_id =${userid})</if>
......@@ -219,17 +223,20 @@
SELECT
<include refid="sqlColumns"/>,
o.number orderCode,
m.status isThree,
(SELECT status FROM t_order sales WHERE sales.del_flag = '0' AND sales.status = '4' AND sales.openid = a.open_id LIMIT 1) isSales,
f.store fansAlias,
o.status orderStatus,
(SELECT SUM(od.drugs_num) FROM t_order_details od WHERE od.order_id = o.id AND od.del_flag = '0') drugNum,
GROUP_CONCAT(g.name SEPARATOR ',') tabNames
GROUP_CONCAT(g.name SEPARATOR ',') tabNames,
m.status isThree,
m.invitcode randomNo,
ou.org_name firstHospital
FROM t_aidea_consult_sheet a
LEFT JOIN t_order o ON a.order_id = o.id
LEFT JOIN t_qyuser b ON b.id = a.doctor_id AND b.del_flag = '0'
LEFT JOIN t_qyuser c ON c.id = a.service_id AND c.del_flag = '0'
LEFT JOIN wx_mp_member m ON m.open_id = a.open_id AND m.del_flag = '0'
LEFT JOIN t_orgunit ou ON m.storeid = ou.id AND ou.del_flag = 0
LEFT JOIN t_aidea_member_group g ON FIND_IN_SET(g.id, m.member_id) != 0 AND g.del_flag = '0'
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = '0'
<include refid="sqlWhere"/>
......@@ -346,7 +353,7 @@
</if>
<if test="followupHospital != null">
followup_hospital = #{followupHospital, jdbcType=VARCHAR},
</if> l
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
......
......@@ -34,9 +34,9 @@ public class ConsultSheet extends UserSheet implements Serializable {
/* 处方医院组织长字段 */
private String illness;
/* 处方医院 */
private Long allergy;
private String allergy;
/* 处方医生 */
private Long pastRecords;
private String pastRecords;
/* 处方单 */
private String prescription;
/* 药师id */
......@@ -100,6 +100,8 @@ public class ConsultSheet extends UserSheet implements Serializable {
private String orderStatus;//订单状态
private String drugNum;//购买数量
private String tabNames;//患者类型
private String randomNo;//随机号
private String firstHospital;//入组医院
public ConsultSheet() {
this.delFlag = false;
......
package com.cftech.consultsheet.model;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
@Data
public class ConsultSheetReportVo {
@ExportConfig(value = "咨询单编码", width = 100, showLevel = 1)
private String consultId;
@ExportConfig(value = "订单编号" , width = 100, showLevel = 1)
private String orderCode;
@ExportConfig(value = "用药人姓名", width = 100, showLevel = 1)
private String userName;
@ExportConfig(value = "别名", width = 100, showLevel = 1)
private String alias;
@ExportConfig(value = "新用户", width = 100, showLevel = 1)
private String isNew;
@ExportConfig(value = "患者类型", width = 100, showLevel = 1)
private String isThree;
@ExportConfig(value = "药师姓名", width = 100, showLevel = 1)
private String pharmaName;
@ExportConfig(value = "客服姓名", width = 100, showLevel = 1)
private String customerName;
@ExportConfig(value = "随机号", width = 100, showLevel = 1)
private String randomNo;
@ExportConfig(value = "入组医院", width = 100, showLevel = 1)
private String firstHospital;
@ExportConfig(value = "随访医院", width = 100, showLevel = 1)
private String randomHospital;
@ExportConfig(value = "审核状态", width = 100, showLevel = 1)
private String status;
@ExportConfig(value = "购买数量" , width = 100 , showLevel = 1)
private String number;
@ExportConfig(value = "提交时间" , width = 100, showLevel = 1)
private String createTime;
@ExportConfig(value = "审核时间" , width = 100, showLevel = 1)
private String auditTime;
}
......@@ -13,49 +13,48 @@ import java.util.Date;
@Data
public class ConsultSheetVO {
/* 咨询单编码 */
@ExportConfig(value = "咨询单编码", width = 100, showLevel = 1)
private String consultId;
@ExportConfig(value = "订单编号" , width = 100, showLevel = 1)
private String orderCode;
/* 用药人name */
@ExportConfig(value = "用药人姓名", width = 100, showLevel = 1)
private String userName;
/* 性别 */
@ExportConfig(value = "别名", width = 100, showLevel = 1)
private String alias;
@ExportConfig(value = "性别", width = 100, showLevel = 1)
private String sex;
/* 手机号 */
@ExportConfig(value = "联系电话", width = 100, showLevel = 1)
private String phone;
/* 疾病史 */
@ExportConfig(value = "新用户", width = 100, showLevel = 1)
private String isNew;
@ExportConfig(value = "患者类型", width = 100, showLevel = 1)
private String isThree;
// /* 病情描述 */
// @ExportConfig(value = "是否服用过该药且无禁忌症", width = 100, showLevel = 1)
// private String illness;
//
// /* 过敏史 */
// @ExportConfig(value = "有无过敏反应", width = 100, showLevel = 1)
// private String allergy;
/* 状态 */
@ExportConfig(value = "是否审核", width = 100, showLevel = 1)
private String status;
/* 药师姓名*/
@ExportConfig(value = "药师姓名", width = 100, showLevel = 1)
private String pharmaName;
/* 客服姓名*/
@ExportConfig(value = "客服姓名", width = 100, showLevel = 1)
private String customerName;
@ExportConfig(value = "随机号", width = 100, showLevel = 1)
private String randomNo;
@ExportConfig(value = "入组医院", width = 100, showLevel = 1)
private String firstHospital;
@ExportConfig(value = "随访医院", width = 100, showLevel = 1)
private String randomHospital;
@ExportConfig(value = "审核状态", width = 100, showLevel = 1)
private String status;
@ExportConfig(value = "拒绝原因" , width = 100 , showLevel = 1)
private String description;
......
......@@ -13,6 +13,7 @@ import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.model.ConsultSheetReportVo;
import com.cftech.consultsheet.model.ConsultSheetVO;
import com.cftech.consultsheet.service.ConsultSheetService;
import com.cftech.core.poi.ExcelKit;
......@@ -171,6 +172,8 @@ public class ConsultSheetController {
if (mpFanssEntity != null && StringUtils.isNotBlank(mpFanssEntity.getStore())) {
consultSheet.setFansAlias(mpFanssEntity.getStore());
}
}
JSONObject object = JSON.parseObject(JSON.toJSONString(consultSheet));
model.addAttribute("orgtypeId", SystemConfig.p.getProperty("HOSPITAL_ORG_TYPE_ID"));
......@@ -213,7 +216,7 @@ public class ConsultSheetController {
@ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, ConsultSheet consultSheet, HttpServletRequest request) {
Long userid = UserUtils.getUser().getUserid();
boolean leader = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_LEADER);
boolean leader = roleService.selectRoleEntityByUserId(UserUtils.getUser().getId(), Constants.SYSTEM_LEADER);
if (leader) {
userid = 1L;//查看全部
}
......@@ -228,10 +231,8 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getFansAlias())) {
conds.like("f.store", consultSheet.getFansAlias());
}
if (StringUtils.equals(consultSheet.getIsThree(), "3")) {
conds.equal("au.status", "0");
} else if (StringUtils.equals(consultSheet.getIsThree(), "4")) {
conds.equal("au.status", "1");
if (StringUtils.equals(consultSheet.getIsThree(), "1")) {
conds.equal("m.status", "1");
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
......@@ -301,6 +302,12 @@ public class ConsultSheetController {
return rtnJosn;
}
/**
* 导出咨询单
* @param request
* @param response
* @param consultSheet
*/
@RequestMapping("/exportExcel")
@RequiresPermissions(value = CONSULTSHEET_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response, ConsultSheet consultSheet) {
......@@ -315,10 +322,8 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getFansAlias())) {
conds.like("f.store", consultSheet.getFansAlias());
}
if (StringUtils.equals(consultSheet.getIsThree(), "3")) {
conds.equal("au.status", "0");
} else if (StringUtils.equals(consultSheet.getIsThree(), "4")) {
conds.equal("au.status", "1");
if (StringUtils.equals(consultSheet.getIsThree(), "1")) {
conds.equal("m.status", "1");
}
if (StringUtils.isNoneBlank(consultSheet.getOrderStatus())) {
conds.equal("o.status", consultSheet.getOrderStatus());
......@@ -349,25 +354,103 @@ public class ConsultSheetController {
StringBuffer tpl = new StringBuffer();
for (ConsultSheet consultSheetObj : list) {
consultSheetVO = new ConsultSheetVO();
consultSheetVO.setOrderCode(consultSheetObj.getOrderCode());
consultSheetVO.setConsultId(consultSheetObj.getConsultId());
consultSheetVO.setOrderCode(consultSheetObj.getOrderCode());
consultSheetVO.setUserName(tpl.append(consultSheetObj.getUserName()).replace(1,2, "*").toString());
tpl.setLength(0);
consultSheetVO.setAlias(consultSheetObj.getFansAlias());
consultSheetVO.setSex(consultSheetObj.getSex() == 1 ? "男" : "女");
consultSheetVO.setPhone( tpl.append(consultSheetObj.getPhone()).replace(3,7, "****").toString());
consultSheetVO.setPhone(tpl.append(consultSheetObj.getPhone()).replace(3,7, "****").toString());
tpl.setLength(0);
consultSheetVO.setIsThree(StringUtils.equals(consultSheetObj.getIsThree(), "0")? "三期患者":(StringUtils.equals(consultSheetObj.getIsThree(), "1") ? "四期患者":""));
consultSheetVO.setStatus("0".equals(consultSheetObj.getStatus()) ? "未审核" : "1".equals(consultSheetObj.getStatus()) ? "已通过" : "已拒绝");
consultSheetVO.setIsNew(StringUtils.equals("4", consultSheetObj.getIsSales()) ? "否" : "是");
consultSheetVO.setIsThree(StringUtils.equals(consultSheetObj.getIsThree(), "1")? "三期患者":"");
consultSheetVO.setPharmaName(consultSheetObj.getPharmaName());
consultSheetVO.setCustomerName(consultSheetObj.getCustomerName());
consultSheetVO.setRandomNo(consultSheetObj.getRandomNo());
consultSheetVO.setFirstHospital(consultSheetObj.getFirstHospital());
consultSheetVO.setRandomHospital(consultSheetObj.getFollowupHospital());
consultSheetVO.setStatus("0".equals(consultSheetObj.getStatus()) ? "未审核" : "1".equals(consultSheetObj.getStatus()) ? "已通过" : "已拒绝");
consultSheetVO.setDescription(consultSheetObj.getDescription());
consultSheetVO.setCreateTime(DateUtils.formatDateTime(consultSheetObj.getCreateTime()));
consultSheetVO.setAuditTime(consultSheetObj.getAuditTime() == null? "" : consultSheetObj.getAuditTime());
consultSheetVO.setAuditTime(consultSheetObj.getAuditTime() == null ? "" : consultSheetObj.getAuditTime());
consultSheetVOS.add(consultSheetVO);
}
ExcelKit.$Export(ConsultSheetVO.class, response).toExcel(consultSheetVOS, "咨询单信息");
}
/**
* 导出咨询单
* @param request
* @param response
* @param consultSheet
*/
@RequestMapping("/exportFromExcel")
@RequiresPermissions(value = CONSULTSHEET_VIEW)
public void exportFromExcel(HttpServletRequest request, HttpServletResponse response, ConsultSheet consultSheet) {
Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("a.create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("a.del_flag", Constants.DEL_FLAG_0);
conds.equal("a.accounts_id", accountId);
if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("a.consult_id", consultSheet.getConsultId());
}
if (StringUtils.isNoneBlank(consultSheet.getFansAlias())) {
conds.like("f.store", consultSheet.getFansAlias());
}
if (StringUtils.equals(consultSheet.getIsThree(), "1")) {
conds.equal("m.status", "1");
}
if (StringUtils.isNoneBlank(consultSheet.getOrderStatus())) {
conds.equal("o.status", consultSheet.getOrderStatus());
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
}
if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) {
String[] dateArr = consultSheet.getStartCreateTime().split(" - ");
conds.greatEqual("DATE_FORMAT(a.create_time, '%Y/%m/%d %H:%i')", dateArr[0]);
conds.lessEqual("DATE_FORMAT(a.create_time, '%Y/%m/%d %H:%i')", dateArr[1]);
}
if (StringUtils.isNoneBlank(consultSheet.getStartAuditTime())) {
String[] dateArr = consultSheet.getStartAuditTime().split(" - ");
conds.greatEqual("DATE_FORMAT(a.audit_time, '%Y/%m/%d %H:%i')", dateArr[0]);
conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y/%m/%d %H:%i')", dateArr[1]);
}
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
conds.equal("a.open_id", consultSheet.getOpenId());
}
List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, 0, 0);
List<ConsultSheetReportVo> consultSheetVOS = new LinkedList<>();
ConsultSheetReportVo consultSheetVO = null;
StringBuffer tpl = new StringBuffer();
for (ConsultSheet consultSheetObj : list) {
consultSheetVO = new ConsultSheetReportVo();
consultSheetVO.setConsultId(consultSheetObj.getConsultId());
consultSheetVO.setOrderCode(consultSheetObj.getOrderCode());
consultSheetVO.setUserName(tpl.append(consultSheetObj.getUserName()).replace(1,2, "*").toString());
tpl.setLength(0);
consultSheetVO.setAlias(consultSheetObj.getFansAlias());
consultSheetVO.setIsNew(StringUtils.equals("4", consultSheetObj.getIsSales()) ? "否" : "是");
consultSheetVO.setIsThree(StringUtils.equals(consultSheetObj.getIsThree(), "1")? "三期患者":"");
consultSheetVO.setPharmaName(consultSheetObj.getPharmaName());
consultSheetVO.setCustomerName(consultSheetObj.getCustomerName());
consultSheetVO.setRandomNo(consultSheetObj.getRandomNo());
consultSheetVO.setFirstHospital(consultSheetObj.getFirstHospital());
consultSheetVO.setRandomHospital(consultSheetObj.getFollowupHospital());
consultSheetVO.setStatus("0".equals(consultSheetObj.getStatus()) ? "未审核" : "1".equals(consultSheetObj.getStatus()) ? "已通过" : "已拒绝");
consultSheetVO.setNumber(consultSheetObj.getDrugNum());
consultSheetVO.setCreateTime(DateUtils.formatDateTime(consultSheetObj.getCreateTime()));
consultSheetVO.setAuditTime(consultSheetObj.getAuditTime() == null ? "" : consultSheetObj.getAuditTime());
consultSheetVOS.add(consultSheetVO);
}
ExcelKit.$Export(ConsultSheetReportVo.class, response).toExcel(consultSheetVOS, "处方单信息");
}
@RequestMapping("/templateExcel")
@RequiresPermissions(value = CONSULTSHEET_VIEW)
public void templateExcel(HttpServletRequest request, HttpServletResponse response) {
......@@ -472,7 +555,7 @@ public class ConsultSheetController {
@RequiresPermissions(value = CONSULTSHEET_EDIT)
@RequestMapping("/updateStatus")
@ResponseBody
public JSONObject updateStatus(Long consultId, String status, Long pastRecords, Long allergy, String fansAlias, String goodsDes, HttpServletRequest request) {
public JSONObject updateStatus(Long consultId, String status, String pastRecords, String allergy, String fansAlias, String goodsDes, HttpServletRequest request) {
Long accountId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(consultId);
......
......@@ -135,15 +135,6 @@
</select>
<select id="fetchMemberByYearGoodsNum" parameterType="java.util.Map" resultType="java.lang.Integer">
<!-- SELECT-->
<!-- IFNULL(SUM(d.drugs_num), 0)-->
<!-- FROM t_order_details d-->
<!-- LEFT JOIN t_order o ON o.id = d.order_id-->
<!-- <include refid="sqlWhere"/>-->
<!-- AND o.create_time >=-->
<!-- (SELECT a.create_time FROM wx_mp_fanss f-->
<!-- INNER JOIN wx_mp_member m ON f.openid = m.open_id AND f.delflag = '0' AND m.del_flag = '0'-->
<!-- INNER JOIN t_aidea_authentication a ON m.cardid = id_card AND a.del_flag = '0' WHERE f.openid = o.openid)-->
SELECT
IFNULL(SUM(t.remind_type), 0)
FROM t_order t
......
......@@ -195,7 +195,7 @@
<div class="form-group form-md-line-input col-xs-6">
#if($!{pageType} != 'true')
<div>
<button class="btn btn-primary" onclick="orderSplit()">订单拆分</button>
<button id="firstBnt" class="btn btn-primary" onclick="orderSplit()">订单拆分</button>
</div>
#end
</div>
......@@ -449,6 +449,9 @@
initSplitHtml();
} else {
orderSplit();
setTimeout(function() {
$("#firstBnt").trigger("click");
}, 500);
}
});
......
......@@ -64,43 +64,36 @@
<!-- 当前选中框id -->
<input type="hidden" id="orderId">
<div class="modal fade" id="remindExampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="remindExampleModalLabel" style="font-weight: 700;">修改发货地址</h4>
<h4 class="modal-title" id="exampleModalLabel" style="font-weight: 700;">订单关闭原由</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" style="height: 80px;">
<div class="col-xs-6">
<div class="input-group">
<input type="hidden" id="addressOpenId">
<input type="text" id="addressId" name="addressId"
class="form-control" style="display: none">
<input type="text" name="addressName" id="addressName"
class="form-control" style="width: 400px" disabled>
<span class="input-group-btn">
<button type="button" name="selHospital" id="selHospital"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="message-text" class="col-form-label">请输入关闭原由:</label>
<textarea class="form-control" rows="3" id="js-textarea"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" onclick="submitRemind()">提交</button>
<button type="button" class="btn btn-primary" onclick="review()">提交</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal fade" id="changePayDiv" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="exampleModalLabel" style="font-weight: 700;">订单关闭原由</h4>
<h4 class="modal-title" style="font-weight: 700;">修改订单金额</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
......@@ -108,14 +101,14 @@
<div class="modal-body">
<form>
<div class="form-group">
<label for="message-text" class="col-form-label">请输入关闭原由:</label>
<textarea class="form-control" rows="3" id="js-textarea"></textarea>
<label for="message-text" class="col-form-label">请输入修改金额:</label>
<input type="number" class="form-control" id="payment" name="payment" />
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" onclick="review()">提交</button>
<button type="button" class="btn btn-primary" onclick="submitChangePay()">提交</button>
</div>
</div>
</div>
......@@ -145,7 +138,7 @@
<!-- dialog body -->
<div class="modal-body">
<input type="text" class="form-control" id="email" name="email" ></input>
<input type="text" class="form-control" id="email" name="email" />
</div>
<div style="text-align: center;padding-bottom: 20px;">
<button style="width: 100px;" type="button" class="btn btn-primary" onclick="exportInvoice()">确定</button>
......@@ -213,6 +206,7 @@
<div class="col-xs-2">
<select id="startOrderAmount" name="startOrderAmount" class="form-control required">
<option value="">请选择订单金额</option>
<option value="0">0</option>
<option value="1">1盒</option>
<option value="2">2盒</option>
<option value="3">3盒</option>
......@@ -222,6 +216,7 @@
<div class="col-xs-2">
<select id="startPayAmount" name="startPayAmount" class="form-control required">
<option value="">请选择付款金额</option>
<option value="0">0</option>
<option value="1">1盒</option>
<option value="2">2盒</option>
<option value="3">3盒</option>
......@@ -269,6 +264,7 @@
<th style="width: 60px">是否开票</th>
<th style="width: 60px">患者类型</th>
<th style="width: 60px">新用户</th>
<th style="width: 80px">客服名称</th>
<th style="width: 120px">创建时间</th>
</tr>
</thead>
......@@ -443,6 +439,10 @@
"mData": "isSales"
}
,
{
"mData": "serviceName"
}
,
{
"mData": "createTime"
}
......@@ -482,7 +482,7 @@
html += '<a href="#springUrl("/a/order/form?pageType=View&id=' + a + '")" class="btn green">查看详情</a>';
}
if (c.status == '1') {
html += '<a onclick="updateStatusSuccess(' + a + ')" class="btn green">订单付款</a>';
html += '<a onclick="updateStatusSuccess(' + a + ')" class="btn green">付款确认</a>';
}
if (c.status != '4' && c.status != '5') {
html += '<a onclick="showModal(' + a + ')" class="btn green">订单关闭</a>';
......@@ -491,6 +491,11 @@
html += '<a onclick="copyPayLink(`' + c.payUrl + '`)" class="btn green">复制链接</a>';
}
html += '#end';
html += '#if($shiro.hasPermission("qy:order:pay"))';
if (c.status == '1') {
html += '<a onclick="changePayAmount(' + a + ')" class="btn green">调整价格</a>';
}
html += '#end';
return html;
}
},
......@@ -601,10 +606,8 @@
"aTargets": [12],
"mData": "isThree",
"mRender": function (a, b, c, d) {
if (a == '0') {
if (a == '1') {
return '三期';
} else if (a == '1') {
return '四期';
} else {
return '';
}
......@@ -623,7 +626,7 @@
}
,
{
"aTargets": [14],
"aTargets": [15],
"mData": "createTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -788,24 +791,25 @@
});
Cfapp.init();
function showRemindModal(orderId) {
$("#addressOpenId").val(orderId);
$('#remindExampleModal').modal('show');
function changePayAmount(id) {
$("#orderId").val(id);
$('#changePayDiv').modal('show');
}
function submitRemind() {
let addressId = $('#addressId') .val();
var url = "#springUrl('/a/order/updateOrderAddress')";
function submitChangePay() {
let orderId = $("#orderId").val();
let payment = $("#payment").val();
var url = "#springUrl('/a/order/changeOrderPay')"
$.ajax({
url: url,
type: "GET",
data: {orderId: $("#addressOpenId").val(),
addressId: addressId},
data: {orderId: orderId,
payment: payment},
success: function (rsp) {
$('#remindExampleModal').modal('hide');
if (rsp.errorNo == "0") {
Cfapp.alert({
message: "设置成功",
message: "修改成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
......@@ -813,7 +817,7 @@
});
} else {
Cfapp.alert({
message: "设置失败",
message: "修改失败",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
......@@ -821,16 +825,15 @@
});
}
}
});
}
function showModal(id) {
$("#orderId").val(id);
$('#exampleModal').modal('show');
}
//确认付款
function updateStatusSuccess(id) {
Cfapp.confirm({
message: "是否确认付款",
......@@ -845,6 +848,7 @@
});
}
//关闭订单
function review() {
var reason = $("#js-textarea").val();
var id = $("#orderId").val();
......@@ -859,6 +863,40 @@
updateStatu(id, 5, reason);
}
//设置订单状态
function updateStatu(id, status, reason) {
var url = "#springUrl('/a/order/updateStatus')"
$.ajax({
url: url,
type: "GET",
data: {id: id,
orderCancel: reason,
status: status},
success: function (rsp) {
if (status == '5') {
$('#exampleModal').modal('hide');
}
if (rsp.errorNo == "0") {
Cfapp.alert({
message: "操作成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
} else {
Cfapp.alert({
message: "操作失败",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}
}
});
}
//开发票
function exportInvoice(data) {
var email = $("[name='email']").val();
......@@ -912,88 +950,7 @@
})
}
function updateStatu(id, status, reason) {
var url = "#springUrl('/a/order/updateStatus')"
$.ajax({
url: url,
type: "GET",
data: {id: id,
orderCancel: reason,
status: status},
success: function (rsp) {
if (status == '5') {
$('#exampleModal').modal('hide');
}
if (rsp.errorNo == "0") {
Cfapp.alert({
message: "操作成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
} else {
Cfapp.alert({
message: "操作失败",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}
}
});
}
function removeData(data) {
Cfapp.confirm({
message: "确定要删除吗",
btnoktext: "确定",
btncanceltext: "取消",
success: function () {
$.ajax({
type: "POST",
url: "#springUrl('/a/order/delete')",
data: {_csrf: csrf, _csrf_header: csrf_header, id: data},
dataType: "json",
success: function (data) {
if (data.errorNo == 0) {
Cfapp.alert({
message: "删除成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}
},
error: function () {
}
})
},
cancel: function () {
$(".modal-backdrop").fadeOut();
}
});
}
function importExcel() {
var templateExcelUrl = "#springUrl('/a/order/templateExcel')";
var importExcelUrl = "#springUrl('/a/order/importExcel')";
Cfapp.importExcel({
title: '订单管理导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
},
success: function () {
}
});
}
//清楚搜索
function clearSearch() {
$("#seachTableForm input,select").each(function () {
$(this).val('');
......@@ -1001,6 +958,7 @@
$("#table").dataTable().fnClearTable();
}
//复制链接
function copyPayLink(payUrl) {
let input = document.createElement('input');
input.setAttribute('readonly', 'readonly'); // 防止手机上弹出软键盘
......@@ -1024,92 +982,11 @@
}
}
$("#selHospital").click(function () {
let orderId = $('#addressOpenId').val();
Cfapp.f7({
dataUrl: "#springUrl('/a/address/listData?orderId="+orderId+"')",
checkType: "single", // 多选为multi
title: '请选择发货地址',
btnoktext: "确定",
btncanceltext: "取消",
columns: ["选择", "收货人", "收货人电话", "省份", "城市", "区域", "详细地址" ],
isSearch: '0',
searchColumns: ["addressName"],//搜索的字段名称
searchColumnsRemarks: ["请输入收货认收货人"],//搜索的字段备注
aoColumns: [{
"mData": "id"
}, {
"mData": "addressName"
}, {
"mData": "phone"
}, {
"mData": "provinceName"
}, {
"mData": "cityName"
}, {
"mData": "countyName"
}, {
"mData": "address"
}],
aoColumnDefs: [{
"aTargets": [0],
"mData": "id",
"mRender": function (a, b, c, d) {
return '<input class="bindId" value="' + a + '" type="radio" id="' + a + '" name="sel" data-value="' + a + '" data-name="' + c.name + '">';
}
}, {
"aTargets": [1],
"mData": "addressName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [2],
"mData": "phone",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
},{
"aTargets": [3],
"mData": "provinceName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [4],
"mData": "cityName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [5],
"mData": "countyName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [6],
"mData": "address",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'addressId', // 储存的字段
displayFields: 'addressName'
})
});
/**
* 动态展示背景颜色
*/
function RowCallBack(row, data, index) {
if (data.isThree == '0') {
if (data.isThree == '1') {
$('td', row).eq(12).css('background-color', "RGB(249,203,132)");
}
}
......
......@@ -7,6 +7,7 @@ import com.cftech.core.generic.GenericDao;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
......@@ -96,4 +97,11 @@ public interface OrderMapper extends GenericDao<Order> {
* @return
*/
List<Map<String, String>> findWaitRemindOrders(Long number);
/**
* 获取所有免费瓶数
* @param openid
* @return
*/
BigDecimal findUserDrugsPatientsSum(String openid);
}
\ No newline at end of file
......@@ -36,6 +36,7 @@
<result column="address_des" property="addressDes"/>
<result column="order_time" property="orderTime"/>
<result column="remind_type" property="remindType"/>
<result column="pay_type" property="payType"/>
</resultMap>
<sql id="sqlWhere">
......@@ -92,7 +93,8 @@
t.id as productId,
m.`name` memberName,
CONVERT ( AES_DECRYPT( m.phone, 'aideakey' ) USING UTF8 ) memberPhone,
a.address
a.address,
a.pay_type
</sql>
<sql id="Column">
......@@ -144,7 +146,8 @@
address_des,
order_time,
cancel_time,
remind_type
remind_type,
pay_type
)
values
(
......@@ -178,7 +181,8 @@
#{addressDes, jdbcType=VARCHAR},
#{orderTime, jdbcType=TIMESTAMP},
#{cancelTime, jdbcType=TIMESTAMP},
#{remindType, jdbcType=VARCHAR}
#{remindType, jdbcType=VARCHAR},
#{payType, jdbcType=VARCHAR}
)
</insert>
<update id="deleteAll" >
......@@ -243,7 +247,7 @@
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM (
SELECT COUNT(1) col
SELECT COUNT(1) col, SUM(d.drugs_num) drugsNum
FROM t_order o
LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
LEFT JOIN t_shipping_address s ON o.address_id = s.id
......@@ -251,29 +255,35 @@
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
LEFT JOIN wx_mp_fanss f ON f.openid = o.openid and f.delflag = '0'
LEFT JOIN wx_mp_member m on m.open_id = o.openid
LEFT JOIN t_aidea_authentication au ON m.cardid = au.id_card AND au.del_flag = '0'
LEFT JOIN t_shipping_address a on a.id = o.address_id
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
LEFT JOIN t_qyuser u ON o.service_id = u.id
<include refid="sqlWhere"/>
<if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.id
<if test="orderAmount != null or payAmount != null">
HAVING 1=1
<if test="orderAmount != null">
<choose>
<when test="orderAmount == 6">
AND drugsNum >= ${orderAmount}
AND drugsNum >= #{orderAmount}
</when>
<otherwise>
AND drugsNum = #{orderAmount}
</otherwise>
</choose>
</if>
<if test="payAmount != null">
<choose>
<when test="payAmount == 6">
AND drugsNum >= ${payAmount}
</when>
<when test="orderAmount != 6">
AND drugsNum = ${orderAmount}
</when>
<when test="payAmount != 6">
AND drugsNum = ${payAmount}
AND drugsNum >= #{payAmount}
</when>
<otherwise>
AND drugsNum = #{payAmount}
</otherwise>
</choose>
</if>
</if>
) duals
</select>
......@@ -318,8 +328,9 @@
m.`name` memberName,
CONVERT ( AES_DECRYPT( m.phone, 'aideakey' ) USING UTF8 ) memberPhone,
s.address,
au.status isThree,
m.status isThree,
SUM(d.drugs_num) drugsNum,
u.name serviceName,
(SELECT status FROM t_order sales WHERE sales.del_flag = '0' AND sales.status = '4' AND sales.openid = o.openid LIMIT 1) isSales
FROM t_order o
LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
......@@ -328,28 +339,34 @@
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
LEFT JOIN wx_mp_fanss f ON f.openid = o.openid and f.delflag = '0'
LEFT JOIN wx_mp_member m on m.open_id = o.openid
LEFT JOIN t_aidea_authentication au ON m.cardid = au.id_card AND au.del_flag = '0'
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
LEFT JOIN t_qyuser u ON o.service_id = u.id
<include refid="sqlWhere"/>
<if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.id
<if test="orderAmount != null or payAmount != null">
HAVING 1=1
<if test="orderAmount != null">
<choose>
<when test="orderAmount == 6">
AND drugsNum >= ${orderAmount}
AND drugsNum >= #{orderAmount}
</when>
<otherwise>
AND drugsNum = #{orderAmount}
</otherwise>
</choose>
</if>
<if test="payAmount != null">
<choose>
<when test="payAmount == 6">
AND drugsNum >= ${payAmount}
</when>
<when test="orderAmount != 6">
AND drugsNum = ${orderAmount}
</when>
<when test="payAmount != 6">
AND drugsNum = ${payAmount}
AND drugsNum >= #{payAmount}
</when>
<otherwise>
AND drugsNum = #{payAmount}
</otherwise>
</choose>
</if>
</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
......@@ -418,9 +435,6 @@
<if test="status != null">
status = #{status, jdbcType=VARCHAR},
</if>
<!--<if test="createTime != null">-->
<!--create_time = #{createTime, jdbcType=TIMESTAMP},-->
<!--</if>-->
<if test="description != null">
description = #{description, jdbcType=VARCHAR},
</if>
......@@ -458,7 +472,10 @@
cancel_time = #{cancelTime, jdbcType=TIMESTAMP},
</if>
<if test="remindType != null">
remind_type = #{remindType, jdbcType=VARCHAR}
remind_type = #{remindType, jdbcType=VARCHAR},
</if>
<if test="payType != null">
pay_type = #{payType, jdbcType=VARCHAR},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
......@@ -710,4 +727,12 @@
AND Date( date_add( w.accept_express_date, INTERVAL ( p.take_frequency * d.drugs_num - #{number} ) DAY ) ) = CURRENT_DATE ()
GROUP BY o.id HAVING max(rate)
</select>
<select id="findUserDrugsPatientsSum" parameterType="java.lang.String" resultType="java.math.BigDecimal">
SELECT
IFNULL(SUM(t.remind_type), 0)
FROM
t_order t
WHERE t.del_flag = 0 AND t.openid = #{openid}
</select>
</mapper>
\ No newline at end of file
......@@ -113,6 +113,11 @@ public class Order extends OrderDetail implements Serializable {
private Date cancelTime;
/**
* 付款类型 0:普通订单 1:三期患者免单 2:pc后台改价
*/
private String payType;
/**
* 规格
*/
......@@ -144,8 +149,6 @@ public class Order extends OrderDetail implements Serializable {
private boolean isFirst;
/**
* 搜索字段
*/
......@@ -168,6 +171,7 @@ public class Order extends OrderDetail implements Serializable {
private String payUrl;//支付链接
private String commonName;//产品全名称
private String isSales;//是否购买
private String serviceName;//客服名称
public Order() {
......
......@@ -36,6 +36,8 @@ import com.cftech.core.sql.Conds;
import com.cftech.order.utils.InvoiceUtil;
import com.cftech.orderdetail.dao.OrderDetailsMapper;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.product.model.Product;
import com.cftech.product.service.ProductService;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TreeTableColumn;
import lombok.extern.slf4j.Slf4j;
......@@ -96,6 +98,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
@Autowired
private CouponrecordService couponrecordService;
@Autowired
private ProductService productService;
@Override
public GenericDao<Order> getGenericMapper() {
return orderMapper;
......@@ -103,38 +108,46 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
@Override
public List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String orderAmount, String payAmount) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort);
Map<String, Object> params = new HashMap<>();
//非管理员查询所有
if (userid != null && userid != 1L) {
params.put("userid", userid);
}
if (StringUtils.isNoneBlank(orderAmount)) {
if (StringUtils.equals(orderAmount, "0")) {
conds.equal("o.order_amount", "0");
} else if (StringUtils.isNoneBlank(orderAmount)) {
params.put("orderAmount", orderAmount);
}
if (StringUtils.isNoneBlank(payAmount)) {
if (StringUtils.equals(payAmount, "0")) {
conds.equal("o.pay_amount", "0");
} else if (StringUtils.isNoneBlank(payAmount)) {
params.put("payAmount", payAmount);
}
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort);
return orderMapper.fetchSearchByPage(params);
}
@Override
public Integer count(Conds conds, Long userid, String orderAmount, String payAmount) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("conds", conds);
//非管理员查询所有
if (userid != null && userid != 1L) {
params.put("userid", userid);
}
if (StringUtils.isNoneBlank(orderAmount)) {
if (StringUtils.equals(orderAmount, "0")) {
conds.equal("o.order_amount", "0");
} else if (StringUtils.isNoneBlank(orderAmount)) {
params.put("orderAmount", orderAmount);
}
if (StringUtils.isNoneBlank(payAmount)) {
if (StringUtils.equals(payAmount, "0")) {
conds.equal("o.pay_amount", "0");
} else if (StringUtils.isNoneBlank(payAmount)) {
params.put("payAmount", payAmount);
}
params.put("conds", conds);
return orderMapper.count(params);
}
......@@ -218,7 +231,8 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
}
if (order != null) {
calculateAmount(order, orderAmount, drugNum, price);
isThreePatients(order, orderAmount, drugNum, price);
//calculateAmount(order, orderAmount, drugNum, price);
} else {
rtnJson.put("errorNo", "1");
return rtnJson;
......@@ -256,6 +270,82 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return rtnJson;
}
/**
* 是否药品免费
* @return
* 当前时间-首单时间 >=( (30天 * 所有免费瓶数 )- N天) 用药逻辑
*/
private boolean isThreePatients(Order order, Double orderAmount, Long num, Double price) {
if (isThreeUsers(order.getOpenid()) > 0) {
//获取三期用户首次免单时间
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.openid", order.getOpenid());
orderConds.greatEqual("o.remind_type", "0");//已免费(艾邦德免费瓶数)
Sort sort = new Sort("o.create_time", OrderType.ASC);
List<Order> orders = this.fetchSearchByPage(orderConds, sort, 0, 0);
if (orders == null || orders.size() == 0) {//无购买记录可免单
BigDecimal unitP = new BigDecimal(price);//折扣单价
BigDecimal nums = new BigDecimal(num);
BigDecimal saleAmount = unitP.multiply(nums);//三期患者折扣价格
BigDecimal sumAmount = new BigDecimal(orderAmount);//订单总价
BigDecimal realAmount = sumAmount.subtract(saleAmount);//实际需支付价格
order.setTotalAmount(sumAmount.doubleValue() * 100);//订单原价
order.setOrderAmount(realAmount.doubleValue());//实际需支付价格
order.setRemindType(nums.toString());//三期患者本单免费数量
order.setPayType("1");
return true;
}
Date currentTime = new Date();//当前时间
Date firstTime = orders.get(0).getCreateTime();//首次下单时间
Long times = currentTime.getTime() - firstTime.getTime();
BigDecimal sumTimes = new BigDecimal(times);
BigDecimal oneDay = new BigDecimal(1000 * 3600 * 24);
BigDecimal interval = sumTimes.divide(oneDay, 0, BigDecimal.ROUND_DOWN);//间隔天数
BigDecimal monthDay = new BigDecimal(30);
//所有免费瓶数
BigDecimal sums = orderMapper.findUserDrugsPatientsSum(order.getOpenid());
//偏移天数
BigDecimal deviationDays = this.findRemindDeviationDay();
if (interval.compareTo(monthDay.multiply(sums).subtract(deviationDays)) > -1) {//免单
BigDecimal unitP = new BigDecimal(price);//折扣单价
BigDecimal nums = new BigDecimal(num);
BigDecimal saleAmount = unitP.multiply(nums);//三期患者折扣价格
BigDecimal sumAmount = new BigDecimal(orderAmount);//订单总价
BigDecimal realAmount = sumAmount.subtract(saleAmount);//实际需支付价格
order.setTotalAmount(sumAmount.doubleValue() * 100);//订单原价
order.setOrderAmount(realAmount.doubleValue());//实际需支付价格
order.setRemindType(nums.toString());//三期患者本单免费数量
order.setPayType("1");
} else {
order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
order.setPayType("0");
}
return true;
} else {
order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
order.setPayType("0");
}
return false;
}
private BigDecimal findRemindDeviationDay() {
BigDecimal bigDecimal = new BigDecimal(0);
Conds conds = new Conds();
conds.equal("a.del_flag", Constants.DEL_FLAG_0);
conds.equal("a.id", SystemConfig.p.getProperty("THREE_DRUGS_ID"));
Product product = productService.fetchSearchByConds(conds);
if (product != null) {
return product.getDeviation() == null? bigDecimal : new BigDecimal(product.getDeviation());
}
return bigDecimal;
}
/**
* 计算总金额
*
......@@ -264,34 +354,6 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
* 三期患者免费购药,根据身份证号做出限制,每年同一身份证号购买12盒以内的药品,价格自动设为0,如超出12 盒恢复原价。
* <p>
* 三期患者 每年12瓶免费用药逻辑
* BigDecimal unitP = new BigDecimal(price);//折扣单价
* BigDecimal nums = null;//折扣数量
* //三期用户
* Conds conds = new Conds();
* conds.equal("t.del_flag", Constants.DEL_FLAG_0);
* conds.equal("t.openid", order.getOpenid());
* Calendar cal = Calendar.getInstance();
* int year = cal.get(Calendar.YEAR);
* conds.equal("YEAR(t.create_time)", year);
* Integer number = orderDetailsService.fetchMemberByYearGoodsNum(conds);//已购药品数据
* if (number >= 12) {
* order.setTotalAmount(orderAmount * 100);//订单原价
* order.setOrderAmount(orderAmount);//实际需支付价格
* } else {
* int realNum = (12 - number);//剩余每年免费盒数
* if (num.intValue() < realNum) {
* nums = new BigDecimal(num);
* } else {
* nums = new BigDecimal(realNum);
* }
* BigDecimal saleAmount = unitP.multiply(nums);//三期患者折扣价格
* BigDecimal sumAmount = new BigDecimal(orderAmount);//订单总价
* BigDecimal realAmount = sumAmount.subtract(saleAmount);//实际需支付价格
* order.setTotalAmount(sumAmount.doubleValue() * 100);//订单原价
* order.setOrderAmount(realAmount.doubleValue());//实际需支付价格
* order.setRemindType(nums.toString());//三期患者本单免费数量
* }
* <p>
* 三期患者 当前时间-首单时间 >=( (30天 * 所有免费瓶数 )- N天) 用药逻辑
*/
private void calculateAmount(Order order, Double orderAmount, Long num, Double price) {
......@@ -328,7 +390,6 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
}
}
@Transactional(rollbackFor = RuntimeException.class)
......
......@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.cftech.authentication.model.Authentication;
import com.cftech.authentication.service.AuthenticationService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.couponrecord.service.CouponrecordService;
......@@ -71,6 +73,7 @@ public class OrderController {
public static final String ORDER_VIEW = "qy:order:view";
public static final String ORDER_EDIT = "qy:order:edit";
public static final String ORDER_PAY = "qy:order:pay";
public static final DoubleJSONFilter DOUBLE_JSON_FILTER = new DoubleJSONFilter();
@Autowired
......@@ -109,6 +112,9 @@ public class OrderController {
@Autowired
private OrderDetailsService orderDetailsService;
@Autowired
private AuthenticationService authenticationService;
//列表页面
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/list")
......@@ -246,16 +252,12 @@ public class OrderController {
Long accountsId = UserUtils.getmpaccounts(request);
MpAccountsEntity mpAccountsEntity = accountsService.getDetail(accountsId);
boolean leader = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_LEADER);
if (leader) {
boolean leader = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_LEADER);//药房主管
boolean manager = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_STORAGEMANAGER);//订单员
if (leader || manager) {
userid = 1L;//药店主管
}
boolean manager = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_STORAGEMANAGER);
if (manager) {
userid = 1L;//仓管员
}
Conds conds = new Conds();
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId);
......@@ -289,8 +291,6 @@ public class OrderController {
//三期患者
if (StringUtils.equals("3", order.getIsThree())) {
conds.equal("au.status", "0");
} else if (StringUtils.equals("4", order.getIsThree())) {
conds.equal("au.status", "1");
}
......@@ -413,6 +413,39 @@ public class OrderController {
return rtnJosn;
}
//删除数据
@RequiresPermissions(value = ORDER_PAY)
@RequestMapping("/changeOrderPay")
@ResponseBody
public JSONObject changeOrderPay(Long orderId, BigDecimal payment) {
JSONObject rtnJosn = new JSONObject();
OrderFromVO orderVo = orderService.fetchId(orderId);
if (orderVo == null) {
rtnJosn.put("errorNo", 1);
return rtnJosn;
}
Double oldAmount = orderVo.getOrderAmount() == null ? 0:Double.parseDouble(orderVo.getOrderAmount());
Double amount = payment.doubleValue();
try {
Order order = new Order();
order.setStatus(null);
order.setId(orderVo.getId());
order.setOrderAmount(payment.doubleValue());
if (orderService.update(order)) {//增加修改记录
Authentication authentication = new Authentication();
authentication.setOrderId(orderId);
authentication.setUserId(UserUtils.getUser().getUserid());
authentication.setAmount(amount);
authentication.setOldAmount(oldAmount);
authenticationService.save(authentication);
}
rtnJosn.put("errorNo", 0);
} catch (Exception e) {
rtnJosn.put("errorNo", 1);
}
return rtnJosn;
}
@RequestMapping("/exportExcel")
@RequiresPermissions(value = ORDER_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response, Order order) {
......
......@@ -257,6 +257,14 @@
</select>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>三期临床偏移天数</label>
<input type="text" class="form-control pull-right"
value="$!{data.deviation}" maxlength="200" required
name="deviation" placeholder="三期临床偏移天数"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>产品税收编码</label>
<input type="text" class="form-control pull-right"
......
......@@ -35,6 +35,7 @@
<result column="isreading" property="isreading"/>
<result column="unit" property="unit"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="deviation" property="deviation"/>
</resultMap>
<sql id="sqlWhere">
......@@ -96,7 +97,8 @@
size,
isreading,
unit,
invoice_code
invoice_code,
deviation
</sql>
<sql id="productList">
......@@ -124,7 +126,8 @@
t.product_img_detail AS productImgDetail,
t.reading,
t.isreading,
t.invoice_code invoiceCode
t.invoice_code invoiceCode,
t.deviation
</sql>
<insert id="save" parameterType="com.cftech.product.model.Product" useGeneratedKeys="true"
......@@ -166,7 +169,8 @@
#{size, jdbcType=BIGINT},
#{isreading, jdbcType=BIGINT},
#{unit,jdbcType=VARCHAR},
#{invoiceCode,jdbcType=VARCHAR}
#{invoiceCode,jdbcType=VARCHAR},
#{deviation, jdbcType=BIGINT}
)
</insert>
......@@ -215,7 +219,8 @@
a.product_number productNumber,
a.is_rs isRs,
a.reading reading,
a.invoice_code
a.invoice_code,
a.deviation
FROM
t_aidea_product a
LEFT JOIN t_aidea_product_classify b ON a.classify_id = b.id
......@@ -366,7 +371,10 @@
isreading = #{isreading , jdbcType=BIGINT},
</if>
<if test="invoiceCode != null">
invoice_code = #{invoiceCode , jdbcType=VARCHAR}
invoice_code = #{invoiceCode , jdbcType=VARCHAR},
</if>
<if test="deviation != null">
deviation = #{deviation, jdbcType=BIGINT}
</if>
</set>
where id=#{id,jdbcType=BIGINT}
......
......@@ -162,6 +162,8 @@ public class Product implements Serializable {
private Long createBy;
/* 更新人 */
private Long updateBy;
/* 偏移量 */
private Long deviation;
public Product() {
this.delFlag = false;
......
......@@ -300,8 +300,8 @@
consult.consult_id consultNumber,
CONVERT ( AES_DECRYPT( consult.user_name, 'aideakey' ) USING UTF8 ) userName,
CONVERT ( AES_DECRYPT( consult.phone, 'aideakey' ) USING UTF8 ) phone,
qyuser.`name` cfDoctor,
org1.org_name cfHospital,
consult.past_records cfDoctor,
consult.allergy cfHospital,
ord.pay_time fkTime,
waybill.send_express_date fhTime,
waybill.accept_express_date sjTime,
......
......@@ -98,7 +98,7 @@
<div id="printContent" style="display:none;">
<div class="invoice">
<div class="header">
<div class="storename">诺康大药房咨询平台</div>
<div class="storename">诺康大药房</div>
<div class="describe">***一切为了百姓***</div>
<div class="orderNumber">订单号 <span>$!{printData.orderCode}</span></div>
<div class="deliverydate">发货日期 <span>$!date.format('yyyy-MM-dd HH:mm:ss',$!printData.printDate)</span></div>
......@@ -152,7 +152,7 @@
<div class="splitline"></div>
<div class="footer">
<div class="think">***谢谢惠顾***</div>
<div class="think">[如非质量问题,概不退换]</div>
<div class="think">[非质量问题/物流破损,概不退换]</div>
<div>门店电话:400-828-4688</div>
<div>门店地址:扬州市运河西路233号</div>
</div>
......@@ -228,13 +228,13 @@
<div class="panel-heading">联系人信息</div>
<div class="panel-body">
<div class="form-group form-md-line-input col-xs-5">
<label>粉丝名称</label>
<input type="text"
class="form-control" id="nickName" name="nickName"
maxlength="500" placeholder="粉丝名称"
value="$!{data.nickName}" readonly>
</div>
<!-- <div class="form-group form-md-line-input col-xs-5">-->
<!-- <label>粉丝名称</label>-->
<!-- <input type="text"-->
<!-- class="form-control" id="nickName" name="nickName"-->
<!-- maxlength="500" placeholder="粉丝名称"-->
<!-- value="$!{data.nickName}" readonly>-->
<!-- </div>-->
<div class="form-group form-md-line-input col-xs-5">
<label>联系人</label>
......
......@@ -100,7 +100,7 @@
<div id="printContent" style="display:none;">
<div class="invoice">
<div class="header">
<div style="font-size: 16px; margin-left: 48px;">诺康大药房咨询平台</div>
<div style="font-size: 16px;text-align: center;">诺康大药房</div>
<div class="describe">&nbsp;&nbsp;&nbsp;</div>
<div class="orderNumber">订单号 <span>$!{printData.orderCode}</span></div>
<div class="deliverydate">发货日期 <span>$!date.format('yyyy-MM-dd HH:mm:ss', $!printData.printDate)</span></div>
......@@ -116,7 +116,7 @@
<div class="splitline"></div>
<div class="footer">
<div class="think">***谢谢惠顾***</div>
<div class="think">[如非质量/物流破损,概不退换]</div>
<div class="think">[非质量问题/物流破损,概不退换]</div>
<div>门店电话:400-828-4688</div>
<div>门店地址:扬州市邗江区科技园路18号</div>
</div>
......@@ -193,7 +193,7 @@
<th>订单编码</th>
<th>咨询单编码</th>
<th>是否打印</th>
<th>粉丝昵称</th>
<!-- <th>粉丝昵称</th>-->
<th>联系人</th>
<th>联系人手机号</th>
<th>订单员</th>
......@@ -335,10 +335,10 @@
}
}
},
{
"width": "100px",
"mData": "nickName"
},
// {
// "width": "100px",
// "mData": "nickName"
// },
{
"width": "100px",
"mData": "contact",
......@@ -390,14 +390,14 @@
'targets': [0]
},
{
"aTargets": [11],
"aTargets": [10],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '';
html += '<a href="#springUrl("/a/waybill/form?id=' + a + '")" class="btn green">查看</a>';
html += '#if($shiro.hasPermission("qy:waybill:edit"))';
html += '<a onclick="printerSfSdk(' + c.orderId + ')" class="btn green">打印物流单</a>';
html += '<a onclick="printSheets(' + c.orderId + ')" class="btn green">打印随行单</a>';
html += '<a onclick="printerSfSdk(' + c.orderId + ')" class="btn green">打印物流单</a>';
html += '#end';
return html;
}
......
......@@ -237,6 +237,7 @@
LEFT JOIN user u ON u.id = t.storage_manage
LEFT JOIN t_qyuser qyu ON qyu.id = u.userid
WHERE t.id = #{id}
GROUP BY t.id
</select>
<select id="fetchByWayBillId" parameterType="java.lang.Long" resultType="com.cftech.waybill.model.Waybill">
......@@ -291,10 +292,13 @@
LEFT JOIN user u ON u.id = t.storage_manage
LEFT JOIN t_qyuser qyu ON qyu.id = u.userid
WHERE t.id = #{id}
GROUP BY t.id
</select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_waybill t
SELECT IFNULL(sum(cot), 0) FROM
(SELECT COUNT(1) cot
FROM t_aidea_waybill t
LEFT JOIN t_aidea_consult_sheet cs ON cs.id = t.consult_id
LEFT JOIN t_order o ON t.order_id = o.id
LEFT JOIN t_order_details od ON o.id = od.order_id
......@@ -302,6 +306,7 @@
LEFT JOIN user u ON u.id = t.storage_manage
LEFT JOIN t_qyuser qyu ON qyu.id = u.userid
<include refid="sqlWhere"/>
GROUP BY t.id ) duals
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.waybill.model.Waybill">
......@@ -356,6 +361,7 @@
LEFT JOIN user u ON u.id = t.storage_manage
LEFT JOIN t_qyuser qyu ON qyu.id = u.userid
<include refid="sqlWhere"/>
GROUP BY t.id
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
......
......@@ -28,7 +28,7 @@
<bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer">
<property name="locations">
<list>
<value>classpath*:application-test.properties</value>
<value>classpath*:application.properties</value>
</list>
</property>
</bean>
......
......@@ -15,6 +15,10 @@ CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5Uk
CHECK_RESULT_TEMPLATE_MSG=5Fy77DKlvulE4L2vxsQfhOsJuRqQzIoI-LSmDYWCJt0
#\u75C5\u8F7D\u68C0\u6D4B\u5238\u751F\u6548\u63D0\u9192
CHECK_COUPON_TAKE_EFFECT_REMIND_TEMPLATE_MSG=NQj8PWw12eA5v-IgN-L2e35FS5NGG4kE7AlvX1vHDfY
#\u4E2A\u4EBA\u4E2D\u5FC3\u4E09\u671F\u5BA1\u6279\u901A\u8FC7
LEVEL_3_AUDIT_PASS_TEMPLATE_MSG=l6jMcA_4nQrxX0PsGOuXh6zO1Yt9XavYC7QMeejpeD4
#\u4E2A\u4EBA\u4E2D\u5FC3\u4E09\u671F\u5BA1\u6279\u4E0D\u901A\u8FC7
LEVEL_3_AUDIT_NOT_PASS_TEMPLATE_MSG=sk6ZQobwIlA7ohN0yslRIx0yF03AxusZfE7t9Y37Dg8
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A
......
......@@ -15,6 +15,10 @@ CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5Uk
CHECK_RESULT_TEMPLATE_MSG=EFXXW0EuaryPpK0jYPhZxYQIA8BaHfGtY1MoVz_n6T0
#\u75C5\u8F7D\u68C0\u6D4B\u5238\u751F\u6548\u63D0\u9192
CHECK_COUPON_TAKE_EFFECT_REMIND_TEMPLATE_MSG=ptIoaIzt8_8zWRLXsWsuwizO-HckVOcCW2EqnExlhdc
#\u4E2A\u4EBA\u4E2D\u5FC3\u4E09\u671F\u5BA1\u6279\u901A\u8FC7
LEVEL_3_AUDIT_PASS_TEMPLATE_MSG=l6jMcA_4nQrxX0PsGOuXh6zO1Yt9XavYC7QMeejpeD4
#\u4E2A\u4EBA\u4E2D\u5FC3\u4E09\u671F\u5BA1\u6279\u4E0D\u901A\u8FC7
LEVEL_3_AUDIT_NOT_PASS_TEMPLATE_MSG=sk6ZQobwIlA7ohN0yslRIx0yF03AxusZfE7t9Y37Dg8
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A
......
......@@ -137,6 +137,32 @@
var url = $(this).attr("data");
$(".content").attr("src", url);
});
// window.onbeforeunload = onbeforeunload_handler;
// function onbeforeunload_handler(){
//
// $.ajax({
// "type": "GET",
// "url": sSource,
// "dataType": "json",
// "success": function() {
//
// }
// });
// }
//清除cookie
// function clearCookie(name) {
// setCookie(name, "", -1);
// }
//
// function setCookie(cname, cvalue, exdays) {
// var d = new Date();
// d.setTime(d.getTime() + (exdays*24*60*60*1000));
// var expires = "expires="+d.toUTCString();
// document.cookie = cname + "=" + cvalue + "; " + expires;
// }
</script>
</body>
......
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<base href="#springUrl('/assets/adminlte/')"/>
<meta charset="utf-8"/>
<title>用户登录</title>
<meta charset="utf-8"/>
<title>用户登录</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link href="plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link href="admin/login.css" rel="stylesheet" type="text/css"/>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME STYLES -->
<link href="admin/components-md.css" id="style_components" rel="stylesheet" type="text/css"/>
<link href="admin/plugins-md.css" rel="stylesheet" type="text/css"/>
<link href="admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
<link href="admin/layout/css/themes/darkblue.css" rel="stylesheet" type="text/css" id="style_color"/>
<link href="admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
<link href="plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link href="admin/login.css" rel="stylesheet" type="text/css"/>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME STYLES -->
<link href="admin/components-md.css" id="style_components" rel="stylesheet" type="text/css"/>
<link href="admin/plugins-md.css" rel="stylesheet" type="text/css"/>
<link href="admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
<link href="admin/layout/css/themes/darkblue.css" rel="stylesheet" type="text/css" id="style_color"/>
<link href="admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
<style>
.login{
.login {
/*background-color: #209CDC;*/
/*background-image: url('img/logo-aidi.jpg');*/
/*background-size: 100%;*/
background-repeat: no-repeat;
/*background-repeat: no-repeat;*/
/*background-image: url('img/firstPage.jpg');*/
}
.login .content {
margin: 10% auto auto auto;
height: 500px;
}
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active{
.btn-success:hover,  .btn-success:focus, .btn-success:active, .btn-success.active {
background-color: #0060af;
}
.btn-success {
background-color: #0060af;
}
......@@ -54,37 +60,53 @@
margin-bottom: 27px;
position: relative;
}
.login .content{background-color: #fff;padding-bottom: 15px;}
.login .content .form-actions .btn-success{ width: 100%;
height: 43px;}
.login .content .form-actions{border-bottom: none}
body{
height: 100%;
overflow: hidden;
.login .content {
background-color: #fff;
padding-bottom: 15px;
}
.login .content .form-actions .btn-success {
width: 100%;
height: 43px;
}
.login .content .form-actions {
border-bottom: none
}
.form-title{
font-size: 22px !important;text-align: left !important;
body {
width: 100%;
background: url('img/aidea-bg.png') no-repeat;
background-size: 100% auto;
}
.form-title {
font-size: 22px !important;
text-align: left !important;
.btn-success{
}
.btn-success {
/*background-color:#00883c;*/
}
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active,.btn-success:active:hover, .btn-success.active:hover {
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .btn-success:active:hover, .btn-success.active:hover {
/*background-color:#00883c;*/
}
}
.login .content .form-actions .btn-success {
.login .content .form-actions .btn-success {
width: 100%;
height: 48px; font-size: 14px;
height: 48px;
font-size: 14px;
border-radius: 4px;
}
.form-group img{
}
.form-group img {
position: absolute;
top: 16px;
left: 10px;
width: 16px;
}
}
</style>
</head>
<!-- END HEAD -->
......@@ -105,7 +127,9 @@
<form class="login-form" action="#springUrl('/page/user/login')" method="post">
<input name="uuid" id="uuid" type="hidden">
<h5 style="color:red;text-align: center;"></h5>
<h3 class="form-title">用户登录<span style="color:#c3c5c6;font-size:18px;font-weight:normal;font-family:Vrinda;margin-left:12px">UserLogin</span></h3>
<h3 class="form-title">用户登录<span
style="color:#c3c5c6;font-size:18px;font-weight:normal;font-family:Vrinda;margin-left:12px">UserLogin</span>
</h3>
<div class="alert alert-danger display-hide">
<button class="close" data-close="alert"></button>
<span>请输入用户名和密码 </span>
......@@ -113,32 +137,35 @@
<div class="form-group">
<!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
<label class="control-label visible-ie8 visible-ie9">用户名</label>
<input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="用户名" name="username"/>
<input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off"
placeholder="用户名" name="username"/>
<img src="img/icon1.png" alt="">
</div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">密码</label>
<input class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="密码" name="password"/>
<input class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off"
placeholder="密码" name="password"/>
<img src="img/icon2.png" alt="">
</div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">验证码</label>
<input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="验证码" name="code"/>
<input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off"
placeholder="验证码" name="code"/>
<img src="img/validate-code.png" alt="">
</div>
<img id="codeImg" src="" alt="" style="padding-bottom: 20px;">
<div class="form-actions">
<button type="submit" class="btn btn-success uppercase">登录</button>
<!-- <label class="rememberme check"> -->
<!-- <input type="checkbox" name="remember" value="1"/>保存 </label> -->
<!-- <a href="javascript:;" id="forget-password" class="forget-password">忘记密码?</a> -->
<!-- <label class="rememberme check"> -->
<!-- <input type="checkbox" name="remember" value="1"/>保存 </label> -->
<!-- <a href="javascript:;" id="forget-password" class="forget-password">忘记密码?</a> -->
</div>
<!-- <div class="create-account"> -->
<!-- <p> -->
<!-- <a href="javascript:;" id="register-btn" class="uppercase">创建账号</a> -->
<!-- </p> -->
<!-- </div> -->
<!-- <div class="create-account"> -->
<!-- <p> -->
<!-- <a href="javascript:;" id="register-btn" class="uppercase">创建账号</a> -->
<!-- </p> -->
<!-- </div> -->
<input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/>
<input type="text" style="display: none" name="_csrf_header" value="${_csrf.headerName}"/>
......@@ -147,19 +174,19 @@
</form>
<!-- END LOGIN FORM -->
<!-- BEGIN FORGOT PASSWORD FORM -->
<!-- <form class="forget-form" action="index.html" method="post"> -->
<!-- <h3>忘记密码 ?</h3> -->
<!-- <p> -->
<!-- 请输入您的邮件地址来重置你的密码. -->
<!-- </p> -->
<!-- <div class="form-group"> -->
<!-- <input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="Email" name="email"/> -->
<!-- </div> -->
<!-- <div class="form-actions"> -->
<!-- <button type="button" id="back-btn" class="btn btn-default">返回</button> -->
<!-- <button type="submit" class="btn btn-success uppercase pull-right">提交</button> -->
<!-- </div> -->
<!-- </form> -->
<!-- <form class="forget-form" action="index.html" method="post"> -->
<!-- <h3>忘记密码 ?</h3> -->
<!-- <p> -->
<!-- 请输入您的邮件地址来重置你的密码. -->
<!-- </p> -->
<!-- <div class="form-group"> -->
<!-- <input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="Email" name="email"/> -->
<!-- </div> -->
<!-- <div class="form-actions"> -->
<!-- <button type="button" id="back-btn" class="btn btn-default">返回</button> -->
<!-- <button type="submit" class="btn btn-success uppercase pull-right">提交</button> -->
<!-- </div> -->
<!-- </form> -->
<!-- END FORGOT PASSWORD FORM -->
<!-- BEGIN REGISTRATION FORM -->
<form class="register-form" action="index.html" method="post">
......@@ -189,15 +216,18 @@
</p>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">登录名</label>
<input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="登录名" name="username"/>
<input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="登录名"
name="username"/>
</div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">登录密码</label>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" id="register_password" placeholder="登录密码" name="password"/>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" id="register_password"
placeholder="登录密码" name="password"/>
</div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">再次输入密码</label>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="再次输入密码" name="rpassword"/>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="再次输入密码"
name="rpassword"/>
</div>
<div class="form-actions">
<button type="button" id="register-back-btn" class="btn btn-default">返回</button>
......@@ -215,8 +245,8 @@
<script src="${ctxStatic}/assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/jQuery/jquery-migrate.min.js" type="text/javascript"></script>
<script src="plugins/jQuery/jquery.blockui.min.js" type="text/javascript"></script>
......@@ -233,16 +263,16 @@
<!-- END PAGE LEVEL SCRIPTS -->
<script>
if(window !=top){
top.location.href=location.href;
}
if (window != top) {
top.location.href = location.href;
}
jQuery(document).ready(function() {
Metronic.init(); // init metronic core components
Layout.init(); // init current layout
Login.init();
Demo.init();
if("$!{error}"!=null && "$!{error}"!=""){
jQuery(document).ready(function () {
Metronic.init(); // init metronic core components
Layout.init(); // init current layout
Login.init();
Demo.init();
if ("$!{error}" != null && "$!{error}" != "") {
if ("$!{error}" == 'captcha') {
$('.alert-danger span').text("验证码错误");
$('.alert-danger', $('.login-form')).show();
......@@ -271,15 +301,16 @@ Demo.init();
function getCode() {
//图片
$('#codeImg').attr("src", "#springUrl('/page/user/captcha.jpg')/?uuid="+uuidVal+"&_csrf="+$("input[name='_csrf']").val()+"&_csrf_header="+$("input[name='_csrf_header']").val());
$('#codeImg').attr("src", "#springUrl('/page/user/captcha.jpg')/?uuid=" + uuidVal + "&_csrf=" + $("input[name='_csrf']").val() + "&_csrf_header=" + $("input[name='_csrf_header']").val());
}
getCode();
$('#codeImg').on('click', function () {
getCode();
});
});
});
</script>
<!-- END JAVASCRIPTS -->
</body>
......
......@@ -5,6 +5,7 @@ import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......
......@@ -14,10 +14,10 @@ public class SystemConfig {
try {
// inputStream = SystemConfig.class.newInstance().getClass()
// .getClassLoader().getResourceAsStream("");
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common-test.properties"), "utf-8"));
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common.properties"), "utf-8"));
inputStreamRedis = SystemConfig.class.newInstance().getClass()
.getClassLoader().getResourceAsStream("/redis-config-test.properties");
.getClassLoader().getResourceAsStream("/redis-config.properties");
r.load(inputStreamRedis);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -906,7 +906,7 @@
function onArticle(e) {
if (e.target.value == 1) {
Cfapp.confirm({
message: "是否确认取消推荐文章",
message: "是否确认发布文章",
btntext: "确定",
btncanceltext: "取消",
success: function () {
......@@ -923,7 +923,7 @@
});
} else if (e.target.value == 0){
Cfapp.confirm({
message: "是否确认推荐文章",
message: "是否确认发布文章",
btntext: "确定",
btncanceltext: "取消",
success: function () {
......@@ -942,12 +942,11 @@
}
function onBanner(e) {
console.log(e.target.value);
if (e.target.value == 1) {
Cfapp.confirm({
message: "是否确认取消推荐",
message: "是否取消推荐banner图",
btntext: "确定",
btncanceltext: "取消",
success: function () {
......@@ -958,12 +957,17 @@
}
});
} else {
if (e.target.value == '0') {
e.target.value = '1'
} else if (e.target.value == '1') {
e.target.value = '0'
Cfapp.confirm({
message: "是否推荐banner图",
btntext: "确定",
btncanceltext: "取消",
success: function () {
select(e)
},
cancel: function () {
location.href = "#springUrl('/a/cfarticle/list')";
}
save()
});
}
}
......
......@@ -356,26 +356,27 @@
<select id="recommended" resultType="com.cftech.cms.cfarticle.model.CfarticleVO" >
select
a.id,
a.title,
a.author,
a.bigimg,
a.smallimg,
a.content,
a.desc,
a.create_time AS createTime,
a.reading,
b.name,
a.recommended,
a.whether_banner AS whetherBanner,
a.size
FROM wx_cms_cfarticle a
LEFT JOIN wx_cms_column b
ON b.id = a.`column`
WHERE a.del_flag = 0
<if test="id!=null">
and a.id = #{id}
</if>
a.id,
a.title,
a.author,
a.bigimg,
a.smallimg,
a.content,
a.desc,
a.create_time AS createTime,
a.reading,
b.name,
a.recommended,
a.whether_banner AS whetherBanner,
a.size,
a.article
FROM wx_cms_cfarticle a
LEFT JOIN wx_cms_column b
ON b.id = a.`column`
WHERE a.del_flag = 0
<if test="id!=null">
and a.id = #{id}
</if>
ORDER BY
a.create_time
</select>
......@@ -454,26 +455,27 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1 and del_flag=0
<select id="columnDetails" resultType="com.cftech.cms.cfarticle.model.CfarticleVO" >
select
id,
title,
author,
bigimg,
smallimg,
content,
create_time AS createTime,
update_time AS updatetime,
reading,
recommended,
whether_banner AS whetherBanner,
size
FROM wx_cms_cfarticle
WHERE del_flag=0
<if test="id!=null">
id,
title,
author,
bigimg,
smallimg,
content,
create_time AS createTime,
update_time AS updatetime,
reading,
recommended,
whether_banner AS whetherBanner,
size,
article
FROM wx_cms_cfarticle
WHERE del_flag=0
<if test="id!=null">
AND `column`= #{id}
</if>
<if test="title!=null and title!=''">
</if>
<if test="title!=null and title!=''">
AND CONCAT(IFNULL(`title`,''),IFNULL(`author`,'')) LIKE '%${title}%'
</if>
</if>
ORDER BY
create_time
DESC
......
......@@ -38,9 +38,10 @@ public class CfarticleVO {
private Long reading;
/*是否置顶文章*/
private Long recommended;
/*是否置顶banner*/
private Long whetherBanner;
/* 是否发布文章 */
private Long article;
private Long size;
}
......@@ -113,11 +113,7 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
if (recommended.size()>0) {
for (CfarticleVO cfarticleVO : recommended) {
String contents = ESAPI.encoder().decodeForHTML(cfarticleVO.getContent());
String unCond = HtmlUtils.htmlUnescape(contents);
//String value = HtmlUtils.htmlEscape(unCond,"UTF-8");
// String content = cfarticleVO.getContent();
// String s1 = StringEscapeUtils.unescapeHtml(content);
// String all = s1.replaceAll("&quot;", "\"");
String unCond = HtmlUtils.htmlUnescape(contents);
cfarticleVO.setContent(unCond);
}
rtnJson.put("errorNo", "0");
......
......@@ -61,8 +61,8 @@
<section class="content-header">
<h1>
CRC患者管理
<small>CRC患者信息</small>
CRC用户管理
<small>CRC用户信息</small>
</h1>
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>首页</a></li>
......@@ -101,7 +101,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" style="font-weight: 700;">设置患者类型</h4>
<h4 class="modal-title" style="font-weight: 700;">设置用户类型</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
......@@ -110,8 +110,8 @@
<form>
<input id="tabNumberId" name="tabNumberId" style="display: none;">
<div class="form-group">
<!-- <label for="message-text" class="col-form-label">请选择患者类型:</label>-->
<select class="form-control select2" style="width: 100%" multiple="multiple" data-placeholder="请选择类型">
<select class="form-control select2" style="width: 100%" multiple="multiple"
data-placeholder="请选择类型">
#foreach($group in $groups)
<option value="${group.id}" data-attr="${role.roleSign}">${group.name}
</option>
......@@ -135,7 +135,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/member/exportExcel')" method="get"
<form id="seachTableForm" action="#springUrl('/a/member/exportExcel')?type=1" method="get"
onkeydown="if(event.keyCode==13){return false;}">
<div class="col-xs-2">
<input type="text" class="form-control required"
......@@ -143,11 +143,12 @@
</div>
<div class="col-xs-2">
<input type="text" class="form-control required"
name="name" placeholder="会员名称">
name="name" placeholder="用户名称">
</div>
<div class="col-xs-5">
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
#if($shiro.hasPermission("qy:member:edit"))
<button class="btn btn-primary">导出</button>
#end
</div>
</form>
......@@ -159,14 +160,13 @@
<td hidden="true">Id</td>
<th>头像</th>
<th>性别</th>
<th>微信OPENID</th>
<th>姓名</th>
<th>联系方式</th>
<th>随机码</th>
<th>身份证</th>
<th>审核状态</th>
<th>来源</th>
<th>患者类型</th>
<th>入组医院</th>
<th>拒绝原由</th>
<th>审核时间</th>
<th>创建日期</th>
<th>操作</th>
</tr>
......@@ -265,9 +265,6 @@
{
"mData": "sex"
},
{
"mData": "openId"
},
{
"mData": "name"
},
......@@ -278,16 +275,16 @@
"mData": "invitcode"
},
{
"mData": "cardid"
"mData": "status"
},
{
"mData": "status"
"mData": "orgName"
},
{
"mData": "source"
"mData": "description"
},
{
"mData": "tabNames"
"mData": "auditTime"
},
{
"mData": "createTime"
......@@ -306,7 +303,7 @@
"aTargets": [1],
"mData": "imageurl",
"mRender": function (a, b, c, d) {
return '<img src="' + a + '" style="width:80px;height:80px;">';
return '<img src="' + a + '" style="width:45px;height:45px;">';
}
}, {
......@@ -324,31 +321,25 @@
},
{
"aTargets": [3],
"mData": "openId",
"mRender": function (a, b, c, d) {
return a;
}
}, {
"aTargets": [4],
"mData": "name",
"mRender": function (a, b, c, d) {
if (a == '' || a == null) {
return '';
}
return a.slice(0, 1) + '*' + a.slice(2, a.length);
return a;
}
}, {
"aTargets": [5],
"aTargets": [4],
"mData": "phone",
"mRender": function (a, b, c, d) {
if (a == '' || a == null) {
return '';
}
return a.slice(0, 3) + '****' + a.slice(7);
return a;
}
},
{
"aTargets": [8],
"aTargets": [6],
"mData": "status",
"mRender": function (a, b, c, d) {
if (a == 0) {
......@@ -361,40 +352,41 @@
return '';
}
},
{
"aTargets": [8],
"mData": "description",
"mRender": function (a, b, c, d) {
if (c.status == '2') {
return a;
}
return '';
}
},
{
"aTargets": [9],
"mData": "source",
"mData": "auditTime",
"mRender": function (a, b, c, d) {
if (a == 1) {
return "普通关注";
} else if (a == 2) {
return "药师二维码";
} else if (a == 3) {
return "客服二维码";
} else if (a == 4) {
return "医生二维码";
} else if (a == 5) {
return "组织二维码";
} else {
return "用户注册";
if (a == null) {
return "";
}
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [11],
"aTargets": [10],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [12],
"aTargets": [11],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '';
html += '#if($shiro.hasPermission("qy:member:audit"))';
html += '<a onclick="showTabsDiv('+c.id+')" class="btn green">设置类型</a>';
if (c.invitcode != null && c.invitcode != '' && c.cardid != null && c.cardid != '') {
//html += '<a onclick="showTabsDiv(' + c.id + ')" class="btn green">设置类型</a>';
if (c.invitcode != null && c.invitcode != '') {
if (c.status == '0') {
html += '<a onclick="auditPass(' + c.id + ')" class="btn green">审核通过</a>';
}
......@@ -518,14 +510,22 @@
$("#tabsDiv").modal('hide');
let vals = $('.select2').select2('val');
if (vals.length == 0) {
Cfapp.alert({ message: "请先选择患者类型", btntext: "确定", success: function () {} });
Cfapp.alert({
message: "请先选择用户类型", btntext: "确定", success: function () {
}
});
return;
}
$.ajax({
type: "POST",
url: "#springUrl('/a/member/formData')",
data: {id: $("#tabNumberId").val(), memberId: vals.join(','), _csrf_header: csrfheader.value, _csrf: csrftoken.value},
data: {
id: $("#tabNumberId").val(),
memberId: vals.join(','),
_csrf_header: csrfheader.value,
_csrf: csrftoken.value
},
dataType: "json",
success: function (data) {
if (data.errorNo == 0) {
......
......@@ -74,7 +74,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" style="font-weight: 700;">设置患者类型</h4>
<h4 class="modal-title" style="font-weight: 700;">设置用户类型</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
......@@ -83,7 +83,7 @@
<form>
<input id="tabNumberId" name="tabNumberId" style="display: none;">
<div class="form-group">
<!-- <label for="message-text" class="col-form-label">请选择患者类型:</label>-->
<!-- <label for="message-text" class="col-form-label">请选择用户类型:</label>-->
<select class="form-control select2" style="width: 100%" multiple="multiple" data-placeholder="请选择类型">
#foreach($group in $groups)
<option value="${group.id}" data-attr="${role.roleSign}">${group.name}
......@@ -142,18 +142,12 @@
<td hidden="true">Id</td>
<th>头像</th>
<th>性别</th>
<!-- <th>姓</th>-->
<!-- <th>名</th>-->
<th>微信OPENID</th>
<th>会员名称</th>
<th>联系方式</th>
<th>身份证</th>
<th>来源</th>
<th>三期患者</th>
<th>患者类型</th>
<!-- <th>邀请码</th>-->
<!-- <th>客户分类</th>-->
<!-- <th>名片</th>-->
<th>三期临床</th>
<th>用户类型</th>
<th>创建日期</th>
<th>操作</th>
</tr>
......@@ -261,9 +255,6 @@
{
"mData": "phone"
},
{
"mData": "cardid"
},
{
"mData": "source"
},
......@@ -289,7 +280,7 @@
"aTargets": [1],
"mData": "imageurl",
"mRender": function (a, b, c, d) {
return '<img src="' + a + '" style="width:80px;height:80px;">';
return '<img src="' + a + '" style="width:45px;height:45px;">';
}
}, {
......@@ -330,7 +321,7 @@
return a.slice(0, 3) + '****' + a.slice(7);
}
}, {
"aTargets": [7],
"aTargets": [6],
"mData": "source",
"mRender": function (a, b, c, d) {
if (a == 1) {
......@@ -349,7 +340,7 @@
}
},
{
"aTargets": [8],
"aTargets": [7],
"mData": "status",
"mRender": function (a, b, c, d) {
if (a == 1) {
......@@ -359,14 +350,14 @@
}
},
{
"aTargets": [10],
"aTargets": [9],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [11],
"aTargets": [10],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '';
......@@ -513,7 +504,7 @@
$("#tabsDiv").modal('hide');
let vals = $('.select2').select2('val');
if (vals.length == 0) {
Cfapp.alert({ message: "请先选择患者类型", btntext: "确定", success: function () {} });
Cfapp.alert({ message: "请先选择用户类型", btntext: "确定", success: function () {} });
return;
}
......
......@@ -336,10 +336,14 @@
m.status,
m.invitcode,
q.name serviceName,
GROUP_CONCAT(g.name SEPARATOR ',') tabNames
GROUP_CONCAT(g.name SEPARATOR ',') tabNames,
m.description,
o.org_name orgName,
m.audit_time auditTime
FROM wx_mp_member m
LEFT JOIN t_qyuser q ON m.service_id = q.id
LEFT JOIN t_aidea_member_group g ON FIND_IN_SET(g.id, m.member_id) != 0 AND g.del_flag = '0'
LEFT JOIN t_aidea_member_group g ON FIND_IN_SET(g.id, m.member_id) != 0 AND g.del_flag = 0
LEFT JOIN t_orgunit o ON m.storeid = o.id AND o.del_flag = 0
<include refid="sqlWhere"/>
GROUP BY m.id
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
......@@ -372,7 +376,8 @@
t.open_id openid,
t.service_id serviceId,
u.name serviceName,
t.compan
t.compan,
t.description
FROM wx_mp_member t
LEFT JOIN t_orgunit o ON t.storeid = o.id
LEFT JOIN t_qyuser u ON t.service_id = u.id
......
......@@ -13,29 +13,40 @@ import java.util.Date;
public class MemberDto {
private Long id;
@ExportConfig(value = "会员头像",width = 100)
@ExportConfig(value = "用户头像",width = 100)
private String imageurl;
@ExportConfig(value = "会员性别",width = 100)
@ExportConfig(value = "用户性别",width = 100)
private String sex;
@ExportConfig(value = "微信OPENID",width = 100)
//@ExportConfig(value = "微信OPENID",width = 100)
private String openId;
@ExportConfig(value = "会员名",width = 100)
@ExportConfig(value = "用户名",width = 120)
private String name;
@ExportConfig(value = "会员手机",width = 100)
@ExportConfig(value = "用户手机",width = 100)
private String phone;
/**
* 随机码
*/
@ExportConfig(value = "随机码", width = 120)
@ExportConfig(value = "随机码", width = 100)
private String invitcode;
@ExportConfig(value = "身份证",width = 100)
/**
* 入组医院
*/
@ExportConfig(value = "入组医院", width = 160)
private String orgName;
private String cardid;
@ExportConfig(value = "审核状态",width = 100)
private String status;
@ExportConfig(value = "粉丝来源",width = 100)
//@ExportConfig(value = "粉丝来源",width = 100)
private String source;
@ExportConfig(value = "创建时间",width = 100)
private String createTime;
@ExportConfig(value = "审核时间",width = 120, dateFormat = "yyyy-MM-dd HH:mm")
private Date auditTime;
@ExportConfig(value = "创建时间",width = 120, dateFormat = "yyyy-MM-dd HH:mm")
private Date createTime;
/**
* 审核不通过原因
*/
@ExportConfig(value = "审核不通过原由",width = 160)
private String description;
/**
* 审批人名称
......@@ -49,4 +60,9 @@ public class MemberDto {
}
......@@ -77,4 +77,6 @@ public class MemberVO {
*/
private String serviceName;
private String description;
}
......@@ -14,6 +14,7 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Cond;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.core.util.DateFormatUtils;
import com.cftech.core.util.IdcardUtils;
import com.cftech.core.util.StringUtils;
......@@ -35,6 +36,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import sun.plugin2.main.client.MessagePassingOneWayJSObject;
import java.lang.invoke.ConstantCallSite;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -161,6 +163,8 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
if (member == null) {
//验证随机号是否被使用
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.in("status", new String[]{"0", "1"});
conds.equal("invitcode", memberVO.getInvitcode());
List<Member> list = this.fetchSearchByPage(conds, null, 0, 0);
if (list != null && list.size() != 0) {
......@@ -177,9 +181,9 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
member.setCardid(memberVO.getCardid());
member.setPhone(memberVO.getPhone());
member.setImageurl(memberVO.getImageUrl());
member.setCompan(memberVO.getCompan());
//三期用户
if (StringUtils.equals(memberVO.getCompan(), "1")) {
member.setCompan(memberVO.getCompan());
member.setStatus("0");
member.setStoreid(memberVO.getStoreid());
member.setInvitcode(memberVO.getInvitcode());
......@@ -192,6 +196,7 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
//验证随机号是否被使用
Conds conds = new Conds();
conds.equal("invitcode", memberVO.getInvitcode());
conds.in("status", new String[]{"0", "1"});
conds.notEqual("id", member.getId());
List<Member> list = this.fetchSearchByPage(conds, null, 0, 0);
if (list != null && list.size() != 0) {
......@@ -203,12 +208,20 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
member.setName(memberVO.getMemberName());
member.setSex(Long.parseLong(memberVO.getSex()));
member.setPhone(memberVO.getPhone());
member.setCompan(memberVO.getCompan());
//三期患者且审核拒绝
if (StringUtils.equals(memberVO.getCompan(), "1") && StringUtils.equals(member.getStatus(), "2")) {
if (StringUtils.equals(memberVO.getCompan(), "1") && !StringUtils.equals(member.getStatus(), "1")) {
member.setStatus("0");
member.setCompan(memberVO.getCompan());
member.setStoreid(memberVO.getStoreid());
member.setInvitcode(memberVO.getInvitcode());
} else if (StringUtils.equals(memberVO.getCompan(), "0")) {
//非三期患者
member.setCompan(memberVO.getCompan());
member.setStatus("");
member.setStoreid("");
member.setServiceId("");
member.setInvitcode("");
member.setDescription("");
}
memberMapper.update(member);
rtnJson.put("errorNo", "0");
......
......@@ -2,6 +2,7 @@ package com.cftech.member.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.model.OrgUnit;
import com.cftech.base.org.service.OrgUnitService;
......@@ -12,6 +13,9 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.core.util.DateFormatUtils;
import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.SystemConfig;
import com.cftech.member.group.model.MemberGroup;
import com.cftech.member.group.service.MemberGroupService;
import com.cftech.member.model.Member;
......@@ -28,9 +32,13 @@ import com.cftech.sys.service.RoleService;
import com.cftech.workshop.workshop.model.Workshop;
import com.cftech.workshop.workshop.service.WorkshopService;
import com.ctc.wstx.util.StringUtil;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.json.HTTP;
import org.mp.api.core.req.model.message.IndustryTemplateMessageSend;
import org.mp.api.core.req.model.message.TemplateData;
import org.mp.api.wxsendmsg.JwTemplateMessageAPI;
import org.owasp.esapi.ESAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.web.csrf.CsrfToken;
......@@ -87,6 +95,9 @@ public class MemberController {
@Autowired
private MpFanssService fanssService;
@Autowired
private MpAccountsService mpAccountsService;
@Autowired
private RoleService roleService;
......@@ -96,6 +107,9 @@ public class MemberController {
@Autowired
private MemberGroupService memberGroupService;
@Autowired
private MpTokenUtil mpTokenUtil;
//列表页面
@RequiresPermissions(value = MEMBER_VIEW)
@RequestMapping("/listpl")
......@@ -230,6 +244,9 @@ public class MemberController {
Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
//三期患者
conds.notNull("m.invitcode");
conds.notNull("m.storeid");
//权限控制
if (user.getId() != 1 && !leader) {
......@@ -264,7 +281,15 @@ public class MemberController {
return rtnJson;
}
//删除数据
/**
* CRC患者审核
* @param id
* @param status
* @param remarks
* @param request
* @param response
* @return
*/
@RequiresPermissions(value = MEMBER_AUDIT)
@RequestMapping(value = "/audit", method = {RequestMethod.POST})
@ResponseBody
......@@ -281,20 +306,46 @@ public class MemberController {
member.setAuditTime(new Date());
member.setServiceId(UserUtils.getUser().getId().toString());
MpFanssEntity fanssEntity = new MpFanssEntity();
fanssEntity.setOpenid(member.getOpenId());
// MpFanssEntity fanssEntity = new MpFanssEntity();
// fanssEntity.setOpenid(member.getOpenId());
if (org.apache.commons.lang.StringUtils.equals(status, "1")) {
member.setCompan("1");
fanssEntity.setUnionid("1");//三期患者
} else if (org.apache.commons.lang.StringUtils.equals(status, "2")) {
member.setCompan("0");
fanssEntity.setUnionid("0");//普通人员
}
if (org.apache.commons.lang.StringUtils.isNotBlank(remarks)) {
member.setDescription(remarks);
}
memberService.update(member);
fanssService.updateByOpenId(fanssEntity);
if (memberService.update(member)) {
if (org.apache.commons.lang3.StringUtils.equals("1", member.getStatus())) {
//审核通过
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("LEVEL_3_AUDIT_PASS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好!您的身份认证已审核通过。";
String remark = "请至个人中心查询。";
String [] keywords = {member.getName(), member.getInvitcode(),
DateFormatUtils.getDateFormat(member.getCreateTime(), "yyyy.MM.dd")};
String url = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/myinfo?appid=" + appid + "&tokenId=1";
sendMessage(refuseTmpId, token, member.getOpenId(),first, remark, keywords, url);
} else if (org.apache.commons.lang3.StringUtils.equals("2", member.getStatus())) {
//审核拒绝
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("LEVEL_3_AUDIT_NOT_PASS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您的身份认证未审核通过。";
String remark = "点击查看审核未通过原由,并至个人中心修改重新提交。";
String [] keywords = {member.getName(), member.getInvitcode(),
DateFormatUtils.getDateFormat(member.getCreateTime(), "yyyy.MM.dd")};
String url = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/myinfo?appid=" + appid + "&tokenId=1";
sendMessage(refuseTmpId, token, member.getOpenId(),first, remark, keywords, url);
}
}
//fanssService.updateByOpenId(fanssEntity);
rtnJosn.put("errorNo", 0);
} catch (Exception e) {
rtnJosn.put("errorNo", 1);
......@@ -363,11 +414,35 @@ public class MemberController {
@RequestMapping("/exportExcel")
@RequiresPermissions(value = MEMBER_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response, Member member) throws ParseException {
public void exportExcel(HttpServletRequest request, HttpServletResponse response, Member member, String type) throws ParseException {
Long accountsId = UserUtils.getmpaccounts(request);
User user = UserUtils.getUser();
Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
//是否拥有药店主管角色 sys:leaders
boolean leader = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_LEADER);
//权限控制
if (user.getId() != 1 && !leader) {
//获取当前人对应的审核部门
Conds orgConds = new Conds();
orgConds.equal("t.del_flag", Constants.DEL_FLAG_0);
orgConds.equal("t.three_phase_auditor", user.getUserid());
List<OrgUnit> list = orgUnitService.fetchSearchByPage(orgConds, null, 0, 0);
Long[] ids = new Long[list.size()];
for(int i=0; i<list.size(); i++) {
ids[i] = list.get(i).getId();
}
if (ids.length == 0) { ids[0] = 0L; }
conds.in("m.storeid", ids);
}
if (org.apache.commons.lang3.StringUtils.equals(type, "1")) {
conds.notNull("m.invitcode");
conds.notNull("m.storeid");
}
if (!StringUtils.isEmpty(member.getName())) {
conds.like("m.name", member.getName());
}
......@@ -401,11 +476,55 @@ public class MemberController {
} else {
memberDto.setSource("用户注册");
}
Date parse = simpleDateFormat.parse(memberDto.getCreateTime());
memberDto.setCreateTime(simpleDateFormat.format(parse));
if ("0".equals(memberDto.getStatus())) {
memberDto.setStatus("待认证");
} else if ("1".equals(memberDto.getStatus())) {
memberDto.setStatus("已认证");
} else if ("2".equals(memberDto.getStatus())) {
memberDto.setStatus("认证未通过");
}
}
}
// 生成Excel并使用浏览器下载
ExcelKit.$Export(MemberDto.class, response).toExcel(list, "会员信息");
ExcelKit.$Export(MemberDto.class, response).toExcel(list, "CRC用户信息");
}
private void sendMessage(String templateId, String token, String openId, String first, String remark, String [] keywords, String url){
IndustryTemplateMessageSend mc = new IndustryTemplateMessageSend();
mc.setTemplate_id(templateId);
mc.setTouser(openId);
mc.setAccess_token(token);
mc.setUrl(url);
StringBuffer json = new StringBuffer();
Gson gson = new Gson();
String objJson = gson.toJson(mc);
json.append(objJson);
json.setLength(json.length()-1);
json.append(",");
json.append("\"data\":{");
TemplateData template = new TemplateData();
template.setValue(first);
//template.setColor("#ffAADD");
objJson = gson.toJson(template);
json.append(" \"first\":");
json.append(objJson);
json.append(",");
if(keywords!=null && keywords.length>0){
for(int i=0;i<keywords.length;i++){
template.setValue(keywords[i]);
objJson = gson.toJson(template);
json.append(" \"keyword"+(i+1)+"\":");
json.append(objJson);
json.append(",");
}
}
template.setValue(remark);
objJson = gson.toJson(template);
json.append(" \"remark\":");
json.append(objJson);
json.append("}}");
JwTemplateMessageAPI.sendTemplateMsgJson(json.toString(),token);
}
}
......@@ -208,8 +208,9 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.addresst.model.Address">
SELECT
<include refid="sqlColumns"/>, concat( a.areaname ,b.areaname, c.areaname, t.address ) name
<include refid="sqlColumns"/>, concat( a.areaname ,b.areaname, c.areaname, t.address ) name, f.nickname nickName
FROM t_shipping_address t
LEFT JOIN wx_mp_fanss f ON t.open_id = f.openid AND f.delflag = '0'
INNER JOIN area a ON t.province_id = a.areaid
INNER JOIN area b ON t.city_id = b.areaid
INNER JOIN area c ON t.area_id = c.areaid
......
......@@ -69,6 +69,12 @@ public class Address extends Area implements Serializable {
private String nickName;
private String provinceName;
private String cityName;
private String areaName;
public Address() {
this.delFlag = false;
this.status = "0";
......
......@@ -9,9 +9,9 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.core.util.StringUtils;
import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -62,9 +62,23 @@ public class AddressController {
@RequestMapping("/form")
public String form(HttpServletRequest request, String id, Model model, String pageType) {
if (!StringUtils.isEmpty(id)) {
Address address = addressService.fetchById(id);
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.id", id);
Address address = addressService.fetchSearchByConds(conds);
if (address != null) {
if (StringUtils.isNotBlank(address.getAddressName()) && address.getAddressName().length() >= 2) {
address.setAddressName(address.getAddressName().substring(0, 1) + "*" + address.getAddressName().substring(2, address.getAddressName().length()));
}
if (StringUtils.isNotBlank(address.getPhone()) && address.getPhone().length() == 11) {
address.setPhone(address.getPhone().substring(0, 3) + "****" + address.getPhone().substring(7, address.getPhone().length()));
}
if (StringUtils.isNotBlank(address.getAddress()) && address.getAddress().length() >= 5) {
address.setAddress("****" + address.getAddress().substring(4, address.getAddress().length()));
}
model.addAttribute("data", address);
}
}
model.addAttribute("isView", StringUtils.equals(pageType, "View") ? true : false);
return "address/addressform";
}
......
......@@ -56,7 +56,7 @@
<section class="content-header">
<h1>
收货地址管理管理
收货地址管理
<small>收货地址管理</small>
</h1>
<ol class="breadcrumb">
......@@ -121,43 +121,59 @@
<div class="form-group form-md-line-input col-md-12">
<label>省份<font style="color: red"></font></label><br>
<!-- <input class="form-control" id="province" name="provinceName"-->
<!-- type="text" readonly="readonly"-->
<!-- maxlength="50" placeholder="省份"-->
<!-- value="$!{data.provinceName}"-->
<!-- >-->
#if ($!{isView} == 'true')
<input type="text"
class="form-control" name="provinceName"
id="provinceName"
maxlength="50" placeholder="省份"
value="$!{data.provinceName}"
readonly="readonly"
>
#else
<select id="province" name="provinceId" onchange="getCityList(this.value)"
#if($!{isView}=='true') disabled #end
class="form-control required">
<option value="">请选择省份</option>
</select>
#end
</div>
<div class="form-group form-md-line-input col-md-12">
<label>城市<font style="color: #ff0000"></font></label><br>
<!-- <input class="form-control" id="city" name="cityName"-->
<!-- type="text" readonly="readonly"-->
<!-- maxlength="50" placeholder="城市"-->
<!-- value="$!{data.cityName}"-->
<!-- >-->
#if ($!{isView} == 'true')
<input type="text"
class="form-control" name="cityName"
id="cityName"
maxlength="50" placeholder="城市"
value="$!{data.cityName}"
readonly="readonly"
>
#else
<select id="city" name="cityId" onchange="getReginList(this.value);"
#if($!{isView}=='true') disabled #end
class="form-control required">
<option value="">请选择城市</option>
</select>
#end
</div>
<div class="form-group form-md-line-input col-md-12">
<label>区/县<font style="color: red"></font></label><br>
<!-- <input class="form-control" id="county" name="countyName"-->
<!-- type="text" readonly="readonly"-->
<!-- maxlength="50" placeholder="城市"-->
<!-- value="$!{data.countyName}"-->
<!-- >-->
#if ($!{isView} == 'true')
<input type="text"
class="form-control" name="countyName"
id="countyName"
maxlength="50" placeholder="城市"
value="$!{data.countyName}"
readonly="readonly"
>
#else
<select id="county" name="areaId" class="form-control required" #if($!{isView}=='true') disabled #end>
<option value="">请选择区/县</option>
</select>
#end
</div>
<div class="form-group form-md-line-input col-md-12">
<label>详细地址<font style="color: red"></font></label>
<input type="text"
......@@ -226,31 +242,6 @@
let listCity = null
let listRegin = null
// function tijiao() {
// var url = "#springUrl('/a/address/formData')"
// var provinceId = $("#province").val();
// var cityId = $("#city").val();
// var areaId = $("#county").val();
// var address = $("#address").val();
// var id = $("#id").val();
// $.ajax({
// type: "POST", //提交的方法
// url: url, //提交的地址
// data: {"_csrf_header": csrfheader.value, "_csrf": csrftoken.value, id, provinceId, cityId, areaId, address},// 序列化表单值
// async: false,
// success: function (data) { //成功
//
// if (data) {
//
// location.href = "#springUrl('/a/address/list')";
// } else {
// alert("修改失败")
// }
//
// }
// });
// }
jQuery(document).ready(function () {
var url = "#springUrl('/a/address/listArea')"
$.ajax({
......@@ -314,7 +305,6 @@
if (province==""){
$("#city").append(`<option value = "">请选择城市</option>`);
$("#county").append(`<option value = "">请选择区/县</option>`);
}
}
......
......@@ -318,6 +318,9 @@
"aTargets": [8],
"mData": "address",
"mRender": function (a, b, c, d) {
if (a != null && a != '' && a.length >= 4) {
return '****' + a.slice(4, a.length);
}
return a;
}
},
......
......@@ -167,9 +167,9 @@ public class CoreService {
//@李士伟 客服消息转发前还是要有自动回复,而且希望根据时间回复不同内容。8:30-16:30回复“您好,
// 很高兴为您服务!”,其他时间段回复“非常抱歉哦~我们客服服务时间段是08:30-16:30哦~有需要请08:30之后在线咨询哦~或者是拨打全国服务热线4008288988/95105910咨询哦
if (msgType.equals(MessageUtil.REQ_MESSAGE_TYPE_TEXT)) {//文字消息进行关键字回复
// String content = requestMap.get("Content");
// return replyMessage(fromUserName, toUserName, content, "keyword");
return "";
String content = requestMap.get("Content");
return replyMessage(fromUserName, toUserName, content, "keyword");
//return "";
}
// 图片消息
else if (msgType.equals(MessageUtil.REQ_MESSAGE_TYPE_IMAGE)) {
......@@ -257,19 +257,17 @@ public class CoreService {
}
}
} else if (replyType.equals("keyword")) {
// List<Reply> replyList = replyService.fetchkeywordByPage(content, mpAccountEntity.getId(), "keyword");
// if (replyList != null && replyList.size() > 0) {
// Reply reply = replyList.get(0);
// if (reply.getReplyType().equals("text")) {//回复文本
// return MessageUtil.textMessageToXml(text(fromUserName, toUserName, reply.getContentSource()));
// } else if (reply.getReplyType().equals("news")) {//回复微信图文
// return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, reply.getContentSource()));
// } else if (reply.getReplyType().equals("article")) {//回复文章
// return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, reply.getContentSource()));
// }
// } else {//没有匹配到关键字,接入到客服
// return MessageUtil.customerServiceMessageToXml(resBaseMessage(fromUserName, toUserName));
// }
List<Reply> replyList = replyService.fetchkeywordByPage(content, mpAccountEntity.getId(), "keyword");
if (replyList != null && replyList.size() > 0) {
Reply reply = replyList.get(0);
if (reply.getReplyType().equals("text")) {//回复文本
return MessageUtil.textMessageToXml(text(fromUserName, toUserName, reply.getContentSource()));
} else if (reply.getReplyType().equals("news")) {//回复微信图文
return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, reply.getContentSource()));
} else if (reply.getReplyType().equals("article")) {//回复文章
return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, reply.getContentSource()));
}
}
} else {
}
......
......@@ -142,19 +142,6 @@
</div>
</div>
<div class="form-group form-md-line-input" id="threePhase" style="display:none">
<label>入组医院</label>
<div class="radio">
<label> <input type="radio" name="isThreePhase"
id="isThreePhase_True" value="1" #if($!{data.isThreePhase}== '1') checked #end>
</label>
<label> <input
type="radio" name="isThreePhase" id="isThreePhase_False"
value="0" #if($!{data.isThreePhase} == '0' || $!{data.isThreePhase} == '') checked #end>
</label>
</div>
</div>
<div class="form-group form-md-line-input" id="hospitalTypeId" style="display:none">
<label for="hospitalType">医院分类</label>
<select class="form-control" name="hospitalType" id="hospitalType">
......@@ -168,6 +155,19 @@
</select>
</div>
<div class="form-group form-md-line-input" id="threePhase" style="display:none">
<label>入组医院</label>
<div class="radio">
<label> <input type="radio" name="isThreePhase"
id="isThreePhase_True" value="1" #if($!{data.isThreePhase}== '1') checked #end>
</label>
<label> <input
type="radio" name="isThreePhase" id="isThreePhase_False"
value="0" #if($!{data.isThreePhase} == '0' || $!{data.isThreePhase} == '') checked #end>
</label>
</div>
</div>
<div class="form-group form-md-line-input" id="threePhaseAuditorId" style="display:none">
<label>CRC审核专员</label>
<div class="input-group">
......@@ -248,9 +248,8 @@
if (orgtypeId == "1") {
$('#threePhase').show();
$('#salesManagerId').show();
if (isThreePhase == "1") {
$('#hospitalTypeId').show();
if (isThreePhase == "1") {
$('#threePhaseAuditorId').show();
}
}
......@@ -269,6 +268,7 @@
if ($(this).val() == '1') {
$('#threePhase').show();
$('#salesManagerId').show();
$('#hospitalTypeId').show();
} else {
$('#threePhase').hide();
$('#salesManagerId').hide();
......@@ -279,10 +279,10 @@
$('input[name="isThreePhase"]').on('click', function() {
if ($(this).val() == '1') {
$('#hospitalTypeId').show();
//$('#hospitalTypeId').show();
$('#threePhaseAuditorId').show();
} else {
$('#hospitalTypeId').hide();
//$('#hospitalTypeId').hide();
$('#threePhaseAuditorId').hide();
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment