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

Submit by Strive

Submit Date 2021/02/25
parent a0367b59
......@@ -83,7 +83,15 @@
maxlength="500" placeholder="name"
value="$!{data.name}"
>
</div>
<div class="form-group form-md-line-input">
<label>患者类型</label>
<select id="status" name="status" class="form-control required">
<option value="">请选择患者类型</option>
<option value="0" #if($!{data.status}=='0') selected="selected" #end>三期患者</option>
<option value="1" #if($!{data.status}=='1') selected="selected" #end>四期患者</option>
</select>
</div>
<div class="form-group form-md-line-input">
......
package com.cftech.checkcoupon.utils;
import com.cftech.core.util.SystemConfig;
import lombok.extern.slf4j.Slf4j;
import javax.imageio.ImageIO;
......@@ -35,7 +36,7 @@ public class LogoConfig {
/**
* 读取Logo图片
*/
BufferedImage logo = ImageIO.read(new File("E:\\logo.png"));
BufferedImage logo = ImageIO.read(new File(SystemConfig.p.getProperty("userfiles.qrcodedir") + File.separator + "logo.png"));
//开始绘制图片
g2.drawImage(logo, matrixWidth / 5 * 2, matrixHeigh / 5 * 2, matrixWidth / 5, matrixHeigh / 5, null);//绘制
......
......@@ -14,6 +14,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Hashtable;
import java.util.UUID;
/**
* @CreateBy Strive
......@@ -30,6 +31,10 @@ public class QrcodeUtil {
private static String QRCODE_DIR = SystemConfig.p.getProperty("userfiles.qrcodedir");
private static String QECODE_URL = SystemConfig.p.getProperty("QRCODEURL");
private static String DOMAIN_NAME = SystemConfig.p.getProperty("QY_DOMAIN");
/**
* 对应卡券编码
*
......@@ -39,6 +44,7 @@ public class QrcodeUtil {
* @throws IOException
*/
public static String generateQrcode(String contents) throws WriterException, IOException {
//contents = UUID.randomUUID().toString().replace("-", "");
Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
......@@ -54,18 +60,17 @@ public class QrcodeUtil {
hints);//生成条形码时的一些配置,此项可选
//文件夹
String path = QRCODE_DIR + File.separator + DateFormatUtils.getDateFormat(new Date(), "yyyyMMdd");
String path = QRCODE_DIR;
File file = new File(path);
if (!file.exists()) {
file.mkdirs();
}
String mediaPath = path + File.separator + contents + "." + LOGO_FORMAT;
String mediaPath = contents + "." + LOGO_FORMAT;
//生成对应文件
File outputFile = new File(path + File.separator + contents + "." + LOGO_FORMAT);
if (MatrixToImageWriter.writeToFile(bitMatrix, LOGO_FORMAT, outputFile, true)) {
return mediaPath;
return DOMAIN_NAME + QECODE_URL.replace("{PICFILENAME}", mediaPath);
}
return null;
}
......
......@@ -97,7 +97,7 @@
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择审核状态</option>
<option value="0">待审核</option>
<option value="0" selected>待审核</option>
<option value="1">已通过</option>
<option value="2">已拒绝</option>
</select>
......@@ -341,7 +341,7 @@
'targets': [0],
},
{
width: "100px",
"width": "100px",
"aTargets": [1],
"mData": "consultId",
"mRender": function (a, b, c, d) {
......@@ -435,10 +435,12 @@
"aTargets": [6],
"mData": "isThree",
"mRender": function (a, b, c, d) {
if (a == '1') {
return '是';
} else if (a == '0') {
return '否';
if (a == '0') {
return '三期';
} else if (a == '1') {
return '四期';
} else {
return '';
}
}
......
......@@ -216,7 +216,7 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT
<include refid="sqlColumns"/>,
o.number orderCode, CASE WHEN au.name IS NOT NULL THEN 1 ELSE 0 END isThree,
o.number orderCode, au.status isThree,
CASE WHEN o.status = '2' OR o.status = '3' OR o.status = '4' THEN 1 ELSE 0 END isSales,
f.store fansAlias
FROM t_aidea_consult_sheet a
......
......@@ -23,6 +23,8 @@ import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.member.service.MemberService;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
......@@ -52,6 +54,9 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
@Autowired
private MpAccountsService mpAccountsService;
@Autowired
private MpFanssService mpFanssService;
@Autowired
private OrderService orderService;
......@@ -185,7 +190,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
conds.equal("o.openid", openid);
conds.in("o.status", new String[]{"4"});// 4:已成交
Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> orders = orderService.fetchSearchBy(conds, sort, 0, 0, null);
List<Order> orders = orderService.fetchSearchBy(conds, sort, 0, 0, null, "0", "0");
if (orders != null && orders.size() > 0 && orders.get(0) != null) { //复购
Order order = orders.get(0);
......@@ -315,10 +320,20 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
String nickname = "";
String fansAlias = "";
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
MpFanssEntity mpFanssEntity = mpFanssService.getWxUser(consultSheet.getOpenId());
if (mpFanssEntity != null) {
nickname = mpFanssEntity.getNickname();
fansAlias = mpFanssEntity.getStore();
}
}
//推送客服消息
String msg = null;
Qyuser service = qyuserService.fetchById(consultSheet.getServiceId());
msg = SystemConfig.p.getProperty("QY_SEND_CUSTOMERSERVICE_MSG") + consultSheet.getConsultId();
msg = SystemConfig.p.getProperty("QY_SEND_CUSTOMERSERVICE_MSG").replace("{NUMBER}", consultSheet.getConsultId()).replace("{NICKNAME}", nickname).replace("{FANSALIAS}", fansAlias);
List<Qyuser> serviceUsers = new ArrayList();
serviceUsers.add(service);
JSONObject result = qyMsgUtil.sendText(accounts, false, serviceUsers, null, null,
......@@ -326,7 +341,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
log.info("客服,消息发送日志 {}", result.toString());
Qyuser doctor = qyuserService.fetchById(consultSheet.getDoctorId());
msg = SystemConfig.p.getProperty("QY_SEND_DOCTOR_MSG") + consultSheet.getConsultId();
msg = SystemConfig.p.getProperty("QY_SEND_DOCTOR_MSG").replace("{NUMBER}", consultSheet.getConsultId()).replace("{NICKNAME}", nickname).replace("{FANSALIAS}", fansAlias);
List<Qyuser> doctorUsers = new ArrayList();
doctorUsers.add(doctor);
qyMsgUtil.sendText(accounts, false, doctorUsers, null, null,
......
......@@ -197,7 +197,7 @@ public class ConsultSheetController {
conds.like("f.store", consultSheet.getFansAlias());
}
if (StringUtils.equals(consultSheet.getIsThree(), "3")) {
conds.notNull("au.name");
conds.equal("au.status", "0");
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
......
......@@ -180,7 +180,7 @@
}
var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input").each(function () {
$("#seachTableForm select,input").each(function () {
var params = {
name: $(this).attr("name"),
value: $(this).val()
......
......@@ -60,13 +60,15 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
List<Couponrecord> couponrecordList = findCouponrecordBySort(null);
int number = 0;
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
if (couponrecordList.size() == 0) {//第一次赠券
number = buyingMedicineNumber(openid, null);//购买数量
if (number >= 3) {//赠送第一张
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(codingruleUtils.getNumber(accountId, Couponrecord.class.getName()));
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear("1");
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
......@@ -81,11 +83,12 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
couponrecordMapper.save(couponrecord);
}
if (number >= 6) {//赠送第二张
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
//获取张券
Couponrecord couponrecord_one = findCouponrecordBySort("1").get(0);
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(codingruleUtils.getNumber(accountId, Couponrecord.class.getName()));
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear("1");
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
......@@ -105,8 +108,9 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
number = buyingMedicineNumber(openid, couponrecordMax.getTakeEffectDate());//获取最后一张券购买数量
if (number >= 3) {//赠送第一张
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(codingruleUtils.getNumber(accountId, Couponrecord.class.getName()));
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear((Integer.parseInt(couponrecordMax.getTakeEffectYear()) + 1) + "");
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
......@@ -123,9 +127,10 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
if (number >= 6) {//赠送第二张
//获取第一张券
Couponrecord couponrecord_one = findCouponrecordBySort("1").get(0);
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(codingruleUtils.getNumber(accountId, Couponrecord.class.getName()));
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear((Integer.parseInt(couponrecordMax.getTakeEffectYear()) + 1) + "");
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
......@@ -148,8 +153,10 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
//获取第一张券
Couponrecord couponrecord_one = findCouponrecordBySort("1").get(0);
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(codingruleUtils.getNumber(accountId, Couponrecord.class.getName()));
couponrecord.setNumber(no);
couponrecord.setTakeEffectYear(couponrecordMax.getTakeEffectYear());
couponrecord.setTakeEffectMonth(checkcoupon.getTakeEffectMonth());
couponrecord.setExpireMonth(checkcoupon.getExpireMonth());
......
......@@ -56,12 +56,12 @@
<section class="content-header">
<h1>
合作医院信息管理
<small>合作医院信息</small>
采血医院信息管理
<small>采血医院信息</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li>
<li><a class="active">合作医院信息</a></li>
<li><a class="active">采血医院信息</a></li>
</ol>
</section>
......
......@@ -60,12 +60,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>
......@@ -80,7 +80,7 @@
<div class="col-xs-2">
<input type="text" class="form-control"
name="name" placeholder="合作医院名称">
name="name" placeholder="采血医院名称">
</div>
<div class="col-xs-5">
......@@ -325,7 +325,7 @@
var templateExcelUrl = "#springUrl('/a/hospital/templateExcel')";
var importExcelUrl = "#springUrl('/a/hospital/importExcel')?_csrfheader=" + csrfheader.value + "&_csrf=" + csrftoken.value;
Cfapp.importExcel({
title: '合作医院信息导入',
title: '采血医院信息导入',
importurl: importExcelUrl,
templateurl: templateExcelUrl,
cancel: function () {
......
......@@ -17,47 +17,48 @@ import org.springframework.stereotype.Service;
import java.util.*;
/**
* 合作医院信息ServiceImpl
*
* @author Strive
* @date: 2021-02-02 11:56
*/
* 合作医院信息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;
@Autowired
@Qualifier("hospitalMapper")
private HospitalMapper hospitalMapper;
@Override
public GenericDao<Hospital> getGenericMapper() {
return hospitalMapper;
}
@Override
public JSONObject hospitalList(HospitalVo vo){
public GenericDao<Hospital> getGenericMapper() {
return hospitalMapper;
}
@Override
public JSONObject hospitalList(HospitalVo vo) {
JSONObject rtnJson = new JSONObject();
String lat = vo.getLatitude();
String lng = vo.getLongitude();
double lattarget = Double.valueOf(lat);
String lat = vo.getLatitude();
String lng = vo.getLongitude();
double lattarget = Double.valueOf(lat);
double lngtarget = Double.valueOf(lng);
// double lattarget = Double.valueOf("32.0572355");
// double lngtarget = Double.valueOf("118.77807441");
// double lattarget = Double.valueOf("32.0572355");
// double lngtarget = Double.valueOf("118.77807441");
try {
List<Map<String,Object>> list = hospitalMapper.hospitalList(vo);
if (list != null&&list.size()>0) {
Map<Double,Map> resultMap = new HashMap<Double,Map>();
double [] a=new double [list.size()];
for (Map<String,Object> map : list) {
double lat2 = Double.valueOf(map.get("latitude")+"");
double lng2 = Double.valueOf(map.get("longitude")+"");
double distance= TxMapUtils. getDistance(lattarget,lngtarget,lat2,lng2);
a[list.indexOf(map)]=distance;
map.put("distance",(double)Math.round(distance*100)/100);
resultMap.put(distance,map);
List<Map<String, Object>> list = hospitalMapper.hospitalList(vo);
if (list != null && list.size() > 0) {
Map<Double, Map> resultMap = new HashMap<Double, Map>();
double[] a = new double[list.size()];
for (Map<String, Object> map : list) {
double lat2 = Double.valueOf(map.get("latitude") + "");
double lng2 = Double.valueOf(map.get("longitude") + "");
double distance = TxMapUtils.getDistance(lattarget, lngtarget, lat2, lng2);
a[list.indexOf(map)] = distance;
map.put("distance", (double) Math.round(distance * 100) / 100);
resultMap.put(distance, map);
}
Arrays.sort(a);
List<Map<String,Object>> reltlist = new ArrayList<Map<String,Object>>();
for (int i=0;i<a.length;i++){
List<Map<String, Object>> reltlist = new ArrayList<Map<String, Object>>();
for (int i = 0; i < a.length; i++) {
reltlist.add(resultMap.get(a[i]));
}
rtnJson.put("errorCode", 0);
......@@ -75,10 +76,10 @@ return hospitalMapper;
}
@Override
public JSONObject getHospitalDetailsById(HospitalVo vo){
public JSONObject getHospitalDetailsById(HospitalVo vo) {
JSONObject rtnJson = new JSONObject();
try {
Hospital info = hospitalMapper.fetchById(vo.getId());
Hospital info = hospitalMapper.fetchById(vo.getId());
if (info != null) {
rtnJson.put("errorCode", 0);
rtnJson.put("data", info);
......
......@@ -28,6 +28,7 @@
<result column="number" property="number"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/>
<result column="aliasName" property="aliasName"/>
</resultMap>
<resultMap id="resultMapDetail" type="com.cftech.invoice.model.InvoiceDetail">
......@@ -152,15 +153,41 @@
</select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_invoice
SELECT COUNT(1) FROM t_aidea_invoice t
<include refid="sqlWhere"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_invoice
t.id,
t.number,
t.invoice_title,
t.invoice_content,
t.unit_tax_number,
t.invoice_type,
t.invoice_form,
t.clerk_id,
t.order_id,
t.push_mode,
t.email,
t.invoice_serial_num,
t.product_id,
t.accounts_id,
t.del_flag,
t.status,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
t.operator,
t.open_id,
t.invoice_code,
t.invoice_num,
f.store aliasName
FROM t_aidea_invoice t
LEFT JOIN wx_mp_fanss f ON t.open_id = f.openid AND f. delflag = '0'
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......
......@@ -85,6 +85,8 @@ public class Invoice implements Serializable {
//发票号码
private String invoiceNum;
private String aliasName;
public Invoice() {
this.delFlag = false;
this.status = "0";
......
......@@ -10,11 +10,11 @@ import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
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;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
......@@ -119,12 +119,17 @@ public class InvoiceController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, Invoice invoice, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountsId);
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.accounts_id", accountsId);
if (!StringUtils.isEmpty(invoice.getInvoiceTitle())){
conds.like("invoice_title",invoice.getInvoiceTitle());
conds.like("t.invoice_title", invoice.getInvoiceTitle());
}
Sort sort = new Sort("create_time", OrderType.DESC);
if (StringUtils.isNoneBlank(invoice.getOrderId())) {
conds.like("t.order_id", invoice.getOrderId());
}
Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Invoice> list = invoiceService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = invoiceService.count(conds);
......@@ -157,10 +162,10 @@ public class InvoiceController {
Sort sort = new Sort("create_time", OrderType.ASC);
Conds conds = new Conds();
if (!StringUtils.isEmpty(invoice.getInvoiceTitle())){
conds.like("invoice_title",invoice.getInvoiceTitle());
conds.like("t.invoice_title",invoice.getInvoiceTitle());
}
conds.equal("del_flag", 0);
conds.equal("accounts_id", accountId);
conds.equal("t.del_flag", 0);
conds.equal("t.accounts_id", accountId);
List<Invoice> list = invoiceService.fetchSearchByPage(conds, sort, 0, 0);
if (list.size() > 0){
for (Invoice invoiceObj : list) {
......@@ -186,7 +191,7 @@ public class InvoiceController {
if (file == null) {
return list(request, model);
}
// 构造临时路径来存储上传的文件
// 构造临时路径来存储上传的文件
String uploadPath = System.getProperty("java.io.tmpdir");
File uploadDir = new File(uploadPath);
if (!uploadDir.exists()) {
......
......@@ -243,7 +243,7 @@
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:logistics:view"))';
html += '<div class="btn-group" style="min-width: 100px;">\n' +
'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
//'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
......
......@@ -102,10 +102,10 @@
<div class="form-group form-md-line-input col-xs-6">
<label>商品名称<font style="color: red"></font></label>
<input type="text"
class="form-control" name="productName"
id="productName" readonly="readonly"
class="form-control" name="drugsName"
id="drugsName" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.productName}"
value="$!{data.drugsName}"
></div>
<div class="form-group form-md-line-input col-xs-6">
<label>商品价格<font style="color: red"></font></label>
......
......@@ -225,7 +225,7 @@
"mData": "drugsCode"
},
{
"mData": "productName"
"mData": "drugsName"
},
{
"mData": "price"
......@@ -270,7 +270,7 @@
}
},{
"aTargets": [3],
"mData": "productName",
"mData": "drugsName",
"mRender": function (a, b, c, d) {
return a;
......
......@@ -57,12 +57,12 @@ public class OrderDetailsController {
//列表页面
@RequiresPermissions(value = ORDERDETAILS_VIEW)
@RequestMapping("/list")
public String list(HttpServletRequest request, Model model,Long id) {
public String list(HttpServletRequest request, Model model, Long id) {
Long accountId = UserUtils.getmpaccounts(request);
model.addAttribute("accountId", accountId);
model.addAttribute("id",id);
if(id==null){
model.addAttribute("isDetail",'N');
model.addAttribute("id", id);
if (id == null) {
model.addAttribute("isDetail", 'N');
}
return "orderDetails/orderDetailslist";
}
......@@ -110,7 +110,7 @@ public class OrderDetailsController {
@RequiresPermissions(value = ORDERDETAILS_VIEW)
@RequestMapping(value = "/listData")
@ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, OrderDetails orderDetails,Long idTmp, HttpServletRequest request) {
public JSONObject listData(int iDisplayStart, int iDisplayLength, OrderDetails orderDetails, Long idTmp, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
String userId = String.valueOf(UserUtils.getUser().getId());
......@@ -122,13 +122,13 @@ public class OrderDetailsController {
conds.like("o.number", orderDetails.getOrderCode());
if (StringUtils.isNoneBlank(orderDetails.getProductName()))
conds.like("t.product_name", orderDetails.getProductName());
if (idTmp!=null && !"".equals(idTmp)){
conds.equal("d.order_id",idTmp);
if (idTmp != null && !"".equals(idTmp)) {
conds.equal("d.order_id", idTmp);
}
Sort sort = new Sort("d.create_time", OrderType.DESC);
List<OrderDetails> list = orderDetailsService.fetchSearchByPageByUser(userId, conds, sort, iDisplayStart, iDisplayLength,idTmp);
List<OrderDetails> list = orderDetailsService.fetchSearchByPageByUser(userId, conds, sort, iDisplayStart, iDisplayLength, idTmp);
Integer counts = orderDetailsService.count(conds);
JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts);
......@@ -172,10 +172,10 @@ public class OrderDetailsController {
@RequestMapping("/importExcel")
@RequiresPermissions(value = ORDERDETAILS_EDIT)
public String importExcel(HttpServletRequest request, MultipartFile file, Model model,Long id) {
public String importExcel(HttpServletRequest request, MultipartFile file, Model model, Long id) {
Long accountId = UserUtils.getmpaccounts(request);
if (file == null) {
return list(request, model,id);
return list(request, model, id);
}
// 构造临时路径来存储上传的文件
String uploadPath = System.getProperty("java.io.tmpdir");
......@@ -199,7 +199,7 @@ public class OrderDetailsController {
log.error(e.getMessage());
}
return list(request, model,id);
return list(request, model, id);
}
}
......@@ -147,6 +147,16 @@
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>openid<font style="color: red"></font></label>
<input type="text"
class="form-control" name="openid"
id="openid" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.openid}"
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>创建时间<font style="color: red"></font></label>
<input type="text"
......@@ -158,12 +168,52 @@
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>openid<font style="color: red"></font></label>
<label>确认时间<font style="color: red"></font></label>
<input type="text"
class="form-control" name="openid"
id="openid" readonly="readonly"
class="form-control" name="orderTime"
id="orderTime" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.openid}"
value="$!{data.orderTime}"
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>付款时间<font style="color: red"></font></label>
<input type="text"
class="form-control" name="payTime"
id="payTime" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.payTime}"
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>发货时间<font style="color: red"></font></label>
<input type="text"
class="form-control" name="sendExpressDate"
id="sendExpressDate" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.sendExpressDate}"
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>签收时间<font style="color: red"></font></label>
<input type="text"
class="form-control" name="acceptExpressDate"
id="acceptExpressDate" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.acceptExpressDate}"
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>取消时间<font style="color: red"></font></label>
<input type="text"
class="form-control" name="cancelTime"
id="cancelTime" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.cancelTime}"
>
</div>
......@@ -177,7 +227,7 @@
>
</div>
<div class="form-group form-md-line-input col-xs-8">
<div class="form-group form-md-line-input col-xs-5">
<label>订单取消原因<font style="color: red"></font></label>
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3"
readonly>$!{data.orderCancel}</textarea>
......@@ -505,6 +555,7 @@
$(".translate").each(function (index, item) {
const idDetail = $(item).find('[name="idDetail"]').val()
const productId = $(item).find('[name="releas"]').val()
const productName = $(item).find('[name="releas"]').select2("data")[0].text;
const drugsNum = $(item).find('[name="listHtml"]').val()
const price = $(item).find('[name="htmlPrice"]').val()
const amount = $(item).find('[name="htmlAmount"]').val()
......@@ -522,6 +573,7 @@
id: id,
idDetail: idDetail,
productId: productId,
productName: productName,
drugsNum: drugsNum,
price: price,
amount: amount,
......
......@@ -176,26 +176,50 @@
<input type="text" class="form-control"
name="courierNumber" placeholder="顺丰运单号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="startOrderAmount" placeholder="订单金额开始区间">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="endOrderAmount" placeholder="订单金额结束区间">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="startPayAmount" placeholder="付款金额开始区间">
<select id="startOrderAmount" name="startOrderAmount" class="form-control required">
<option value="">请选择订单金额</option>
<option value="1">1盒</option>
<option value="2">2盒</option>
<option value="3">3盒</option>
<option value="6">6盒</option>
</select>
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="endPayAmount" placeholder="付款金额结束区间">
<select id="startPayAmount" name="startPayAmount" class="form-control required">
<option value="">请选择付款金额</option>
<option value="1">1盒</option>
<option value="2">2盒</option>
<option value="3">3盒</option>
<option value="6">6盒</option>
</select>
</div>
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="startOrderAmount" placeholder="订单金额开始区间">-->
<!-- </div>-->
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="endOrderAmount" placeholder="订单金额结束区间">-->
<!-- </div>-->
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="startPayAmount" placeholder="付款金额开始区间">-->
<!-- </div>-->
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="endPayAmount" placeholder="付款金额结束区间">-->
<!-- </div>-->
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option>
<option value="0">待确认</option>
<option value="0" selected>待确认</option>
<option value="1">待付款</option>
<option value="2">待发货</option>
<option value="3">待收货</option>
......@@ -322,6 +346,7 @@
<script>
var csrf = '${_csrf.token}';
var csrf_header = '${_csrf.headerName}';
var defaultStatus = true;
//咨询单列表通过订单编码跳转单条订单信息
var orderCode = `${orderCode}`;
......@@ -357,9 +382,19 @@
name: $(this).attr("name"),
value: $(this).val()
};
aoData.push(params);
});
// if (defaultStatus) {
// aoData.push({
// name: "isFirst",
// value: defaultStatus
// });
// defaultStatus = false;
// }
$.ajax({
"type": "GET",
"url": sSource,
......@@ -380,9 +415,10 @@
"sAjaxSource": sSource,
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"autowidth": true,
"autoWidth": true,
"scrollX": true,
"sScrollY": false,
"rowCallback": RowCallBack,
"aoColumns": [
{
"mData": "id"
......@@ -621,7 +657,13 @@
"aTargets": [11],
"mData": "isThree",
"mRender": function (a, b, c, d) {
return a == '0' ? '否':'是';
if (a == '0') {
return '三期';
} else if (a == '1') {
return '四期';
} else {
return '';
}
}
}
,
......@@ -695,13 +737,13 @@
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))';
html += '<div class="btn-group" style="min-width: 100px;">\n' +
'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
// '<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
'</button>\n' +
'<ul class="dropdown-menu" role="menu" style="min-width: 100px;">\n';
html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看清单明细</a></li>';
//html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看清单明细</a></li>';
if (c.status == '0') {
html += '<li><a href="#springUrl("/a/order/form?pageType=Edit&id=' + a + '")">订单确认</a></li>';
}
......@@ -714,9 +756,9 @@
if (c.status != '4' && c.status != '5') {
html += '<li><a onclick="showModal(' + a + ')">订单关闭</a></li>';
}
if (c.status == '1' || c.status == '2') {
html += '<li><a onclick="showRemindModal(' + a + ')">修改发货地址</a></li>';
}
// if (c.status == '1' || c.status == '2') {
// html += '<li><a onclick="showRemindModal(' + a + ')">修改发货地址</a></li>';
// }
if (c.status != '0') {//待付款可复制链接
html += '<li><a onclick="copyPayLink(`' + c.payUrl + '`)">复制链接</a></li>';
}
......@@ -1186,6 +1228,21 @@
displayFields: 'addressName'
})
});
/**
* 动态展示背景颜色
*/
function RowCallBack(row, data, index) {
if (data.status == '0') {
$(row).css('background-color', '#DBA433');
} else if (data.status == '1') {
$(row).css('background-color', 'red');
}
if (data.isThree == '0') {
$('td', row).eq(11).css('background-color', "#008d4c");
}
}
</script>
</body>
......
......@@ -319,9 +319,9 @@
"sAjaxSource": sSource,
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"autowidth": true,
"autoWidth": true,
"scrollX": true,
"sScrollY":"480px",
"sScrollY": false,
"aoColumns": [
{
"mData": "id"
......@@ -514,7 +514,7 @@
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))';
html += '<div class="btn-group">\n' +
'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
//'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
......
......@@ -150,27 +150,6 @@
a.address
</sql>
<sql id="sqlColumnFrom">
o.id,
o.consult_id AS consultId,
o.number,
o.pay_amount AS payAmount,
o.order_amount AS orderAmount,
o.pay_status AS payStatus,
o.order_cancel AS orderCancel,
o.trade_no AS tradeNo,
o.description,
o.status,
o.create_time AS createTime,
o.confirm,
o.courier_number AS courierNumber,
o.address_des AS addressDes,
o.openid,
o.remarks
</sql>
<sql id="Column">
order_id,
order_code,
......@@ -181,7 +160,8 @@
amount,
drugs_code,
drugs_sku,
accounts_id
accounts_id,
drugs_name
</sql>
......@@ -263,10 +243,31 @@
<select id="fetchId" parameterType="java.lang.Long" resultType="com.cftech.order.model.OrderFromVO">
SELECT
<include refid="sqlColumnFrom"/>
o.id,
o.consult_id AS consultId,
o.number,
o.pay_amount AS payAmount,
o.order_amount AS orderAmount,
o.pay_status AS payStatus,
o.order_cancel AS orderCancel,
o.trade_no AS tradeNo,
o.description,
o.status,
o.create_time AS createTime,
o.confirm,
o.courier_number AS courierNumber,
o.address_des AS addressDes,
o.openid,
o.remarks,
o.order_time orderTime,
o.cancel_time cancelTime,
DATE_FORMAT(aw.create_time, '%Y-%m-%d %H:%i:%s') sendExpressDateStr,
DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i:%s') acceptExpressDateStr,
o.pay_time payTime
from
t_order o
LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid
......@@ -344,8 +345,9 @@
o.remind_type,
t.take_frequency takeFrequency,
f.store fansAlias,
CASE WHEN au.name IS NOT NULL THEN 1 ELSE 0 END isThree,
o.remarks
au.status isThree,
o.remarks,
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
......@@ -359,6 +361,23 @@
<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
<choose>
<when test="orderAmount == 6">
AND drugsNum >= ${orderAmount}
</when>
<when test="payAmount == 6">
AND drugsNum >= ${payAmount}
</when>
<when test="orderAmount != 6">
AND drugsNum = ${orderAmount}
</when>
<when test="payAmount != 6">
AND drugsNum = ${payAmount}
</when>
</choose>
</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
......@@ -520,7 +539,8 @@
#{amount},
#{drugsCode},
#{drugsSku},
#{accountsId}
#{accountsId},
#{drugsName}
)
</insert>
......@@ -684,7 +704,7 @@
FROM wx_mp_fanss f
INNER JOIN wx_mp_member m ON f.openid = m.open_id
INNER JOIN t_aidea_authentication au ON m.cardid = au.id_card
WHERE f.delflag = '0' AND m.del_flag = '0' AND au.del_flag = '0' AND m.open_id = #{openid}
WHERE f.delflag = '0' AND m.del_flag = '0' AND au.del_flag = '0' AND au.status = '0' AND m.open_id = #{openid}
</select>
<update id="updateRemindType">
......
......@@ -138,6 +138,11 @@ public class Order extends OrderDetail implements Serializable {
*/
private String isExceedSevenDay;
/**
* 是否首次打开页面
*/
private boolean isFirst;
......@@ -583,4 +588,12 @@ public class Order extends OrderDetail implements Serializable {
public void setPayUrl(String payUrl) {
this.payUrl = payUrl;
}
public boolean getIsFirst() {
return isFirst;
}
public void setIsFirst(boolean first) {
isFirst = first;
}
}
\ No newline at end of file
......@@ -26,5 +26,6 @@ public class OrderDetailDto {
private String drugsSku;
/* 所属的账号 */
private Long accountsId;
private String drugsName;
}
......@@ -38,6 +38,11 @@ public class OrderFromVO {
private String payUrl;
private String payAmount;
private String addressDes;
private String orderTime;
private String cancelTime;
private String sendExpressDateStr;
private String acceptExpressDateStr;
private String payTime;
}
......@@ -29,7 +29,7 @@ public interface OrderService extends GenericService<Order> {
* @param userid
* @return
*/
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid);
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String orderAmount, String payAmount);
Integer count(Conds conds, Long userid);
......
......@@ -96,7 +96,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
}
@Override
public List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid) {
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);
......@@ -106,6 +106,12 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
if (userid != null && userid != 1L) {
params.put("userid", userid);
}
if (StringUtils.isNoneBlank(orderAmount)) {
params.put("orderAmount", orderAmount);
}
if (StringUtils.isNoneBlank(payAmount)) {
params.put("payAmount", payAmount);
}
return orderMapper.fetchSearchByPage(params);
}
......@@ -168,6 +174,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
params.put("price", obj.getDouble("price"));
params.put("amount", obj.getDouble("amount"));
params.put("orderAmount", obj.getDouble("orderAmount"));
params.put("productName", obj.getString("productName"));
//获取产品信息
ProductDto productDtos = orderMapper.fetchProduct(params);
......@@ -195,6 +202,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderDetailDto.setPrice(obj.getDouble("price"));
orderDetailDto.setAmount(obj.getDouble("amount"));
orderDetailDto.setDrugsId(productDtos.getId());
orderDetailDto.setDrugsName(obj.getString("productName"));
orderDetailDto.setDrugsNum(obj.getLong("drugsNum"));
orderDetailDto.setDrugsCode(productDtos.getProductNumber());
orderDetailDto.setDrugsSku(productDtos.getFormat());
......@@ -373,7 +381,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Conds conds = new Conds();
conds.equal("o.id", invoiceDto.getId());
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null);
List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null, "0", "0");
if (list.size() > 0) {
for (Order order : list) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.couponrecord.service.CouponrecordService;
import com.cftech.invoice.model.Invoice;
import com.cftech.invoice.service.InvoiceService;
import com.cftech.accounts.model.MpAccountsEntity;
......@@ -29,6 +30,7 @@ import com.cftech.sys.model.UserRole;
import com.cftech.sys.security.UserUtils;
import com.cftech.sys.service.RoleService;
import com.cftech.sys.service.UserService;
import com.google.zxing.WriterException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
......@@ -77,6 +79,9 @@ public class OrderController {
@Autowired
private OrderDetailsController orderDetailsController;
@Autowired
private CouponrecordService couponrecordService;
@Autowired
private InvoiceService invoiceService;
......@@ -110,7 +115,7 @@ public class OrderController {
return "order/orderlist";
}
//列表页面
//订单出库列表页面
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/listout")
public String listout(HttpServletRequest request, Model model) {
......@@ -119,6 +124,15 @@ public class OrderController {
return "order/orderlistout";
}
//修改地址列表页面
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/listEditAds")
public String listEditAds(HttpServletRequest request, Model model) {
Long accountId = UserUtils.getmpaccounts(request);
model.addAttribute("accountId", accountId);
return "order/editOrderAdsList";
}
//编辑页面(新增、修改)
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/form")
......@@ -244,22 +258,24 @@ public class OrderController {
if (StringUtils.isNoneBlank(order.getCourierNumber())) {
conds.like("o.courier_number", order.getCourierNumber());
}
//订单开始金额
if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
conds.greatEqual("o.order_amount", order.getStartOrderAmount());
}
//订单结束金额
if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
conds.lessEqual("o.order_amount", order.getEndOrderAmount());
}
//最终开始金额
if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
conds.greatEqual("o.total_amount", Integer.parseInt(order.getStartPayAmount()) * 100);
}
//最终结束金额
if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
conds.lessEqual("o.total_amount", Integer.parseInt(order.getEndPayAmount()) * 100);
}
// //订单开始金额
// if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
// conds.greatEqual("o.order_amount", order.getStartOrderAmount());
// }
// //订单结束金额
// if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
// conds.lessEqual("o.order_amount", order.getEndOrderAmount());
// }
// //最终开始金额
// if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
// conds.greatEqual("o.total_amount", Integer.parseInt(order.getStartPayAmount()) * 100);
// }
// //最终结束金额
// if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
// conds.lessEqual("o.total_amount", Integer.parseInt(order.getEndPayAmount()) * 100);
// }
//订单状态
if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus());
......@@ -280,7 +296,7 @@ public class OrderController {
}
Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid, order.getStartOrderAmount(), order.getStartPayAmount());
//设置是否可以开票
Date today = new Date();
int longNum = 0;
......@@ -319,7 +335,7 @@ public class OrderController {
conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid, "0", "0");
if(list.size() > 0){
for (Order order : list){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -385,11 +401,23 @@ public class OrderController {
@RequestMapping("/exportExcel")
@RequiresPermissions(value = ORDER_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response, Order order) {
Long accountId = UserUtils.getmpaccounts(request);
User user = UserUtils.getUser();
Long userid = user.getUserid();
Long accountsId = UserUtils.getmpaccounts(request);
MpAccountsEntity mpAccountsEntity = accountsService.getDetail(accountsId);
List<UserRole> roleList = roleService.selectRolesByUserAccountsId(user.getId(), accountsId);
for (UserRole role : roleList) {
if (role.getRoleId() == 5L) {
userid = 1L;
}
}
Sort sort = new Sort("o.create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("o.del_flag", 0);
conds.equal("o.accounts_id", accountId);
conds.equal("o.accounts_id", accountsId);
//咨询单编码
if (StringUtils.isNoneBlank(order.getConsultCode())) {
conds.like("cs.consult_id", order.getConsultCode());
......@@ -406,22 +434,22 @@ public class OrderController {
if (StringUtils.isNoneBlank(order.getCourierNumber())) {
conds.like("o.courier_number", order.getCourierNumber());
}
//订单开始金额
if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
conds.greatEqual("o.order_amount", order.getStartOrderAmount());
}
//订单结束金额
if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
conds.lessEqual("o.order_amount", order.getEndOrderAmount());
}
//最终开始金额
if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
conds.greatEqual("o.total_amount", Integer.parseInt(order.getStartPayAmount()) * 100);
}
//最终结束金额
if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
conds.lessEqual("o.total_amount", Integer.parseInt(order.getEndPayAmount()) * 100);
}
// //订单开始金额
// if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
// conds.greatEqual("o.order_amount", order.getStartOrderAmount());
// }
// //订单结束金额
// if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
// conds.lessEqual("o.order_amount", order.getEndOrderAmount());
// }
// //最终开始金额
// if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
// conds.greatEqual("o.total_amount", Integer.parseInt(order.getStartPayAmount()) * 100);
// }
// //最终结束金额
// if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
// conds.lessEqual("o.total_amount", Integer.parseInt(order.getEndPayAmount()) * 100);
// }
//订单状态
if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus());
......@@ -440,7 +468,8 @@ public class OrderController {
if (StringUtils.isNoneBlank(order.getOrderEndTime())) {
conds.lessEqual("DATE_FORMAT(o.create_time, '%Y-%m-%d')", order.getOrderEndTime());
}
List<Order> list = orderService.fetchSearchByPage(conds, sort, 0, 0);
List<Order> list = orderService.fetchSearchBy(conds, sort, 0, 0, userid, order.getStartOrderAmount(), order.getStartPayAmount());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
LinkedList<OrderVO> orderVOS = new LinkedList<>();
OrderVO orderVO = null;
......@@ -545,6 +574,8 @@ public class OrderController {
@RequestMapping("/updateStatus")
@ResponseBody
public JSONObject updateStatus(Long id, String status, String orderCancel, HttpServletRequest request) {
Long accountId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
Integer integer = orderService.updateStatus(id, status, orderCancel);
//设置已付款
......@@ -552,6 +583,16 @@ public class OrderController {
//线下付款成功
if (StringUtils.equals(status, "2")) {
orderService.sendQyWechatMassage(id);
try {
OrderFromVO orderFromVO = orderService.fetchId(id);
if (orderFromVO != null && StringUtils.isNoneBlank(orderFromVO.getOpenid())) {
couponrecordService.sendCouponRecord(orderFromVO.getOpenid(), accountId);
}
} catch (IOException e) {
e.printStackTrace();
} catch (WriterException e) {
e.printStackTrace();
}
}
rtnJson.put("errorNo","0");
return rtnJson;
......
......@@ -96,14 +96,14 @@
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id</td>
<td>产品分类名称</td>
<td>产品分类编码</td>
<td>序号</td>
<td>分类级别</td>
<td>上级分类</td>
<td>是否推荐</td>
<td>备注</td>
<th hidden="true">Id</th>
<th>产品分类名称</th>
<th>产品分类编码</th>
<th>序号</th>
<th>分类级别</th>
<th>上级分类</th>
<th>是否推荐</th>
<th>备注</th>
<th>创建时间</th>
<th>操作</th>
</tr>
......
......@@ -109,26 +109,26 @@
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id</td>
<td>产品分类名称</td>
<td>产品名称</td>
<td>产品编码</td>
<td>产品封面图</td>
<td>通用名</td>
<td>剂型</td>
<td>规格</td>
<td>批准文号</td>
<td>生产企业</td>
<td>温馨提示</td>
<td>服用类型</td>
<td>服用频率</td>
<td>服用数量</td>
<td>库存</td>
<td>价格</td>
<td>是否为处方药</td>
<td>销量</td>
<td>创建时间</td>
<td>操作</td>
<th hidden="true">Id</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>
<th>库存</th>
<th>价格</th>
<th>是否为处方药</th>
<th>销量</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody id="tablebody">
......
......@@ -263,6 +263,9 @@
"sAjaxSource": sSource,
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"autoWidth": true,
"scrollX": true,
"sScrollY": false,
"aoColumns": [
{
"mData": "id"
......
......@@ -308,8 +308,7 @@
ord.openid openId
FROM
t_order_details detail
LEFT JOIN t_aidea_product product ON product.id = detail.drugs_id
AND product.del_flag = 0
LEFT JOIN t_aidea_product product ON product.id = detail.drugs_id AND product.del_flag = 0
LEFT JOIN t_order ord ON ord.id = detail.order_id
LEFT JOIN t_aidea_consult_sheet consult ON consult.order_id = ord.id
LEFT JOIN t_qyuser qyuser ON qyuser.id = consult.past_records
......
......@@ -9,6 +9,7 @@ import com.cftech.base.org.service.QyuserService;
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.SpringContextHolder;
import com.cftech.core.util.SystemConfig;
import com.cftech.report.model.Report;
......@@ -50,7 +51,7 @@ public class ReportJob implements Job {
Conds condPeople = new Conds();
condPeople.equal("DATE_FORMAT(detail.create_time ,'%Y-%m-%d')", format.format(today));
condPeople.equal("detail.del_flag", 0);
condPeople.equal("detail.del_flag", Constants.DEL_FLAG_0);
Sort sortPeople = new Sort("detail.create_time", OrderType.DESC);
//获取报表用户信息
List<ReportPeopleInfo> listPeople = reportService.selectReportPeopleInfo(condPeople, sortPeople);
......
......@@ -77,23 +77,35 @@
<div class="box">
<div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/waybill/exportExcel')" method="get">
<div class="col-xs-2">
<div class="col-xs-1">
<input type="text" class="form-control" name="number" placeholder="物流编码">
</div>
<div class="col-xs-2">
<div class="col-xs-1">
<input type="text" class="form-control" name="waybillNo" placeholder="顺丰运单号">
</div>
<div class="col-xs-2">
<div class="col-xs-1">
<input type="text" class="form-control" name="orderCode" placeholder="订单编码">
</div>
<div class="col-xs-2">
<div class="col-xs-1">
<input type="text" class="form-control" name="consultSheetCode" placeholder="咨询单编码">
</div>
<div class="col-xs-1">
<input type="text" class="form-control" name="contact" placeholder="联系人">
</div>
<div class="col-xs-3">
<div class="col-xs-1">
<select id="status" name="status" class="form-control required">
<option value="">请选择打印状态</option>
<option value="0" selected>未打印</option>
<option value="1">已打印</option>
</select>
</div>
<div class="col-xs-2">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:waybill:edit"))
<!--<a href="#springUrl('/a/waybill/form')" class="btn btn-primary">新增</a>-->
......@@ -217,14 +229,19 @@
"sAjaxSource": sSource,
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"autoWidth": true,
"scrollX": true,
"sScrollY": false,
"aoColumns": [
{
"mData": "id"
},
{
"width": "100px",
"mData": "number"
},
{
"width": "100px",
"mData": "waybillNo",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -236,12 +253,15 @@
}
},
{
"width": "100px",
"mData": "orderCode"
},
{
"width": "100px",
"mData": "consultSheetCode"
},
{
"width": "70px",
"mData": "status",
"mRender": function (a, b, c, d) {
if (a == '0') {
......@@ -252,12 +272,15 @@
}
},
{
"width": "100px",
"mData": "nickName"
},
{
"width": "120px",
"mData": "openId"
},
{
"width": "100px",
"mData": "contact",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -268,6 +291,7 @@
}
},
{
"width": "100px",
"mData": "mobile",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -278,6 +302,7 @@
}
},
{
"width": "80px",
"mData": "storageManageName",
"mRender": function (a, b, c, d) {
if (c.storageManage == '1') {
......@@ -288,6 +313,7 @@
}
},
{
"width": "80px",
"mData": "filterResult",
"mRender": function (a, b, c, d) {
switch (a) {
......@@ -301,6 +327,7 @@
}
},
{
"width": "130px",
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
......@@ -308,6 +335,7 @@
}
},
{
"width": "130px",
"mData": "sendExpressDate",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -318,6 +346,7 @@
}
},
{
"width": "130px",
"mData": "acceptExpressDate",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -341,7 +370,7 @@
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:waybill:edit"))';
html += '<div class="btn-group" style="min-width: 100px;">\n' +
'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
//'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
......
......@@ -145,7 +145,15 @@ public class WaybillController {
}
if (StringUtils.isNoneBlank(waybill.getContact())) {
conds.like("t.contact", "%" + waybill.getContact() + "%");
conds.like("t.contact", waybill.getContact());
}
if (StringUtils.isNoneBlank(waybill.getConsultSheetCode())) {
conds.like("cs.consult_id", waybill.getConsultSheetCode());
}
if (StringUtils.isNoneBlank(waybill.getStatus())) {
conds.equal("t.status", waybill.getStatus());
}
Sort sort = new Sort("t.create_time", OrderType.DESC);
......
......@@ -28,9 +28,9 @@ QY_SEND_APPID=350
#\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863
QY_CHAT_WORK=351
#\u63A8\u9001\u5BA2\u670D\u6D88\u606F\u6DFB\u52A0\u7528\u6237
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}
#\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{fansAlias}
#\u63A8\u9001\u8BA2\u5355\u5458\u53D1\u8D27\u6D88\u606F
QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801:
#\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F
......@@ -51,6 +51,8 @@ userfiles.qrcodedir=/mydata/fileQrcode
#\u56FE\u7247\u8BBF\u95EE\u5730\u5740
IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME}
#\u4E8C\u7EF4\u7801\u8BBF\u95EE\u8DEF\u5F84
QRCODEURL=/aidea/mobile/qybase/showQrcode?picFileName={PICFILENAME}
ROOT_MATERIALCATEGORY_NAME=\u7D20\u6750\u7C7B\u578B
ARTICLEDETAILURL=http://www.changfu-tech.com/schaeffler/static/mp/dc/buy-car/dc-news-detail.html?appid={APPID}&articleId={ID}
ARTICLEDETAILPICURL=http://localhost:8080/schaeffler/static/article/picDetail.html?accountsid={ACCOUNTSID}&id={ID}
......@@ -59,13 +61,13 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true
jwt.domain=localhost
jwt.domain=pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
security.secure=false
#\u662F\u5426\u96C6\u7FA4 master\u4E3Atrue
quartz.isCluster=true
quartz.isCluster=false
#\u987A\u4E30\u7269\u6D41\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
#\u987A\u4E30\u5BA2\u6237\u7F16\u7801
......
......@@ -16,6 +16,7 @@
<result column="accounts_id" property="accountsId"/>
<result column="del_flag" property="delFlag"/>
<result column="status" property="status"/>
<result column="nickname" property="nickName"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="description" property="description"/>
......@@ -184,8 +185,10 @@
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
<include refid="sqlColumns"/>,
CONVERT(AES_DECRYPT(f.nickname, 'aideakey') USING UTF8) nickName
FROM t_shipping_address t
LEFT JOIN wx_mp_fanss f ON t.open_id = f.openid AND f.delflag = '0'
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
......
......@@ -67,6 +67,8 @@ public class Address extends Area implements Serializable {
private String name;
private String nickName;
public Address() {
this.delFlag = false;
this.status = "0";
......
......@@ -9,14 +9,13 @@ 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.sys.security.PermissionSign;
import com.cftech.core.util.StringUtils;
import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -61,17 +60,18 @@ public class AddressController {
//编辑页面(新增、修改)
@RequiresPermissions(value = ADDRESS_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)) {
Address address = addressService.fetchById(id);
model.addAttribute("data", address);
}
model.addAttribute("isView", StringUtils.equals(pageType, "View") ? true : false);
return "address/addressform";
}
//提交数据(新增、修改)
@RequiresPermissions(value = ADDRESS_EDIT)
@RequestMapping(value = "/formData", method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/formData", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public JSONObject formData(Address address, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
......@@ -111,13 +111,13 @@ public class AddressController {
if (!StringUtils.isEmpty(address.getAddressName())) {
conds.like("t.address_name", address.getAddressName());
}
if (!StringUtils.isEmpty(address.getProvinceId())) {
if (address.getProvinceId() != null) {
conds.equal("t.province_id", address.getProvinceId());
}
if (!StringUtils.isEmpty(address.getCityId())) {
if (address.getCityId() != null) {
conds.equal("t.city_id", address.getCityId());
}
if (!StringUtils.isEmpty(address.getAreaId())) {
if (address.getAreaId() != null) {
conds.equal("t.area_id", address.getAreaId());
}
if (!StringUtils.isEmpty(address.getOrderId())) {
......
......@@ -76,30 +76,38 @@
<input id="id" name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body">
<div class="form-group form-md-line-input col-md-12">
<label>openid</label>
<div class="input-group">
<input type="text" name="openId" id="openId"
value="$!{data.openId}"
class="form-control" style="display: none">
<input type="text" id="previewOpenId"
name="previewOpenId" value="$!{previewOpenId}"
class="form-control" disabled>
<span class="input-group-btn">
<button type="button" id="openidSelect"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
<label>昵称</label>
#if($!{isView}=='true')
<input type="text" name="nickName" id="nickName"
value="$!{data.nickName}"
class="form-control" readonly="readonly">
#else
<div class="input-group">
<input type="text" name="openId" id="openId"
value="$!{data.openId}"
class="form-control" style="display: none">
<input type="text" id="previewOpenId"
name="previewOpenId" value="$!{previewOpenId}"
class="form-control" disabled>
<span class="input-group-btn">
<button type="button" id="openidSelect"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
#end
</div>
<div class="form-group form-md-line-input col-md-12">
<div class="form-group form-md-line-input col-md-12">
<label>患者姓名<font style="color: red"></font></label>
<input type="text"
class="form-control" name="addressName"
id="addressName"
maxlength="50" placeholder="患者姓名"
value="$!{data.addressName}"
#if($!{isView}=='true') readonly="readonly" #end
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>联系方式<font style="color: red"></font></label>
<input type="text"
......@@ -107,8 +115,10 @@
id="phone"
maxlength="50" placeholder="联系方式"
value="$!{data.phone}"
#if($!{isView}=='true') readonly="readonly" #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="province" name="provinceName"-->
......@@ -117,10 +127,12 @@
<!-- value="$!{data.provinceName}"-->
<!-- >-->
<select id="province" name="provinceId" onchange="getCityList(this.value)"
#if($!{isView}=='true') disabled #end
class="form-control required">
<option value="">请选择省份</option>
</select>
</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"-->
......@@ -129,19 +141,20 @@
<!-- value="$!{data.cityName}"-->
<!-- >-->
<select id="city" name="cityId" onchange="getReginList(this.value);"
#if($!{isView}=='true') disabled #end
class="form-control required">
<option value="">请选择城市</option>
</select>
</div>
<div class="form-group form-md-line-input col-md-12">
<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}"-->
<!-- >-->
<select id="county" name="areaId" class="form-control required">
<select id="county" name="areaId" class="form-control required" #if($!{isView}=='true') disabled #end>
<option value="">请选择区/县</option>
</select>
</div>
......@@ -152,6 +165,7 @@
id="address"
maxlength="50" placeholder="联系方式"
value="$!{data.address}"
#if($!{isView}=='true') readonly="readonly" #end
>
</div>
<input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/>
......@@ -163,6 +177,7 @@
#end
<a href="#springUrl('/a/address/list')" class="btn btn-default">返回</a>
</div>
</div>
</form>
<!-- /.box-body -->
</div><!-- /.box -->
......@@ -242,7 +257,7 @@
url: url,
type: "GET",
success: function (data) {
console.log(data)
//console.log(data)
areaList = data;
listProvince = data.filter(x => x.cityType == 1)
var province = document.querySelector('#province') //querySelector获取id="province"的元素
......
......@@ -113,7 +113,7 @@
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id</td>
<th hidden="true">Id</th>
<th>openId</th>
<th>患者姓名</th>
<th>性别</th>
......@@ -122,7 +122,7 @@
<th>城市</th>
<th>区/县</th>
<th>详细地址</th>
<!-- <th>操作</th>-->
<th>操作</th>
</tr>
</thead>
<tbody id="tablebody">
......@@ -251,6 +251,9 @@
},
{
"mData": "address"
},
{
"mData": "id"
}
],
"aoColumnDefs": [
......@@ -317,26 +320,26 @@
"mRender": function (a, b, c, d) {
return a;
}
},
{
"aTargets": [9],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:wxQrcode:edit"))';
html += '<div class="btn-group">\n' +
//'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
'</button>\n' +
'<ul class="dropdown-menu" role="menu">\n';
html += '<li><a href="#springUrl("/a/address/form")?id=' + a + '&pageType=View">查看</a></li>';
// html += '<li><a href="javascript:removeData(' + a + ')">删除</a></li>';
html += '</ul>';
html += '#end';
return html;
}
}
// {
// "aTargets": [9],
// "mData": "id",
// "mRender": function (a, b, c, d) {
// var html = '#if($shiro.hasPermission("qy:wxQrcode:edit"))';
// html += '<div class="btn-group">\n' +
// '<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
// '<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
// ' <span class="caret"></span>\n' +
// ' <span class="sr-only">Toggle Dropdown</span>\n' +
// '</button>\n' +
// '<ul class="dropdown-menu" role="menu">\n';
// html += '<li><a href="#springUrl("/a/address/form?id=' + a + '")">查看</a></li>';
// // html += '<li><a href="javascript:removeData(' + a + ')">删除</a></li>';
// html += '</ul>';
// html += '#end';
// return html;
// }
// }
]
......
......@@ -179,6 +179,65 @@ public class MobileQybaseController {
return retObj;
}
@RequestMapping(value = "showQrcode")
public void showQrcode(HttpServletRequest request, HttpServletResponse response, Long accountsId, String picFileName) throws Exception{
if(!StringUtils.isEmpty(picFileName))
{
if(picFileName.contains("..")||picFileName.contains("/")|| picFileName.contains("%00"))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
}
String filePath = SystemConfig.p.getProperty("userfiles.qrcodedir");
String picPath = filePath + File.separator + picFileName;
//取后缀
String ext = picFileName.substring(picFileName.lastIndexOf(".") + 1, picFileName.length());
if ("jpg".equals(ext.toLowerCase()) || "jpeg".equals(ext.toLowerCase())) {
response.setContentType("image/jpeg;charset=GB2312");
}
if ("png".equals(ext.toLowerCase())) {
response.setContentType("image/png;charset=GB2312");
}
if ("bmp".equals(ext.toLowerCase())) {
response.setContentType("image/bmp;charset=GB2312");
}
if ("gif".equals(ext.toLowerCase())) {
response.setContentType("image/gif;charset=GB2312");
}
if("mp3".equals(ext.toLowerCase()))
{
response.setContentType("audio/mp3;charset=GB2312");
}
try {
InputStream imageIn = new FileInputStream(picPath); // 文件流
OutputStream output = response.getOutputStream();// 得到输出流
BufferedInputStream bis = new BufferedInputStream(imageIn);// 输入缓冲流
BufferedOutputStream bos = new BufferedOutputStream(output);// 输出缓冲流
byte data[] = new byte[4096];// 缓冲字节数
int size = 0;
size = bis.read(data);
while (size != -1) {
bos.write(data, 0, size);
size = bis.read(data);
}
bis.close();
bos.flush();// 清空输出缓冲流
bos.close();
output.close();
} catch (FileNotFoundException e) {
log.error("showPic not found file, accountsId={}, picFileName={}", accountsId, picFileName);
} catch (IOException e) {
log.error("showPic got IOException: ", e.getMessage());
}
}
@RequestMapping(value = "showPic")
public void showPic(HttpServletRequest request, HttpServletResponse response, Long accountsId, String picFileName) throws Exception{
......
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