Commit 432c86f0 authored by fanjr's avatar fanjr

“解决冲突

parents 364b77f4 a36b917f
......@@ -56,7 +56,7 @@
<section class="content-header">
<h1>
检测券管理管理
检测券管理
<small>检测券管理</small>
</h1>
<ol class="breadcrumb">
......
......@@ -60,12 +60,12 @@
<section class="content-header">
<h1>
检测券管理管理
检测券管理
<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>
......
......@@ -112,7 +112,7 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_check_coupon
FROM t_aidea_check_coupon t
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......
......@@ -65,7 +65,7 @@ public class CheckcouponController {
Checkcoupon checkcoupon = checkcouponService.fetchById(id);
model.addAttribute("data", checkcoupon);
}
model.addAttribute("pageType", pageType);
model.addAttribute("isView", pageType.equals("View") ? true : false);//是否查看页面
return "checkcoupon/checkcouponform";
}
......
......@@ -60,12 +60,12 @@
<section class="content-header">
<h1>
检测结果管理管理
检测结果管理
<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>
......@@ -77,13 +77,23 @@
<div class="box">
<div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/checkresult/list')" method="get">
<div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:checkresult:edit"))
<a href="#springUrl('/a/checkresult/form')" class="btn btn-primary">新增</a>
<a href="#springUrl('/a/checkresult/exportExcel')" class="btn btn-primary">导出</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a>
#end
<div class="col-xs-2">
<input type="text" class="form-control"
name="sendCheckNo" placeholder="送检编号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="name" placeholder="患者名称">
</div>
<div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:checkresult:edit"))
<a href="#springUrl('/a/checkresult/form')?pageType=Edit" class="btn btn-primary">新增</a>
<a href="#springUrl('/a/checkresult/exportExcel')" class="btn btn-primary">导出</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a>
#end
</div>
</form>
</div><!-- /.box-header -->
......@@ -91,7 +101,13 @@
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id</td><th>创建时间</th>
<td hidden="true">Id</td>
<th>送检编号</th>
<th>检测试剂批号</th>
<th>昵称</th>
<th>送检日期</th>
<th>检测试剂效期</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
......@@ -135,6 +151,10 @@
src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="common/js/cfapp.js"></script>
<script>
var csrfheader = {name: '_csrf_header', value: '${_csrf.headerName}'};
var csrftoken = {name: '_csrf', value: '${_csrf.token}'};
</script>
<script>
function formatDates(now) {
var now = new Date(now);
......@@ -145,7 +165,7 @@
var minute = now.getMinutes();
var second = now.getSeconds();
return year + "-" + month + "-" + date + " " + hour + ":"
+ minute + ":" + second;
+ minute + ":" + second;
}
function seachTable() {
......@@ -185,32 +205,83 @@
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"aoColumns": [
{
"mData": "id"
},
{
"mData": "createTime"
},
{
{
"mData": "id"
},
{
"mData": "sendCheckNo"
},
{
"mData": "reagentBatchNo"
},
{
"mData": "name"
},
{
"mData": "checkDate"
},
{
"mData": "reagentVerifDate"
},
{
"mData": "createTime"
},
{
"mData": "id"
}],
"aoColumnDefs": [
{ // set default column settings
'visible': false,
'targets': [0]
},
{
"aTargets": [1],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return '<a href="#springUrl("/a/checkresult/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + formatDates(a, "yyyy-MM-dd HH:mm:ss");
+'</a>';
}
},
]
{ // set default column settings
'visible': false,
'targets': [0]
},
{
"mData": "sendCheckNo"
},
{
"mData": "reagentBatchNo"
},
{
"mData": "name"
},
{
"aTargets": [4],
"mData": "checkDate",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [5],
"mData": "reagentVerifDate",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [6],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [7],
"mData": "",
"mRender": function (a, b, c, d) {
let html = '';
html += '<div class="btn-group">' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">' +
' <span class="caret"></span>' +
' <span class="sr-only">Toggle Dropdown</span>' +
'</button>' +
'<ul class="dropdown-menu" role="menu" style="min-width: 100px;">';
html += '<li>#if($shiro.hasPermission("qy:checkresult:view"))<a href="#springUrl("/a/checkresult/form?pageType=View&id=' + a + '")" class="btn green">查看</a>#end</li>';
html += '<li>#if($shiro.hasPermission("qy:checkresult:edit"))<a href="#springUrl("/a/checkresult/form?pageType=Edit&id=' + a + '")" class="btn green">修改</a>#end</li>';
html += '</ul></div>';
return html;
}
},
]
});
}
......@@ -231,6 +302,7 @@
});
Cfapp.init();
function removeData(data) {
Cfapp.confirm({
message: "确定要删除吗",
......@@ -262,22 +334,23 @@
}
});
}
function importExcel() {
var templateExcelUrl = "#springUrl('/a/checkresult/templateExcel')";
var importExcelUrl = "#springUrl('/a/checkresult/importExcel')";
Cfapp.importExcel({
title: '检测结果管理导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
},
success: function () {
function importExcel() {
var templateExcelUrl = "#springUrl('/a/checkresult/templateExcel')";
var importExcelUrl = "#springUrl('/a/checkresult/importExcel')?_csrf_header=" + csrfheader.value + "&_csrf=" + csrftoken.value;
Cfapp.importExcel({
title: '检测结果管理导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
},
success: function () {
}
});
}
}
});
}
</script>
......
......@@ -10,6 +10,14 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>checkresult-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>couponrecord-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -7,84 +7,90 @@ import java.io.Serializable;
import java.util.Date;
/**
* 检测结果管理
*
* @author Strive
* @date: 2021-01-27 17:19
*/
* 检测结果管理
*
* @author Strive
* @date: 2021-01-27 17:19
*/
@Data
public class Checkresult implements Serializable {
/* 主键id */
private Long id;
/* 送检编号 */
@ExportConfig(value = "送检编号", width = 100, showLevel = 1)
/* 主键id */
private Long id;
/* 送检编号 */
@ExportConfig(value = "送检编号", width = 120)
private String sendCheckNo;
/* 送检时间 */
@ExportConfig(value = "送检时间", width = 100, showLevel = 1)
/* 送检时间 */
@ExportConfig(value = "送检日期(格式:yyyy-MM-dd)", width = 180, dateFormat = "yyyy-MM-dd")
private Date checkDate;
/* 检测试剂编号 */
@ExportConfig(value = "检测试剂编号", width = 100, showLevel = 1)
/* 检测试剂编号 */
@ExportConfig(value = "检测试剂批号", width = 120)
private String reagentBatchNo;
/* 检测试剂有效期 */
@ExportConfig(value = "检测试剂有效期", width = 100, showLevel = 1)
/* 检测试剂有效期 */
@ExportConfig(value = "检测试剂效期(格式:yyyy-MM-dd)", width = 180, dateFormat = "yyyy-MM-dd")
private Date reagentVerifDate;
/* 检测编号 */
@ExportConfig(value = "检测编号", width = 100, showLevel = 1)
/* 检测编号 */
@ExportConfig(value = "检测编号", width = 100)
private String checkNo;
/* 系统检测编号 */
@ExportConfig(value = "系统检测编号", width = 120, showLevel = 1)
private String number;
/* 检测项目 */
@ExportConfig(value = "检测项目", width = 100, showLevel = 1)
/* 检测项目 */
@ExportConfig(value = "检测项目", width = 100)
private String checkProject;
/* 粉丝id */
@ExportConfig(value = "粉丝id", width = 100, showLevel = 1)
/* 粉丝id */
private String openid;
/* 检测结果 */
@ExportConfig(value = "检测结果", width = 100, showLevel = 1)
private String result;
/* 试剂盒检测下限 */
@ExportConfig(value = "试剂盒检测下限", width = 100, showLevel = 1)
/* 试剂盒检测下限 */
@ExportConfig(value = "试剂盒检测下限", width = 130)
private String lowerLimit;
/* 试剂品牌 */
@ExportConfig(value = "试剂品牌", width = 100, showLevel = 1)
/* 试剂品牌 */
@ExportConfig(value = "试剂", width = 100)
private String brand;
/* 检测方法 */
@ExportConfig(value = "检测方法", width = 100, showLevel = 1)
/* 检测方法 */
@ExportConfig(value = "检测方法", width = 100)
private String checkMethod;
/* 单位 */
@ExportConfig(value = "单位", width = 100, showLevel = 1)
/* 单位 */
@ExportConfig(value = "单位", width = 100)
private String unit;
/* 仪器名称 */
@ExportConfig(value = "仪器名称", width = 100, showLevel = 1)
/* 仪器名称 */
@ExportConfig(value = "仪器名称", width = 100)
private String instrument;
/* 审核人 */
@ExportConfig(value = "审核人", width = 100, showLevel = 1)
/* 检测结果 */
@ExportConfig(value = "检测结果", width = 100)
private String result;
/* 审核人 */
private String auditor;
/* 审核时间 */
@ExportConfig(value = "审核时间", width = 100, showLevel = 1)
/* 审核时间 */
private Date auditDate;
/* 检测人 */
@ExportConfig(value = "检测人", width = 100, showLevel = 1)
/* 检测人 */
private String checkedBy;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
private String status;
/* 创建时间 */
private Date createTime;
/* 更新时间 */
private Date updateTime;
/* 备注 */
private String description;
/* 创建人 */
private Long createBy;
/* 更新人 */
private Long updateBy;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
private String status;
/* 创建时间 */
private Date createTime;
/* 更新时间 */
private Date updateTime;
/* 备注 */
private String description;
/* 创建人 */
private Long createBy;
/* 更新人 */
private Long updateBy;
@ExportConfig(value = "粉丝昵称", width = 100, showLevel = 1)
private String name;//患者名称
@ExportConfig(value = "检测券编码", width = 120, showLevel = 1)
private String copponRecordNo;//检测券编码
private String checkDateStr;
private String reagentVerifDateStr;
public Checkresult() {
this.delFlag = false;
this.status = "0";
public Checkresult() {
this.delFlag = false;
this.status = "0";
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>aidea-modules</artifactId>
......
......@@ -56,7 +56,7 @@
<section class="content-header">
<h1>
发券信息管理管理
发券信息管理
<small>发券信息管理</small>
</h1>
<ol class="breadcrumb">
......
......@@ -60,12 +60,12 @@
<section class="content-header">
<h1>
发券信息管理管理
发券信息管理
<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>
......@@ -77,13 +77,11 @@
<div class="box">
<div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/couponrecord/list')" method="get">
<div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:couponrecord:edit"))
<a href="#springUrl('/a/couponrecord/form')" class="btn btn-primary">新增</a>
<a href="#springUrl('/a/couponrecord/exportExcel')" class="btn btn-primary">导出</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a>
#end
<div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:couponrecord:edit"))
<a href="#springUrl('/a/couponrecord/exportExcel')" class="btn btn-primary">导出</a>
#end
</div>
</form>
</div><!-- /.box-header -->
......@@ -91,7 +89,8 @@
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id</td><th>创建时间</th>
<td hidden="true">Id</td>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
......@@ -145,7 +144,7 @@
var minute = now.getMinutes();
var second = now.getSeconds();
return year + "-" + month + "-" + date + " " + hour + ":"
+ minute + ":" + second;
+ minute + ":" + second;
}
function seachTable() {
......@@ -185,32 +184,32 @@
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"aoColumns": [
{
"mData": "id"
},
{
"mData": "createTime"
},
{
{
"mData": "id"
},
{
"mData": "createTime"
},
{
"mData": "id"
}],
"aoColumnDefs": [
{ // set default column settings
'visible': false,
'targets': [0]
},
{
"aTargets": [1],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return '<a href="#springUrl("/a/couponrecord/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + formatDates(a, "yyyy-MM-dd HH:mm:ss");
+'</a>';
}
},
]
{ // set default column settings
'visible': false,
'targets': [0]
},
{
"aTargets": [1],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return '<a href="#springUrl("/a/couponrecord/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + formatDates(a, "yyyy-MM-dd HH:mm:ss");
+'</a>';
}
},
]
});
}
......@@ -231,6 +230,7 @@
});
Cfapp.init();
function removeData(data) {
Cfapp.confirm({
message: "确定要删除吗",
......@@ -262,22 +262,23 @@
}
});
}
function importExcel() {
var templateExcelUrl = "#springUrl('/a/couponrecord/templateExcel')";
var importExcelUrl = "#springUrl('/a/couponrecord/importExcel')";
Cfapp.importExcel({
title: '发券信息管理导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
},
success: function () {
function importExcel() {
var templateExcelUrl = "#springUrl('/a/couponrecord/templateExcel')";
var importExcelUrl = "#springUrl('/a/couponrecord/importExcel')";
Cfapp.importExcel({
title: '发券信息管理导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
},
success: function () {
}
});
}
}
});
}
</script>
......
......@@ -10,6 +10,14 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>couponrecord-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>checkcoupon-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -8,6 +8,8 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Map;
/**
* 发券信息管理Mapper
*
......@@ -16,6 +18,7 @@ import java.util.Map;
*/
public interface CouponrecordMapper extends GenericDao<Couponrecord> {
<<<<<<< HEAD
List<Map<String,Object>> CheckCouponDSYList(CouponrecordVo vo);
List<Map<String,Object>> CheckCouponYSYList(CouponrecordVo vo);
......@@ -26,4 +29,12 @@ public interface CouponrecordMapper extends GenericDao<Couponrecord> {
Map<String,Object> checkCouponDetails(CouponrecordVo vo);
=======
/**
* 查询粉丝购药数量
* @param params
* @return
*/
Integer buyingMedicineNumber(Map<String, Object> params);
>>>>>>> a36b917f9562e200889fcced02ed1de0d7aeb745
}
\ No newline at end of file
......@@ -52,26 +52,25 @@
</sql>
<sql id="sqlColumns">
id
,
take_effect_year,
take_effect_month,
expire_month,
type,
number,
openid,
qrcode,
invalid_date,
verif_date,
facility_no,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by
id,
take_effect_year,
take_effect_month,
expire_month,
type,
number,
openid,
qrcode,
invalid_date,
verif_date,
facility_no,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by
</sql>
......@@ -194,6 +193,7 @@
where id = #{id,jdbcType=BIGINT}
</update>
<<<<<<< HEAD
<select id="CheckCouponYSYList" resultType="map">
SELECT
id,number,DATE_FORMAT(create_time,'%Y-%m-%d') create_time,DATE_FORMAT(invalid_date,'%Y-%m-%d') invalid_date,status
......@@ -246,5 +246,13 @@
id,number,DATE_FORMAT(create_time,'%Y-%m-%d') create_time,DATE_FORMAT(invalid_date,'%Y-%m-%d') invalid_date,status,description
from t_aidea_coupon_record
where id = #{id}
=======
<select id="buyingMedicineNumber" parameterType="java.util.Map" resultType="map">
SELECT
SUM(d.number) number
FROM t_order t
LEFT JOIN t_order_details d ON t.id = d.order_id
<include refid="sqlWhere"/>
>>>>>>> a36b917f9562e200889fcced02ed1de0d7aeb745
</select>
</mapper>
\ No newline at end of file
......@@ -7,66 +7,72 @@ import java.io.Serializable;
import java.util.Date;
/**
* 发券信息管理
*
* @author Strive
* @date: 2021-01-27 15:54
*/
* 发券信息管理
*
* @author Strive
* @date: 2021-01-27 15:54
*/
@Data
public class Couponrecord implements Serializable {
/* 主键id */
private Long id;
/* 有效期年 */
@ExportConfig(value = "有效期年", width = 100, showLevel = 1)
/* 主键id */
private Long id;
/* 有效期年 */
@ExportConfig(value = "有效期年", width = 100, showLevel = 1)
private String takeEffectYear;
/* 生效月 */
@ExportConfig(value = "生效月", width = 100, showLevel = 1)
/* 生效月 */
@ExportConfig(value = "生效月", width = 100, showLevel = 1)
private String takeEffectMonth;
/* 过期月份 */
@ExportConfig(value = "过期月份", width = 100, showLevel = 1)
/* 过期月份 */
@ExportConfig(value = "过期月份", width = 100, showLevel = 1)
private String expireMonth;
/* 检测券类型 */
@ExportConfig(value = "检测券类型", width = 100, showLevel = 1)
/* 检测券类型 */
@ExportConfig(value = "检测券类型", width = 100, showLevel = 1)
private String type;
/* 检测券编码 */
@ExportConfig(value = "检测券编码", width = 100, showLevel = 1)
/* 检测券编码 */
@ExportConfig(value = "检测券编码", width = 100, showLevel = 1)
private String number;
/* 粉丝id */
@ExportConfig(value = "粉丝id", width = 100, showLevel = 1)
/* 粉丝id */
@ExportConfig(value = "粉丝id", width = 100, showLevel = 1)
private String openid;
/* 二维码链接 */
@ExportConfig(value = "二维码链接", width = 100, showLevel = 1)
/* 二维码链接 */
@ExportConfig(value = "二维码链接", width = 100, showLevel = 1)
private String qrcode;
/* 失效时间 */
@ExportConfig(value = "失效时间", width = 100, showLevel = 1)
/* 失效时间 */
@ExportConfig(value = "失效时间", width = 100, showLevel = 1)
private Date invalidDate;
/* 核销时间 */
@ExportConfig(value = "核销时间", width = 100, showLevel = 1)
/* 核销时间 */
@ExportConfig(value = "核销时间", width = 100, showLevel = 1)
private Date verifDate;
/* 设备号 */
@ExportConfig(value = "设备号", width = 100, showLevel = 1)
/* 设备号 */
@ExportConfig(value = "设备号", width = 100, showLevel = 1)
private Date facilityNo;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
private String status;
/* 创建时间 */
private Date createTime;
/* 更新时间 */
private Date updateTime;
/* 备注 */
private String description;
/* 创建人 */
private Long createBy;
/* 更新人 */
private Long updateBy;
/* 过期时间 */
@ExportConfig(value = "过期时间", width = 100, showLevel = 1)
private Date expireDate;
/* 过期时间 */
@ExportConfig(value = "生效时间", width = 100, showLevel = 1)
private Date takeEffectDate;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
private String status;
/* 创建时间 */
private Date createTime;
/* 更新时间 */
private Date updateTime;
/* 备注 */
private String description;
/* 创建人 */
private Long createBy;
/* 更新人 */
private Long updateBy;
public Couponrecord() {
this.delFlag = false;
this.status = "0";
public Couponrecord() {
this.delFlag = false;
this.status = "0";
}
}
\ No newline at end of file
package com.cftech.couponrecord.service;
import com.alibaba.fastjson.JSONObject;
import com.cftech.couponrecord.model.Couponrecord;
import com.cftech.core.generic.GenericService;
import com.cftech.couponrecord.model.CouponrecordVo;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.couponrecord.model.Couponrecord;
import com.cftech.core.generic.GenericService;
import java.util.List;
/**
* 发券信息管理Service
......@@ -38,4 +43,18 @@ public interface CouponrecordService extends GenericService<Couponrecord> {
* @return
**/
JSONObject checkCouponById(CouponrecordVo vo);
/** 发放检测券
* @param couponId
* @param openid
* @return
*/
boolean sendCouponRecord(Long couponId, String openid);
/**
* 获取用户购药数量
* @param openid
* @return
*/
Integer buyingMedicineNumber(String openid);
}
package com.cftech.couponrecord.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.checkcoupon.model.Checkcoupon;
import com.cftech.checkcoupon.service.CheckcouponService;
import com.cftech.checkcoupon.utils.QrcodeUtil;
import com.cftech.core.util.Constants;
import com.cftech.couponrecord.model.Couponrecord;
import com.cftech.couponrecord.dao.CouponrecordMapper;
import com.cftech.couponrecord.model.CouponrecordVo;
......@@ -8,30 +13,197 @@ import com.cftech.couponrecord.service.CouponrecordService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.google.zxing.WriterException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.util.*;
/**
* 发券信息管理ServiceImpl
*
* @author Strive
* @date: 2021-01-27 15:54
*/
* 发券信息管理ServiceImpl
*
* @author Strive
* @date: 2021-01-27 15:54
*/
@Service("couponrecordService")
public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> implements CouponrecordService {
@Autowired
@Qualifier("couponrecordMapper")
private CouponrecordMapper couponrecordMapper;
@Autowired
@Qualifier("couponrecordMapper")
private CouponrecordMapper couponrecordMapper;
@Override
public GenericDao<Couponrecord> getGenericMapper() {
return couponrecordMapper;
}
@Autowired
private CheckcouponService checkCoupouService;
@Autowired
private CodingruleUtils codingruleUtils;
@Override
public GenericDao<Couponrecord> getGenericMapper() {
return couponrecordMapper;
}
public boolean sendCouponRecord(Long couponId, String openid, Long accountId) throws IOException, WriterException {
Conds couponConds = new Conds();
couponConds.equal("t.del_flag", Constants.DEL_FLAG_0);
couponConds.equal("t.openid", openid);
Map<String, Object> params = new HashMap<>();
params.put("conds", couponConds);
List<Couponrecord> couponrecordList = couponrecordMapper.fetchSearchByPage(params);
int sendCouponNumber = couponrecordList == null ? 0: couponrecordList.size();//粉丝获取卡券数量
int number = buyingMedicineNumber(openid);//购买数量
int years = 1;
switch (sendCouponNumber) {
case 0:
if (number >=3 && number <6) {//赠送第一年第一张券
Checkcoupon checkcoupon = this.findCheckCoupon("1");
//生成卡券发放记录编码
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear(String.valueOf(years));
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
couponrecord.setType(checkcoupon.getType());
couponrecord.setOpenid(openid);
couponrecord.setInvalidDate(dateCalculation(new Date(), 12));
couponrecord.setTakeEffectDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.getTakeEffectMonth())));//生效时间
couponrecord.setExpireDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.getExpireMonth())));//过期时间
couponrecord.setQrcode(QrcodeUtil.generateQrcode(no));//生成二维码
couponrecordMapper.save(couponrecord);
//couponrecord.setInvalidDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.)));//失效时间
} else if (number >= 6) {
Checkcoupon checkcoupon = this.findCheckCoupon("2");
//生成卡券发放记录编码
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear(String.valueOf(years));
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
couponrecord.setType(checkcoupon.getType());
couponrecord.setOpenid(openid);
couponrecord.setTakeEffectDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.getTakeEffectMonth())));//生效时间
couponrecord.setExpireDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.getExpireMonth())));//过期时间
couponrecord.setQrcode(QrcodeUtil.generateQrcode(no));//生成二维码
couponrecordMapper.save(couponrecord);
}
break;
case 1:
//int number = buyingMedicineNumber(openid);//购买数量
if (number >= 6) {
Checkcoupon checkcoupon = this.findCheckCoupon("2");
//生成卡券发放记录编码
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear(String.valueOf(years));
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
couponrecord.setType(checkcoupon.getType());
couponrecord.setOpenid(openid);
couponrecord.setTakeEffectDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.getTakeEffectMonth())));//生效时间
couponrecord.setExpireDate(dateCalculation(new Date(), Integer.parseInt(checkcoupon.getExpireMonth())));//过期时间
couponrecord.setQrcode(QrcodeUtil.generateQrcode(no));//生成二维码
couponrecordMapper.save(couponrecord);
}
break;
case 2:
//int number = buyingMedicineNumber(openid);//购买数量
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
default://0张
}
// int number = buyingMedicineNumber(openid);
// if (number == 0) {
//
// }
// Conds couponConds = new Conds();
// couponConds.equal("t.del_flag", Constants.DEL_FLAG_0);
// Map<String, Object> params = new HashMap<>();
// params.put("conds", couponConds);
// couponrecordMapper.fetchSearchByPage(params);
// int number = buyingMedicineNumber(openid);
// if (number >= 3 && number <6) {//赠送第一张券
// Conds couponConds = new Conds();
// couponConds.equal("t.del_flag", Constants.DEL_FLAG_0);
// couponConds.equal("t.type", "1");//第一张券
// couponrecordMapper.f
//
// } else if (number >= 6) {//赠送第二张券
//
// }
return false;
}
@Override
public boolean sendCouponRecord(Long couponId, String openid) {
return false;
}
@Override
public Integer buyingMedicineNumber(String openid) {
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.openid", openid);
conds.equal("d.del_flag", Constants.DEL_FLAG_0);
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
return couponrecordMapper.buyingMedicineNumber(params);
}
/**
* 获取卡券基础信息
* @param type
* @return
*/
public Checkcoupon findCheckCoupon(String type) {
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.type", type);
return checkCoupouService.fetchSearchByConds(conds);
}
/**
* 时间计算
* @param date
* @param number
* @return
*/
public Date dateCalculation(Date date, int number) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, number);
return calendar.getTime();
}
@Override
public JSONObject CheckCouponList(CouponrecordVo vo) {
......@@ -90,4 +262,8 @@ return couponrecordMapper;
}
return rtnJson;
}
/**
* 获取卡券最大失效时间。重新计算
*/
//public Date findMax
}
\ No newline at end of file
......@@ -61,11 +61,12 @@ public class CouponrecordController {
//编辑页面(新增、修改)
@RequiresPermissions(value = COUPONRECORD_VIEW)
@RequestMapping("/form")
public String form(HttpServletRequest request, String id, Model model) {
public String form(HttpServletRequest request, String id, Model model, String pageType) {
if (!StringUtils.isEmpty(id)) {
Couponrecord couponrecord = couponrecordService.fetchById(id);
model.addAttribute("data", couponrecord);
}
model.addAttribute("isView", pageType.equals("View") ? true : false);//是否查看页面
return "couponrecord/couponrecordform";
}
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>aidea-modules</artifactId>
<groupId>com.cftech</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<name>hospital-module-web</name>
<groupId>com.cftech</groupId>
<artifactId>hospital-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>hospital-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>hospital-module-web</finalName>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aidea-modules</artifactId>
<groupId>com.cftech</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hospital-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>waybill-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.cftech.hospital.dao;
import com.cftech.hospital.model.Hospital;
import com.cftech.core.generic.GenericDao;
/**
* 合作医院信息Mapper
*
* @author Strive
* @date: 2021-02-02 11:56
*/
public interface HospitalMapper extends GenericDao<Hospital> {
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cftech.hospital.dao.HospitalMapper">
<resultMap id="resultMap" type="com.cftech.hospital.model.Hospital">
<id column="id" property="id"/>
<result column="number" property="number"/>
<result column="name" property="name"/>
<result column="address" property="address"/>
<result column="telephone" property="telephone"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<result column="remarks" property="remarks"/>
<result column="province" property="province"/>
<result column="city" property="city"/>
<result column="adcode" property="adcode"/>
<result column="reliability" property="reliability"/>
<result column="level" property="level"/>
<result column="org_id" property="orgId"/>
<result column="org_name" property="orgName"/>
<result column="accounts_id" property="accountsId"/>
<result column="del_flag" property="delFlag"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="description" property="description"/>
<result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/>
</resultMap>
<sql id="sqlWhere">
<if test="conds!=null">
<trim prefix="WHERE" prefixOverrides="AND|OR">
<foreach collection="conds.conds" index="index" item="cond">
${cond.linkType}
<if test="cond.condType == 'EQUAL'">${cond.param} = #{cond.value}</if>
<if test="cond.condType == 'NOTEQUAL'">${cond.param} &lt;&gt; #{cond.value}</if>
<if test="cond.condType == 'GREATEQUAL'">${cond.param} &gt;= #{cond.value}</if>
<if test="cond.condType == 'GREATTHAN'">${cond.param} &gt; #{cond.value}</if>
<if test="cond.condType == 'LESSEQUAL'">${cond.param} &lt;= #{cond.value}</if>
<if test="cond.condType == 'LESSTHAN'">${cond.param} &lt; #{cond.value}</if>
<if test="cond.condType == 'BETWEEN'">${cond.param} BETWEEN #{cond.startValue} AND
#{cond.endValue}
</if>
<if test="cond.condType == 'ISNULL'">${cond.param} IS NULL</if>
<if test="cond.condType == 'NOTNULL'">${cond.param} IS NOT NULL</if>
<if test="cond.condType == 'LIKE'">${cond.param} LIKE #{cond.value}</if>
<if test="cond.condType == 'IN'">${cond.param} IN
<foreach item="item" index="index" collection="cond.value" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</foreach>
</trim>
</if>
</sql>
<sql id="sqlColumns">
t.id,
t.number,
t.name,
t.address,
t.telephone,
t.longitude,
t.latitude,
t.remarks,
t.province,
t.city,
t.adcode,
t.reliability,
t.level,
t.org_id,
t.accounts_id,
t.del_flag,
t.status,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
o.org_name
</sql>
<insert id="save" parameterType="com.cftech.hospital.model.Hospital" useGeneratedKeys="true"
keyProperty="id">
insert into t_aidea_hospital
(
<include refid="sqlColumns"/>
)
values
(
#{id, jdbcType=BIGINT},
#{number, jdbcType=VARCHAR},
#{name, jdbcType=VARCHAR},
#{address, jdbcType=VARCHAR},
#{telephone, jdbcType=VARCHAR},
#{longitude, jdbcType=VARCHAR},
#{latitude, jdbcType=VARCHAR},
#{remarks, jdbcType=VARCHAR},
#{province, jdbcType=VARCHAR},
#{city, jdbcType=VARCHAR},
#{adcode, jdbcType=VARCHAR},
#{reliability, jdbcType=VARCHAR},
#{level, jdbcType=VARCHAR},
#{orgId, jdbcType=VARCHAR},
#{accountsId, jdbcType=BIGINT},
#{delFlag, jdbcType=TINYINT},
#{status, jdbcType=VARCHAR},
now(),
now(),
#{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}
)
</insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_hospital t
LEFT JOIN t_orgunit o ON o.id = t.org_id AND o.del_flag = 0
WHERE t.id=#{id}
</select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_hospital t
<include refid="sqlWhere"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_hospital t
LEFT JOIN t_orgunit o ON o.id = t.org_id AND o.del_flag = 0
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<update id="update" parameterType="com.cftech.hospital.model.Hospital">
update t_aidea_hospital
<set>
<if test="id != null">
id = #{id, jdbcType=BIGINT},
</if>
<if test="number != null">
number = #{number, jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name, jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address, jdbcType=VARCHAR},
</if>
<if test="telephone != null">
telephone = #{telephone, jdbcType=VARCHAR},
</if>
<if test="longitude != null">
longitude = #{longitude, jdbcType=VARCHAR},
</if>
<if test="latitude != null">
latitude = #{latitude, jdbcType=VARCHAR},
</if>
<if test="remarks != null">
remarks = #{remarks, jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province, jdbcType=VARCHAR},
</if>
<if test="city != null">
city = #{city, jdbcType=VARCHAR},
</if>
<if test="adcode != null">
adcode = #{adcode, jdbcType=VARCHAR},
</if>
<if test="reliability != null">
reliability = #{reliability, jdbcType=VARCHAR},
</if>
<if test="level != null">
level = #{level, jdbcType=VARCHAR},
</if>
<if test="orgId != null">
org_id = #{orgId, jdbcType=VARCHAR},
</if>
<if test="accountsId != null">
accounts_id = #{accountsId, jdbcType=BIGINT},
</if>
<if test="delFlag != null">
del_flag = #{delFlag, jdbcType=TINYINT},
</if>
<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>
<if test="createBy != null">
create_by = #{createBy, jdbcType=BIGINT},
</if>
<if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
<update id="delete" parameterType="java.lang.Long">
update t_aidea_hospital
set del_flag=1
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
package com.cftech.hospital.model;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 合作医院信息
*
* @author Strive
* @date: 2021-02-02 11:56
*/
@Data
public class Hospital implements Serializable {
/* 主键id */
private Long id;
/* 编码 */
@ExportConfig(value = "编码", width = 100, showLevel = 1)
private String number;
/* 医院名称 */
@ExportConfig(value = "医院名称", width = 100)
private String name;
/* 地址 */
@ExportConfig(value = "地址", width = 100)
private String address;
/* 联系方式 */
@ExportConfig(value = "联系方式", width = 100)
private String telephone;
/* 备注 */
@ExportConfig(value = "备注", width = 100)
private String remarks;
/* 经度 */
@ExportConfig(value = "经度", width = 100, showLevel = 1)
private String longitude;
/* 纬度 */
@ExportConfig(value = "纬度", width = 100, showLevel = 1)
private String latitude;
/* 检测结果 */
@ExportConfig(value = "省份", width = 100, showLevel = 1)
private String province;
/* 试剂盒检测下限 */
@ExportConfig(value = "城市", width = 100, showLevel = 1)
private String city;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
private String status;
/* 创建时间 */
private Date createTime;
/* 更新时间 */
private Date updateTime;
/* 备注 */
private String description;
/* 创建人 */
private Long createBy;
/* 更新人 */
private Long updateBy;
private String adcode;//行政区划代码
private String reliability;//可信度参考:值范围 1 <低可信> - 10 <高可信>
private String level;//解析精度级别,分为11个级别,一般>=9即可采用(定位到点,精度较高)
private String orgId;//组织id
@ExportConfig(value = "组织编码", width = 100, showLevel = 2)
private String orgCode;
@ExportConfig(value = "组织名称", width = 100, showLevel = 1)
private String orgName;//组织名称
public Hospital() {
this.delFlag = false;
this.status = "0";
}
}
\ No newline at end of file
package com.cftech.hospital.service;
import com.cftech.hospital.model.Hospital;
import com.cftech.core.generic.GenericService;
/**
* 合作医院信息Service
*
* @author Strive
* @date: 2021-02-02 11:56
*/
public interface HospitalService extends GenericService<Hospital> {
}
package com.cftech.hospital.service.impl;
import com.cftech.hospital.model.Hospital;
import com.cftech.hospital.dao.HospitalMapper;
import com.cftech.hospital.service.HospitalService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
/**
* 合作医院信息ServiceImpl
*
* @author Strive
* @date: 2021-02-02 11:56
*/
@Service("hospitalService")
public class HospitalServiceImpl extends GenericServiceImpl<Hospital> implements HospitalService {
@Autowired
@Qualifier("hospitalMapper")
private HospitalMapper hospitalMapper;
@Override
public GenericDao<Hospital> getGenericMapper() {
return hospitalMapper;
}
}
\ No newline at end of file
package com.cftech.hospital.util;
import com.alibaba.fastjson.JSONObject;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.pay.HashKit;
import com.cftech.waybill.utils.CloseableHttpEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
/**
* @Creator Strive
* @Date 2021/02/03
*/
@Slf4j
public class TxMapUtils {
private static Map<String, String> headers = new HashMap<>();
private static RequestConfig requestConfig = null;
static {
requestConfig = RequestConfig.custom()
.setSocketTimeout(60000)//连接时间
.setConnectTimeout(60000)//超时时间
.setConnectionRequestTimeout(60000)
.build();
//headers.put("Accept", "application/x-www-form-urlencoded;charset=UTF-8");
headers.put("Content-Type", "application/json;charset=UTF-8");
}
private static String ADDRESS_RESOLVE = SystemConfig.p.getProperty("map.ads_resolve");
//private static String ADDRESS_RESOLVE = "https://apis.map.qq.com/ws/geocoder/v1/?address=${address}";
private static String DOMAIN_NAME = SystemConfig.p.getProperty("map.domain_name");
//private static String DOMAIN_NAME = "apis.map.qq.com";
private static String KEY = SystemConfig.p.getProperty("map.key");
//private static String KEY = "OPIBZ-VYIW2-CK7UO-CM4WN-ELY2K-EUFYP";
private static String SECERT_KEY = SystemConfig.p.getProperty("map.secret_key");
//private static String SECERT_KEY = "W1je0RfMuDsfxCy73M0b3iEfZRF5cAcU";
private static String getParamsSort(String url) {
if (!url.contains("?") || !url.contains("=")) {
return null;
}
String[] arr = null;
//获取get请求参数部分
String params = url.split("\\?")[1];
//将参数封装进map
if (!url.contains("&")) {
arr = new String[]{params};
} else {
arr = params.split("&");
}
TreeMap<String, String> map = new TreeMap<>();
for (String str: arr) {
if (StringUtils.isBlank(str) || !url.contains("="))
continue;
map.put(str.split("=")[0], str.split("=")[1]);
}
StringBuffer retStr = new StringBuffer();
for (Map.Entry<String, String> s : map.entrySet()) {
String key = s.getKey();
String value = s.getValue();
if (StringUtils.isBlank(value)) {
continue;
}
retStr.append(key).append("=").append(value).append("&");
}
String str = retStr.substring(0, retStr.length()-1);
return str;
}
/**
* GET请求根据url排序
* @return
*/
public static CloseableHttpEntity sendHttpGet(String address) {
String domain = ADDRESS_RESOLVE.split("\\?")[0];
String path = domain.split(DOMAIN_NAME)[1];
String url = ADDRESS_RESOLVE.replace("${address}", address) + "&key=" + KEY;
//生成签名
String md5Str = HashKit.md5(path + "?" + getParamsSort(url) + SECERT_KEY).toLowerCase();
url = url + "&sig=" + md5Str;
CloseableHttpClient httpClient = null;
CloseableHttpResponse httpResponse = null;
try {
httpClient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(url);
httpGet.setConfig(requestConfig);
for (Map.Entry<String, String> entry : headers.entrySet()) {
httpGet.setHeader(entry.getKey(), entry.getValue());
}
httpResponse = httpClient.execute(httpGet);
InputStream inputStream = httpResponse.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
StringBuilder strber = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
strber.append(line);
}
reader.close();
inputStream.close();
log.info(strber.toString());
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), strber == null ? null : JSONObject.parseObject(strber.toString()));
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (httpClient != null) {
try {
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (httpResponse != null) {
try {
httpResponse.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return null;
}
public static void main(String[] args) {
sendHttpGet("上海市徐汇区漕河泾新兴技术开发区钦州北路1198号智慧园88号楼5层");
}
}
......@@ -50,7 +50,6 @@ public class WechatPayUtils {
return UUID.randomUUID().toString().replace("-", "");
}
/**
* 生成签名
* @param params
......
......@@ -44,6 +44,8 @@
<module>couponrecord-module-web</module>
<module>checkresult-module</module>
<module>checkresult-module-web</module>
<module>hospital-module</module>
<module>hospital-module-web</module>
</modules>
<dependencies>
......
......@@ -67,6 +67,7 @@ public class FqHttpUtils {
/**
* 服务端发送http get请求
*
* @param url
* @return
*/
......@@ -100,7 +101,7 @@ public class FqHttpUtils {
reader.close();
inputStream.close();
log.info(strber.toString());
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), strber == null? null:JSONObject.parseObject(strber.toString()));
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), strber == null ? null : JSONObject.parseObject(strber.toString()));
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
......@@ -151,7 +152,7 @@ public class FqHttpUtils {
if (entity != null) {
String result = EntityUtils.toString(entity, CHARACTER_CODE_UTF8);
log.info(result);
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), result == null? null:JSONObject.parseObject(result));
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), result == null ? null : JSONObject.parseObject(result));
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
......@@ -210,23 +211,23 @@ public class FqHttpUtils {
String result = EntityUtils.toString(entity, CHARACTER_CODE_UTF8);
System.out.println(result);
log.info(result);
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), result == null? null:JSONObject.parseObject(result));
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), result == null ? null : JSONObject.parseObject(result));
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
log.error("API HTTP POST UnsupportedEncodingException 请求异常 url={" + url + "}; error = " +e.getMessage() );
log.error("API HTTP POST UnsupportedEncodingException 请求异常 url={" + url + "}; error = " + e.getMessage());
} catch (IOException e) {
e.printStackTrace();
log.error("API HTTP POST IOException 请求异常 url={" + url + "}; error = " +e.getMessage() );
log.error("API HTTP POST IOException 请求异常 url={" + url + "}; error = " + e.getMessage());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
log.error("API HTTP POST NoSuchAlgorithmException 请求异常 url={" + url + "}; error = " +e.getMessage() );
log.error("API HTTP POST NoSuchAlgorithmException 请求异常 url={" + url + "}; error = " + e.getMessage());
} catch (KeyStoreException e) {
e.printStackTrace();
log.error("API HTTP POST KeyStoreException 请求异常 url={" + url + "}; error = " +e.getMessage() );
log.error("API HTTP POST KeyStoreException 请求异常 url={" + url + "}; error = " + e.getMessage());
} catch (KeyManagementException e) {
e.printStackTrace();
log.error("API HTTP POST KeyManagementException 请求异常 url={" + url + "}; error = " +e.getMessage() );
log.error("API HTTP POST KeyManagementException 请求异常 url={" + url + "}; error = " + e.getMessage());
} finally {
if (httpClient != null) {
try {
......@@ -247,7 +248,7 @@ public class FqHttpUtils {
}
public static String generateUUID() {
return UUID.randomUUID().toString().replaceAll("-","");
return UUID.randomUUID().toString().replaceAll("-", "");
}
public static void main(String[] args) {
......
##JDBC Global Setting
#\u5916\u7F51
jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://58.220.99.124:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
#jdbc.username=root
#jdbc.password=Aidea@2017
#\u5185\u7F51
jdbc.url=jdbc:mysql://172.18.10.40:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
jdbc.url=jdbc:mysql://58.220.99.124:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
jdbc.username=root
jdbc.password=Aidea@2017
#\u5185\u7F51
#jdbc.url=jdbc:mysql://172.18.10.40:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
#jdbc.username=root
#jdbc.password=Aidea@2017
##DataSource Global Setting
......
......@@ -107,3 +107,13 @@ mch.secret_key=4bcd5546d65f4d88bf1ba549436e0e9f
mch.notify_url=https://pd.shxrtech.com/aidea/mobile/auth/order/wechatCallback
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898
mch.title=\u8BFA\u5EB7\u5927\u836F\u623F\u54A8\u8BE2\u5E73\u53F0
#\u817E\u8BAFMAP\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
#\u63A5\u53E3\u5730\u5740\u57DF\u540D
map.domain_name=apis.map.qq.com
#\u5730\u5740\u89E3\u6790\u63A5\u53E3
map.ads_resolve=https://apis.map.qq.com/ws/geocoder/v1/?address=${address}
#\u5F00\u53D1\u8005\u5BC6\u94A5
map.key=OPIBZ-VYIW2-CK7UO-CM4WN-ELY2K-EUFYP
#\u7B7E\u540D\u5BC6\u94A5
map.secret_key=W1je0RfMuDsfxCy73M0b3iEfZRF5cAcU
......@@ -2,9 +2,9 @@
# Redis\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u012C\uFFFD\uFFFD\u03AA0\uFFFD\uFFFD
spring.redis.database=10
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7
#spring.redis.host=58.220.99.124
spring.redis.host=58.220.99.124
# \u5185\u7F51Reids
spring.redis.host=172.18.10.44
#spring.redis.host=172.18.10.44
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04F6\u02FF\uFFFD
spring.redis.port=6379
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uB8E8\u012C\uFFFD\uFFFD\u03AA\uFFFD\u0563\uFFFD
......
......@@ -340,6 +340,12 @@
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>hospital-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<finalName>portal-web</finalName>
......
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