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

Submit by Strive

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