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

Aidea product update by Strive Date 2020-12-25

parent 610cc965
......@@ -34,4 +34,6 @@ public interface MpAccountsMapper extends GenericDao<MpAccountsEntity> {
int insertUserAccount(Map<String, Object> params);
int getUserAccounts(Map<String, Object> params);
String getByQyUserAvater(Long id);
}
......@@ -171,4 +171,7 @@
where userid = #{userid} and accountsid = #{accountsid}
</update>
<select id="getByQyUserAvater" parameterType="java.lang.Long" resultType="java.lang.String">
SELECT q.avatar FROM t_qyuser q INNER JOIN user u ON q.id = u.userid WHERE q.del_flag = '0' AND u.delflag = '0' AND u.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -88,6 +88,7 @@ public class DataSourceJobThread extends Thread {
{
try {
jedis = jedisPool.getResource();
jedis.auth(DESUtil.decrypt(SystemConfig.r.getProperty("spring.redis.password"),DESUtil.KEY));
log.info("订阅REDIS JOB");
jedis.subscribe(redisSubPubListener,"job_listener");
}catch (Exception subScribeException)
......
......@@ -33,4 +33,10 @@ public interface MpAccountsService extends GenericService<MpAccountsEntity> {
int insertUserAccounts(Map<String, Object> params);
int getUserAccounts(Map<String, Object> params);
/**
* 获取登陆账号对应的企业微信头像
* @param id
*/
String getByQyUserAvater(Long id);
}
......@@ -93,4 +93,9 @@ public class MpAccountsServiceImpl extends GenericServiceImpl<MpAccountsEntity>
public int getUserAccounts(Map<String, Object> params) {
return accountsMapper.getUserAccounts(params);
}
@Override
public String getByQyUserAvater(Long id) {
return accountsMapper.getByQyUserAvater(id);
}
}
......@@ -30,6 +30,7 @@ public class CommonController {
@Autowired
private PermissionService permissionService;
@Autowired
private MpAccountsService mpAccountService;
......@@ -86,6 +87,14 @@ public class CommonController {
request.getSession().setAttribute("permission", allPerms);
}
//获得当前账号
String avatar = mpAccountService.getByQyUserAvater(currentUser.getId());
if (StringUtils.isBlank(avatar)) {
request.getSession().setAttribute("USER_AVATAR", "dist/img/avatar_.jpg");
} else {
request.getSession().setAttribute("USER_AVATAR", avatar);
}
//获得当前账号
request.getSession().setAttribute("mpaccounts", accountsEntity.getId());
request.getSession().setAttribute("isshow", "2");//不显示,首页报表图
......@@ -102,6 +111,7 @@ public class CommonController {
id= UserUtils.getmpaccounts(request);
}
User currentUser = UserUtils.getUser();
String roleids= "";
List<UserRole> userRole = roleService.selectRolesByUserAccountsId(currentUser.getId(), id);
......@@ -116,11 +126,16 @@ public class CommonController {
{
model.addAttribute("permission",permissionService.getMenuByRoles(roleids));
}
//获取企业微信头像
//获得当前账号
MpAccountsEntity mpAccount=mpAccountService.getDetail(id);
MpAccountsEntity mpAccount = mpAccountService.getDetail(id);
String avatar = mpAccountService.getByQyUserAvater(currentUser.getId());
request.getSession().setAttribute("USER_AVATAR", avatar);
request.getSession().setAttribute("mpaccountsDescription", mpAccount.getDescription());
request.getSession().setAttribute("mpaccounts", id);
//调用微信接口获得 关注数据 详情
//调用微信接口获得 关注数据 详情
return "index";
}
......
......@@ -87,7 +87,7 @@
</div>
<div class="form-group form-md-line-input">
<label>份证号码</label>
<label>份证号码</label>
<input type="text"
class="form-control" name="idCard"
id="idCard"
......@@ -189,7 +189,7 @@
var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/;
if(reg.test(card) == false){
Cfapp.alert({
message: "请输入正确格式的份证号码",
message: "请输入正确格式的份证号码",
btntext: "确定",
success: function () {
}
......
......@@ -97,7 +97,7 @@
<tr>
<td hidden="true">Id</td>
<th>姓名</th>
<th>份证号码</th>
<th>份证号码</th>
<th>描述</th>
<th>创建时间</th>
<th>操作</th>
......
......@@ -19,8 +19,8 @@ public class Authentication implements Serializable {
private Long id;
@ExportConfig(value = "姓名", width = 100)
private String name;
/* 份证号码 */
@ExportConfig(value = "份证号码", width = 100)
/* 份证号码 */
@ExportConfig(value = "份证号码", width = 100)
private String idCard;
/* 所属的账号 */
private Long accountsId;
......@@ -36,7 +36,7 @@ public class Authentication implements Serializable {
private String description;
/* 创建时间 */
@ExportConfig(value = "创建时间",width = 150,showLevel = 1)
@ExportConfig(value = "创建时间",width = 150, showLevel = 1, dateFormat = "yyyy-MM-dd HH:mm")
private Date createTime;
/* 创建人 */
private Long createBy;
......
......@@ -82,6 +82,24 @@
name="consultId" placeholder="咨询单编码">
</div>
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择审核状态</option>
<option value="0">待审核</option>
<option value="1">已通过</option>
<option value="2">已拒绝</option>
</select>
</div>
<div class="col-xs-2">
<select id="serviceId" name="serviceId" class="form-control required">
<option value="">请选择客服</option>
#foreach($qyuser in $cusServices)
<option value="$!{qyuser.id}">$!{qyuser.name}</option>
#end
</select>
</div>
<div class="col-xs-2">
<div class="input-group date">
<div class="input-group-addon">
......@@ -196,17 +214,18 @@
src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="common/js/cfapp.js"></script>
<script src="js/moment.min.js"></script>
<script>
function formatDates(now) {
var now = new Date(now);
var year = now.getFullYear();
var month = now.getMonth() + 1;
var month = now.getMonth();
var date = now.getDate();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
return year + "-" + (month <= 9 ? "0" + month : month) + "-" + (date <= 9 ? "0" + date : date) + " " + (hour <= 9 ? "0" + hour : hour) + ":"
+ (minute <= 9 ? "0" + minute : minute) + ":" + (second <= 9 ? "0" + second : second);
return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
}
function seachTable() {
......@@ -218,7 +237,7 @@
}
var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input").each(function () {
$("#seachTableForm input,select").each(function () {
var params = {
name: $(this).attr("name"),
value: $(this).val()
......@@ -325,7 +344,6 @@
"mData": "userName",
"mRender": function (a, b, c, d) {
if (c) {
console.log(c.userName);
return c.userName.slice(0, 1) + '*' + c.userName.slice(2, c.userName.length);
} else {
return null;
......@@ -408,7 +426,7 @@
"mData": "createTime",
"mRender": function (a, b, c, d) {
if (a) {
return formatDates(a);
return moment(a).format('YYYY-MM-DD HH:mm:ss');;
} else {
return null;
}
......@@ -442,7 +460,6 @@
} else {
html += '<li>#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?pageType=View&id=' + a + '")" class="btn green">查看</a> #end</li>';
}
html += '</ul>';
return html;
}
}
......@@ -517,9 +534,12 @@
}
function clearSearch() {
$("#seachTableForm input").each(function () {
$("#seachTableForm input").each(function() {
$(this).val('');
});
$("select").each(function() {
$(this).find("option[value='']").prop("selected", true);
});
$("#table").dataTable().fnClearTable();
}
</script>
......
......@@ -67,28 +67,28 @@
a.number_id numberId,
a.sex,
CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone,
a.past_records,
a.past_records pastRecords,
a.prescription,
a.doctor_id,
a.service_id,
a.doctor_id doctorId,
a.service_id serviceId,
a.illness,
a.accounts_id,
a.del_flag,
a.STATUS,
a.create_time,
a.update_time,
a.accounts_id accountsId,
a.del_flag delFlag,
a.status,
a.create_time createTime,
a.update_time updateTime,
a.description,
a.create_by,
a.update_by,
a.create_by createBy,
a.update_by updateBy,
a.allergy,
a.symptom,
a.diagnosis,
a.open_id openId,
a.drugs_id,
a.member_id,
a.order_id,
a.address_id,
a.audit_time,
a.drugs_id drugsId,
a.member_id memberId,
a.order_id orderId,
a.address_id addressId,
a.audit_time auditTime,
b.`name` pharmaName,
c.`name` customerName
</sql>
......@@ -182,13 +182,13 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = 0
WHERE a.id = #{id}
GROUP BY id
</select>
......@@ -218,7 +218,7 @@
LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id
<include refid="sqlWhere"/>
<if test="id!=null">and (a.doctor_id = ${id} or a.service_id =${id} )</if>
<if test="id!=null">AND (a.doctor_id = ${id} or a.service_id =${id})</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
......
......@@ -92,6 +92,7 @@ public class ConsultSheet extends UserSheet implements Serializable {
private String hospital;//处方医院
private String pharmacist;//处方医生
private String fansAlias;//粉丝别名
private String nickName;//昵称
public ConsultSheet() {
this.delFlag = false;
......
......@@ -101,6 +101,12 @@ public class ConsultSheetController {
@RequestMapping("/list")
public String list(HttpServletRequest request, Model model) {
Long accountId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.user_type", "2");//客服
List<Qyuser> qyuserList = qyuserService.fetchSearchByPage(conds, null, 0, 0);
model.addAttribute("cusServices", qyuserList);
model.addAttribute("accountId", accountId);
return "consultSheet/consultSheetlist";
}
......@@ -187,6 +193,12 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%");
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
}
if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) {
conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime());
}
......@@ -238,6 +250,12 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%");
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
}
if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) {
conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime());
}
......@@ -529,7 +547,9 @@ public class ConsultSheetController {
}
//推送客服消息
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_AUDIT_FAIL_MAG") + consultSheet.getConsultId();
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_AUDIT_FAIL_MAG") + consultSheet.getConsultId() + ";患者昵称:" +
(StringUtils.isNoneBlank(consultSheet.getNickName()) ? consultSheet.getNickName() : "") + ";患者别名:" +
consultSheet.getFansAlias() + ";患者openid:"+consultSheet.getOpenId();
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
return true;
}
......
......@@ -67,28 +67,28 @@
a.number_id numberId,
a.sex,
CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone,
a.past_records,
a.past_records pastRecords,
a.prescription,
a.doctor_id,
a.service_id,
a.doctor_id doctorId,
a.service_id serviceId,
a.illness,
a.accounts_id,
a.del_flag,
a.STATUS,
a.create_time,
a.update_time,
a.accounts_id accountsId,
a.del_flag delFlag,
a.status,
a.create_time createTime,
a.update_time updateTime,
a.description,
a.create_by,
a.update_by,
a.create_by createBy,
a.update_by updateBy,
a.allergy,
a.symptom,
a.diagnosis,
a.open_id openId,
a.drugs_id,
a.member_id,
a.order_id,
a.address_id,
a.audit_time,
a.drugs_id drugsId,
a.member_id memberId,
a.order_id orderId,
a.address_id addressId,
a.audit_time auditTime,
b.`name` pharmaName,
c.`name` customerName
</sql>
......@@ -182,13 +182,13 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = 0
WHERE a.id = #{id}
GROUP BY id
</select>
......@@ -218,7 +218,7 @@
LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id
<include refid="sqlWhere"/>
<if test="id!=null">and (a.doctor_id = ${id} or a.service_id =${id} )</if>
<if test="id!=null">AND (a.doctor_id = ${id} or a.service_id =${id})</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
......@@ -256,7 +256,7 @@
user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'),
</if>
<if test="numberId != null">
number_id = #{numberId, jdbcType=VARBINARY},
number_id = #{numberId, jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex, jdbcType=BIGINT},
......
......@@ -26,6 +26,8 @@
<result column="operator" property="operator"/>
<result column="openId" property="openId"/>
<result column="number" property="number"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/>
</resultMap>
<resultMap id="resultMapDetail" type="com.cftech.invoice.model.InvoiceDetail">
......@@ -46,6 +48,8 @@
<result column="invoiceContent" property="invoiceContent"/>
<result column="invoiceStatus" property="invoiceStatus"/>
<result column="invoiceCreateTime" property="invoiceCreateTime"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/>
</resultMap>
<sql id="sqlWhere">
......@@ -98,7 +102,9 @@
create_by,
update_by,
operator,
open_id
open_id,
invoice_code,
invoice_num
</sql>
......@@ -132,7 +138,9 @@
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT},
#{operator, jdbcType=VARCHAR},
#{openId, jdbcType=VARCHAR}
#{openId, jdbcType=VARCHAR},
#{invoiceCode, jdbcType=VARCHAR},
#{invoiceNum, jdbcType=VARCHAR}
)
</insert>
......@@ -160,12 +168,12 @@
<select id="selectInvoiceDetail" parameterType="java.util.Map" resultMap="resultMapDetail">
SELECT
o.id id,
i.id id,
o.number number,
o.create_time createTime,
o.confirm confirm,
o.`status` STATUS,
o.total_amount totalAmount,
o.order_amount totalAmount,
p.product_name productName,
p.format format,
p.unit unit,
......@@ -176,7 +184,9 @@
i.invoice_type invoiceType,
i.invoice_content invoiceContent,
i.`status` invoiceStatus,
i.create_time invoiceCreateTime
i.create_time invoiceCreateTime,
i.invoice_code invoiceCode,
i.invoice_num invoiceNum
FROM
t_order o
LEFT JOIN t_order_details d ON d.order_id = o.id
......@@ -258,6 +268,12 @@
<if test="openId != null">
open_id = #{openId,jdbcType=VARCHAR},
</if>
<if test="invoiceCode != null">
invoice_code = #{invoiceCode,jdbcType=VARCHAR},
</if>
<if test="invoiceNum != null">
invoice_num = #{invoiceNum,jdbcType=VARCHAR}
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
......
......@@ -79,6 +79,12 @@ public class Invoice implements Serializable {
*/
private String operator;
//发票代码
private String invoiceCode;
//发票号码
private String invoiceNum;
public Invoice() {
this.delFlag = false;
this.status = "0";
......
......@@ -11,7 +11,7 @@ import lombok.Data;
public class InvoiceDetail {
/**
* 订单ID
* 发票id
*/
private String id;
/**
......
......@@ -25,4 +25,21 @@ public interface InvoiceService extends GenericService<Invoice> {
* @return
*/
JSONObject selectInvoiceDetail(InvoiceDetail invoiceDetail);
/**
* 获取粉丝最近邮箱
* @param openid
* @return
*/
JSONObject findFassDefaultEmail(String openid);
/**
* 发送邮箱
* @param appId
* @param openId
* @param orderId
* @param email
* @return
*/
JSONObject sendEmail(String appId, String openId, String invoiceId, String email);
}
package com.cftech.invoice.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService;
......@@ -13,9 +14,11 @@ import com.cftech.invoice.service.InvoiceService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.invoice.web.InvoiceHttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
......@@ -79,4 +82,80 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I
return jsonObject;
}
@Override
public JSONObject findFassDefaultEmail(String openid) {
JSONObject retObj = new JSONObject();
if (StringUtils.isBlank(openid)) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "Fanss OpenId is not find ");
return retObj;
}
Conds conds = new Conds();
conds.equal("open_id", openid);
Sort sort = new Sort("create_time", OrderType.DESC);
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
params.put("sort", sort);
List<Invoice> invoices = invoiceMapper.fetchSearchByPage(params);
if (invoices != null && invoices.size() > 0) {
retObj.put("errorNo", 0);
retObj.put("data", invoices.get(0).getEmail());
return retObj;
}
retObj.put("errorNo", 1);
retObj.put("errorMsg", " data is null ");
return retObj;
}
@Override
@Transactional
public JSONObject sendEmail(String appId, String openId, String invoiceId, String email) {
JSONObject retObj = new JSONObject();
Invoice invoice = invoiceMapper.fetchById(invoiceId);
if (invoice == null) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "entity is null");
return retObj;
}
//查询开票详情,存储发票代码以及号码
if (StringUtils.isBlank(invoice.getInvoiceCode()) || StringUtils.isBlank(invoice.getInvoiceNum())) {
String result = InvoiceHttpUtil.queryInvoiceResult(invoice);
if (StringUtils.isNotBlank(result) && result.contains("code")) {
JSONObject obj = JSONObject.parseObject(result);
if (obj.getString("code").equals("E0000")) {
JSONArray arr = obj.getJSONArray("result");
for (int i=0; i<arr.size(); i++) {
JSONObject invoiceObj = arr.getJSONObject(i);
if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && invoiceObj.getString("status").equals("2")) {
invoice.setInvoiceCode(invoiceObj.getString("invoiceCode"));
invoice.setInvoiceNum(invoiceObj.getString("invoiceNum"));
invoice.setDescription(result);
invoiceMapper.update(invoice);
} else if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && !invoiceObj.getString("status").equals("2")) {
invoice.setDescription(result);
invoiceMapper.update(invoice);
retObj.put("errorNo", 1);
retObj.put("errorMsg", invoiceObj.getString("statusMsg"));
return retObj;
}
}
}
}
}
String result = InvoiceHttpUtil.deliveryInvoice(invoice, email);
JSONObject obj = JSONObject.parseObject(result);
if (obj.containsKey("code") && obj.getString("code").equals("E0000")) {
retObj.put("errorNo", 0);
retObj.put("errorMsg", "推送成功");
return retObj;
}
retObj.put("errorNo", 1);
retObj.put("errorMsg", obj.getString("describe"));
return retObj;
}
}
\ No newline at end of file
package com.cftech.invoice.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.core.util.SystemConfig;
import com.cftech.invoice.model.Invoice;
import lombok.extern.slf4j.Slf4j;
import nuonuo.open.sdk.NNOpenSDK;
import org.springframework.stereotype.Component;
import java.util.UUID;
/**
* Created by 16444 on 2020/12/23.
*/
@Slf4j
@Component
public class InvoiceHttpUtil {
//授权企业税号
private static String taxNum = SystemConfig.p.getProperty("INVOICE_TAX");
//appkey
private static String appKey = SystemConfig.p.getProperty("APP_KEY");
//appSecrt
private static String appSecret = SystemConfig.p.getProperty("APP_SECRET");
//访问令牌
private static String token = SystemConfig.p.getProperty("INVOICE_TOKEN");
//SDK请求地址
private static String url = SystemConfig.p.getProperty("INVOICE_URL");
private static String genarateUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
public static String queryInvoiceResult(Invoice invoice) {
JSONObject params = new JSONObject();
params.put("serialNos", new String[]{invoice.getInvoiceSerialNum()});
params.put("isOfferInvoiceDetail", "0");//提供发票明细
String method = SystemConfig.p.getProperty("INVOICE_QUERY_API");
NNOpenSDK sdk = NNOpenSDK.getIntance();
String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString());
log.info("发票结果查询" + result);
return result;
}
public static String deliveryInvoice(Invoice invoice, String email) {
JSONObject params = new JSONObject();
params.put("taxnum", taxNum);
params.put("invoiceCode", invoice.getInvoiceCode());//发票代码
params.put("invoiceNum", invoice.getInvoiceNum());//发票号码
params.put("mail", email);
String method = SystemConfig.p.getProperty("INVOICE_SEND_EMAIL_API");
NNOpenSDK sdk = NNOpenSDK.getIntance();
String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString());
log.info("发票结果查询" + result);
return result;
}
}
......@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
......@@ -28,4 +29,26 @@ public class MobileInvoiceController {
return invoiceService.selectInvoiceDetail(invoiceDetail);
}
/**
* 通过openid获取已填写邮箱
* @param openid
* @return
*/
@RequestMapping(value = "/findFassDefaultEmail", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject findFassDefaultEmail(@RequestParam String openid) {
return invoiceService.findFassDefaultEmail(openid);
}
/**
* 重新发送邮箱
* @param appId
* @param invoiceId
* @param openId
* @param email
* @return
*/
@RequestMapping(value = "/sendEmail", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject sendEmail(@RequestParam String appId, @RequestParam String invoiceId, @RequestParam String openId, @RequestParam String email) {
return invoiceService.sendEmail(appId, openId, invoiceId, email);
}
}
......@@ -96,13 +96,12 @@
<thead>
<tr>
<td hidden="true">Id</td>
<td>运单号</td>
<td>运单号</td>
<td>订单号</td>
<td>路由节点发生时间</td>
<td>物流编码</td>
<td>路由节点描述</td>
<td>路由节点发生地</td>
<td>路由节点操作码</td>
<td>路由节点描述</td>
<th>创建时间</th>
</tr>
</thead>
......@@ -217,9 +216,6 @@
{
"mData":"opcode"
},
{
"mData":"description"
},
{
"mData": "createTime"
}],
......@@ -238,7 +234,7 @@
},
{
"aTargets": [8],
"aTargets": [7],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
......
......@@ -77,7 +77,7 @@
#{id, jdbcType=BIGINT},
#{mailNo, jdbcType=VARCHAR},
#{orderNo, jdbcType=VARCHAR},
now(),
#{acceptTime, jdbcType=TIMESTAMP},
#{number, jdbcType=VARCHAR},
#{acceptAddress, jdbcType=VARCHAR},
#{opcode, jdbcType=VARCHAR},
......
......@@ -108,7 +108,7 @@
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
<include refid="sqlColumns"/>
FROM t_order_details d
LEFT JOIN t_aidea_product t ON t.id = d.drugs_id
WHERE d.id=#{id}
......@@ -122,9 +122,9 @@
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.orderdetail.model.OrderDetails">
SELECT
<include refid="sqlColumns"/>
<include refid="sqlColumns"/>, t.common_name commonName, t.format format, t.unit unit
FROM t_order_details d
LEFT JOIN t_order o ON o.id = d.order_id
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
......@@ -132,7 +132,6 @@
<if test="userId!=null"> AND (o.service_id = ${userId} OR o.clerk_id = ${userId} OR o.doctor_id = ${userId}) </if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<update id="update" parameterType="com.cftech.orderdetail.model.OrderDetails">
......
......@@ -69,6 +69,13 @@ public class OrderDetails implements Serializable {
/* 更新人 */
private Long updateBy;
/**
* 商品数据
*/
private String commonName;//商品通用名称
private String format;//药品规格
private String unit;//药品单位
public OrderDetails() {
this.delFlag = false;
this.status = "0";
......
......@@ -300,12 +300,19 @@
var avgTime = 30;
var lastTime = 0;//最后一次扫码时间
//触发顺序keydown keypress keyup
function initScanEvent() {
$(document).on('keydown', function(event) {
//键盘按下回车后会转换成click 阻止键盘的所有默认行为
event.preventDefault();
console.log('扫码开始');
scanCode(event);
});
}
function scanCode(event) {
let subCode = String.fromCharCode(event.keyCode);
console.log(event.keyCode + "==");
let currTime = new Date().getTime();//当前时间
let spaceTime = currTime - lastTime;//间隔时间
//扫码间隔大于30,未认为输入
......@@ -336,39 +343,53 @@
if (!flag) {
$("#labels").text("商品不在订单中");
$('#exampleModal').modal('show');
lastTime = 0;
console.log('扫码结束');
} else {
let orderNum = $("#group").find('input[name="orderNum"]:eq('+index+')').val();
let sendNum = $("#group").find('input[name="sendNum"]:eq('+index+')').val();
if (parseInt(sendNum) >= parseInt(orderNum)) {
$("#labels").text("超过订单商品数量");
$('#exampleModal').modal('show');
lastTime = 0;
console.log('扫码结束');
} else {
$("#group").find('input[name="sendNum"]:eq('+index+')').val(parseInt(sendNum) + 1);
sumScanCode += scanSubCode + "|";
sumScanCode += scanSubCode + "#";
$('textarea[name="scanGoodsCode"]').text(sumScanCode);
lastTime = 0;
console.log('扫码结束');
}
}
scanSubCode = "";
}
}
//触发顺序keydown keypress keyup
$(document).on('keydown', function(event){
console.log("触发1");
scanCode(event);
});
function delGoodsFun() {
$('.list-group').on('click', '.delGoods', function() {
console.log("删除");
let productCode = $(this).parent().find('input[name="productCode"]').val();
let numbers = $(this).parent().find('input[name="sendNum"]').val();
let scanGoods = $('textarea[name="scanGoodsCode"]').text();
if (numbers > 0 && scanGoods.indexOf(productCode) > -1) {
$(this).parent().find('input[name="sendNum"]').val(numbers - 1);
let arrStr = scanGoods.split('#');
for (let i=0; i<arrStr.length; i++) {
if (arrStr[i] == productCode) {
arrStr.splice(i, 1);
break;
}
}
sumScanCode = arrStr.join('#');
$('textarea[name="scanGoodsCode"]').text(sumScanCode);
} else {
$("#labels").text("商品数量已为0件无法删除");
$('#exampleModal').modal('show');
sumScanCode="";
}
});
}
// $(document).on('keypress', function(event){
// if(event.keyCode == 13){
// //alert('你按下了Enter' + 2);
// }
// });
//
// $(document).on('keyup', function(event){
// if(event.keyCode == 13){
// //alert('你按下了Enter' + 3);
// }
// });
function list() {
......@@ -389,7 +410,6 @@
selectProductList = JSON.parse(selectProductList);
for (var i = 0; i < selectProductList.length; i++) {
var obj = selectProductList[i];
console.log(obj);
clickAdd(obj.id, obj.productId, obj.productName, obj.drugsNum, obj.price, obj.amount, obj.productNumber);
}
}
......@@ -416,9 +436,10 @@
if (confirm = '0') {
$("#divClass").css('display', 'blocks')
}
Cfapp.init();
initScanEvent();
delGoodsFun();
list();
});
......@@ -454,7 +475,7 @@
var HtmlAmount = `<input name="sendNum" class="form-control" type="text" style="width: 180px ;margin-right: 50px;" readonly value="0"></input>`;
//扫码商品编码
var HtmlCode = `<button name="delGoods" type="button" class="btn btn-danger">删除</button>`;
var HtmlCode = `<button name="delGoods" type="button" class="btn btn-danger delGoods">删除</button>`;
let html = `<li id="form-translate" class="list-group-item" style="display:flex;">
......@@ -475,7 +496,7 @@
toTal()
}
function toTal() {
function toTal() {
var count = 0
$('.group [name="htmlAmount"]').each(function(index, item){
count += +item.value
......@@ -534,7 +555,7 @@
bindEvent();
};
var bindEvent = function () {
$('.scanCode').focus();
};
initFormCtrl();
};
......
......@@ -155,12 +155,16 @@
maxlength="50" placeholder=""
value="$!{data.createTime}"
>
</div>
<div class="form-group form-md-line-input col-xs-8">
<label>订单取消原因<font style="color: red"></font></label>
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea>
<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">
......@@ -173,14 +177,25 @@
>
</div>
<div class="form-group form-md-line-input col-xs-10">
<div class="form-group form-md-line-input col-xs-8">
<label>订单取消原因<font style="color: red"></font></label>
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea>
</div>
<div class="form-group form-md-line-input col-xs-8">
<label>付款链接<font style="color: red"></font></label>
<input type="text"
class="form-control" name="payUrl"
id="payUrl" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.payUrl}"
>
<div style="display: flex; justify-content: center; align-items: center;">
<input type="text"
class="form-control" name="payUrl"
id="payUrl" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.payUrl}"
>
<button type="button" class="btn btn-info" onclick="copy(this)">复制</button>
</div>
</div>
<div class="form-group form-md-line-input col-xs-10">
......@@ -536,14 +551,44 @@
});
}
/**
* 复制付款链接
* @param ele
*/
function copy(ele) {
let text = $(ele).prev().val();
let input = document.createElement('input');
input.setAttribute('readonly', 'readonly'); // 防止手机上弹出软键盘
input.setAttribute('value', text);
document.body.appendChild(input);
input.select();
var res = document.execCommand('copy');
document.body.removeChild(input);
if (res) {
Cfapp.alert({
message: "链接复制成功!",
btntext: "确定",
success: function () { }
});
} else {
Cfapp.alert({
message: "链接复制失败!",
btntext: "确定",
success: function () { }
});
}
}
let qrcodeUrl = `$!{data.payUrl}`;
var qrcode = new QRCode("qrcodeDiv",
{
render: "canvas", //也可以替换为table
width: 200,
height: 200,
text: qrcodeUrl
});
if (qrcodeUrl != null && qrcodeUrl != '') {
var qrcode = new QRCode("qrcodeDiv",
{
render: "canvas", //也可以替换为table
width: 200,
height: 200,
text: qrcodeUrl
});
}
</script>
</body>
<!-- END BODY -->
......
......@@ -260,10 +260,10 @@
<th>付款金额</th>
<th>昵称</th>
<th>别名</th>
<th>openid</th>
<!--<th>openid</th>-->
<th>顺丰运单号</th>
<th>订单状态</th>
<th>支付交易号</th>
<!--<th>支付交易号</th>-->
<th>是否开票</th>
<th>创建时间</th>
<th>确认时间</th>
......@@ -379,6 +379,9 @@
"sAjaxSource": sSource,
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"autowidth": true,
"scrollX": true,
"sScrollY":"450px",
"aoColumns": [
{
"mData": "id"
......@@ -407,10 +410,10 @@
{
"mData": "fansAlias"
}
,
{
"mData": "openid"
}
// ,
// {
// "mData": "openid"
// }
,
{
"mData": "courierNumber"
......@@ -419,10 +422,10 @@
{
"mData": "status"
}
,
{
"mData": "tradeNo"
}
// ,
// {
// "mData": "tradeNo"
// }
,
{
......@@ -464,7 +467,7 @@
'aTargets': [0],
"mData":"id",
"mRender": function(a, b, c, d){
if (c.status == 4 || c.status == 3 || c.status == 2){
if ((c.status == 4 || c.status == 3 || c.status == 2) && c.confirm == null){
//是否超过7天 0标识超过7天
if( c.isExceedSevenDay == '0'){
if(isCheckedQyCode.indexOf(a+"")!=-1){
......@@ -550,17 +553,17 @@
}
}
}
// ,
// {
// "aTargets": [8],
// "mData": "openid",
// "mRender": function (a, b, c, d) {
// return a;
// }
// }
,
{
"aTargets": [8],
"mData": "openid",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [9],
"mData": "courierNumber",
"mRender": function (a, b, c, d) {
return a;
......@@ -568,7 +571,7 @@
}
,
{
"aTargets": [10],
"aTargets": [9],
"mData": "status",
"mRender": function (a, b, c, d) {
if (a == '0') {
......@@ -586,16 +589,16 @@
}
}
},
// {
// "aTargets": [11],
// "mData": "tradeNo",
// "mRender": function (a, b, c, d) {
// return a;
// }
// }
// ,
{
"aTargets": [11],
"mData": "tradeNo",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [12],
"aTargets": [10],
"mData": "confirm",
"mRender": function (a, b, c, d) {
return a == null ? '否':'是';
......@@ -603,7 +606,7 @@
}
,
{
"aTargets": [13],
"aTargets": [11],
"mData": "createTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -615,7 +618,7 @@
}
,
{
"aTargets": [14],
"aTargets": [12],
"mData": "orderTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -627,7 +630,7 @@
}
,
{
"aTargets": [15],
"aTargets": [13],
"mData": "payTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -639,7 +642,7 @@
}
,
{
"aTargets": [16],
"aTargets": [14],
"mData": "sendExpressDateStr",
"mRender": function (a, b, c, d) {
return a;
......@@ -647,7 +650,7 @@
}
,
{
"aTargets": [17],
"aTargets": [15],
"mData": "acceptExpressDateStr",
"mRender": function (a, b, c, d) {
return a;
......@@ -655,7 +658,7 @@
}
,
{
"aTargets": [18],
"aTargets": [16],
"mData": "cancelTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -667,7 +670,7 @@
}
,
{
"aTargets": [19],
"aTargets": [17],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))';
......@@ -680,7 +683,7 @@
'<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>';
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>';
}
if (c.status != '0') {
html += '<li><a href="#springUrl("/a/order/form?pageType=View&id=' + a + '")">查看详情</a></li>';
......
......@@ -34,5 +34,10 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>logistics-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -136,7 +136,7 @@
o.order_cancel,
o.trade_no,
o.description,
o.STATUS,
o.status,
o.create_time,
o.update_time,
o.confirm,
......@@ -159,13 +159,12 @@
o.order_cancel AS orderCancel,
o.trade_no AS tradeNo,
o.description,
o.STATUS,
o.status,
o.create_time AS createTime,
o.confirm,
o.courier_number AS courierNumber,
o.address_des,
o.address_des AS addressDes,
o.openid,
o.status,
o.remarks
</sql>
......
......@@ -14,26 +14,30 @@ import java.util.Date;
public class OrderFromVO {
private Long id;
private String consultId;
private String number;
private String courierNumber;
private String productNumber;
private String productName;
private Long productId;
private Long drugsNum;
private double orderAmount;
private String orderAmount;
private String address;
private String payStatus;
private String description;
private String tradeNo;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Long confirm;
private String confirm;
private String orderCancel;
private Double price;
private Double amount;
private String price;
private String amount;
private String openid;
private String status;
private String remarks;
private String payUrl;
private String payAmount;
private String addressDes;
}
......@@ -109,9 +109,17 @@ public interface OrderService extends GenericService<Order> {
String findOrderPayParams(String orderId, String openId, String appId, String prepayId);
/**
* 发送
* 发送微信消息
* @param id
* @return
*/
boolean sendQyWechatMassage(Long id);
/**
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
JSONObject findRouteDetails(String appId, String orderCode);
}
......@@ -10,6 +10,7 @@ import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.core.util.DateFormatUtils;
......@@ -18,6 +19,8 @@ import com.cftech.core.util.SystemConfig;
import com.cftech.invoice.model.Invoice;
import com.cftech.invoice.model.InvoiceDto;
import com.cftech.invoice.service.InvoiceService;
import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.service.LogisticsService;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.order.model.*;
......@@ -29,6 +32,8 @@ import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.order.utils.InvoiceUtil;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TreeTableColumn;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
......@@ -63,6 +68,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
@Autowired
private InvoiceService invoiceService;
@Autowired
private LogisticsService logisticsService;
@Autowired
private CodingruleUtils codingruleUtils;
......@@ -344,8 +352,8 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
if (StringUtils.isNotBlank(invoiceDto.getAppId())){
mpAccountsEntity = mpAccountsService.getMpAccountsAppid(invoiceDto.getAppId());
}else{
jsonObject.put("errorNo","2");
jsonObject.put("errorMsg","appId不能为空");
jsonObject.put("errorNo", "2");
jsonObject.put("errorMsg", "appId不能为空");
return jsonObject;
}
......@@ -365,9 +373,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
unitTax = invoiceDto.getUnitTaxNumber();
}
String str = invoiceUtil.startInvoice(order,order.getNickName(),invoiceDto.getEmail(),invoiceDto.getType(),"0",unitTax);
String str = invoiceUtil.startInvoice(order,order.getNickName(), invoiceDto.getEmail(), invoiceDto.getType(), "0", unitTax);
JSONObject json = JSON.parseObject(str);
if ( org.apache.commons.lang3.StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){
if (StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){
//开票成功 添加一条开票记录
//流水号
String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum");
......@@ -381,12 +389,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
invoice.setInvoiceTitle(invoiceDto.getInvoiceTitle());
invoice.setInvoiceContent(invoiceDto.getInvoiceContent());
invoice.setInvoiceType("1");
invoice.setInvoiceForm("1");
invoice.setInvoiceForm("0");
invoice.setClerkId(order.getMemberName());
invoice.setOrderId(order.getNumber());
invoice.setPushMode("0");
invoice.setEmail(invoiceDto.getEmail());
invoice.setStatus("0");
invoice.setInvoiceSerialNum(invoiceSerialNum);
invoice.setAccountsId(mpAccountsEntity.getId());
invoice.setOpenId(order.getOpenid());
......@@ -398,7 +405,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderMapper.update(order);
}else{
jsonObject.put("errorNo", 1);
jsonObject.put("errorMsg", org.apache.commons.lang3.StringUtils.isEmpty(json.getString("describe")) ? json.getString("message") : json.getString("describe"));
jsonObject.put("errorMsg", StringUtils.isNotBlank(json.getString("describe")) ? json.getString("describe") : json.getString("describe"));
return jsonObject;
}
}
......@@ -561,4 +568,28 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return true;
}
@Override
public JSONObject findRouteDetails(String appId, String orderCode) {
JSONObject retObj = new JSONObject();
if (StringUtils.isBlank(orderCode)) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "RequestParams Is Null! ");
return retObj;
}
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("order_no", orderCode);
Sort sort = new Sort("accept_time", OrderType.DESC);
List<Logistics> logistics = logisticsService.fetchSearchByPage(conds, sort, 0, 0);
if (logistics != null && logistics.size() > 0) {
retObj.put("errorNo", 0);
retObj.put("data", logistics);
} else {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "RequestParams Is Null! ");
}
return retObj;
}
}
\ No newline at end of file
......@@ -3,20 +3,25 @@ package com.cftech.order.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.model.Order;
import com.cftech.order.model.OrderDetail;
import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.product.model.Product;
import com.cftech.product.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import nuonuo.open.sdk.NNOpenSDK;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.UUID;
/**
......@@ -30,19 +35,20 @@ public class InvoiceUtil {
@Autowired
private ProductService productService;
@Autowired
private OrderDetailsService orderDetailsService;
/**
* 开票接口
* @param orderObj
* @param clerk 开票员
* @param email 邮箱
* @param type 0:
* @param type 0:个人 1:企业
* @param from 0:移动端 1:后台
* @param unitTax 单位税号 移动端发票抬头为公司需要填写税号
* @return
*/
public String startInvoice (Order orderObj,String clerk,String email,String type,String from,String unitTax){
public String startInvoice(Order orderObj, String clerk, String email, String type, String from, String unitTax){
NNOpenSDK sdk = NNOpenSDK.getIntance();
// 授权企业税号
String taxNum = SystemConfig.p.getProperty("INVOICE_TAX");
......@@ -58,156 +64,139 @@ public class InvoiceUtil {
String senId = UUID.randomUUID().toString().replace("-", "");
JSONObject order = new JSONObject();
order.put("terminalNumber","");
order.put("terminalNumber", "");//终端号(开票终端号,只能 为空或数字)
//购方电话 非必传
order.put("buyerTel",orderObj.getMemberPhone());
order.put("buyerTel", orderObj.getMemberPhone());
//清单标志:非清单:0;清单:1,默认:0 非必传
order.put("listFlag","0");
order.put("listFlag", "0");
//推送方式:-1,不推送;0,邮箱;1,手机(默认);2,邮箱、手机 非必填
order.put("pushMode","0");
//部门门店id(诺诺系统中的id) 非必填
order.put("departmentId","9F7E9439CA8B4C60A2FFF3EA3290B088");
order.put("pushMode", "0");
//部门门店id(诺诺系统中的id) 非必填 9F7E9439CA8B4C60A2FFF3EA3290B088
order.put("departmentId", "");
//开票员id(诺诺系统中的id) 非必填
order.put("clerkId","");
order.put("clerkId", "");
//备注 非必填
order.put("remark","");
order.put("remark", "");
//复核人 非必填
order.put("checker",SystemConfig.p.getProperty("CHECKER"));
order.put("checker", SystemConfig.p.getProperty("CHECKER"));
//收款人 非必填
order.put("payee",SystemConfig.p.getProperty("PAYEE"));
order.put("payee", SystemConfig.p.getProperty("PAYEE"));
//购方地址 非必填
order.put("buyerAddress",orderObj.getAddressDes());
order.put("buyerAddress", orderObj.getAddressDes());
//购方税号(企业要填,个人可为空)
if (StringUtils.isNotBlank(unitTax)){
order.put("buyerTaxNum",unitTax);
}else{
order.put("buyerTaxNum","");
order.put("buyerTaxNum", unitTax);
} else {
order.put("buyerTaxNum", "");
}
//开票类型:1:蓝票;2:红票 必填
order.put("invoiceType","1");
order.put("invoiceType", "1");
//发票种类:p,普通发票(电票)(默认);c,普通发票(纸票);s,专用发票;e,收购发票(电票);f,收购发票(纸质);r,普通发票(卷式) 非必填
order.put("invoiceLine","p");
order.put("invoiceLine", "p");
//推送邮箱(pushMode为0或2时,此项为必填) 必填
order.put("email",email);
order.put("email", email);
//销方银行账号和开户行地址 非必填
order.put("salerAccount",SystemConfig.p.getProperty("KAIHUHANG_ADDRESS"));
order.put("salerAccount", SystemConfig.p.getProperty("KAIHUHANG_ADDRESS"));
//销方电话 必填
order.put("salerTel",SystemConfig.p.getProperty("SALER_TEL"));
order.put("salerTel", SystemConfig.p.getProperty("SALER_TEL"));
//订单号 (每个企业唯一) 必填
order.put("orderNo", orderObj.getNumber()); //todo
order.put("orderNo", orderObj.getNumber());
// 开票完成回传发票信息地址 非必填
order.put("callBackUrl","http:127.0.0.1/invoice/callback/");
//order.put("callBackUrl", "http:127.0.0.1/invoice/callback/");
// 购方名称 必填
if(type.equals("0")){
order.put("buyerName","个人");
order.put("buyerName", "个人");
}else{
order.put("buyerName","企业名称");
order.put("buyerName", "企业名称");
}
// 订单时间 必填
order.put("invoiceDate",orderObj.getCreateTimeStr());
order.put("invoiceDate", orderObj.getCreateTimeStr());
//冲红时填写的对应蓝票发票代码(红票必填,不满12位请左补0) 非必填
order.put("invoiceCode","125999915630");
order.put("invoiceCode", "");
//冲红时填写的对应蓝票发票号码(红票必填,不满8位请左补0) 非必填
order.put("invoiceNum","00130865");
order.put("invoiceNum", "");
//销方地址 必填
order.put("salerAddress",SystemConfig.p.getProperty("SALER_ADDRESS"));
order.put("salerAddress", SystemConfig.p.getProperty("SALER_ADDRESS"));
//开票员 必填
if(from.equals("1")){
order.put("clerk",SystemConfig.p.getProperty("CLERK"));
if (from.equals("1")) {
order.put("clerk", SystemConfig.p.getProperty("CLERK"));
}else{
order.put("clerk",clerk);
order.put("clerk", SystemConfig.p.getProperty("CLERK"));
}
//购方手机(pushMode为1或2时,此项为必填) 必填
order.put("buyerPhone",""); //todo
order.put("buyerPhone", "");
//购方银行账号及开户行地址 非必填
order.put("buyerAccount","");
order.put("buyerAccount", "");
//成品油标志:非成品油(默认):0;成品油:1 非必填
order.put("productOilFlag","0");
//order.put("productOilFlag","0");
//分机号(只能为空或者数字) 非必填
order.put("extensionNumber","");
order.put("extensionNumber", "");
//销方税号(使用沙箱环境请求时消息体参数salerTaxNum和消息头参数userTax填写339901999999142) 必填
order.put("salerTaxNum",SystemConfig.p.getProperty("INVOICE_TAX"));
order.put("salerTaxNum", SystemConfig.p.getProperty("INVOICE_TAX"));
//清单项目名称:对应发票票面项目名称(listFlag为1时,必填,默认为“详见销货清单”) 非必填
order.put("listName","详见销货清单");
order.put("listName", "详见销货清单");
//代开标志:0非代开;1代开。代开蓝票时备注要求填写文案:代开企业税号:***,代开企业名称:***;代开红票时备注要求填写文案:对应正数发票代码:***号码:***代开企业税号:***代开企业名称:*** 非必填
order.put("proxyInvoiceFlag","0");
order.put("proxyInvoiceFlag", "0");
/* --------------------------------------------------商品详情-----------------------------------------------------**/
JSONObject detail = null;
Conds goodsDetail = new Conds();
goodsDetail.equal("d.del_flag", Constants.DEL_FLAG_0);
goodsDetail.equal("o.id", orderObj.getId());
List<OrderDetails> orderDetails = orderDetailsService.fetchSearchByPage(goodsDetail, null, 0, 0);
JSONArray detailArray = new JSONArray();
JSONArray decArray = JSON.parseArray(orderObj.getDescription());
//税率
BigDecimal taxRate = new BigDecimal("0.13");
//商品含税单价
BigDecimal price = null;
//商品数量
BigDecimal num = null;
//不含税金额 不含税金额 = (商品含税单价*商品数量)/ (1+0.13)
BigDecimal taxExcludedAmount = null;
//税额 税额 = 不含税金额*税率
BigDecimal tax = null;
//含税金额 含税金额 = 不含税金额+税额
BigDecimal taxIncludedAmount = null;
for (int i = 0; i<decArray.size(); i++){
detail = new JSONObject();
JSONObject jsonObject = decArray.getJSONObject(i);
Product product = productService.fetchById(jsonObject.getString("productId"));
price = new BigDecimal(jsonObject.getString("price"));
num = new BigDecimal(jsonObject.getString("drugsNum"));
taxExcludedAmount = (price.multiply(num)).divide(new BigDecimal(1).add(taxRate),2, RoundingMode.HALF_UP);
tax = taxExcludedAmount.multiply(taxRate).setScale(2, BigDecimal.ROUND_HALF_UP);
taxIncludedAmount = taxExcludedAmount.add(tax);
for (OrderDetails obj : orderDetails) {
JSONObject detail = new JSONObject();
//商品名称(如invoiceLineProperty =1,则此商品行为折扣行,折扣行不允许多行折扣,折扣行必须紧邻被折扣行,商品名称必须与被折扣行一致) 必填
detail.put("goodsName", obj.getCommonName());
//商品编码(商品税收分类编码开发者自行填写)非必填
detail.put("goodsCode", "");
//自行编码(可不填) 非必填
detail.put("selfCode", "");
//税率,注:纸票清单红票存在为null的情况 必填
detail.put("taxRate", "0.13");
//单价含税标志:0:不含税,1:含税 必填
detail.put("withTaxFlag", "1");
//单价,当单价(price)为空时,数量(num)也必须为空;(price)为空时,含税金额(taxIncludedAmount)、不含税金额(taxExcludedAmount)、税额(tax)都不能为空
detail.put("price", obj.getPrice());
//数量(开具红票时数量为负数) 非必填
detail.put("num", obj.getDrugsNum());
//单位 非必填
detail.put("unit", obj.getUnit());
//规格型号 非必填
detail.put("specType",product.getFormat()); // todo
// 不含税金额。红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非毕传
detail.put("taxExcludedAmount",taxExcludedAmount.toString());
detail.put("specType", obj.getFormat());
// 发票行性质:0,正常行;1,折扣行;2,被折扣行 非必填
detail.put("invoiceLineProperty","0");
// 增值税特殊管理(优惠政策名称),当favouredPolicyFlag为1时,此项必填
detail.put("favouredPolicyName","0");
//数量(开具红票时数量为负数) 非必填
detail.put("num",num.toString()); //todo
//单价含税标志:0:不含税,1:含税 必填
detail.put("withTaxFlag","1");
//税额,[不含税金额] * [税率] = [税额];税额允许误差为 0.06。红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非必填
//BigDecimal tax = new BigDecimal(orderObj.getPrice()).multiply(new BigDecimal(0.1));
detail.put("tax",tax.toString());
detail.put("invoiceLineProperty", "0");
//优惠政策标识:0,不使用;1,使用 非必填
detail.put("favouredPolicyFlag","0");
//税率,注:纸票清单红票存在为null的情况 必填
detail.put("taxRate","0.13");
//单位 非必填
detail.put("unit",product.getUnit()); //todo
detail.put("favouredPolicyFlag", "0");
// 增值税特殊管理(优惠政策名称),当favouredPolicyFlag为1时,此项必填
detail.put("favouredPolicyName", "");
//扣除额,差额征收时填写,目前只支持填写一项。 注意:当传0、空或字段不传时,都表示非差额征税;传0.00才表示差额征税:0.00 非必填
detail.put("deduction","0");
//单价,当单价(price)为空时,数量(num)也必须为空;(price)为空时,含税金额(taxIncludedAmount)、不含税金额(taxExcludedAmount)、税额(tax)都不能为空
detail.put("price",price.toString()); //todo
detail.put("deduction", "0");
//零税率标识 非必填
detail.put("zeroRateFlag","0");
//商品编码(商品税收分类编码开发者自行填写)非必填
detail.put("goodsCode", product.getProductNumber());
//自行编码(可不填) 非必填
detail.put("selfCode", "");
//商品名称(如invoiceLineProperty =1,则此商品行为折扣行,折扣行不允许多行折扣,折扣行必须紧邻被折扣行,商品名称必须与被折扣行一致) 必填
detail.put("goodsName",product.getProductName()); //todo
detail.put("zeroRateFlag", "");
//税额,[不含税金额] * [税率] = [税额];税额允许误差为 0.06。红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非必填
detail.put("tax", "");
// 不含税金额。红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非毕传
detail.put("taxExcludedAmount", "");
//含税金额,[不含税金额] + [税额] = [含税金额],红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非必填
//BigDecimal taxIncludedAmount = new BigDecimal(orderObj.getPrice()).add(tax);
detail.put("taxIncludedAmount",taxIncludedAmount.toString());
detail.put("taxIncludedAmount", "");
detailArray.add(detail);
}
order.put("invoiceDetail",detailArray);
JSONObject total = new JSONObject();
total.put("order",order);
order.put("invoiceDetail", detailArray);
JSONObject total = new JSONObject();
total.put("order", order);
String result = sdk.sendPostSyncRequest(url, senId, appKey, appSecret, token, taxNum, method, total.toString());
log.error(result);
return result;
}
......
......@@ -25,6 +25,7 @@ import java.util.List;
@CrossOrigin
@RequestMapping("mobile/auth/order")
public class MobileOrderController {
@Autowired
private OrderService orderService;
......@@ -85,6 +86,14 @@ public class MobileOrderController {
return orderService.callBackPayStatus(request);
}
/**
* 获取微信付款加密参数
* @param orderId
* @param openId
* @param appId
* @param prepayId
* @return
*/
@RequestMapping(value = "/findOrderPayParams", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public String findOrderPayParams(@RequestParam String orderId,
@RequestParam String openId,
......@@ -93,4 +102,16 @@ public class MobileOrderController {
return orderService.findOrderPayParams(orderId, openId, appId, prepayId);
}
/**
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
@RequestMapping(value = "/findRouteDetails", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject findRouteDetails(@RequestParam String appId,
@RequestParam String orderCode) {
return orderService.findRouteDetails(appId, orderCode);
}
}
......@@ -266,17 +266,16 @@ public class OrderController {
Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
//设置是否可以开票
Date today = new Date();
int i = 0;
int longNum = 0;
for (Order obj : list){
if((obj.getStatus().equals("4") || obj.getStatus().equals("3") || obj.getStatus().equals("2")) && StringUtils.isBlank(obj.getConfirm()) && obj.getPayTime() != null){
i = (int)(today.getTime()-obj.getPayTime().getTime()) / (1000*3600*24);
if(i >= 7){
// if (obj.getPayTime() != null && StringUtils.isBlank(obj.getConfirm())) {
// longNum = (int)(today.getTime()-obj.getPayTime().getTime()) / (1000*3600*24);
// if(longNum >= 7){
obj.setIsExceedSevenDay("0");
}else {
obj.setIsExceedSevenDay("1");
}
}
// }
// }
}
Integer counts = orderService.count(conds, userid);
JSONObject rtnJson = new JSONObject();
......@@ -296,7 +295,7 @@ public class OrderController {
Long accountsId = UserUtils.getmpaccounts(request);
try {
Conds conds = new Conds();
conds.in("o.id",id.split(","));
conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid);
......@@ -304,9 +303,9 @@ public class OrderController {
for (Order order : list){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
order.setCreateTimeStr(format.format(order.getCreateTime()));
String str = invoiceUtil.startInvoice(order,String.valueOf(userid),email,"0","1",null);
String str = invoiceUtil.startInvoice(order, String.valueOf(userid), email,"0","1",null);
JSONObject json = JSON.parseObject(str);
if ( StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){
if (StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){
//开票成功 添加一条开票记录
//流水号
String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum");
......@@ -318,10 +317,9 @@ public class OrderController {
invoice.setInvoiceType("1");
invoice.setInvoiceForm("1");
invoice.setClerkId(SystemConfig.p.getProperty("CLERK"));
invoice.setOrderId(order.getNumber());
invoice.setOrderId(order.getNickName());
invoice.setPushMode("0");
invoice.setEmail(email);
invoice.setStatus("0");
invoice.setInvoiceSerialNum(invoiceSerialNum);
invoice.setAccountsId(accountsId);
invoice.setOpenId(order.getOpenid());
......
......@@ -270,7 +270,15 @@
}
},
{
"mData": "storageManageName"
"mData": "storageManageName",
"mRender": function (a, b, c, d) {
console.log(a);
if (c.storageManage == '1') {
return 'admin';
} else {
return a;
}
}
},
{
"mData": "filterResult",
......
......@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.SpringContextHolder;
......@@ -11,6 +13,12 @@ import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.service.LogisticsService;
import com.cftech.member.model.Member;
import com.cftech.member.service.MemberService;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService;
import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.service.WaybillService;
import com.cftech.waybill.utils.CloseableHttpEntity;
......@@ -69,6 +77,14 @@ public class WaybillRouterJob implements Job {
WaybillService waybillService = SpringContextHolder.getBean(WaybillService.class);
LogisticsService logisticsService = SpringContextHolder.getBean(LogisticsService.class);
OrderService orderService = SpringContextHolder.getBean(OrderService.class);
MpAccountsService mpAccountsService = SpringContextHolder.getBean(MpAccountsService.class);
MemberService memberService = SpringContextHolder.getBean(MemberService.class);
MpFanssService fanssService = SpringContextHolder.getBean(MpFanssService.class);
CodingruleUtils codingruleUtils = SpringContextHolder.getBean(CodingruleUtils.class);
String appId = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
Long accoountId = mpAccountsService.getMpAccountsAppid(appId).getId();
Conds conds = new Conds();
conds.isNull("t.accept_express_date");
......@@ -95,7 +111,7 @@ public class WaybillRouterJob implements Job {
StringUtils.equals(closeableHttpEntity.getRetObj().getString("apiResultCode"), "A1000")) {
JSONObject result = closeableHttpEntity.getRetObj().getJSONObject("apiResultData");
if (result.getBoolean("success") && StringUtils.equals("errorCode", "S0000")) {
if (result.getBoolean("success") && StringUtils.equals(result.getString("errorCode"), "S0000")) {
JSONObject msgData = result.getJSONObject("msgData");
JSONArray routeResps = msgData.getJSONArray("routeResps");
for (int i = 0; i<routeResps.size(); i++) {
......@@ -105,29 +121,59 @@ public class WaybillRouterJob implements Job {
for (int y=0; y<routes.size(); y++) {
JSONObject routObj = routes.getJSONObject(y);
Conds routConds = new Conds();
routConds.equal("mail_no", mailNo);
routConds.equal("del_flag", Constants.DEL_FLAG_0);
routConds.equal("opcode", routObj.getString("opcode"));
routConds.equal("mail_no", waybill.getNumber());
Logistics logistics =logisticsService.fetchSearchByConds(routConds);
routConds.equal("opcode", routObj.getString("opCode"));
routConds.equal("number", routObj.getString("remark"));
Logistics logistics = logisticsService.fetchSearchByConds(routConds);
if (logistics == null) {
logistics = new Logistics();
logistics.setMailNo(waybill.getNumber());
logistics.setAccountsId(accoountId);
logistics.setMailNo(mailNo);
logistics.setOrderNo(waybill.getOrderCode());
logistics.setAcceptTime(routObj.getDate("acceptTime"));
logistics.setAcceptAddress(routObj.getString("acceptAddress"));
logistics.setNumber(routObj.getString("remark"));
logistics.setOpcode(routObj.getString("opcode"));
logistics.setOpcode(routObj.getString("opCode"));
logisticsService.save(logistics);
}
if (StringUtils.equals(routObj.getString("opcode"), "50")) {
waybill.setSendExpressDate(routObj.getDate("acceptTime"));
waybillService.update(waybill);
}
if (StringUtils.equals(routObj.getString("opcode"), "80")) {
waybill.setAcceptExpressDate(routObj.getDate("acceptTime"));
waybillService.update(waybill);
//订单收件
if (StringUtils.equals(routObj.getString("opCode"), "50")) {
waybill.setSendExpressDate(routObj.getDate("acceptTime"));
waybillService.update(waybill);
}
//订单签收
if (StringUtils.equals(routObj.getString("opCode"), "80")) {
waybill.setAcceptExpressDate(routObj.getDate("acceptTime"));
waybillService.update(waybill);
//回写订单已完成状态
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", waybill.getOrderId());
Order order = orderService.fetchSearchByConds(orderConds);
if (order != null) {
order.setStatus("4");
orderService.update(order);
}
Conds memberConds = new Conds();
memberConds.equal("del_flag", Constants.DEL_FLAG_0);
memberConds.equal("open_id", order.getOpenid());
Member member = memberService.fetchSearchByConds(memberConds);
if (member == null) {
MpFanssEntity fanssEntity = fanssService.getWxUser(order.getOpenid());
//生成会员数据
member = new Member();
member.setNumber(codingruleUtils.getNumber(fanssEntity.getMpaccountid(), Member.class.getName()));
member.setName(fanssEntity.getNickname());
member.setImageurl(fanssEntity.getHeadimgurl());
member.setSex(Long.parseLong(fanssEntity.getSex()));
memberService.save(member);
}
}
}
}
}
......
......@@ -29,6 +29,7 @@ public class BillPrinterUtils {
* @return
*/
public static boolean executePrinter(String printStr) {
System.out.print(printStr);
String link = FqConstants.TWO_UNITED_150;
try {
link = isPrinterLogo(link, true);
......@@ -45,7 +46,7 @@ public class BillPrinterUtils {
connection.setReadTimeout(3 * 5000);
connection.getOutputStream().write(printStr.getBytes());
connection.getOutputStream().write(printStr.getBytes("utf-8"));
connection.getOutputStream().flush();
connection.getOutputStream().close();
......
......@@ -65,15 +65,13 @@ public class ExpressOrderInfoUtils {
billPrinter.put("consignerMobile", waybillObj.getMobile());
billPrinter.put("consignerProvince", waybillObj.getProvince());
billPrinter.put("consignerCity", waybillObj.getCity());
if (StringUtils.isNoneBlank(waybillObj.getCounty()) && waybillObj.getCounty().length() >= 2) {
StringBuilder county = new StringBuilder(waybillObj.getCounty());
billPrinter.put("consignerCounty", county.replace(1, 2, "*"));
} else {
billPrinter.put("consignerCounty", "");
}
billPrinter.put("consignerCounty", waybillObj.getCounty());
if (StringUtils.isNoneBlank(waybillObj.getAddress()) && waybillObj.getAddress().length() >= 2) {
StringBuilder address = new StringBuilder(waybillObj.getAddress());
billPrinter.put("consignerAddress", address.replace(0, 2, "*"));
String tips = "";
for (int i=0; i<address.length(); i++) {tips += "*";}
billPrinter.put("consignerAddress", address.replace(0, address.length(), tips));
} else {
billPrinter.put("consignerAddress", "");
}
......@@ -89,7 +87,7 @@ public class ExpressOrderInfoUtils {
JSONArray cargoInfoDtoList = new JSONArray();
for (OrderDetails ord: orderDetails) {
JSONObject cargoInfo = new JSONObject();
cargoInfo.put("cargo", ord.getProductName());
cargoInfo.put("cargo", ord.getCommonName());
cargoInfo.put("cargoCount", ord.getDrugsNum());
cargoInfo.put("cargoUnit", "盒");
cargoInfo.put("remark", "医药物品,请小心轻放!");
......@@ -273,6 +271,8 @@ public class ExpressOrderInfoUtils {
retObj.put("trackingType", 1);//1:根据顺丰运单号查询
JSONArray waybills = new JSONArray();
waybills.add(waybillObj.getWaybillNo());
retObj.put("trackingNumber", waybills);//顺丰运单号
retObj.put("methodType", 1);//标准路由查询
} catch (Exception e) {
......
......@@ -10,14 +10,14 @@ public class FqConstants {
* url: 请求地址
* code: 接口服务代码
*/
public static final String SF_ORDER_SEND_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_SEND_URL = "https://sfapi.sf-express.com/std/service";
public static final String SF_ORDER_SEND_CODE = "EXP_RECE_CREATE_ORDER";
/**
* 丰桥API:订单查询接口URL
* code: 接口服务代码
*/
public static final String SF_ORDER_SEARCH_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_SEARCH_URL = "https://sfapi.sf-express.com/std/service";
public static final String SF_ORDER_SEARCH_CODE = "EXP_RECE_SEARCH_ORDER_RESP";
/**
......@@ -32,7 +32,7 @@ public class FqConstants {
* 丰桥API:订单路由接口URL
* code: 接口服务代码
*/
public static final String SF_ORDER_ROUTE_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_ROUTE_URL = "https://sfapi.sf-express.com/std/service";
public static final String SF_ORDER_ROUTE_CODE = "EXP_RECE_SEARCH_ROUTES";
/**
......
......@@ -313,7 +313,7 @@
if (a == '1') {
return '药师二维码';
} else if (a == '2') {
return '客服二码';
return '客服二码';
}else if(a == '3'){
return '医生二维码';
}else if(a == "4"){
......
......@@ -150,15 +150,15 @@
q.`name`,
o.org_name,
CASE
WHEN t.type = '0' OR t.type = '1' OR t.type = '2' THEN
WHEN t.type = '1' OR t.type = '2' OR t.type = '3' THEN
q.`name`
WHEN t.type = '3' THEN
WHEN t.type = '4' THEN
o.org_name ELSE ''
END qrcodeNames
FROM
t_shop_wxqrcode t
LEFT JOIN t_qyuser q ON q.id = t.bind_id
LEFT JOIN t_orgunit o ON o.id = t.bind_id AND t.type='3'
LEFT JOIN t_orgunit o ON o.id = t.bind_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>
......
##JDBC Global Setting
#\u5916\u7F51
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.18.10.40:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
jdbc.url=jdbc:mysql://58.220.99.124:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
jdbc.username=root
jdbc.password=Aidea@2017
#jdbc.url=jdbc:mysql://120.195.144.73:3306/cfwechat?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
#\u5185\u7F51
#jdbc.url=jdbc:mysql://172.18.10.40:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
#jdbc.username=root
#jdbc.password=cf123456
#jdbc.password=Aidea@2017
......
......@@ -28,7 +28,7 @@
<bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer">
<property name="locations">
<list>
<value>classpath*:application-test.properties</value>
<value>classpath*:application.properties</value>
</list>
</property>
</bean>
......
......@@ -50,7 +50,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=localhost
jwt.domain=pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
......@@ -58,7 +58,7 @@ security.secure=false
#\u662F\u5426\u96C6\u7FA4 master\u4E3Atrue
quartz.isCluster=true
#\u987A\u4E30API\u914D\u7F6E\u53C2\u6570
#\u987A\u4E30\u7269\u6D41\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
#\u987A\u4E30\u5BA2\u6237\u7F16\u7801
sf.partnerID=NKDYFr
#\u987A\u4E30\u5BA2\u6237\u6821\u9A8C\u7801
......@@ -66,7 +66,7 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
#\u987A\u4E30\u6708\u7ED3\u5361\u53F7
sf.monthlyCard=7551234567
#INVOICE
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms
SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=339901999999824
......@@ -83,7 +83,7 @@ INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services
REGION_LONG_ID=0,1,5,
#\u5546\u6237\u53F7\u914D\u7F6E\u6587\u4EF6
#\u5546\u6237\u53F7\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
mch.mch_id=1604243615
#\u7EC8\u7AEFid
mch.spbill_id=47.103.35.182
......
......@@ -6,10 +6,10 @@ WX_MP_QRCODE_URI=https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=
#\u670D\u52A1\u53F7\u6A21\u677F\u6D88\u606F ID LIST
#\u54A8\u8BE2\u5355\u5BA1\u6838\u901A\u8FC7\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG=AoZzYGqvG5h5wDDDOE_fUrdMOam-QTqTc7wkBO7-VmU
CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG=a7oZd-03JxbKKNup-q9p4vrR4h0a6pbiLMNCi69RdGU
#\u54A8\u8BE2\u5355\u5BA1\u6838\u62D2\u7EDD\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG=VSTKsUB_vK8UaiaZplmgk4IvrqIAfIiRD54mUlGR0k0
#\u54A8\u8BE2\u4F46\u5BA1\u6838\u5931\u8D25\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG=qJNaTk1KaSCha1LowafhVWS6y4rNBI5JxKP5Af9CPGQ
#\u54A8\u8BE2\u5355\u5BA1\u6838\u5931\u8D25\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5UkHwk
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
......@@ -50,7 +50,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
......@@ -67,19 +67,24 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
sf.monthlyCard=5141870609
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms
SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=339901999999824
INVOICE_TOKEN=4d02142a23eece11a0407f0jge3cbk0s
#SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=91321000MA22HQQ953
SALER_TEL=0514-82360278
SALER_ADDRESS=\u626C\u5DDE\u5E02\u9097\u6C5F\u533A\u79D1\u6280\u56ED\u8DEF18\u53F7
APP_KEY=SD76454598
APP_SECRET=SD25624CC1DF4AB7
APP_KEY=76454598
APP_SECRET=7625624CC1DF4AB7
KAIHUHANG_ADDRESS=\u6C5F\u82CF\u94F6\u884C\u626C\u5DDE\u5510\u57CE\u652F\u884C 90160188000128434
CLERK=\u5415\u5029
CHECKER=\u7530\u59DD
PAYEE=\u6C6A\u8A00\u52C7
#\u5F00\u53D1\u7968\u63A5\u53E3
INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services
#\u67E5\u8BE2\u53D1\u7968\u63A5\u53E3
INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult
#\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3
INVOICE_SEND_EMAIL_API=nuonuo.ElectronInvoice.deliveryInvoice
INVOICE_URL=https://sdk.nuonuo.com/open/vi/services
REGION_LONG_ID=0,1,5,
......
......@@ -2,11 +2,13 @@
# Redis\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u012C\uFFFD\uFFFD\u03AA0\uFFFD\uFFFD
spring.redis.database=10
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7
spring.redis.host=172.18.10.44
spring.redis.host=58.220.99.124
# \u5185\u7F51Reids
#spring.redis.host=172.18.10.44
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04F6\u02FF\uFFFD
spring.redis.port=6379
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uB8E8\u012C\uFFFD\uFFFD\u03AA\uFFFD\u0563\uFFFD
spring.redis.password=Aidea@2017
spring.redis.password=OJpVPXowrqbtWtkdi3wt5A==
# \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u02B9\uFFFD\u00F8\uFFFD\u05B5\uFFFD\uFFFD\u02BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01A3\uFFFD
spring.redis.pool.max-active=8
# \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0234\uFFFD\u02B1\uFFFD\u48E8\u02B9\uFFFD\u00F8\uFFFD\u05B5\uFFFD\uFFFD\u02BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01A3\uFFFD
......
<!-- Main Header -->
<header class="main-header">
<!-- Main Header -->
<header class="main-header">
<!-- Logo -->
<a href="#springUrl('/a/index')" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>schaeffler</b></span>
<!-- logo for regular state and mobile devices -->
<!--#if($session.getAttribute("isshow") == '2') -->
<span class="logo-lg"><b></b>艾迪健康平台</span>
<!--#else if($session.getAttribute("isshow") == '1') -->
<!--<span class="logo-lg"><b>CF</b>汤沟微信后台</span>-->
<!--#end -->
</a>
<!-- Logo -->
<a href="#springUrl('/a/index')" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<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>
<!--#else if($session.getAttribute("isshow") == '1') -->
<!--<span class="logo-lg"><b>CF</b>汤沟微信后台</span>-->
<!--#end -->
</a>
<!-- Header Navbar -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<!-- Header Navbar -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
</a>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown notifications-menu">
<!--<a href="#" class="dropdown-toggle" data-toggle="dropdown">-->
<!--<i class="fa fa-server"></i>-->
<!--<i class="fa fa-server"></i>-->
<!--</a>-->
<ul class="dropdown-menu">
#set($qysizevar = $qyList.size())
......@@ -67,145 +67,145 @@
</ul>
</li>
<!-- Messages: style can be found in dropdown.less-->
<!-- <li class="dropdown messages-menu"> -->
<!-- Menu toggle button -->
<!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"> -->
<!-- <i class="fa fa-envelope-o"></i> -->
<!-- <span class="label label-success">4</span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu"> -->
<!-- <li class="header">You have 4 messages</li> -->
<!-- <li> -->
<!-- inner menu: contains the messages -->
<!-- <ul class="menu"> -->
<!-- <li>start message -->
<!-- <a href="#"> -->
<!-- <div class="pull-left"> -->
<!-- User Image -->
<!-- <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"> -->
<!-- </div> -->
<!-- Message title and timestamp -->
<!-- <h4> -->
<!-- Support Team -->
<!-- <small><i class="fa fa-clock-o"></i> 5 mins</small> -->
<!-- </h4> -->
<!-- The message -->
<!-- <p>Why not buy a new awesome theme?</p> -->
<!-- </a> -->
<!-- </li>end message -->
<!-- </ul>/.menu -->
<!-- </li> -->
<!-- <li class="footer"><a href="#">See All Messages</a></li> -->
<!-- </ul> -->
<!-- </li>/.messages-menu -->
<!-- <li class="dropdown messages-menu"> -->
<!-- Menu toggle button -->
<!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"> -->
<!-- <i class="fa fa-envelope-o"></i> -->
<!-- <span class="label label-success">4</span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu"> -->
<!-- <li class="header">You have 4 messages</li> -->
<!-- <li> -->
<!-- inner menu: contains the messages -->
<!-- <ul class="menu"> -->
<!-- <li>start message -->
<!-- <a href="#"> -->
<!-- <div class="pull-left"> -->
<!-- User Image -->
<!-- <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"> -->
<!-- </div> -->
<!-- Message title and timestamp -->
<!-- <h4> -->
<!-- Support Team -->
<!-- <small><i class="fa fa-clock-o"></i> 5 mins</small> -->
<!-- </h4> -->
<!-- The message -->
<!-- <p>Why not buy a new awesome theme?</p> -->
<!-- </a> -->
<!-- </li>end message -->
<!-- </ul>/.menu -->
<!-- </li> -->
<!-- <li class="footer"><a href="#">See All Messages</a></li> -->
<!-- </ul> -->
<!-- </li>/.messages-menu -->
<!-- Notifications Menu -->
<!-- <li class="dropdown notifications-menu"> -->
<!-- Menu toggle button -->
<!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"> -->
<!-- <i class="fa fa-bell-o"></i> -->
<!-- <span class="label label-warning">10</span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu"> -->
<!-- <li class="header">You have 10 notifications</li> -->
<!-- <li> -->
<!-- Inner Menu: contains the notifications -->
<!-- <ul class="menu"> -->
<!-- <li>start notification -->
<!-- <a href="#"> -->
<!-- <i class="fa fa-users text-aqua"></i> 5 new members joined today -->
<!-- </a> -->
<!-- </li>end notification -->
<!-- </ul> -->
<!-- </li> -->
<!-- <li class="footer"><a href="#">View all</a></li> -->
<!-- </ul> -->
<!-- </li> -->
<!-- Tasks Menu -->
<!-- <li class="dropdown tasks-menu"> -->
<!-- Menu Toggle Button -->
<!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"> -->
<!-- <i class="fa fa-flag-o"></i> -->
<!-- <span class="label label-danger">9</span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu"> -->
<!-- <li class="header">You have 9 tasks</li> -->
<!-- <li> -->
<!-- Inner menu: contains the tasks -->
<!-- <ul class="menu"> -->
<!-- <li>Task item -->
<!-- <a href="#"> -->
<!-- Task title and progress text -->
<!-- <h3> -->
<!-- Design some buttons -->
<!-- <small class="pull-right">20%</small> -->
<!-- </h3> -->
<!-- The progress bar -->
<!-- <div class="progress xs"> -->
<!-- Change the css width attribute to simulate progress -->
<!-- <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> -->
<!-- <span class="sr-only">20% Complete</span> -->
<!-- </div> -->
<!-- </div> -->
<!-- </a> -->
<!-- </li>end task item -->
<!-- </ul> -->
<!-- </li> -->
<!-- <li class="footer"> -->
<!-- <a href="#">View all tasks</a> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </li> -->
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<img src="$!{USER_AVATAR}" class="user-image" alt="User Image">
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">${userInfo.username}</span>
</a>
<ul class="dropdown-menu">
<!-- The user image in the menu -->
<li class="user-header">
<img src="$!{USER_AVATAR}" class="user-image" alt="User Image">
<p>
$!{mpaccountsDescription}
<small></small>
</p>
</li>
<!-- Menu Body -->
<!-- <li class="user-body"> -->
<!-- <div class="col-xs-4 text-center"> -->
<!-- <a href="#">Followers</a> -->
<!-- </div> -->
<!-- <div class="col-xs-4 text-center"> -->
<!-- <a href="#">Sales</a> -->
<!-- </div> -->
<!-- <div class="col-xs-4 text-center"> -->
<!-- <a href="#">Friends</a> -->
<!-- </div> -->
<!-- </li> -->
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left sidebar-menu">
<a data="#springUrl('/a/manageuser/updatePassword')" class="btn btn-default btn-flat"
id="editProfile">修改密码</a>
</div>
<div class="pull-right">
<a href="#springUrl('/a/logout')" class="btn btn-default btn-flat">登出</a>
</div>
</li>
</ul>
</li>
<!-- Control Sidebar Toggle Button -->
<!-- <li> -->
<!-- <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> -->
<!-- </li> -->
<!-- Notifications Menu -->
<!-- <li class="dropdown notifications-menu"> -->
<!-- Menu toggle button -->
<!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"> -->
<!-- <i class="fa fa-bell-o"></i> -->
<!-- <span class="label label-warning">10</span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu"> -->
<!-- <li class="header">You have 10 notifications</li> -->
<!-- <li> -->
<!-- Inner Menu: contains the notifications -->
<!-- <ul class="menu"> -->
<!-- <li>start notification -->
<!-- <a href="#"> -->
<!-- <i class="fa fa-users text-aqua"></i> 5 new members joined today -->
<!-- </a> -->
<!-- </li>end notification -->
<!-- </ul> -->
<!-- </li> -->
<!-- <li class="footer"><a href="#">View all</a></li> -->
<!-- </ul> -->
<!-- </li> -->
<!-- Tasks Menu -->
<!-- <li class="dropdown tasks-menu"> -->
<!-- Menu Toggle Button -->
<!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"> -->
<!-- <i class="fa fa-flag-o"></i> -->
<!-- <span class="label label-danger">9</span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu"> -->
<!-- <li class="header">You have 9 tasks</li> -->
<!-- <li> -->
<!-- Inner menu: contains the tasks -->
<!-- <ul class="menu"> -->
<!-- <li>Task item -->
<!-- <a href="#"> -->
<!-- Task title and progress text -->
<!-- <h3> -->
<!-- Design some buttons -->
<!-- <small class="pull-right">20%</small> -->
<!-- </h3> -->
<!-- The progress bar -->
<!-- <div class="progress xs"> -->
<!-- Change the css width attribute to simulate progress -->
<!-- <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> -->
<!-- <span class="sr-only">20% Complete</span> -->
<!-- </div> -->
<!-- </div> -->
<!-- </a> -->
<!-- </li>end task item -->
<!-- </ul> -->
<!-- </li> -->
<!-- <li class="footer"> -->
<!-- <a href="#">View all tasks</a> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </li> -->
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">${userInfo.username}</span>
</a>
<ul class="dropdown-menu">
<!-- The user image in the menu -->
<li class="user-header">
<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
<p>
$!{mpaccountsDescription}
<small></small>
</p>
</li>
<!-- Menu Body -->
<!-- <li class="user-body"> -->
<!-- <div class="col-xs-4 text-center"> -->
<!-- <a href="#">Followers</a> -->
<!-- </div> -->
<!-- <div class="col-xs-4 text-center"> -->
<!-- <a href="#">Sales</a> -->
<!-- </div> -->
<!-- <div class="col-xs-4 text-center"> -->
<!-- <a href="#">Friends</a> -->
<!-- </div> -->
<!-- </li> -->
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left sidebar-menu">
<a data="#springUrl('/a/manageuser/updatePassword')" class="btn btn-default btn-flat"
id="editProfile">修改密码</a>
</div>
<div class="pull-right">
<a href="#springUrl('/a/logout')" class="btn btn-default btn-flat">登出</a>
</div>
</li>
</ul>
</li>
<!-- Control Sidebar Toggle Button -->
<!-- <li> -->
<!-- <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> -->
<!-- </li> -->
</ul>
</div>
</nav>
</header>
\ No newline at end of file
</div>
</nav>
</header>
\ No newline at end of file
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Tt(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function v(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function p(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function k(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function S(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function D(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=S(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&D(e[s])!==D(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function b(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function C(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function H(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function R(e){var t,n,s={};for(n in e)m(e,n)&&(t=H(n))&&(s[t]=e[n]);return s}var U={};function F(e,t){U[e]=t}function L(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=b(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=b(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(he(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function he(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var de={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),h(n)&&(s=function(e,t){t[n]=D(e)}),t=0;t<e.length;t++)de[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,ve=4,pe=5,we=6,Me=7,ke=8;function Se(e){return De(e)?366:365}function De(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),C("year","y"),F("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):D(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return D(e)+(68<D(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(xe(this,t,e),c.updateOffset(this,n),this):be(this,t)}}function be(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function xe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&De(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?De(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),C("month","M"),F("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=D(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var He="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Re(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=D(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ue(e){return null!=e?(Re(this,e),c.updateOffset(this,!0),this):be(this,"Month")}var Fe=ae;var Le=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=he(s[t]),i[t]=he(i[t]);for(t=0;t<24;t++)r[t]=he(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t;if(e<100&&0<=e){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return a=o<=0?Se(r=e-1)+o:o>Se(e)?(r=e+1,o-Se(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(Se(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),F("week",5),F("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=D(e)});function je(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=D(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var $e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qe=ae;var Je=ae;var Be=ae;function Qe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Xe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),C("hour","h"),F("hour",13),ue("a",et),ue("A",et),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=D(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=D(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i))});var tt,nt=Te("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:He,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){var t=null;if(!it[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),ut(t)}catch(e){}return it[e]}function ut(e,t){var n;return e&&((n=l(t)?ht(e):lt(e,t))?tt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function lt(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ot(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new P(x(s,t)),rt[e]&&rt[e].forEach(function(e){lt(e.name,e.config)}),ut(e),it[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!o(e)){if(t=ot(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=at(e[r]).split("-")).length,n=(n=at(e[r+1]))?n.split("-"):null;0<t;){if(s=ot(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return tt}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[ve]||0!==n[pe]||0!==n[we])?ge:n[ve]<0||59<n[ve]?ve:n[pe]<0||59<n[pe]?pe:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=ke),g(e).overflow=t),e}function ct(e,t,n){return null!=e?e:null!=t?t:n}function ft(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ct(t.GG,e._a[me],Ie(bt(),1,4).year),s=ct(t.W,1),((i=ct(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(bt(),r,a);n=ct(t.gg,e._a[me],l.year),s=ct(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ct(e._a[me],s[me]),(e._dayOfYear>Se(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[ve]&&0===e._a[pe]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var mt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,s,i,r,a,o=e._i,u=mt.exec(o)||_t.exec(o);if(u){for(g(e).iso=!0,t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[1])){i=gt[t][0],s=!1!==gt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(u[3])){r=(u[2]||" ")+vt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!yt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Yt(e)}else e._isValid=!1}var Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function kt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),He.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=Mt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=kt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function Yt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,h=l.length,d=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),d+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(de,a)&&de[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=h-d,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ft(e),dt(e)}else Dt(e);else wt(e)}function Ot(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||ht(e._l),null===r||void 0===a&&""===r?p({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),k(r)?new M(dt(r)):(d(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Yt(t),v(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?Yt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):d(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(wt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ft(t)):u(n)?function(e){if(!e._d){var t=R(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ft(e)}}(t):h(n)?t._d=new Date(n):c.createFromInputFallback(t),v(e)||(e._d=null),e))}function Tt(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Ot(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function bt(e,t,n,s){return Tt(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:p()}),Pt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:p()});function Wt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return bt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Ct=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=R(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,h=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Ct,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Ct.length;++s)if(e[Ct[s]]){if(n)return!1;parseFloat(e[Ct[s]])!==D(e[Ct[s]])&&(n=!0)}return!0}(t),this._milliseconds=+h+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ht(),this._bubble()}function Rt(e){return e instanceof Ht}function Ut(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+L(~~(e/60),2)+n+L(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Nt(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Nt(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+D(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Gt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(k(e)||d(e)?e.valueOf():bt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):bt(e).local()}function Vt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Et(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var It=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,At=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jt(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:D(a[ye])*n,h:D(a[ge])*n,m:D(a[ve])*n,s:D(a[pe])*n,ms:D(Ut(1e3*a[we]))*n}):(a=At.exec(e))?(n="-"===a[1]?-1:1,r={y:Zt(a[2],n),M:Zt(a[3],n),w:Zt(a[4],n),d:Zt(a[5],n),h:Zt(a[6],n),m:Zt(a[7],n),s:Zt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(bt(r.from),bt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function Zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function $t(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),qt(this,jt(e="string"==typeof e?+e:e,t),s),this}}function qt(e,t,n,s){var i=t._milliseconds,r=Ut(t._days),a=Ut(t._months);e.isValid()&&(s=null==s||s,a&&Re(e,be(e,"Month")+a*n),r&&xe(e,"Date",be(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}jt.fn=Ht.prototype,jt.invalid=function(){return jt(NaN)};var Jt=$t(1,"add"),Bt=$t(-1,"subtract");function Qt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Xt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ht(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Kt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function en(){return this._locale}var tn=126227808e5;function nn(e,t){return(e%t+t)%t}function sn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-tn:new Date(e,t,n).valueOf()}function rn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-tn:Date.UTC(e,t,n)}function an(e,t){I(0,[e,e.length],0,t)}function on(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=D(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),C("quarter","Q"),F("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(D(e)-1)}),I("D",["DD",2],"Do","date"),C("date","D"),F("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=D(e.match(B)[0])});var un=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),F("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=D(e)}),I("m",["mm",2],0,"minute"),C("minute","m"),F("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],ve);var ln=Te("Minutes",!1);I("s",["ss",2],0,"second"),C("second","s"),F("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],pe);var hn,dn=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),F("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),hn="SSSS";hn.length<=9;hn+="S")ue(hn,ne);function cn(e,t){t[we]=D(1e3*("0."+e))}for(hn="S";hn.length<=9;hn+="S")ce(hn,cn);var fn=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var mn=M.prototype;function _n(e){return e}mn.add=Jt,mn.calendar=function(e,t){var n=e||bt(),s=Gt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(b(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,bt(n)))},mn.clone=function(){return new M(this)},mn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=H(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:S(r)},mn.endOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1;break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},mn.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.fromNow=function(e){return this.from(bt(),e)},mn.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.toNow=function(e){return this.to(bt(),e)},mn.get=function(e){return b(this[e=H(e)])?this[e]():this},mn.invalidAt=function(){return g(this).overflow},mn.isAfter=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},mn.isBefore=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},mn.isBetween=function(e,t,n,s){var i=k(e)?e:bt(e),r=k(t)?t:bt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},mn.isSame=function(e,t){var n,s=k(e)?e:bt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},mn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},mn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},mn.isValid=function(){return v(this)},mn.lang=Kt,mn.locale=Xt,mn.localeData=en,mn.max=Pt,mn.min=xt,mn.parsingFlags=function(){return _({},g(this))},mn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:U[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=R(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(b(this[e=H(e)]))return this[e](t);return this},mn.startOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=nn(t,6e4);break;case"second":t=this._d.valueOf(),t-=nn(t,1e3);break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.subtract=Bt,mn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},mn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},mn.toDate=function(){return new Date(this.valueOf())},mn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):b(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},mn.toJSON=function(){return this.isValid()?this.toISOString():null},mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},mn.unix=function(){return Math.floor(this.valueOf()/1e3)},mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},mn.year=Oe,mn.isLeapYear=function(){return De(this.year())},mn.weekYear=function(e){return on.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},mn.isoWeekYear=function(e){return on.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},mn.quarter=mn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},mn.month=Ue,mn.daysInMonth=function(){return Pe(this.year(),this.month())},mn.week=mn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},mn.isoWeek=mn.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},mn.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},mn.isoWeeksInYear=function(){return Ae(this.year(),1,4)},mn.date=un,mn.day=mn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},mn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},mn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},mn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},mn.hour=mn.hours=nt,mn.minute=mn.minutes=ln,mn.second=mn.seconds=dn,mn.millisecond=mn.milliseconds=fn,mn.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Vt(this);if("string"==typeof e){if(null===(e=Nt(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Vt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?qt(this,jt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this},mn.utc=function(e){return this.utcOffset(0,e)},mn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vt(this),"m")),this},mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},mn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?bt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mn.isUtc=Et,mn.isUTC=Et,mn.zoneAbbr=function(){return this._isUTC?"UTC":""},mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mn.dates=n("dates accessor is deprecated. Use date instead.",un),mn.months=n("months accessor is deprecated. Use month instead",Ue),mn.years=n("years accessor is deprecated. Use year instead",Oe),mn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),mn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Ot(e))._a){var t=e._isUTC?y(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var yn=P.prototype;function gn(e,t,n,s){var i=ht(),r=y().set(s,t);return i[n](r,e)}function vn(e,t,n){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return gn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=gn(e,s,n,"month");return i}function pn(e,t,n,s){t=("boolean"==typeof e?h(t)&&(n=t,t=void 0):(t=e,e=!1,h(n=t)&&(n=t,t=void 0)),t||"");var i,r=ht(),a=e?r._week.dow:0;if(null!=n)return gn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=gn(t,(i+a)%7,s,"day");return o}yn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return b(s)?s.call(t,n):s},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=_n,yn.postformat=_n,yn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return b(i)?i(e,t,n,s):i.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return b(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)b(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},yn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?je(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ut("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===D(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ut),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ht);var wn=Math.abs;function Mn(e,t,n,s){var i=jt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function kn(e){return e<0?Math.floor(e):Math.ceil(e)}function Sn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Yn(e){return function(){return this.as(e)}}var On=Yn("ms"),Tn=Yn("s"),bn=Yn("m"),xn=Yn("h"),Pn=Yn("d"),Wn=Yn("w"),Cn=Yn("M"),Hn=Yn("Q"),Rn=Yn("y");function Un(e){return function(){return this.isValid()?this._data[e]:NaN}}var Fn=Un("milliseconds"),Ln=Un("seconds"),Nn=Un("minutes"),Gn=Un("hours"),Vn=Un("days"),En=Un("months"),In=Un("years");var An=Math.round,jn={ss:44,s:45,m:45,h:22,d:26,M:11};var Zn=Math.abs;function zn(e){return(0<e)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Zn(this._milliseconds)/1e3,s=Zn(this._days),i=Zn(this._months);t=S((e=S(n/60))/60),n%=60,e%=60;var r=S(i/12),a=i%=12,o=s,u=t,l=e,h=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var c=d<0?"-":"",f=zn(this._months)!==zn(d)?"-":"",m=zn(this._days)!==zn(d)?"-":"",_=zn(this._milliseconds)!==zn(d)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||h?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(h?_+h+"S":"")}var qn=Ht.prototype;return qn.isValid=function(){return this._isValid},qn.abs=function(){var e=this._data;return this._milliseconds=wn(this._milliseconds),this._days=wn(this._days),this._months=wn(this._months),e.milliseconds=wn(e.milliseconds),e.seconds=wn(e.seconds),e.minutes=wn(e.minutes),e.hours=wn(e.hours),e.months=wn(e.months),e.years=wn(e.years),this},qn.add=function(e,t){return Mn(this,e,t,1)},qn.subtract=function(e,t){return Mn(this,e,t,-1)},qn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=H(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Sn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},qn.asMilliseconds=On,qn.asSeconds=Tn,qn.asMinutes=bn,qn.asHours=xn,qn.asDays=Pn,qn.asWeeks=Wn,qn.asMonths=Cn,qn.asQuarters=Hn,qn.asYears=Rn,qn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN},qn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*kn(Dn(o)+a),o=a=0),u.milliseconds=r%1e3,e=S(r/1e3),u.seconds=e%60,t=S(e/60),u.minutes=t%60,n=S(t/60),u.hours=n%24,o+=i=S(Sn(a+=S(n/24))),a-=kn(Dn(i)),s=S(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},qn.clone=function(){return jt(this)},qn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},qn.milliseconds=Fn,qn.seconds=Ln,qn.minutes=Nn,qn.hours=Gn,qn.days=Vn,qn.weeks=function(){return S(this.days()/7)},qn.months=En,qn.years=In,qn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,h,d,c=this.localeData(),f=(n=!e,s=c,i=jt(t=this).abs(),r=An(i.as("s")),a=An(i.as("m")),o=An(i.as("h")),u=An(i.as("d")),l=An(i.as("M")),h=An(i.as("y")),(d=r<=jn.ss&&["s",r]||r<jn.s&&["ss",r]||a<=1&&["m"]||a<jn.m&&["mm",a]||o<=1&&["h"]||o<jn.h&&["hh",o]||u<=1&&["d"]||u<jn.d&&["dd",u]||l<=1&&["M"]||l<jn.M&&["MM",l]||h<=1&&["y"]||["yy",h])[2]=n,d[3]=0<+t,d[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,d));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},qn.toISOString=$n,qn.toString=$n,qn.toJSON=$n,qn.locale=Xt,qn.localeData=en,qn.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),qn.lang=Kt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(D(e))}),c.version="2.24.0",e=bt,c.fn=mn,c.min=function(){return Wt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Wt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return bt(1e3*e)},c.months=function(e,t){return vn(e,t,"months")},c.isDate=d,c.locale=ut,c.invalid=p,c.duration=jt,c.isMoment=k,c.weekdays=function(e,t,n){return pn(e,t,n,"weekdays")},c.parseZone=function(){return bt.apply(null,arguments).parseZone()},c.localeData=ht,c.isDuration=Rt,c.monthsShort=function(e,t){return vn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return pn(e,t,n,"weekdaysMin")},c.defineLocale=lt,c.updateLocale=function(e,t){if(null!=t){var n,s,i=st;null!=(s=ot(e))&&(i=s._config),(n=new P(t=x(i,t))).parentLocale=it[e],it[e]=n,ut(e)}else null!=it[e]&&(null!=it[e].parentLocale?it[e]=it[e].parentLocale:null!=it[e]&&delete it[e]);return it[e]},c.locales=function(){return s(it)},c.weekdaysShort=function(e,t,n){return pn(e,t,n,"weekdaysShort")},c.normalizeUnits=H,c.relativeTimeRounding=function(e){return void 0===e?An:"function"==typeof e&&(An=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==jn[e]&&(void 0===t?jn[e]:(jn[e]=t,"s"===e&&(jn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=mn,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},c});
\ No newline at end of file
......@@ -16,11 +16,11 @@ import java.security.SecureRandom;
* DES加密类
*/
public class DESUtil {
public static final String KEY_ALGORITHM = "DES";
//算法名称/加密模式/填充方式
public static final String KEY = "schaffler@952710";
//算法名称
public static final String KEY_ALGORITHM = "DES";
//算法名称/加密模式/填充方式
//DES共有四种工作模式-->>ECB:电子密码本模式、CBC:加密分组链接模式、CFB:加密反馈模式、OFB:输出反馈模式
public static final String CIPHER_ALGORITHM = "DES/ECB/PKCS5Padding";
......@@ -112,9 +112,9 @@ public class DESUtil {
// REDIS : changfu@123 ,数据库 mongodb root root, 正是环境sfl@2018 SQL数据库 55555abc
System.out.println(0x1);
System.out.println(encrypt("xrdba",KEY));
String encryptData = encrypt("XR123456xr", KEY);
String encryptData = encrypt("Aidea@2017", KEY);
System.out.println("加密后: " + encryptData);
String decryptData = decrypt("W1yXo/+FlJFDyCmGhUWK0vs75T8N4+SZ", KEY);
String decryptData = decrypt("OJpVPXowrqbtWtkdi3wt5A==", KEY);
System.out.println("解密后: " + decryptData);
}
}
......@@ -96,8 +96,8 @@ public class EnDecryptUtils {
*
*/
public static void main(String[] args) throws Exception {
String KEY = "abcdefgabcdefg12";
String content = "hello world"; //0gqIDaFNAAmwvv3tKsFOFf9P9m/6MWlmtB8SspgxqpWKYnELb/lXkyXm7P4sMf3e
String KEY = "schaffler@952710";
String content = "Aidea@2017"; //0gqIDaFNAAmwvv3tKsFOFf9P9m/6MWlmtB8SspgxqpWKYnELb/lXkyXm7P4sMf3e
System.out.println("加密前:" + content);
System.out.println("加密密钥和解密密钥:" + KEY);
......
......@@ -14,10 +14,10 @@ public class SystemConfig {
try {
// inputStream = SystemConfig.class.newInstance().getClass()
// .getClassLoader().getResourceAsStream("");
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common-test.properties"), "utf-8"));
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common.properties"), "utf-8"));
inputStreamRedis = SystemConfig.class.newInstance().getClass()
.getClassLoader().getResourceAsStream("/redis-config-test.properties");
.getClassLoader().getResourceAsStream("/redis-config.properties");
r.load(inputStreamRedis);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -302,10 +302,10 @@
src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8"
src="plugins/ueditor-min-1.4.3/p/main.js"></script>
<script type="text/javascript" charset="utf-8"
src="plugins/ueditor-min-1.4.3/q/main.js"></script>
<!--<script type="text/javascript" charset="utf-8"-->
<!--src="plugins/ueditor-min-1.4.3/p/main.js"></script>-->
<!--<script type="text/javascript" charset="utf-8"-->
<!--src="plugins/ueditor-min-1.4.3/q/main.js"></script>-->
<!-- Uedit End -->
<script src="js/jquery.serializejson.js"></script>
......@@ -326,8 +326,8 @@
var smallimg = "$!{data.smallimg}";
coverPP = new uePicPicker({
tarId: 'smallimg',
title: '文章图',
sizeDes: '205*202',
title: '文章封面图',
sizeDes: "大图(390*170); 小图(170*90)",
max: 1,
datas: smallimg == '' ? null : smallimg.split(","),
success: null
......@@ -350,7 +350,6 @@
toolbars: [[
'insertimage',
'insertvideo',
'redo', //重做
'bold', //加粗
'indent', //首行缩进
'italic', //斜体
......@@ -361,16 +360,12 @@
'superscript', //上标
'formatmatch', //格式刷
'source', //源代码
'blockquote', //引用
'pasteplain', //纯文本粘贴模式
'selectall', //全选
'print', //打印
'preview', //预览
'horizontal', //分隔线
'removeformat', //清除格式
'time', //时间
'date', //日期
'unlink', //取消链接
// 'time', //时间
// 'date', //日期
'insertrow', //前插入行
'insertcol', //前插入列
'mergeright', //右合并单元格
......@@ -386,16 +381,17 @@
'deletetable', //删除表格
'cleardoc', //清空文档
'insertparagraphbeforetable', //"表格前插入行"
'insertcode', //代码语言
// 'insertcode', //代码语言
'fontfamily', //字体
'fontsize', //字号
'paragraph', //段落格式
'edittable', //表格属性
'edittd', //单元格属性
'link', //超链接
'unlink', //取消链接
'emotion', //表情
'spechars', //特殊字符
'insertvideo', //视频
// 'insertvideo', //视频
'justifyleft', //居左对齐
'justifyright', //居右对齐
......@@ -411,13 +407,13 @@
'rowspacingtop', //段前距
'rowspacingbottom', //段后距
'pagebreak', //分页
'insertframe', //插入Iframe
// 'insertframe', //插入Iframe
'imagenone', //默认
'imageleft', //左浮动
'imageright', //右浮动
'attachment', //附件
// 'attachment', //附件
'imagecenter', //居中
'wordimage', //图片转存
// 'wordimage', //图片转存
'lineheight', //行间距
'edittip ', //编辑提示
'customstyle', //自定义标题
......@@ -426,8 +422,8 @@
'tolowercase', //字母小写
'inserttable', //插入表格
'drafts', // 从草稿箱加载
'charts', // 图表
//'drafts', // 从草稿箱加载
//'charts', // 图表
]]
});
//数据
......
......@@ -224,7 +224,7 @@
coverPP = new uePicPicker({
tarId: 'img',
title: '栏目小图',
sizeDes: '205*202',
sizeDes: '35*35',
max: 1,
datas: smallimg=='' ? null : smallimg.split(","),
success: null
......
......@@ -14,8 +14,6 @@ import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.owasp.esapi.ESAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
......
......@@ -2,6 +2,7 @@ package com.cftech.base.codingrule.utils;
import com.cftech.base.codingrule.model.Codingrule;
import com.cftech.base.codingrule.service.CodingruleService;
import com.cftech.core.util.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
......@@ -65,4 +66,44 @@ public class CodingruleUtils {
tpl = tpl.substring(0, tpl.length() - number.length()) + number;
return tpl;
}
/**
* 粉丝别名生成规则
* 年份后两位+月份两位+四位数从0开始排序
* @return
*/
public String getAlias() {
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();
// }
}
......@@ -91,7 +91,7 @@
<form id="seachTableForm" action="#springUrl('/a/materialUpload/list')" method="get">
<div class="col-xs-2" style="display: none">
<input type="text" class="form-control required"
name="categoryid" id="categoryid" value="0">
name="categoryid" id="categoryid" value="$!{categoryid}">
<input type="text" class="form-control required"
name="categoryName" id="categoryName" placeholder="categoryName" value="素材分类">
</div>
......@@ -170,6 +170,13 @@
var csrftoken = {name: '_csrf', value: '${_csrf.token}'};
</script>
<script>
var categoryid = `$!{categoryid}`;
// if (categoryid != null && categoryid != '') {
// let zTree = $('#zTree');
// var node = zTree.getNodeByParam("id", categoryid);
// zTree.selectNode(node);
// }
function formatDates(now) {
var now = new Date(now);
var year = now.getFullYear();
......@@ -343,7 +350,13 @@
return node.level == 0;
}, true), true, false, false);
var nodes = tree.getNodes();
tree.selectNode(nodes[0]); //选中第一个子节点
if (categoryid != null && categoryid != '') {
var node = tree.getNodeByParam("id", categoryid);
tree.selectNode(node);
} else {
tree.selectNode(nodes[0]); //选中第一个子节点
}
};
getTreeData();
}
......@@ -366,7 +379,8 @@
message: "删除成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/materialUpload/list')";
let id = $('#categoryid').val();
location.href = '#springUrl("/a/materialUpload/list?categoryid='+id+'")';
}
});
}
......
......@@ -76,8 +76,8 @@ public class MaterialUploadController {
//列表页面
@RequestMapping("/list")
@RequiresPermissions(value = MATERIAL_VIEW)
public String list(HttpServletRequest request, Model model) {
public String list(HttpServletRequest request, Model model, Long categoryid) {
request.setAttribute("categoryid", categoryid == null ? 0L : categoryid);
return "upload/materialUploadlist";
}
......
......@@ -51,30 +51,30 @@
</sql>
<sql id="sqlColumns">
t.id,
t.open_id,
t.address_name,
t.address,
t.province_id,
t.city_id,
t.area_id,
t.sex,
t.phone,
t.whether,
t.accounts_id,
t.del_flag,
t.STATUS,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
a.areaid,
a.citytype,
a.areaname provinceName,
b.areaname cityName,
c.areaname countyName
</sql>
t.id,
t.open_id,
t.address_name,
t.address,
t.province_id,
t.city_id,
t.area_id,
t.sex,
t.phone,
t.whether,
t.accounts_id,
t.del_flag,
t.STATUS,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
a.areaid,
a.citytype,
a.areaname provinceName,
b.areaname cityName,
c.areaname countyName
</sql>
<sql id="Columns">
id,
......@@ -189,7 +189,6 @@
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
and t.del_flag=0
WHERE t.id=#{id}
</select>
......
......@@ -336,7 +336,7 @@
'</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 += '<li><a href="javascript:removeData(' + a + ')">删除</a></li>';
html += '</ul>';
html += '#end';
return html;
......
......@@ -114,12 +114,12 @@
<a style="width: 15%;-webkit-box-flex: 0; margin-left: 20px; margin-top: 2px;float:left"
class="btn btn-primary btn-sm" id="areaselect">选择</a>
</div>
<div class="form-group form-md-line-input" style="display:none" id="massSendTag">
<label style="clear:both;width:100%">选择标签</label>
<select class="form-control select2" multiple='multiple' style="width: 100%"
id="addlabel" name="tags" data-placeholder='请选择标签'>
</select>
</div>
<!--<div class="form-group form-md-line-input" style="display:none" id="massSendTag">-->
<!--<label style="clear:both;width:100%">选择标签</label>-->
<!--<select class="form-control select2" multiple='multiple' style="width: 100%"-->
<!--id="addlabel" name="tags" data-placeholder='请选择标签'>-->
<!--</select>-->
<!--</div>-->
<div class="form-group form-md-line-input" id="storeDiv" style="display:none">
<label>所属门店</label>
<div class="input-group">
......@@ -423,7 +423,7 @@
message: "预览文章发送成功,请在手机上查看",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/cfarticle/list')";
location.href = "#springUrl('/a/article/list')";
}
});
}
......
......@@ -2,12 +2,14 @@ package com.cftech.mp.article.service;
import com.cftech.core.generic.GenericService;
import com.cftech.mp.article.model.MpArticle;
/**
* 素材管理Service
*
* @author lisw
* @date: 2017-04-18 17:37
*/
* 素材管理Service
*
* @author lisw
* @date: 2017-04-18 17:37
*/
public interface ArticleService extends GenericService<MpArticle> {
Integer updateSynsTable(String accessToken,Long accountsId);
Integer updateSynsTable(String accessToken, Long accountsId);
}
......@@ -348,7 +348,7 @@
</if>
where fanss.delflag=0 and fanss.mpaccountid=${accountsid}
<if test="areaName!=null and areaName!=''">
and ((find_in_set(city,#{areaName})) or (find_in_set(province,#{areaName})))
and ((find_in_set( CONVERT(AES_DECRYPT(city,'aideakey') USING UTF8) ,#{areaName})) or (find_in_set( CONVERT(AES_DECRYPT(province,'aideakey') USING UTF8),#{areaName})))
</if>
<if test="sex!=null and sex!=''">
and fanss.sex=${sex}
......
......@@ -2,6 +2,7 @@ package com.cftech.mp.reply.service;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.model.OrgUnit;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.OrgUnitService;
......@@ -89,6 +90,9 @@ public class CoreService {
@Autowired
private CfarticleService cfarticleService;
@Autowired
private CodingruleUtils codingruleUtils;
// @Autowired
// private CardRecordService cardRecordService;
//
......@@ -198,15 +202,15 @@ public class CoreService {
mpFanssService.deleteByOpenId(fromUserName);
return "";
} else if (eventType.equals(MessageUtil.EVENT_TYPE_CLICK)) {// 自定义菜单点击事件
// Menu menu = menuServices.fetchById(eventKey);
// if (StringUtils.equals(menu.getMsgType(), "1")) {
// String content = MessageUtil.textMessageToXml(text(fromUserName, toUserName, menu.getSourceContent()));
// return content;
// } else if (StringUtils.equals(menu.getMsgType(), "2")) {
// return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, menu.getSourceContent()));
// } else if (StringUtils.equals(menu.getMsgType(), "3")) {
// return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, menu.getSourceContent()));
// }
Menu menu = menuServices.fetchById(eventKey);
if (StringUtils.equals(menu.getMsgType(), "1")) {
String content = MessageUtil.textMessageToXml(text(fromUserName, toUserName, menu.getSourceContent()));
return content;
} else if (StringUtils.equals(menu.getMsgType(), "2")) {
return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, menu.getSourceContent()));
} else if (StringUtils.equals(menu.getMsgType(), "3")) {
return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, menu.getSourceContent()));
}
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GET_CARD)) {//用户领取卡券
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GIFTING_CARD)) {//用户转赠卡券
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_CONSUME_CARD)) {//核销卡券
......@@ -562,7 +566,11 @@ public class CoreService {
MpFanssEntity fannsEntity = new MpFanssEntity();
//增加粉丝别名
if (fansList != null && fansList.size() > 0) {
fannsEntity.setStore(fansList.get(0).getStore());
if (StringUtils.isNoneBlank(fansList.get(0).getStore())) {
fannsEntity.setStore(fansList.get(0).getStore());
} else {
fannsEntity.setStore(codingruleUtils.getAlias());
}
}
fannsEntity.setHeadimgurl(user.getHeadimgurl());
......
......@@ -118,7 +118,7 @@
<div class="box-tools pull-right">
#if($shiro.hasPermission("sys:orgunit:edit"))
<a href="#springUrl('/a/orgunit/form')" class="btn btn-primary">新增</a>
<a onclick="addDept()" class="btn btn-primary">新增</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a>
#end
......@@ -198,6 +198,15 @@
<script src="dist/js/demo.js"></script>
<script>
function addDept(){
var orgId = $("#orgid").val();
if (orgId == null || orgId == "") {
orgId = 0;
}
location.href = "#springUrl('/a/orgunit/form')?parentId="+orgId;
}
function formatDates(now) {
var now = new Date(now);
var year = now.getFullYear();
......
......@@ -565,6 +565,7 @@
if ($("#passwordQyUser").val() != null && $("#passwordQyUser").val() != "") {
var password = sha256_digest($("#passwordQyUser").val());
$("#passwordQyUser").val(password);
dataJson.passwordQyUser = password;
}
$.post("#springUrl('/a/qyuser/formData')", dataJson, function (returnobj) {
$("#save").attr("disabled", false);
......
......@@ -68,17 +68,15 @@ public class OrgUnitController {
//返回编辑页面(新增、修改)
@RequiresPermissions(value = PermissionSign.ORGUNIT_VIEW)
@RequestMapping(value = "/form",method = {RequestMethod.GET,RequestMethod.POST})
public String form(HttpServletRequest request, String id, Model model) {
public String form(HttpServletRequest request, String id, Model model, String parentId) {
Long accountsId = Long.parseLong(qyAccounts);
Sort sort = new Sort("number", OrderType.ASC);
Conds conds = new Conds();
conds.equal("del_flag", 0);
if (!StringUtils.isEmpty(id)) {
OrgUnit orgUnit = orgUnitService.fetchById(id);
String parentOrgName = "";
if (orgUnit.getParentId() == 0) {
parentOrgName = rootOrgName;
} else {
......@@ -94,6 +92,16 @@ public class OrgUnitController {
model.addAttribute("accountId", orgUnit.getAccountsId());
conds.equal("accounts_id", orgUnit.getAccountsId());
} else {
if (parentId.equals("0")) {
OrgUnit orgUnit = new OrgUnit();
orgUnit.setParentId(0L);
model.addAttribute("data", orgUnit);
model.addAttribute("parentName", rootOrgName);
} else {
OrgUnit orgUnit = orgUnitService.fetchById(parentId);
model.addAttribute("data", orgUnit);
model.addAttribute("parentName", orgUnit.getOrgName());
}
model.addAttribute("accountId", accountsId);
conds.equal("accounts_id", accountsId);
}
......
......@@ -145,8 +145,7 @@ public class QyuserController {
qyuser.setWxuserId(loginNameQyUser);
qyUserUtil.updateQyUser(qyuser);
if (!StringUtils.isEmpty(qyuser.getImg())) {
String domainName = SystemConfig.p.getProperty("QY_DOMAIN");
qyuser.setDescription(domainName + qyuser.getImg());
qyuser.setDescription(qyuser.getImg().contains("http") ? qyuser.getImg():SystemConfig.p.getProperty("QY_DOMAIN") + qyuser.getImg());
}
qyuserService.update(qyuser);
if (!StringUtils.isEmpty(loginNameQyUser)) {
......@@ -181,15 +180,18 @@ public class QyuserController {
qyuser.setWxuserId(loginNameQyUser);
//同步至企业微信
qyUserUtil.updateQyUser(qyuser);
user.setPassword(passwordQyUser);
user.setUsername(loginNameQyUser);
user.setState("0");
if (!StringUtils.isEmpty(qyuser.getImg())) {
String domainName = SystemConfig.p.getProperty("QY_DOMAIN");
qyuser.setDescription(domainName + qyuser.getImg());
qyuser.setDescription(qyuser.getImg().contains("http") ? qyuser.getImg():SystemConfig.p.getProperty("QY_DOMAIN") + qyuser.getImg());
}
qyuserService.save(qyuser);
//添加本地用户
user.setState("0");
user.setPassword(passwordQyUser);
user.setUsername(loginNameQyUser);
user.setUserid(qyuser.getId());
user.setAccountsid(UserUtils.getmpaccounts(request));
user.setDefaultAccId(UserUtils.getmpaccounts(request));
userService.save(user);
rtnJson.put("errorNo", 2);
......
......@@ -177,7 +177,7 @@ function formSubmit (data)
btnoktext: "确定",
btncanceltext: "关闭",
success: function () {
location.href = "#springUrl('/a/index')";
top.location.href = "#springUrl('/a/index')";
},
cancel: function () {
}
......
......@@ -89,36 +89,42 @@ public class UserController {
* 验证码
*/
@GetMapping("captcha.jpg")
public void captcha(HttpServletRequest request,HttpServletResponse response, String uuid)throws ServletException, IOException {
Assert.hasText(uuid, "uuid不能为空");
if(uuid.contains("..")||uuid.contains("/")|| uuid.contains("%00"))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
public void captcha(HttpServletRequest request,HttpServletResponse response, String uuid) {
String refer = request.getHeader("Referer");
if (com.cftech.core.util.StringUtils.isBlank(refer))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
URL url = new URL(refer);
String remoteHost = url.getHost();
if((!MpGlobalConfig.JWT_DOMAIN.equals(remoteHost))||(!refer.contains("/login")))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
try {
Assert.hasText(uuid, "uuid不能为空");
if(uuid.contains("..")||uuid.contains("/")|| uuid.contains("%00"))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
//获取图片验证码
BufferedImage image = getCaptcha(uuid);
String refer = request.getHeader("Referer");
if (com.cftech.core.util.StringUtils.isBlank(refer))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
URL url = new URL(refer);
String remoteHost = url.getHost();
if((!MpGlobalConfig.JWT_DOMAIN.equals(remoteHost))||(!refer.contains("/login")))
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
IOUtils.closeQuietly(out);
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
//获取图片验证码
BufferedImage image = getCaptcha(uuid);
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
IOUtils.closeQuietly(out);
} catch (IOException e) {
logger.error("验证码失败:" + e.getMessage());
e.printStackTrace();
}
}
/**
* 用户登录
......
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