Commit ded26f20 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-01-19

parent fffddcdb
......@@ -822,7 +822,7 @@
});
},
cancel: function () {
return;
$("#save").attr("disabled", false);
}
});
......
......@@ -86,7 +86,7 @@
class="form-control" name="mailNo"
id="mailNo" readonly="readonly"
maxlength="50" placeholder="咨询单编码"
value="$!{data.mailNo}"
value="$!{data.orderNo}"
>
</div>
......@@ -96,7 +96,7 @@
class="form-control" name="orderNo"
id="orderNo" readonly="readonly"
maxlength="50" placeholder="用药人姓名"
value="$!{data.orderNo}"
value="$!{data.mailNo}"
>
</div>
......
......@@ -70,7 +70,7 @@ public class LogisticsController {
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("mail_no", logistics.getMailNo());
Sort sort = new Sort( "create_time", OrderType.DESC);
Sort sort = new Sort( "accept_time", OrderType.DESC);
List<Logistics> routes = logisticsService.fetchSearchByPage(conds, sort, 0, 0);
model.addAttribute("routes", routes);
......
......@@ -185,7 +185,7 @@
<div class="panel panel-primary">
<div class="panel-heading">商品信息</div>
<div class="panel-body">
<div class="panel-body" style="overflow: hidden; overflow-x: auto; white-space: nowrap;">
<div class="form-group form-md-line-input">
<div id="group" class="list-group">
<li class="list-group-item">
......@@ -193,12 +193,17 @@
<th style=""><label style="width: 200px;margin-right: 40px;text-align: center">商品编码</label></th>
<th style=""><label style="width: 100px;margin-right: 45px;text-align: center">购买数量</label></th>
<th style=""><label style="width: 100px;margin-right: 100px;text-align: center">出货数量</label></th>
<!--<th style=""><label style="width: 180px;margin-right: 50px;text-align: center">批次号</label></th>-->
<th style=""><label style="width: 180px;margin-right: 50px;text-align: center">批次号</label></th>
</li>
</div>
<!-- <div class="form-group form-md-line-input col-xs-8">-->
<!-- <label><font></font></label>-->
<!-- <button name="clickScan" type="button" class="btn btn-primary">点击扫码</button>-->
<!-- </div>-->
<div class="form-group form-md-line-input col-xs-8">
<label>已扫商品编码<font></font></label>
<textarea class="form-control" id="scanGoodsCode" name="scanGoodsCode" rows="5" readonly></textarea>
......@@ -294,7 +299,11 @@
//触发顺序keydown keypress keyup
function initScanEvent() {
$(document).on('keydown', function(event) {
// $("#clickScan").on('click', function() {
// $("#scanGoodsCode").focus();
// });
$("#scanGoodsCode").on('keydown', function(event) {
//键盘按下回车后会转换成click 阻止键盘的所有默认行为
event.preventDefault();
console.log('扫码开始');
......@@ -467,9 +476,9 @@
listHtml += `<input name="orderNum" class="form-control" type="text" style="width: 100px;margin-right: 50px;" readonly value="1"></input>`;
}
var HtmlAmount = `<input name="sendNum" class="form-control" type="text" style="width: 100px;margin-right: 50px;" readonly value="1"></input>`;
var HtmlAmount = `<input name="sendNum" class="form-control" type="text" style="width: 100px;margin-right: 50px;" readonly value="0"></input>`;
//var HtmlBatchNo = `<input name="batchNo" class="form-control" type="text" style="width: 300px; margin-right: 50px;"></input>`;
var HtmlBatchNo = `<input name="batchNo" class="form-control" type="text" style="width: 300px; margin-right: 50px;"></input>`;
//扫码商品编码
var HtmlCode = `<button name="delGoods" type="button" class="btn btn-danger delGoods">删除</button>`;
......@@ -486,6 +495,8 @@
${HtmlAmount}
${HtmlBatchNo}
${HtmlCode}
</li>`;
......@@ -519,29 +530,29 @@
}
let datas = [];
// $(".translate").each(function (index,item){
// const idDetail = $(item).find('[name="idDetail"]').val();
// const productName = $(item).find('[name="productName"]').val();
// const productCode = $(item).find('[name="productCode"]').val();
// const orderNum = $(item).find('[name="orderNum"]').val();
// const sendNum = $(item).find('[name="sendNum"]').val();
// const batchNo = $(item).find('[name="batchNo"]').val();
// if (batchNo == null || batchNo == '') {
// $("#labels").text("请输入商品批次号!");
// $('#exampleModal').modal('show');
// return;
// }
//
// datas.push({
// idDetail : idDetail,
// productName :productName,
// productCode : productCode,
// orderNum : orderNum,
// sendNum : sendNum,
// batchNo :batchNo
// })
// });
$(".translate").each(function (index,item){
const idDetail = $(item).find('[name="idDetail"]').val();
const productName = $(item).find('[name="productName"]').val();
const productCode = $(item).find('[name="productCode"]').val();
const orderNum = $(item).find('[name="orderNum"]').val();
const sendNum = $(item).find('[name="sendNum"]').val();
const batchNo = $(item).find('[name="batchNo"]').val();
if (batchNo == null || batchNo == '') {
$("#labels").text("请输入商品批次号!");
$('#exampleModal').modal('show');
return;
}
datas.push({
idDetail : idDetail,
productName :productName,
productCode : productCode,
orderNum : orderNum,
sendNum : sendNum,
batchNo :batchNo
})
});
$("#save").attr("disabled", true);
var url = "#springUrl('/a/waybill/orderSendOutForWaybill')";
$.ajax({
url: url,
......@@ -553,6 +564,7 @@
orderId: $("#id").val(),
datas: JSON.stringify(datas)},
success :function (rsp) {
$("#save").attr("disabled", false);
if(rsp.errorNo == "0"){
Cfapp.alert({
message: "出库成功",
......
......@@ -96,7 +96,7 @@
<input type="text"
class="form-control" name="courierNumber"
id="courierNumber" readonly="readonly"
maxlength="50" placeholder="快递单号"
maxlength="50" placeholder="顺丰运单号"
value="$!{data.courierNumber}" >
</div>
......@@ -105,7 +105,7 @@
<input type="text"
class="form-control" name="orderAmount"
id="orderAmount" readonly="readonly"
maxlength="50" placeholder="订单金额"
maxlength="50" placeholder="订单总价"
value="$!{data.orderAmount}"
>
</div>
......@@ -468,14 +468,13 @@
$(".translate").each((index, item) => {
var txt = $(item).find('[name="releas"]').val()
if (obj[txt]) {
arr.push(index)
return
return;
} else {
obj[txt] = true
}
})
});
if (arr.length > 0) {
Cfapp.alert({
message: "无法增加重复商品!",
......@@ -486,7 +485,6 @@
return;
}
var id = $("#id").val();
var orderAmount = $("#orderAmount").val();
var datas = [];
......@@ -496,7 +494,16 @@
const drugsNum = $(item).find('[name="listHtml"]').val()
const price = $(item).find('[name="htmlPrice"]').val()
const amount = $(item).find('[name="htmlAmount"]').val()
console.log(item)
if (price == 0) {
Cfapp.alert({
message: "商品单价不能为0元!",
btntext: "确定",
success: function () {
}
});
return;
}
datas.push({
id : id,
idDetail : idDetail,
......@@ -519,7 +526,7 @@
}
var url = "#springUrl('/a/order/formData')";
$("#save").attr("disabled", true);
$.ajax({
url: url,
type: "POST",
......@@ -528,6 +535,7 @@
data : {_csrf:csrf,_csrf_header:csrf_header,
datas: JSON.stringify(datas)},
success :function (rsp) {
$("#save").attr("disabled", false);
console.log(rsp);
if(rsp.errorNo == "0"){
Cfapp.alert({
......
......@@ -517,8 +517,10 @@
"aTargets": [4],
"mData": "orderAmount",
"mRender": function (a, b, c, d) {
if (a != null) {
if (a != null && Number.isInteger(a)) {
return parseInt(a).toFixed(2);
} else {
return a;
}
return '';
}
......@@ -750,7 +752,6 @@
jQuery(document).ready(function () {
$('.col-xs-12').on('click', '.paginate_button', function() {
//console.log('aaaaaaaaaaaaaa');
setTimeout(function () {
var flag = true;
$('#table tbody tr').each(function(){
......@@ -1083,7 +1084,6 @@
}
function copyPayLink(payUrl) {
console.log(payUrl);
let input = document.createElement('input');
input.setAttribute('readonly', 'readonly'); // 防止手机上弹出软键盘
input.setAttribute('value', payUrl);
......@@ -1108,7 +1108,6 @@
$("#selHospital").click(function () {
let orderId = $('#addressOpenId').val();
console.log(orderId);
Cfapp.f7({
dataUrl: "#springUrl('/a/address/listData?orderId="+orderId+"')",
checkType: "single", // 多选为multi
......
......@@ -90,4 +90,10 @@ public interface OrderMapper extends GenericDao<Order> {
* @return
*/
Integer updateRemindType(@Param("orderId")Long orderId, @Param("option") String option);
/**
* 获取等待提醒的订单发送提醒消息
* @return
*/
List<Map<String, String>> findWaitRemindOrders(Long number);
}
\ No newline at end of file
......@@ -696,4 +696,23 @@
</set>
WHERE id= #{id}
</update>
<select id="findWaitRemindOrders" parameterType="java.lang.Long" resultType="java.util.Map">
SELECT
o.*, (p.take_frequency * d.drugs_num) rate
FROM
t_order o
INNER JOIN t_aidea_waybill w ON o.id = w.order_id
LEFT JOIN t_order_details d ON o.id = d.order_id
LEFT JOIN t_aidea_product p ON d.drugs_id = p.id
WHERE
o.del_flag = '0'
AND w.del_flag = '0'
AND d.del_flag = '0'
AND p.del_flag = '0'
AND w.accept_express_date IS NOT NULL
AND o.`status` = '4'
AND Date( date_add( w.accept_express_date, INTERVAL ( p.take_frequency * d.drugs_num - #{number} ) DAY ) ) = CURRENT_DATE ()
GROUP BY o.id HAVING max(rate)
</select>
</mapper>
\ No newline at end of file
......@@ -23,10 +23,7 @@ import org.quartz.JobExecutionException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* 订单跟进提醒 前7天、当天、后7天 关闭提醒
......@@ -42,69 +39,70 @@ public class OrderFollowupRemindJob implements Job {
return;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsService mpAccountsService= SpringContextHolder.getBean(MpAccountsService.class);
MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_FOLLOWUP_MSG");
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.notNull("o.remind_type");
orderConds.notEqual("o.remind_type", "0");
OrderService orderService = SpringContextHolder.getBean(OrderService.class);
List<Order> list = orderService.fetchSearchByPage(orderConds, null, 0, 0);
for (Order order: list) {
//未设置提醒或关闭提醒跳出循环
if (StringUtils.isBlank(order.getRemindType()) || StringUtils.equals(order.getRemindType(), "0")) {
continue;
}
String frequency = order.getTakeFrequency();//药品服用频率
if (StringUtils.isBlank(frequency) || !frequency.contains("/")) {
continue;
}
try {
String[] arr = frequency.split("/");
BigDecimal sum = new BigDecimal(arr[1]);//药品总数
BigDecimal avg = new BigDecimal(arr[0]);//每日服用数量
BigDecimal result = sum.divide(avg, 0, BigDecimal.ROUND_HALF_UP);
Date date = sdf.parse(order.getAcceptExpressDateStr());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int day = 0;
if (StringUtils.equals(order.getRemindType(), "1")) {//7天前
day = result.intValue() - 7;
} else if (StringUtils.equals(order.getRemindType(), "2")) {//当天
day = result.intValue();
} else if (StringUtils.equals(order.getRemindType(), "3")) {//7天后
day = result.intValue() + 7;
} else {
continue;
}
calendar.set(Calendar.MONTH, day);
date = calendar.getTime();
Date nowDate = sdf.parse(sdf.format(new Date()));
if (date.compareTo(nowDate) == 0) {
QyuserService qyuserService = SpringContextHolder.getBean(QyuserService.class);
Qyuser serverUser = qyuserService.fetchById(order.getServiceId());
List<Qyuser> serviceUsers = new ArrayList();
serviceUsers.add(serverUser);
QyMsgUtil qyMsgUtil = SpringContextHolder.getBean(QyMsgUtil.class);
msg += msg + order.getNumber();
qyMsgUtil.sendText(accounts, false, serviceUsers, null, null, agenId, msg, false);
}
} catch (ParseException e) {
e.printStackTrace();
} catch (Exception e) {
e.getMessage();
}
}
executeRemind();
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
// MpAccountsService mpAccountsService= SpringContextHolder.getBean(MpAccountsService.class);
// MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
// Long agenId = Long.parseLong(accountsEntity.getAgentId());
// String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_FOLLOWUP_MSG");
//
// Conds orderConds = new Conds();
// orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
// orderConds.notNull("o.remind_type");
// orderConds.notEqual("o.remind_type", "0");
// OrderService orderService = SpringContextHolder.getBean(OrderService.class);
// List<Order> list = orderService.fetchSearchByPage(orderConds, null, 0, 0);
// for (Order order: list) {
// //未设置提醒或关闭提醒跳出循环
// if (StringUtils.isBlank(order.getRemindType()) || StringUtils.equals(order.getRemindType(), "0")) {
// continue;
// }
//
// String frequency = order.getTakeFrequency();//药品服用频率
// if (StringUtils.isBlank(frequency) || !frequency.contains("/")) {
// continue;
// }
//
// try {
// String[] arr = frequency.split("/");
// BigDecimal sum = new BigDecimal(arr[1]);//药品总数
// BigDecimal avg = new BigDecimal(arr[0]);//每日服用数量
// BigDecimal result = sum.divide(avg, 0, BigDecimal.ROUND_HALF_UP);
// Date date = sdf.parse(order.getAcceptExpressDateStr());
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(date);
//
// int day = 0;
// if (StringUtils.equals(order.getRemindType(), "1")) {//7天前
// day = result.intValue() - 7;
// } else if (StringUtils.equals(order.getRemindType(), "2")) {//当天
// day = result.intValue();
// } else if (StringUtils.equals(order.getRemindType(), "3")) {//7天后
// day = result.intValue() + 7;
// } else {
// continue;
// }
//
// calendar.set(Calendar.MONTH, day);
// date = calendar.getTime();
//
// Date nowDate = sdf.parse(sdf.format(new Date()));
// if (date.compareTo(nowDate) == 0) {
// QyuserService qyuserService = SpringContextHolder.getBean(QyuserService.class);
// Qyuser serverUser = qyuserService.fetchById(order.getServiceId());
// List<Qyuser> serviceUsers = new ArrayList();
// serviceUsers.add(serverUser);
// QyMsgUtil qyMsgUtil = SpringContextHolder.getBean(QyMsgUtil.class);
// msg += msg + order.getNumber();
// qyMsgUtil.sendText(accounts, false, serviceUsers, null, null, agenId, msg, false);
// }
// } catch (ParseException e) {
// e.printStackTrace();
// } catch (Exception e) {
// e.getMessage();
// }
// }
//获得明细数据
......@@ -125,7 +123,36 @@ public class OrderFollowupRemindJob implements Job {
}
}
private void executeRemind() {
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsService mpAccountsService= SpringContextHolder.getBean(MpAccountsService.class);
MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
OrderService orderService = SpringContextHolder.getBean(OrderService.class);
QyuserService qyuserService = SpringContextHolder.getBean(QyuserService.class);
QyMsgUtil qyMsgUtil = SpringContextHolder.getBean(QyMsgUtil.class);
//获取还有7天服用完成订单
List<Map<String, String>> order_1 = orderService.findWaitRemindOrders(-7L);
eachSendMsg(accounts, agenId, order_1, qyuserService, qyMsgUtil, "客户还有7天服用完成药品!");
List<Map<String, String>> order_2 = orderService.findWaitRemindOrders(0L);
eachSendMsg(accounts, agenId, order_2, qyuserService, qyMsgUtil, "客户今日服用完成药品!");
List<Map<String, String>> order_3 = orderService.findWaitRemindOrders(7L);
eachSendMsg(accounts, agenId, order_3, qyuserService, qyMsgUtil, "客户7天前服用完成药品!");
}
private void eachSendMsg(Long accounts, Long agenId, List<Map<String, String>> orders, QyuserService qyuserService, QyMsgUtil qyMsgUtil, String remindStr) {
orders.forEach(item-> {
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_ORDER_FOLLOW_REMIND") + item.get("number") + ";" + remindStr;
Qyuser qyuser = qyuserService.fetchById(item.get("service_id"));
List<Qyuser> qyusers = new ArrayList<>();
qyusers.add(qyuser);
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
});
}
}
......@@ -95,7 +95,8 @@ public class WechatPayUtils {
params.put("nonce_str", randomStr);
params.put("body", SystemConfig.p.getProperty("mch.title"));
params.put("out_trade_no", order.getNumber());
params.put("total_fee", String.valueOf(order.getOrderAmount().intValue() * 100));
Double total = order.getOrderAmount() * 100;
params.put("total_fee", String.valueOf(total.intValue()));
params.put("spbill_create_ip", SystemConfig.p.getProperty("mch.spbill_id"));
params.put("notify_url", SystemConfig.p.getProperty("mch.notify_url"));
params.put("trade_type", "JSAPI");
......
......@@ -10,6 +10,7 @@ import com.cftech.core.generic.GenericService;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 订单管理Service
......@@ -40,7 +41,7 @@ public interface OrderService extends GenericService<Order> {
Integer updateStatus(Long id, String status, String orderCancel);
JSONObject newlyAdded(String datas, Long accountsId);
JSONObject saveOrderDetail(String datas, Long accountsId) throws Exception;
JSONObject deleteAll(Long id);
......@@ -122,4 +123,10 @@ public interface OrderService extends GenericService<Order> {
* @return
*/
JSONObject findRouteDetails(String appId, String orderCode);
/**
* 获取等待提醒的订单发送客服跟进提醒消息
* @return
*/
List<Map<String, String>> findWaitRemindOrders(Long number);
}
......@@ -38,7 +38,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.NoTransactionException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
......@@ -138,9 +140,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return orderMapper.updateStatus(params);
}
@Transactional
@Transactional(rollbackFor = RuntimeException.class)
@Override
public JSONObject newlyAdded(String datas, Long accountsId) {
public JSONObject saveOrderDetail(String datas, Long accountsId) throws Exception {
JSONObject rtnJson = new JSONObject();
OrderDetailDto orderDetailDto = null;
Map<String, Object> params = new HashMap<>();
......@@ -151,7 +153,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Double orderAmount = null;
Order order = null;
boolean flag = false;
try {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
params.put("accountsId", accountsId);
......@@ -193,7 +195,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderDetailDto.setDrugsCode(productDtos.getProductNumber());
orderDetailDto.setDrugsSku(productDtos.getFormat());
orderDetailDto.setAccountsId(accountsId);
Integer result = orderMapper.saveDetill(orderDetailDto);
Integer result = this.saveDetill(orderDetailDto);
if (result > 0) {
flag = true;
}
......@@ -213,17 +215,23 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
rtnJson.put("errorMsg", "确认成功!");
return rtnJson;
}
} else {
//商户号调用失败抛出异常回滚
//new RuntimeException();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
}
} catch (Exception e) {
e.printStackTrace();
rtnJson.put("errorNo", "1");
}
rtnJson.put("errorNo", "1");
return rtnJson;
}
@Transactional(rollbackFor = RuntimeException.class)
public Integer saveDetill(OrderDetailDto orderDetailDto) {
return orderMapper.saveDetill(orderDetailDto);
}
@Override
public JSONObject deleteAll(Long id) {
JSONObject jsonObject = new JSONObject();
......@@ -384,6 +392,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
if(invoiceDto.getType().equals("1")){
//抬头类型为公司则发票税号
invoice.setUnitTaxNumber(invoiceDto.getUnitTaxNumber());
invoice.setStatus("1");
}
invoice.setNumber(codingruleUtils.getNumber(mpAccountsEntity.getId(), Invoice.class.getName()));
invoice.setInvoiceTitle(invoiceDto.getInvoiceTitle());
......@@ -592,4 +601,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return retObj;
}
@Override
public List<Map<String, String>> findWaitRemindOrders(Long number) {
return orderMapper.findWaitRemindOrders(number);
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.UnexpectedRollbackException;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -133,7 +134,7 @@ public class OrderController {
JSONObject remarkObj = JSONObject.parseObject(remarks);
String payUrl = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/orderPay?appid=" + mpAccountsEntity.getAppid() + //
"&tokenId=1&orderId=" + orderFromVO.getId() + "&prepayId=" + remarkObj.getString("prepay_id");
"&tokenId=1&orderId=" + orderFromVO.getId() + "&prepayId=" + remarkObj.getString("prepay_id") + "&timestamp=" + new Date().getTime();
orderFromVO.setPayUrl(payUrl);
}
}
......@@ -190,7 +191,20 @@ public class OrderController {
@ResponseBody
public JSONObject formData(HttpServletRequest request, String datas) {
Long accountsId = UserUtils.getmpaccounts(request);
JSONObject jsonObject = orderService.newlyAdded(datas, accountsId);
JSONObject jsonObject = null;
try {
jsonObject = orderService.saveOrderDetail(datas, accountsId);
} catch (UnexpectedRollbackException e) {
if (jsonObject == null)
jsonObject = new JSONObject();
jsonObject.put("errorNo", 1);
e.printStackTrace();
} catch (Exception e) {
if (jsonObject == null)
jsonObject = new JSONObject();
jsonObject.put("errorNo", 1);
e.printStackTrace();
}
return jsonObject;
}
......@@ -280,7 +294,7 @@ public class OrderController {
if (StringUtils.isNoneBlank(obj.getRemarks())) {
JSONObject remarkObj = JSONObject.parseObject(obj.getRemarks());
String payUrl = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/orderPay?appid=" + mpAccountsEntity.getAppid() + //
"&tokenId=1&orderId=" + obj.getId() + "&prepayId=" + remarkObj.getString("prepay_id");
"&tokenId=1&orderId=" + obj.getId() + "&prepayId=" + remarkObj.getString("prepay_id") + "&timestamp=" + new Date().getTime();
obj.setPayUrl(payUrl);
}
}
......
......@@ -36,6 +36,8 @@
<module>invoice-module-web</module>
<module>logistics-module</module>
<module>logistics-module-web</module>
<module>msgrecord-module</module>
<module>msgrecord-module-web</module>
</modules>
......
......@@ -186,7 +186,7 @@
</div>
<div class="form-group form-md-line-input col-md-12">
<label>服用频率<span style="color:red;">(格式“ 1/10 ” :1表示每天服用数量,10表示单盒药品总数)</span></label>
<label>服用频率<span style="color:red;">(预计单位药品可服用天数[正整数])</span></label>
<input type="text" required class="form-control pull-right"
value="$!{data.takeFrequency}" maxlength="500" required
name="takeFrequency" placeholder="1/100"
......@@ -366,7 +366,7 @@
coverPP = new uePicPicker({
tarId: 'img',
title: '产品封面图',
sizeDes: '205*202',
sizeDes: '100*100',
max: 1,
datas: smallimg=='' ? null : smallimg.split(","),
success: null
......@@ -375,12 +375,11 @@
};
var initPicsSelDetail = function () {
var smallimg = "$!{data.productImgDetail}";
coverPPDetail = new uePicPicker({
tarId: 'imgDetail',
title: '产品详情图',
sizeDes: '205*202',
sizeDes: '400*265',
max: 4,
datas: smallimg=='' ? null : smallimg.split(","),
success: null
......
......@@ -41,7 +41,7 @@ public class ReportJob implements Job {
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date today = new Date(System.currentTimeMillis()-(24*60*60*1000));
Date today = new Date(System.currentTimeMillis() - (24 * 60 * 60 * 1000));
ReportService reportService = SpringContextHolder.getBean(ReportService.class);
OrgUnitService orgUnitService = SpringContextHolder.getBean(OrgUnitService.class);
......@@ -49,14 +49,14 @@ public class ReportJob implements Job {
Conds condPeople = new Conds();
condPeople.equal("DATE_FORMAT(detail.create_time ,'%Y-%m-%d')",format.format(today));
condPeople.equal("detail.del_flag",0);
condPeople.equal("DATE_FORMAT(detail.create_time ,'%Y-%m-%d')", format.format(today));
condPeople.equal("detail.del_flag", 0);
Sort sortPeople = new Sort("detail.create_time", OrderType.DESC);
//获取报表用户信息
List<ReportPeopleInfo> listPeople = reportService.selectReportPeopleInfo(condPeople,sortPeople);
List<ReportPeopleInfo> listPeople = reportService.selectReportPeopleInfo(condPeople, sortPeople);
Report report = null;
if(listPeople.size() > 0){
if (listPeople.size() > 0) {
for (ReportPeopleInfo reportPeopleInfo : listPeople) {
report = new Report();
report.setProductName(reportPeopleInfo.getProductName());
......@@ -72,18 +72,18 @@ public class ReportJob implements Job {
report.setSjTime(reportPeopleInfo.getSjTime());
//根据openId获取扫码记录 只获取医生和组织二维码
Conds condCode = new Conds();
condCode.equal("record.openid",reportPeopleInfo.getOpenId());
condCode.in("record.type",new String[]{"3","4"});
Sort sortCode = new Sort("record.create_time",OrderType.DESC);
List<ReportCode> listCode = reportService.selectReportCodeInfo(condCode,sortCode);
if(listCode.size()>0){
if(listCode.get(0).getType().equals("3")){
condCode.equal("record.openid", reportPeopleInfo.getOpenId());
condCode.in("record.type", new String[]{"3", "4"});
Sort sortCode = new Sort("record.create_time", OrderType.DESC);
List<ReportCode> listCode = reportService.selectReportCodeInfo(condCode, sortCode);
if (listCode.size() > 0) {
if (listCode.get(0).getType().equals("3")) {
//二维码类型为医生 根据绑定的医生人员ID查医生信息
Conds condDoctor = new Conds();
condDoctor.equal("qyuser.id",listCode.get(0).getBindId());
condDoctor.equal("qyuser.del_flag","0");
condDoctor.equal("qyuser.id", listCode.get(0).getBindId());
condDoctor.equal("qyuser.del_flag", "0");
ReportDoctorInfo reportDoctorInfo = reportService.selectReportDoctorInfo(condDoctor);
if(reportDoctorInfo != null){
if (reportDoctorInfo != null) {
report.setDoctorName(reportDoctorInfo.getUserName());
report.setDoctorPhone(reportDoctorInfo.getUserPhone());
report.setDoctorTitle("医生");
......@@ -92,41 +92,41 @@ public class ReportJob implements Job {
String orgParentIds = reportDoctorInfo.getOrgParentIds();
String[] orgParentIdArray = orgParentIds.split(",");
String regionOrgIds = SystemConfig.p.getProperty("REGION_LONG_ID");
if (orgParentIds.contains(regionOrgIds) && orgParentIdArray.length > regionOrgIds.split(",").length){
if (orgParentIds.contains(regionOrgIds) && orgParentIdArray.length > regionOrgIds.split(",").length) {
//若果医生组织id在区域组织下面 则根据大区长编码获取下面所有组织信息
String areIds = regionOrgIds + regionOrgIds.split(",")[4];
Conds condOrg = new Conds();
condOrg.rightLike("t.parent_ids",areIds);
Sort sortOrg = new Sort("t.parent_id",OrderType.ASC);
List<OrgUnit> orgUnits = orgUnitService.fetchSearchByPage(0L,condOrg,sortOrg,0,0);
if (orgUnits.size() > 0){
condOrg.rightLike("t.parent_ids", areIds);
Sort sortOrg = new Sort("t.parent_id", OrderType.ASC);
List<OrgUnit> orgUnits = orgUnitService.fetchSearchByPage(0L, condOrg, sortOrg, 0, 0);
if (orgUnits.size() > 0) {
//若根据大区长编码查出数据 循环
for (OrgUnit orgUnit : orgUnits){
for (OrgUnit orgUnit : orgUnits) {
int level = orgUnit.getParentIds().split(",").length;
if (level == 4){
if (level == 4) {
// 大区
report.setRegion(orgUnit.getOrgName());
}else if (level == 5){
} else if (level == 5) {
// 省
report.setProvince(orgUnit.getOrgName());
}else if (level == 6) {
} else if (level == 6) {
// 市
report.setCity(orgUnit.getOrgName());
}else if (level == 7) {
} else if (level == 7) {
//医院
report.setHospital(orgUnit.getOrgName());
// 根据医院组织ID 查找医院下面的销售代表
Conds condDepartment = new Conds();
condDepartment.equal("t.org_id",orgUnit.getId());
List<Qyuser> listUser = qyuserService.fetchSearchByPage(0L,condDepartment,null,0,0);
condDepartment.equal("t.org_id", orgUnit.getId());
List<Qyuser> listUser = qyuserService.fetchSearchByPage(0L, condDepartment, null, 0, 0);
StringBuffer sb = new StringBuffer();
if(listUser.size() > 0){
if (listUser.size() > 0) {
for (Qyuser qyuser : listUser) {
sb.append(qyuser.getName() + ",");
}
}
report.setSalesRepresent(sb.toString());
}else if (level == 8) {
} else if (level == 8) {
//科室
report.setDepartment(orgUnit.getOrgName());
}
......@@ -135,54 +135,54 @@ public class ReportJob implements Job {
}
}
}
}else{
} else {
//二维码类型为组织 根据绑定的组织ID获取对应组织信息
OrgUnit orgUnitObj = orgUnitService.fetchById(listCode.get(0).getBindId());
if(orgUnitObj != null){
if (orgUnitObj != null) {
String orgParentIds = orgUnitObj.getParentIds();
String[] orgParentIdArray = orgParentIds.split(",");
String regionOrgIds = SystemConfig.p.getProperty("REGION_LONG_ID");
if (orgParentIds.contains(regionOrgIds) && orgParentIdArray.length > regionOrgIds.split(",").length){
if (orgParentIds.contains(regionOrgIds) && orgParentIdArray.length > regionOrgIds.split(",").length) {
//若果医生组织id在区域组织下面 则根据大区长编码获取下面所有组织信息
String areIds = regionOrgIds + orgParentIdArray[3];
Conds condOrg = new Conds();
condOrg.rightLike("t.parent_ids",areIds);
Sort sortOrg = new Sort("t.parent_id",OrderType.ASC);
List<OrgUnit> orgUnits = orgUnitService.fetchSearchByPage(0L,condOrg,sortOrg,0,0);
if (orgUnits.size() > 0){
condOrg.rightLike("t.parent_ids", areIds);
Sort sortOrg = new Sort("t.parent_id", OrderType.ASC);
List<OrgUnit> orgUnits = orgUnitService.fetchSearchByPage(0L, condOrg, sortOrg, 0, 0);
if (orgUnits.size() > 0) {
//若根据大区长编码查出数据 循环
for (OrgUnit orgUnit : orgUnits){
for (OrgUnit orgUnit : orgUnits) {
int level = orgUnit.getParentIds().split(",").length;
if (level == 4){
if (level == 4) {
// 大区
report.setRegion(orgUnit.getOrgName());
}else if (level == 5){
} else if (level == 5) {
// 省
report.setProvince(orgUnit.getOrgName());
}else if (level == 6) {
} else if (level == 6) {
// 市
report.setCity(orgUnit.getOrgName());
}else if (level == 7) {
} else if (level == 7) {
//医院
report.setHospital(orgUnit.getOrgName());
// 根据医院组织ID 查找医院下面的销售代表
Conds condDepartment = new Conds();
condDepartment.equal("t.org_id",orgUnit.getId());
List<Qyuser> listUser = qyuserService.fetchSearchByPage(0L,condDepartment,null,0,0);
condDepartment.equal("t.org_id", orgUnit.getId());
List<Qyuser> listUser = qyuserService.fetchSearchByPage(0L, condDepartment, null, 0, 0);
StringBuffer sb = new StringBuffer();
if(listUser.size() > 0){
if (listUser.size() > 0) {
for (int i = 0; i < listUser.size(); i++) {
Qyuser qyUser = listUser.get(i);
if(i == listUser.size()-1){
sb.append(qyUser.getName() );
}else{
if (i == listUser.size() - 1) {
sb.append(qyUser.getName());
} else {
sb.append(qyUser.getName() + ",");
}
}
}
report.setSalesRepresent(sb.toString());
}else if (level == 8) {
} else if (level == 8) {
//科室
report.setDepartment(orgUnit.getOrgName());
}
......@@ -193,16 +193,16 @@ public class ReportJob implements Job {
}
//查找医生信息
Conds conds = new Conds();
conds.equal("record.openid",reportPeopleInfo.getOpenId());
conds.in("record.type",new String[]{"3"});
Sort sort = new Sort("record.create_time",OrderType.DESC);
List<ReportCode> list = reportService.selectReportCodeInfo(conds,sort);
if(list.size() > 0){
conds.equal("record.openid", reportPeopleInfo.getOpenId());
conds.in("record.type", new String[]{"3"});
Sort sort = new Sort("record.create_time", OrderType.DESC);
List<ReportCode> list = reportService.selectReportCodeInfo(conds, sort);
if (list.size() > 0) {
Conds condDoctor = new Conds();
condDoctor.equal("qyuser.id",listCode.get(0).getBindId());
condDoctor.equal("qyuser.del_flag","0");
condDoctor.equal("qyuser.id", listCode.get(0).getBindId());
condDoctor.equal("qyuser.del_flag", "0");
ReportDoctorInfo reportDoctorInfo = reportService.selectReportDoctorInfo(condDoctor);
if (reportDoctorInfo != null){
if (reportDoctorInfo != null) {
report.setDoctorName(reportDoctorInfo.getUserName());
report.setDoctorPhone(reportDoctorInfo.getUserPhone());
report.setDoctorTitle("医生");
......@@ -221,7 +221,6 @@ public class ReportJob implements Job {
}
//获得明细数据
JobDataMap jobInfo = context.getJobDetail().getJobDataMap();
//这个也是ID主键
......@@ -244,12 +243,12 @@ public class ReportJob implements Job {
public static void main(String[] args) {
String str = "0,1,5,36,40,41,";
String[] arry = str.split(",");
if(str.contains("0,1,5,")){
if (str.contains("0,1,5,")) {
System.out.println(arry.length);
}
}
public Report setOrgUnitInfo (String orgParentId , Report report){
public Report setOrgUnitInfo(String orgParentId, Report report) {
return report;
}
......
......@@ -7,10 +7,7 @@ import com.cftech.accounts.service.JobService;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.SpringContextHolder;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.core.util.*;
import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.service.LogisticsService;
import com.cftech.member.model.Member;
......@@ -33,10 +30,7 @@ import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 同步顺丰物流节点接口
......@@ -127,11 +121,14 @@ public class WaybillRouterJob implements Job {
routConds.equal("number", routObj.getString("remark"));
Logistics logistics = logisticsService.fetchSearchByConds(routConds);
if (logistics == null) {
//路由事件节点
Date acceptTime = DateFormatUtils.formatDate(routObj.getString("acceptTime"), "yyyy-MM-dd HH:mm:ss");
logistics = new Logistics();
logistics.setAccountsId(accoountId);
logistics.setMailNo(mailNo);
logistics.setOrderNo(waybill.getOrderCode());
logistics.setAcceptTime(routObj.getDate("acceptTime"));
logistics.setAcceptTime(acceptTime);
logistics.setAcceptAddress(routObj.getString("acceptAddress"));
logistics.setNumber(routObj.getString("remark"));
logistics.setOpcode(routObj.getString("opCode"));
......@@ -139,13 +136,13 @@ public class WaybillRouterJob implements Job {
//订单收件
if (StringUtils.equals(routObj.getString("opCode"), "50")) {
waybill.setSendExpressDate(routObj.getDate("acceptTime"));
waybill.setSendExpressDate(acceptTime);
waybillService.update(waybill);
}
//订单签收
if (StringUtils.equals(routObj.getString("opCode"), "80")) {
waybill.setAcceptExpressDate(routObj.getDate("acceptTime"));
waybill.setAcceptExpressDate(acceptTime);
waybillService.update(waybill);
//回写订单已完成状态
......
......@@ -180,25 +180,25 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W
waybill.setWaybillRemark(msgData.getString("remark"));//不可派发原因
//更新出库批次号
// if (StringUtils.isNoneBlank(datas) && JSONObject.parseArray(datas).size() > 0) {
// JSONArray arr = JSONObject.parseArray(datas);
//
// Conds orderDesConds = new Conds();
// orderDesConds.equal("d.del_flag", Constants.DEL_FLAG_0);
// orderDesConds.equal("d.order_id", orderId);
// List<OrderDetails> orderDetailsList = orderDetailsService.fetchSearchByPage(orderDesConds, null, 0, 0);
// for (OrderDetails orderDetails : orderDetailsList) {
// for (int i=0; i< arr.size(); i++) {
// JSONObject obj = arr.getJSONObject(i);
// if (StringUtils.equals(orderDetails.getDrugsCode(), obj.getString("productCode"))) {
// orderDetails.setDrugsName(obj.getString("productName"));
// orderDetails.setDrugsMateriel(obj.getString("batchNo"));
// orderDetailsService.update(orderDetails);
// continue;
// }
// }
// }
// }
if (StringUtils.isNoneBlank(datas) && JSONObject.parseArray(datas).size() > 0) {
JSONArray arr = JSONObject.parseArray(datas);
Conds orderDesConds = new Conds();
orderDesConds.equal("d.del_flag", Constants.DEL_FLAG_0);
orderDesConds.equal("d.order_id", orderId);
List<OrderDetails> orderDetailsList = orderDetailsService.fetchSearchByPage(orderDesConds, null, 0, 0);
for (OrderDetails orderDetails : orderDetailsList) {
for (int i=0; i< arr.size(); i++) {
JSONObject obj = arr.getJSONObject(i);
if (StringUtils.equals(orderDetails.getDrugsCode(), obj.getString("productCode"))) {
orderDetails.setDrugsName(obj.getString("productName"));
orderDetails.setDrugsMateriel(obj.getString("batchNo"));
orderDetailsService.update(orderDetails);
continue;
}
}
}
}
waybillMapper.save(waybill);
orderService.update(order);
......
......@@ -303,8 +303,6 @@ public class ExpressOrderInfoUtils {
verifyText.append(timestamp);
verifyText.append(checkWord);
//String verifyText = msgData + timestamp + checkWord;
//因业务报文中可能包含加号、空格等特殊字符,需要urlEnCode处理
String text = URLEncoder.encode(verifyText.toString(), "UTF-8");
......
......@@ -110,6 +110,7 @@
>
<th>粉丝openid</th>
<th>二维码类型</th>
<th>二维码对象</th>
<th>二维码</th>
<th>扫码时间</th>
</tr>
......@@ -218,6 +219,9 @@
{
"mData": "type"
},
{
"mData": "objName"
},
{
"mData": "ticket"
},
......@@ -256,14 +260,14 @@
}
},
{
"aTargets": [3],
"mData": "openid",
"aTargets": [4],
"mData": "ticket",
"mRender": function (a, b, c, d) {
return "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + a + "' style='width: 80px;height: 80px;'>";
}
},
{
"aTargets": [4],
"aTargets": [5],
"mData": "createTime",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
......
......@@ -19,6 +19,7 @@
<result column="description" property="description"/>
<result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/>
<result column="objName" property="objName"/>
</resultMap>
<sql id="sqlWhere">
......@@ -49,23 +50,23 @@
</sql>
<sql id="sqlColumns">
id,
number,
openid,
type,
ticket,
empname,
keywords,
mobile,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by
</sql>
id,
number,
openid,
type,
ticket,
empname,
keywords,
mobile,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by
</sql>
<insert id="save" parameterType="com.cftech.behavior.qrcode.record.model.QrcodeRecord" useGeneratedKeys="true"
......@@ -103,15 +104,35 @@
</select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_behavior_qrcode_record
SELECT COUNT(1) FROM t_behavior_qrcode_record t
LEFT JOIN t_orgunit o ON t.keywords = o.id AND (t.type = '1' OR t.type = '2' OR t.type = '3')
LEFT JOIN t_qyuser u ON t.keywords = u.id AND t.type = '4'
<include refid="sqlWhere"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_behavior_qrcode_record
t.id,
t.number,
t.openid,
t.type,
t.ticket,
t.empname,
t.keywords,
t.mobile,
t.accounts_id,
t.del_flag,
t.status,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
CASE WHEN t.type = '1' OR t.type = '2' OR t.type = '3' THEN u.name WHEN t.type = '4' THEN o.org_name ELSE '其他' END objName
FROM t_behavior_qrcode_record t
LEFT JOIN t_qyuser u ON t.keywords = u.id AND (t.type = '1' OR t.type = '2' OR t.type = '3')
LEFT JOIN t_orgunit o ON t.keywords = o.id AND t.type = '4'
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......
......@@ -54,6 +54,8 @@ public class QrcodeRecord implements Serializable {
/* 更新人 */
private Long updateBy;
private String objName;
public QrcodeRecord() {
this.delFlag = false;
this.status = "0";
......
......@@ -107,13 +107,13 @@ public class QrcodeRecordController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, QrcodeRecord qrcodeRecord, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountsId);
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.accounts_id", accountsId);
if (!StringUtils.isEmpty(qrcodeRecord.getOpenid())) {
conds.like("openid", qrcodeRecord.getOpenid());
conds.like("t.openid", qrcodeRecord.getOpenid());
}
if (!StringUtils.isEmpty(qrcodeRecord.getType())) {
conds.like("type", qrcodeRecord.getType());
conds.like("t.type", qrcodeRecord.getType());
}
// if (!StringUtils.isEmpty(qrcodeRecord.getTicket())) {
// conds.like("ticket", qrcodeRecord.getTicket());
......@@ -127,7 +127,7 @@ public class QrcodeRecordController {
// if (!StringUtils.isEmpty(qrcodeRecord.getMobile())) {
// conds.like("mobile", qrcodeRecord.getMobile());
// }
Sort sort = new Sort("create_time", OrderType.DESC);
Sort sort = new Sort("t.create_time", OrderType.DESC);
List<QrcodeRecord> list = qrcodeRecordService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = qrcodeRecordService.count(conds);
......@@ -159,8 +159,8 @@ public class QrcodeRecordController {
Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("del_flag", 0);
conds.equal("accounts_id", accountId);
conds.equal("t.del_flag", 0);
conds.equal("t.accounts_id", accountId);
List<QrcodeRecord> list = qrcodeRecordService.fetchSearchByPage(conds, sort, 0, 0);
ExcelKit.$Export(QrcodeRecord.class, response).toExcel(list, "扫码记录信息");
}
......
......@@ -39,6 +39,8 @@ QY_SEND_SERVICE_AUDIT_FAIL_MAG=\u60A8\u6536\u5230\u4E00\u5F20\u5BA1\u6838\u672A\
#\u56FE\u7247\u4E0A\u4F20\u5730\u5740
#userfiles.imgdir=/mydata/fileResource
userfiles.imgdir=/mydata/fileResource
#\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863\u5730\u5740
userfiles.msgdir=/mydata/wechatSdk/
#\u56FE\u7247\u8BBF\u95EE\u5730\u5740
IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME}
......
......@@ -25,6 +25,8 @@ MOBILE_MP_DOMAIN_NAME=https://pe.aidea.com.cn/aideas
QY_DOMAIN=https://pe.aidea.com.cn
#\u4F01\u4E1A\u53F7\u63A8\u9001\u9ED8\u8BA4\u5E94\u7528id
QY_SEND_APPID=350
#\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863
QY_CHAT_WORK=351
#\u63A8\u9001\u5BA2\u670D\u6D88\u606F\u6DFB\u52A0\u7528\u6237
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
#\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355
......@@ -35,10 +37,15 @@ QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5
QY_SEND_SERVICE_FOLLOWUP_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u8BA2\u5355\u8DDF\u8FDB\u63D0\u9192\uFF0C\u8BA2\u5355\u7F16\u7801\uFF1A
#\u54A8\u8BE2\u5355\u5BA1\u6838\u5931\u8D25\u63A8\u9001\u6D88\u606F
QY_SEND_SERVICE_AUDIT_FAIL_MAG=\u60A8\u6536\u5230\u4E00\u5F20\u5BA1\u6838\u672A\u901A\u8FC7\u7684\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
#\u8BA2\u5355\u5F85\u66F4\u8FDB\u63D0\u9192
QY_SEND_SERVICE_ORDER_FOLLOW_REMIND=\u60A8\u6709\u4E00\u5F20\u5F85\u8DDF\u8FDB\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801\uFF1A
#\u56FE\u7247\u4E0A\u4F20\u5730\u5740
#userfiles.imgdir=/mydata/fileResource
userfiles.imgdir=/mydata/fileResource
#\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863\u5730\u5740
userfiles.msgdir=/mydata/wechatSdk/
userfiles.imagedir=/mydata/wechatImage
#\u56FE\u7247\u8BBF\u95EE\u5730\u5740
IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME}
......@@ -50,7 +57,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true
jwt.domain=pe.aidea.com.cn
jwt.domain=localhost
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
......@@ -98,3 +105,4 @@ mch.secret_key=4bcd5546d65f4d88bf1ba549436e0e9f
mch.notify_url=https://pe.aidea.com.cn/aidea/mobile/auth/order/wechatCallback
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898
mch.title=\u8BFA\u5EB7\u5927\u836F\u623F\u54A8\u8BE2\u5E73\u53F0
432503199206040032,432503199203056646
\ No newline at end of file
......@@ -7,7 +7,7 @@
<span class="logo-mini"><b>Aidea</b></span>
<!-- logo for regular state and mobile devices -->
<!--#if($session.getAttribute("isshow") == '2') -->
<span class="logo-lg"><b>艾迪健康平台</b></span>
<span class="logo-lg"><b>诺康咨询服务平台</b></span>
<!--#else if($session.getAttribute("isshow") == '1') -->
<!--<span class="logo-lg"><b>CF</b>汤沟微信后台</span>-->
<!--#end -->
......
......@@ -2,7 +2,9 @@ package com.cftech.base.codingrule.utils;
import com.cftech.base.codingrule.model.Codingrule;
import com.cftech.base.codingrule.service.CodingruleService;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.SpringContextHolder;
import com.cftech.core.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
......@@ -52,7 +54,7 @@ public class CodingruleUtils {
String key = accountsId + "-" + clzName;
String lastkey = accountsId + "-" + clzName + "-" + lastDate;
if(tpl.indexOf(dateformatStr) != -1){
key+="-" + today;;
key+="-" + today;
//如果模版包含日期,则删除昨日的key值
if (getConfig().hasKey(lastkey)) {
getConfig().delete(lastkey);
......@@ -72,38 +74,20 @@ public class CodingruleUtils {
* 年份后两位+月份两位+四位数从0开始排序
* @return
*/
public String getAlias() {
public String getAlias(String isDel) {
String key = "FANSS_ENTITY_NUMBER";
if (StringUtils.equals(isDel, "1")) {//每月执行一次记录是否删除主键自增长
getConfig().delete(key);
}
String dateFormatStr = "yyMM";
SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStr);
String today = sdf.format(new Date());
String key = "FANSS_ENTITY_NUMBER";
String tplNum = "0000";
long count = getConfig().opsForValue().increment(key, 1);
String number = String.valueOf(count);
number = today + tplNum.substring(0, tplNum.length() - number.length()) + number;
System.out.println(number);
return number;
}
// public static void main(String[] args) {
// RedisTemplate<String, String> redisTemplate = SpringContextHolder.getBean(RedisTemplate.class);
// StringRedisSerializer stringSerializer = new StringRedisSerializer();
// redisTemplate.setKeySerializer(stringSerializer);
//// redisTemplate.setValueSerializer(stringSerializer);
// redisTemplate.setHashKeySerializer(stringSerializer);
// redisTemplate.setHashValueSerializer(stringSerializer);
//
// String dateFormatStr = "yyMM";
// SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStr);
// String today = sdf.format(new Date());
//
//
// String key = "FANSS_ENTITY_NUMBER";
// String tplNum = "0000";
// long count = redisTemplate.opsForValue().increment(key, 1);
// String number = String.valueOf(count);
// number = today + tplNum.substring(0, tplNum.length() - number.length()) + number;
// System.out.println(number);
// //getAlias();
// }
}
......@@ -195,10 +195,10 @@
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
select COUNT(1) from (
SELECT COUNT(1)FROM t_shipping_address t
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
LEFT JOIN t_order o ON o.openid = t.open_id
INNER JOIN area a ON t.province_id = a.areaid
INNER JOIN area b ON t.city_id = b.areaid
INNER JOIN area c ON t.area_id = c.areaid
INNER JOIN t_order o ON o.openid = t.open_id
<include refid="sqlWhere"/>
GROUP BY t.id) tmp
</select>
......@@ -207,10 +207,10 @@
SELECT
<include refid="sqlColumns"/>, concat( a.areaname ,b.areaname, c.areaname, t.address ) name
FROM t_shipping_address t
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
LEFT JOIN t_order o ON o.openid = t.open_id
INNER JOIN area a ON t.province_id = a.areaid
INNER JOIN area b ON t.city_id = b.areaid
INNER JOIN area c ON t.area_id = c.areaid
INNER JOIN t_order o ON o.openid = t.open_id
<include refid="sqlWhere"/>
GROUP BY t.id
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
......
......@@ -71,7 +71,7 @@ public class AddressController {
//提交数据(新增、修改)
@RequiresPermissions(value = ADDRESS_EDIT)
@RequestMapping(value = "/formData", method = {RequestMethod.GET})
@RequestMapping(value = "/formData", method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody
public JSONObject formData(Address address, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
......@@ -91,7 +91,7 @@ public class AddressController {
address.setCreateBy(UserUtils.getUser().getId());
address.setUpdateBy(UserUtils.getUser().getId());
addressService.save(address);
rtnJson.put("errorNo", 0);
}
} catch (Exception e) {
rtnJson.put("errorNo", 1);
......
......@@ -73,84 +73,96 @@
<!-- general form elements disabled -->
<div class="box box-primary">
<form role="form" id="myForm">
<input id="id" name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body">
<div class="form-group form-md-line-input">
<label>openId<font style="color: red"></font></label>
<input type="text"
class="form-control" name="consultId"
id="openId" readonly="readonly"
maxlength="50" placeholder="openId"
value="$!{data.openId}"
>
<input id="id" name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body">
<div class="form-group form-md-line-input col-md-12">
<label>openid</label>
<div class="input-group">
<input type="text" name="openId" id="openId"
value="$!{data.openId}"
class="form-control" style="display: none">
<input type="text" id="previewOpenId"
name="previewOpenId" value="$!{previewOpenId}"
class="form-control" disabled>
<span class="input-group-btn">
<button type="button" id="openidSelect"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
<label>患者姓名<font style="color: red"></font></label>
<input type="text"
class="form-control" name="addressName"
id="addressName" readonly="readonly"
maxlength="50" placeholder="患者姓名"
value="$!{data.addressName}"
>
<label>性别<font style="color: red"></font></label>
<input type="text"
class="form-control" name="sex"
id="sex" readonly="readonly"
maxlength="50" placeholder="性别"
value="$!{data.sex}"
>
<label>联系方式<font style="color: red"></font></label>
<input type="text"
class="form-control" name="phone"
id="phone" readonly="readonly"
maxlength="50" placeholder="联系方式"
value="$!{data.phone}"
>
<!-- $!{data.provinceId}-->
<!-- $!{data.provinceName}-->
</div>
<div class="form-group form-md-line-input col-md-12">
<label>患者姓名<font style="color: red"></font></label>
<input type="text"
class="form-control" name="addressName"
id="addressName"
maxlength="50" placeholder="患者姓名"
value="$!{data.addressName}"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>联系方式<font style="color: red"></font></label>
<input type="text"
class="form-control" name="phone"
id="phone"
maxlength="50" placeholder="联系方式"
value="$!{data.phone}"
>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>省份<font style="color: red"></font></label><br>
<!-- <input class="form-control" id="province" name="provinceName"-->
<!-- type="text" readonly="readonly"-->
<!-- maxlength="50" placeholder="省份"-->
<!-- value="$!{data.provinceName}"-->
<!-- >-->
<select id="province" name="provinceId" onchange="getCityList(this.value)"
class="form-control required">
<option value="">请选择省份</option>
</select>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>城市<font style="color: #ff0000"></font></label><br>
<!-- <input class="form-control" id="city" name="cityName"-->
<!-- type="text" readonly="readonly"-->
<!-- maxlength="50" placeholder="城市"-->
<!-- value="$!{data.cityName}"-->
<!-- >-->
<select id="city" name="cityId" onchange="getReginList(this.value);"
class="form-control required">
<option value="">请选择城市</option>
</select>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>省份<font style="color: red"></font></label><br>
<input class="form-control" id="province" name="provinceName"
type="text" readonly="readonly"
maxlength="50" placeholder="省份"
value="$!{data.provinceName}"
>
<!-- onchange="getCityList(this.value);"-->
<!-- <option></option>-->
</input><br>
<label>城市<font style="color: #ff0000"></font></label><br>
<input class="form-control" id="city" name="cityName"
type="text" readonly="readonly"
maxlength="50" placeholder="城市"
value="$!{data.cityName}"
>
<!-- onchange="getReginList(this.value);"-->
<label>区/县<font style="color: red"></font></label><br>
<!-- <input class="form-control" id="county" name="countyName"-->
<!-- type="text" readonly="readonly"-->
<!-- maxlength="50" placeholder="城市"-->
<!-- value="$!{data.countyName}"-->
<!-- >-->
<select id="county" name="areaId" class="form-control required">
<option value="">请选择区/县</option>
</select>
</div>
<div class="form-group form-md-line-input col-md-12">
<label>详细地址<font style="color: red"></font></label>
<input type="text"
class="form-control" name="address"
id="address"
maxlength="50" placeholder="联系方式"
value="$!{data.address}"
>
</div>
<input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/>
<input type="text" style="display: none" name="_csrf_header" value="${_csrf.headerName}"/>
<!-- <option></option>-->
</input><br>
<label>区/县<font style="color: red"></font></label><br>
<input class="form-control" id="county" name="countyName"
type="text" readonly="readonly"
maxlength="50" placeholder="城市"
value="$!{data.countyName}"
>
<!-- <option></option>-->
</input><br>
<label>详细地址<font style="color: red"></font></label>
<input type="text"
class="form-control" name="address"
id="address" readonly="readonly"
maxlength="50" placeholder="联系方式"
value="$!{data.address}"
>
</div>
<div class="box-footer">
<!-- #if($shiro.hasPermission("qy:address:edit"))-->
<!-- <input class="btn btn-primary" id="save" value="保存" type="button" onclick="tijiao()">-->
<!-- #end-->
<a href="#springUrl('/a/address/list')" class="btn btn-default">返回</a>
</div>
<div class="box-footer">
#if($shiro.hasPermission("qy:address:edit"))
<input class="btn btn-primary" id="save" value="保存" type="submit" >
#end
<a href="#springUrl('/a/address/list')" class="btn btn-default">返回</a>
</div>
</form>
<!-- /.box-body -->
</div><!-- /.box -->
......@@ -192,199 +204,220 @@
<script src="common/js/cfapp.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<script>
var csrfheader = {name:'_csrf_header',value:'${_csrf.headerName}'};
var csrftoken = {name:'_csrf',value:'${_csrf.token}'};
let areaList=null
let listProvince=null
let listCity=null
let listRegin=null
function tijiao(){
var url = "#springUrl('/a/address/formData')"
var provinceId = $("#province").val();
var cityId = $("#city").val();
var areaId = $("#county").val();
var address =$("#address").val();
var id= $("#id").val();
$.ajax({
type: "POST", //提交的方法
url:url, //提交的地址
data:{"_csrf_header":csrfheader.value,"_csrf":csrftoken.value, id,provinceId,cityId,areaId,address},// 序列化表单值
async: false,
success: function(data) { //成功
var csrfheader = {name: '_csrf_header', value: '${_csrf.headerName}'};
var csrftoken = {name: '_csrf', value: '${_csrf.token}'};
let areaList = null
let listProvince = null
let listCity = null
let listRegin = null
// function tijiao() {
// var url = "#springUrl('/a/address/formData')"
// var provinceId = $("#province").val();
// var cityId = $("#city").val();
// var areaId = $("#county").val();
// var address = $("#address").val();
// var id = $("#id").val();
// $.ajax({
// type: "POST", //提交的方法
// url: url, //提交的地址
// data: {"_csrf_header": csrfheader.value, "_csrf": csrftoken.value, id, provinceId, cityId, areaId, address},// 序列化表单值
// async: false,
// success: function (data) { //成功
//
// if (data) {
//
// location.href = "#springUrl('/a/address/list')";
// } else {
// alert("修改失败")
// }
//
// }
// });
// }
if (data){
jQuery(document).ready(function () {
var url = "#springUrl('/a/address/listArea')"
$.ajax({
url: url,
type: "GET",
success: function (data) {
console.log(data)
areaList = data;
listProvince = data.filter(x => x.cityType == 1)
var province = document.querySelector('#province') //querySelector获取id="province"的元素
for (index in listProvince) {
var op = new Option(listProvince[index].areaName, listProvince[index].areaId, false, false)
//将循环出来的元素追加到province下拉框里
province.options[province.length] = op
}
var provinceId = "$!{data.provinceId}";
$('#province option').each(function () {
if ($(this).val() == provinceId) {
$(this).attr('selected', 'selected');
getCityList(provinceId);
}
})
location.href = "#springUrl('/a/address/list')";
}else {
alert("修改失败")
}
});
// var all_select = $('#province > option')
//
// for (var i = 0; i < all_select.length; i++) {
// console.log(all_select.length)
// var svalue = all_select[i]
// console.log(svalue+"$!{data.provinceId}")
// if (svalue == '') {
// console.log("$!{data.provinceName}")
// //取select中所有的option的值与其进行对比,相等则令这个option添加上selected属性
// $("#province option[value='" + svalue + "']").attr('selected', 'selected')
// }
// }'
}
$('#openidSelect').on('click', function() {
preview();
});
Cfapp.init();
recdTypeAdd.init();
});
}
function getCityList(areaId) {
listCity = areaList.filter(x => x.affiliationareaId == areaId && x.cityType == 2)
$("#city").empty();
$("#county").empty();
var city = document.querySelector('#city')
for (index in listCity) {
var op = new Option(listCity[index].areaName, listCity[index].areaId, false, false)
//将循环出来的元素追加到province下拉框里
city.options[city.length] = op
}
if (listCity.length==1){
getReginList(listCity[0].areaId);
}
getReginList($("#city").val())
var province = $("#province option:selected").val()
if (province==""){
$("#city").append(`<option value = "">请选择城市</option>`);
$("#county").append(`<option value = "">请选择区/县</option>`);
}
$().ready(function () {
}
var sex = $("#sex").val();
if (sex == '0') {
$("#sex").val("女");
} else if (sex == '0') {
$("#sex").val("男");
} else {
$("#sex").val("");
function getReginList(areaId) {
listRegin = areaList.filter(x => x.affiliationareaId == areaId && x.cityType == 3)
$("#county").empty();
var county = document.querySelector('#county')
for (index in listRegin) {
var op = new Option(listRegin[index].areaName, listRegin[index].areaId, false, false)
//将循环出来的元素追加到province下拉框里,第一次训话length=1,第二次循环length=2
county.options[county.length] = op
}
})
}
// var url = "#springUrl('/a/address/listArea')"
// $.ajax({
// url:url,
// type:"GET",
// success:function(data){
// console.log(data)
// areaList=data
// listProvince=data.filter(x=>x.cityType==1)
// var province = document.querySelector('#province') //querySelector获取id="province"的元素
// for (index in listProvince) {
// var op = new Option(listProvince[index].areaName, listProvince[index].areaId, false, false)
// //将循环出来的元素追加到province下拉框里
// province.options[province.length] = op
// }
// var provinceId = "$!{data.provinceId}";
// $('#province option').each(function () {
// if($(this).val() == provinceId){
// $(this).attr('selected', 'selected');
// getCityList(provinceId);
// }
// })
//
// }
// });
// // var all_select = $('#province > option')
// //
// // for (var i = 0; i < all_select.length; i++) {
// // console.log(all_select.length)
// // var svalue = all_select[i]
// // console.log(svalue+"$!{data.provinceId}")
// // if (svalue == '') {
// // console.log("$!{data.provinceName}")
// // //取select中所有的option的值与其进行对比,相等则令这个option添加上selected属性
// // $("#province option[value='" + svalue + "']").attr('selected', 'selected')
// // }
// // }'
//
//
//
//
// Cfapp.init();
// // recdTypeAdd.init();
// });
//
// function getCityList(areaId) {
// listCity=areaList.filter(x=>x.affiliationareaId==areaId&&x.cityType==2)
// $("#city").empty();
// $("#county").empty();
// var city = document.querySelector('#city')
// for (index in listCity) {
// var op = new Option(listCity[index].areaName, listCity[index].areaId, false, false)
// //将循环出来的元素追加到province下拉框里
// city.options[city.length] = op
// }
// var cityId = "$!{data.cityId}";
// $('#city option').each(function () {
// if($(this).val() == cityId){
// $(this).attr('selected', 'selected');
// getReginList(cityId);
// }
// })
//
// }
//
// function getReginList(areaId) {
// listRegin=areaList.filter(x=>x.affiliationareaId==areaId&&x.cityType==3)
// $("#county").empty();
// var county = document.querySelector('#county')
// for (index in listRegin) {
// // 1、new Option("文本","值",true,true).后面两个true分别表示默认被选中和有效
// var op = new Option(listRegin[index].areaName, listRegin[index].areaId, false, false)
// //将循环出来的元素追加到province下拉框里,第一次训话length=1,第二次循环length=2
// county.options[county.length] = op
// }
// var countyId = "$!{data.countyId}";
// $('#county option').each(function () {
// if($(this).val() == countyId){
// $(this).attr('selected', 'selected');
// }
// })
// }
//
//
//
//
var fanssList = "#springUrl('/a/managefanss/fanss/fetchdata')";
function preview() {
Cfapp.f7({
dataUrl: fanssList,
checkType: 'single', // 多选为multi
title: "选择粉丝",
btnoktext: "确定",
btncanceltext: "取消",
columns: ['选择', '头像', '昵称'],
isSearch: '0',
searchColumns:["nickname"],//搜索的字段名称
searchColumnsRemarks:['昵称'],//搜索的字段备注
aoColumns: [{
"mData": "openid"
}, {
"mData": "headimgurl"
}, {
"mData": "nickname"
}],
aoColumnDefs: [{
"aTargets":[0],
"mData":"openid",
"mRender":function (a,b,c,d) {
return '<input type="radio" id="' + a + '" name="sel" data-value="' + a + '" data-name="' + c.nickname + '">';
}
},{
"aTargets": [1],
"mData": "img",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return "<img src='"+a+"' style='width: 80px;height:80px;' />";
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'openId', // 储存的字段
displayFields:'previewOpenId'
})
}
// var recdTypeAdd = function () {
// var initForm = function () {
// var initFormCtrl = function () {
// bindEvent();
// };
// var bindEvent = function () {
//
// $("#myForm").validate({
// rules: {},
// messages: {},
// submitHandler: function (form) {
// // $("#save").attr("disabled", true);
//
// $.getJSON("#springUrl('/a/address/formData')",$("#myForm").serialize(), function (returnobj) {
// // $("#save").attr("disabled", false);
// if (returnobj.errorNo == 2) { //保存成功
// Cfapp.confirm({
// message: "添加成功",
// btnoktext: "继续添加",
// btncanceltext: "关闭",
// success: function () {
// location.href = "#springUrl('/a/address/form')";
// },
// cancel: function () {
// location.href = "#springUrl('/a/address/list')";
// }
// });
// } else if (returnobj.errorNo == 0) { //修改成功
// Cfapp.alert({
// message: "更新成功",
// btntext: "确定",
// success: function () {
// location.href = "#springUrl('/a/address/list')";
// }
// });
// } else {
// Cfapp.alert({
// message: "创建失败",
// btntext: "确定",
// success: function () {
// location.href = "#springUrl('/a/address/list')";
// }
// });
// }
// });
// }
// })
// }
// initFormCtrl();
// }
// return {
//
// //main function to initiate the module
// init: function () {
// initForm();
// }
//
// };
// }();
var recdTypeAdd = function () {
var initForm = function () {
var initFormCtrl = function () {
bindEvent();
};
var bindEvent = function () {
$("#myForm").validate({
rules: {},
messages: {},
submitHandler: function (form) {
$("#save").attr("disabled", true);
$.post("#springUrl('/a/address/formData')", $("#myForm").serialize(), function (returnobj) {
$("#save").attr("disabled", false);
if (returnobj.errorNo == 2) { //保存成功
Cfapp.confirm({
message: "添加成功",
btnoktext: "继续添加",
btncanceltext: "关闭",
success: function () {
location.href = "#springUrl('/a/address/form')";
},
cancel: function () {
location.href = "#springUrl('/a/address/list')";
}
});
} else if (returnobj.errorNo == 0) { //修改成功
Cfapp.alert({
message: "更新成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/address/list')";
}
});
} else {
Cfapp.alert({
message: "创建失败",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/address/list')";
}
});
}
});
}
})
}
initFormCtrl();
}
return {
//main function to initiate the module
init: function () {
initForm();
}
};
}();
</script>
</body>
<!-- END BODY -->
......
......@@ -101,21 +101,19 @@
#if($shiro.hasPermission("qy:address:view"))
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
#end
#if($shiro.hasPermission("qy:address:edit"))
<a href="#springUrl('/a/address/form')" class="btn btn-primary">新增</a>
#end
</div>
<!-- #if($shiro.hasPermission("qy:address:edit"))-->
<!-- <a href="#springUrl('/a/address/form')" class="btn btn-primary">新增</a>-->
<!-- <a href="#springUrl('/a/address/exportExcel')" class="btn btn-primary">导出</a>-->
<!-- <a onclick="importExcel();" class="btn btn-primary">导入</a>-->
<!-- #end-->
</form>
</div><!-- /.box-header -->
<div class="box-body">
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id
</td>
<td hidden="true">Id</td>
<th>openId</th>
<th>患者姓名</th>
<th>性别</th>
......@@ -124,7 +122,7 @@
<th>城市</th>
<th>区/县</th>
<th>详细地址</th>
<th>操作</th>
<!-- <th>操作</th>-->
</tr>
</thead>
<tbody id="tablebody">
......@@ -254,10 +252,7 @@
{
"mData": "address"
}
,
{
"mData": "id"
}],
],
"aoColumnDefs": [
{ // set default column settings
'visible': false,
......@@ -322,26 +317,26 @@
"mRender": function (a, b, c, d) {
return a;
}
},
{
"aTargets": [9],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:wxQrcode:edit"))';
html += '<div class="btn-group">\n' +
'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
'</button>\n' +
'<ul class="dropdown-menu" role="menu">\n';
html += '<li><a href="#springUrl("/a/address/form?id=' + a + '")">查看</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;
// }
// }
]
......
package com.cftech.mp.reply.service;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.model.SysJob;
import com.cftech.accounts.service.JobService;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.model.OrgUnit;
......@@ -93,6 +95,9 @@ public class CoreService {
@Autowired
private CodingruleUtils codingruleUtils;
@Autowired
private JobService jobService;
// @Autowired
// private CardRecordService cardRecordService;
//
......@@ -568,7 +573,15 @@ public class CoreService {
if (fansList != null && fansList.size() > 0 && StringUtils.isNoneBlank(fansList.get(0).getStore())) {
fannsEntity.setStore(fansList.get(0).getStore());
} else {
fannsEntity.setStore(codingruleUtils.getAlias());
Conds conds = new Conds();
conds.equal("clazz_path","com.cftech.order.job.InitAliasNumberJob");
conds.equal("del_flag",0);
SysJob job = jobService.fetchSearchByConds(conds);
fannsEntity.setStore(codingruleUtils.getAlias(job.getDescription()));
if (job.getDescription().equals("1")) {
job.setDescription("0");
jobService.update(job);
}
}
fannsEntity.setHeadimgurl(user.getHeadimgurl());
......
......@@ -79,8 +79,6 @@
<module>workshop-module-web</module>
<module>schaeffler-modules</module>
<module>aidea-modules</module>
<!-- <module>authentication-module-web</module>-->
</modules>
<properties>
......@@ -947,6 +945,7 @@
<include>**/*.xml</include>
<include>**/*.tld</include>
<include>**/*.ftl</include>
<include>**/*.so</include>
</includes>
<filtering>false</filtering>
</resource>
......
......@@ -316,6 +316,12 @@
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>msgrecord-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<finalName>portal-web</finalName>
......
......@@ -81,24 +81,24 @@
<input name="accountsId" value="$!{accountId}" hidden="true"/>
<div class="box-body">
<div class="form-group form-md-line-input">
<label>上级职位</label>
<div class="input-group">
<input type="text" id="parentId" name="parentId" value="$!{data.parentId}"
class="form-control" style="display: none">
<input type="text" id="parentName" name="parentName" value="$!{parentName}"
class="form-control" disabled>
<span class="input-group-btn">
<button type="button" id="parentPositionSelect"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
</div>
<!--<div class="form-group form-md-line-input">-->
<!--<label>上级职位</label>-->
<!--<div class="input-group">-->
<!--<input type="text" id="parentId" name="parentId" value="$!{data.parentId}"-->
<!--class="form-control" style="display: none">-->
<!--<input type="text" id="parentName" name="parentName" value="$!{parentName}"-->
<!--class="form-control" disabled>-->
<!--<span class="input-group-btn">-->
<!--<button type="button" id="parentPositionSelect"-->
<!--class="btn btn-info btn-flat">选择</button>-->
<!--</span>-->
<!--</div>-->
<!--</div>-->
<div class="form-group form-md-line-input">
<label>职位编码</label>
<input type="text"
class="form-control" name="number" id="number"
maxlength="50" placeholder="职位编码" required="required"
maxlength="50" placeholder="职位编码" readonly
value="$!{data.number}">
</div>
<div class="form-group form-md-line-input">
......@@ -201,24 +201,24 @@
required: true,
htmlescape: true
},
number: {
required: true,
htmlescape: true
}
// number: {
// required: true,
// htmlescape: true
// }
},
messages: {
name: {
required: "请输入职位名称!",
htmlescape: "请您不要输入特殊字符!"
},
number: {
required: "请输入职位编码!",
htmlescape: "请您不要输入特殊字符!"
}
// number: {
// required: "请输入职位编码!",
// htmlescape: "请您不要输入特殊字符!"
// }
},
submitHandler: function (form) {
$("#save").attr("disabled", true);
$.getJSON("#springUrl('/a/position/formData')", $("#myForm").serialize(), function (returnobj) {
$.post("#springUrl('/a/position/formData')", $("#myForm").serialize(), function (returnobj) {
$("#save").attr("disabled", false);
if (returnobj.errorNo == 2) { //保存成功
Cfapp.confirm({
......
......@@ -80,9 +80,9 @@
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("sys:position:edit"))
<a href="#springUrl('/a/position/form')" class="btn btn-primary">新增</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a>
<!--<a onclick="importExcel();" class="btn btn-primary">导入</a>-->
#end
<a href="#springUrl('/a/position/exportExcel')" class="btn btn-primary">导出</a>
<!--<a href="#springUrl('/a/position/exportExcel')" class="btn btn-primary">导出</a>-->
</div>
</form>
</div><!-- /.box-header -->
......@@ -93,7 +93,7 @@
<td hidden="true">Id</td>
<th>职位编码</th>
<th>职位名称</th>
<th>上级职位</th>
<!--<th>上级职位</th>-->
<th>创建时间</th>
<th>操作</th>
</tr>
......@@ -203,9 +203,11 @@
"mData": "number"
}, {
"mData": "name"
}, {
"mData": "parentName"
}, {
},
// {
// "mData": "parentName"
// },
{
"mData": "createTime"
}, {
"mData": "id"
......@@ -220,13 +222,13 @@
return '<a href="#springUrl("/a/position/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + a + '</a>';
}
}, {
"aTargets": [4],
"aTargets": [3],
"mData": "createTime",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
}, {
"aTargets": [5],
"aTargets": [4],
"mData": "id",
"mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象
var html = '#if($shiro.hasPermission("sys:position:edit"))';//
......
......@@ -153,7 +153,7 @@
</div>
<div class="form-group form-md-line-input col-md-4">
<label>职业</label>
<label>角色</label>
<select name="userType" class="form-control pull-right">
<option label="其他" value="0">其他</option>
<option label="药师" value="1" #if($data.userType == '1') selected #end>药师</option>
......@@ -162,6 +162,15 @@
<option label="订单员" value="4" #if($data.userType == '4') selected #end>订单员</option>
</select>
</div>
<div class="form-group form-md-line-input col-md-4">
<label>职位</label>
<select name="positionId" class="form-control pull-right">
#foreach($item in $positions)
<option label="${item.name}" value="${item.id}" #if($item.id == $data.positionId) selected #end>${item.name}</option>
#end
</select>
</div>
<!--<div class="form-group form-md-line-input col-md-4">-->
<!--<label for="description">部门</label>-->
<!--<input type="text"-->
......
......@@ -182,7 +182,8 @@
<th>姓名</th>
<th>手机号</th>
<th>邮箱</th>
<th>职位</th>
<th>角色</th>
<th>职位名称</th>
<th>峰值</th>
<th>操作</th>
</tr>
......@@ -320,6 +321,9 @@
},{
"mData": "userType"
},{
"mData": "positionName"
},
{
"mData": "peakVal"
},/* {
"mData": "storeName"
......@@ -367,7 +371,7 @@
return "<font color='blue'>" +postion + "</font>";
}
},{
"aTargets": [8],
"aTargets": [9],
"mData": "id",
"mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象
var html = '#if($shiro.hasPermission("sys:qyuser:edit"))';//
......
......@@ -9,6 +9,7 @@ import com.cftech.base.org.service.OrgUnitService;
import com.cftech.base.org.service.PositionService;
import com.cftech.base.org.service.QyuserService;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.QyTokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -117,26 +118,32 @@ public class QyUserUtil {
if (!StringUtils.isEmpty(qyuser.getWxno()))
postObj.put("weixinid", qyuser.getWxno());
if (!StringUtils.isEmpty(qyuser.getUserType())) {
switch (qyuser.getUserType()) {
case "0":
postObj.put("position", "其他");
break;
case "1":
postObj.put("position", "药师");
break;
case "2":
postObj.put("position", "客服");
break;
case "3":
postObj.put("position", "医生");
break;
case "4":
postObj.put("position", "订单员");
break;
}
Position position = positionService.fetchById(qyuser.getId());
if (position != null) {
postObj.put("position", position.getName());
}
postObj.put("to_invite", false);//不推送企业微信
// if (!StringUtils.isEmpty(qyuser.getUserType())) {
// switch (qyuser.getUserType()) {
// case "0":
// postObj.put("position", "其他");
// break;
// case "1":
// postObj.put("position", "药师");
// break;
// case "2":
// postObj.put("position", "客服");
// break;
// case "3":
// postObj.put("position", "医生");
// break;
// case "4":
// postObj.put("position", "订单员");
// break;
// }
// }
JSONObject retObj = WxApiUtils.userCreate(qyTokenUtil.getToken(qyuser.getAccountsId()), postObj);
......@@ -167,26 +174,31 @@ public class QyUserUtil {
if (!StringUtils.isEmpty(qyuser.getWxno()))
postObj.put("weixinid", qyuser.getWxno());
if (!StringUtils.isEmpty(qyuser.getUserType())) {
switch (qyuser.getUserType()) {
case "0":
postObj.put("position", "其他");
break;
case "1":
postObj.put("position", "药师");
break;
case "2":
postObj.put("position", "客服");
break;
case "3":
postObj.put("position", "医生");
break;
case "4":
postObj.put("position", "订单员");
break;
}
Position position = positionService.fetchById(qyuser.getId());
if (position != null) {
postObj.put("position", position.getName());
}
// if (!StringUtils.isEmpty(qyuser.getUserType())) {
// switch (qyuser.getUserType()) {
// case "0":
// postObj.put("position", "其他");
// break;
// case "1":
// postObj.put("position", "药师");
// break;
// case "2":
// postObj.put("position", "客服");
// break;
// case "3":
// postObj.put("position", "医生");
// break;
// case "4":
// postObj.put("position", "订单员");
// break;
// }
// }
JSONObject retObj = WxApiUtils.userUpdate(qyTokenUtil.getToken(qyuser.getAccountsId()), postObj);
return retObj.getIntValue("errcode") == 0;
......
......@@ -47,6 +47,7 @@
<result column="wxuser_id" property="wxuserId"/>
<result column="user_type" property="userType"/>
<result column="gender" property="gender"/>
<result column="positionName" property="positionName"/>
</resultMap>
<sql id="sqlWhere">
......@@ -261,11 +262,12 @@
t.wxuser_id
wxuser_id,
u.username loginName, t.user_type, t.gender, qrcode.ticket qrcode, t.user_type, t.peak_val, t.assigned,
t.un_assigned
t.un_assigned, pos.name positionName
FROM t_qyuser t
left join t_orgunit o on o.id = t.org_id
left join user u on u.userid = t.id
left join t_shop_wxqrcode qrcode on qrcode.bind_id = t.id AND qrcode.del_flag = '0' AND (qrcode.type = '0' or qrcode.type = '1' or qrcode.type = '2')
left join t_position pos ON t.position_id = pos.id
<include refid="sqlWhere"/>
<if test="orgId > 0">
and instr(o.parent_ids,',${orgId},')>0
......
......@@ -18,7 +18,7 @@ public class QyuserVO implements Serializable {
private String avatar;
private String qrcode;
private String role;
private String positionName;
private String orgName;
@ExportConfig(value = "姓名", width = 100)
private String name;
......@@ -39,7 +39,7 @@ public class QyuserVO implements Serializable {
@ExportConfig(value = "登录账号(密码同账号)", width = 100)
private String loginName;
@ExportConfig(value = "职业(0:客服;1:药师;2:医生;3:订单员;4:其他)", width = 200)
@ExportConfig(value = "角色(0:客服;1:药师;2:医生;3:订单员;4:其他)", width = 200)
private String userType;
@ExportConfig(value = "性别", width = 120)
......@@ -48,6 +48,9 @@ public class QyuserVO implements Serializable {
@ExportConfig(value = "峰值", width = 120)
private String peakVal;
@ExportConfig(value = "职位名称", width = 100)
private String positionName;
// @ExportConfig(value = "粉丝关注数", width = 100,showLevel=1)
// private String fanssCount;
......
......@@ -2,6 +2,7 @@ package com.cftech.base.org.web;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.model.Position;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.model.vo.PositionVO;
......@@ -12,6 +13,7 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.core.util.SystemConfig;
import com.cftech.sys.model.User;
import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils;
......@@ -51,6 +53,9 @@ public class PositionController {
private PositionService positionService;
@Autowired
private QyuserService qyuserService;
@Autowired
private CodingruleUtils codingruleUtils;
private final static String qyAccounts = SystemConfig.p.getProperty("AIDEA_QY_ACCOUNTS");
//返回列表页面
@RequiresPermissions(value = PermissionSign.POSITION_VIEW)
......@@ -65,7 +70,6 @@ public class PositionController {
@RequiresPermissions(value = PermissionSign.POSITION_VIEW)
@RequestMapping(value = "/form",method = {RequestMethod.GET,RequestMethod.POST})
public String form(HttpServletRequest request, String id, Model model) {
if (!StringUtils.isEmpty(id)) {
Position position = positionService.fetchById(id);
model.addAttribute("data", position);
......@@ -82,6 +86,7 @@ public class PositionController {
@RequestMapping(value = "/formData",method = {RequestMethod.POST})
@ResponseBody
public JSONObject positionListformData(Position position, Model model, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
try {
if (position != null && position.getId() != null) {
......@@ -96,11 +101,13 @@ public class PositionController {
positionService.update(position);
rtnJson.put("errorNo", 0);
} else {
String number = codingruleUtils.getNumber(accountsId, Position.class.getName());
Position parentPosition = null;
if (!StringUtils.isEmpty(position.getParentId())) {
parentPosition = positionService.fetchById(position.getParentId());
}
position.setNumber(number);
position.setParentIds(parentPosition == null ? 0 + "," : parentPosition.getParentIds());
position.setDelFlag(false);
position.setStatus("0");
......@@ -108,6 +115,12 @@ public class PositionController {
position.setCreateBy(UserUtils.getUser().getId());
position.setUpdateBy(UserUtils.getUser().getId());
positionService.save(position);
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.number", number);
position = positionService.fetchSearchByConds(conds);
position.setParentIds(position.getParentIds() + position.getId() + ",");
positionService.update(position);
rtnJson.put("errorNo", 2);
......
......@@ -113,6 +113,12 @@ public class QyuserController {
}
model.addAttribute("accountId", accountId);
}
Conds positionConds = new Conds();
positionConds.equal("t.del_flag", Constants.DEL_FLAG_0);
Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Position> positionList = positionService.fetchSearchByPage(positionConds, sort, 0, 0);
model.addAttribute("positions", positionList);
return "managerqyuser/qyuseradd";
}
......@@ -145,7 +151,7 @@ public class QyuserController {
qyuser.setWxuserId(loginNameQyUser);
qyUserUtil.updateQyUser(qyuser);
if (!StringUtils.isEmpty(qyuser.getImg())) {
qyuser.setDescription(qyuser.getImg().contains("http") ? qyuser.getImg():SystemConfig.p.getProperty("QY_DOMAIN") + qyuser.getImg());
qyuser.setDescription(qyuser.getImg().contains("http") ? qyuser.getImg() : SystemConfig.p.getProperty("QY_DOMAIN") + qyuser.getImg());
}
qyuserService.update(qyuser);
if (!StringUtils.isEmpty(loginNameQyUser)) {
......
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