1、优化发布java代码流程,开源不易,开源统计请大家配合,谢谢。
2、修复bug 3、优化sql文件 4、短信回执
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"name": "vue-element-admin",
|
||||
"version": "4.2.1",
|
||||
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
||||
"author": "Pan <panfree23@gmail.com>",
|
||||
"author": "CRMEB",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
:default-checked-keys="selectModelKeys"
|
||||
@check="handleSelectionChange"
|
||||
/>
|
||||
<!-- {{biztype}}-->
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="divBox">
|
||||
@@ -88,7 +87,7 @@
|
||||
<el-table-column label="操作" min-width="200" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="biztype.value!==3"
|
||||
v-if="biztype.value!==3 && scope.row.pid === 0"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleAddMenu(scope.row)"
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
<el-cascader v-model="tableFrom.cateId" :options="merCateList" :props="props" clearable class="selWidth mr20" @change="getList"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品搜索:">
|
||||
<!--<el-input v-model="tableFrom.keywords" placeholder="请输入内容"></el-input>-->
|
||||
|
||||
<el-input v-model="tableFrom.keywords" @input="onInput()" placeholder="请输入商品名称,关键字,产品编号" class="selWidth">
|
||||
<el-button slot="append" icon="el-icon-search" @click="getList"/>
|
||||
</el-input>
|
||||
@@ -50,7 +52,7 @@
|
||||
label="ID"
|
||||
min-width="50"
|
||||
/>
|
||||
<el-table-column label="商品图" min-width="80">
|
||||
<el-table-column label="商品图" width="80">
|
||||
<template slot-scope="scope">
|
||||
<div class="demo-image__preview">
|
||||
<el-image
|
||||
@@ -64,17 +66,20 @@
|
||||
<el-table-column
|
||||
prop="storeName"
|
||||
label="商品名称"
|
||||
min-width="250"
|
||||
min-width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="cateId"
|
||||
label="商品分类"
|
||||
min-width="90"
|
||||
/>
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item, index) in scope.row.cateValues.split(',')" :key="index" class="mr10">{{ item }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block mb20">
|
||||
<el-pagination
|
||||
:page-sizes="[5, 10, 20, 30]"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@@ -120,7 +125,7 @@ export default {
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
limit: 10,
|
||||
cateId: '',
|
||||
keywords: '',
|
||||
type: '1'
|
||||
|
||||
@@ -206,7 +206,7 @@ table .el-image{
|
||||
margin-left: 40px !important;
|
||||
}
|
||||
.mr5{
|
||||
margin-right: 5px;
|
||||
margin-right: 5px !important;
|
||||
}
|
||||
.font14{
|
||||
font-size: 14px;
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
.down, .el-icon-caret-bottom {
|
||||
color: #39C15B;
|
||||
font-size: 12px;
|
||||
opacity: 100% !important;
|
||||
/*opacity: 100% !important;*/
|
||||
}
|
||||
|
||||
.baseInfo {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form inline size="small">
|
||||
<el-form inline size="small" @submit.native.prevent>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="listPram.keywords" placeholder="请输入id,名称,描述" clearable class="selWidth" size="small">
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="handlerSearch" />
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
min-width="120"
|
||||
min-width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
label="类型"
|
||||
|
||||
@@ -277,6 +277,16 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.demo-table-expand{
|
||||
/deep/ label{
|
||||
width: 82px;
|
||||
}
|
||||
}
|
||||
.demo-table-expand{
|
||||
/deep/ .el-form-item__content{
|
||||
width: 77%;
|
||||
}
|
||||
}
|
||||
.selWidth{
|
||||
width: 350px !important;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="pram" :model="pram" :rules="rules" label-width="100px">
|
||||
<el-form ref="pram" :model="pram" :rules="rules" label-width="100px" @submit.native.prevent>
|
||||
<el-form-item label="管理员账号" prop="account">
|
||||
<el-input v-model="pram.account" placeholder="管理员账号" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<el-form inline size="small">
|
||||
<el-form inline size="small" @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-select v-model="listPram.roles" placeholder="身份" clearable class="selWidth">
|
||||
<el-option
|
||||
@@ -39,43 +39,45 @@
|
||||
<el-button size="mini" type="primary" @click="handleSearch">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form inline>
|
||||
<el-form inline @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-button size="mini" type="primary" @click="handlerOpenEdit(0)">添加管理员</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="listData.list" size="mini">
|
||||
<el-table-column label="姓名" prop="realName" />
|
||||
<el-table-column label="账号" prop="account" />
|
||||
<el-table-column label="身份" prop="realName">
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="ID"
|
||||
width="50"
|
||||
/>
|
||||
<el-table-column label="姓名" prop="realName" min-width="120"/>
|
||||
<el-table-column label="账号" prop="account" min-width="120"/>
|
||||
<el-table-column label="身份" prop="realName" min-width="230">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="item in roleList.list" :key="item.id">
|
||||
<el-tag v-if="scope.row.roles.includes(item.id)" type="info">{{ item.roleName }}</el-tag>
|
||||
<!-- <span>{{ scope.row }}</span>-->
|
||||
</span>
|
||||
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" class="mr5">{{ item }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后登录时间" prop="lastTime">
|
||||
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.updateTime | filterEmpty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后登录IP" prop="lastIp">
|
||||
<el-table-column label="最后登录IP" prop="lastIp" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.lastIp | filterEmpty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="100">
|
||||
<el-table-column label="状态" prop="status" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.status | filterShowOrHide }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="删除标记" prop="status" width="100">
|
||||
<el-table-column label="删除标记" prop="status" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDel | filterYesOrNo }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" min-width="130" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<template v-if="scope.row.isDel">
|
||||
<span>-</span>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="pram" :model="pram" label-width="100px">
|
||||
<el-form ref="pram" :model="pram" label-width="100px" @submit.native.prevent>
|
||||
<el-form-item label="身份名称" prop="roleName" :rules="[{required:true,message:'请填写身份名称', trigger:['blur','change']}]">
|
||||
<el-input v-model="pram.roleName" placeholder="身份名称" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<el-form inline size="small">
|
||||
<el-form inline size="small" @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-select v-model="listPram.status" placeholder="状态" clearable class="selWidth">
|
||||
<el-option
|
||||
@@ -19,7 +19,7 @@
|
||||
<el-button size="mini" type="primary" @click.native="handleGetRoleList">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form inline>
|
||||
<el-form inline @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-button size="mini" type="primary" @click="handlerOpenEdit(0)">添加身份</el-button>
|
||||
</el-form-item>
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
<el-switch
|
||||
v-model="scope.row.isShow"
|
||||
class="demo"
|
||||
:active-value="1" :inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
@change="bindStatus(scope.row)"
|
||||
@@ -158,6 +159,7 @@ export default {
|
||||
sort: item.sort
|
||||
}).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
this.getExpressList()
|
||||
}).catch(() => {
|
||||
item.isShow = !item.isShow
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogFormVisible" :title="id?'修改核销员':'添加核销员'" :visible.sync="dialogFormVisible" width="750px" @close="cancel">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm" @submit.native.prevent>
|
||||
<el-form-item label="商城用户:" prop="avatar">
|
||||
<div class="publicPicBox" @click="upImg">
|
||||
{{ruleForm.avatar}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form ref="form" inline :model="artFrom" size="small">
|
||||
<el-form ref="form" inline :model="artFrom" size="small" @submit.native.prevent>
|
||||
<el-form-item label="提货点名称:">
|
||||
<el-select v-model="artFrom.storeId" placeholder="请选择" class="selWidth" clearable @change="search">
|
||||
<el-option
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogFormVisible" :title="id?'修改提货点':'添加提货点'" :visible.sync="dialogFormVisible" width="750px" @close="cancel">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm" @submit.native.prevent>
|
||||
<el-form-item label="提货点名称:" prop="name">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入提货点名称" class="dialogWidth"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<el-tab-pane :label="'隐藏中的提货点('+ headerCount.hide +')'" name="0"></el-tab-pane>
|
||||
<el-tab-pane :label="'回收站的提货点('+ headerCount.recycle +')'" name="2"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form ref="form" inline :model="artFrom">
|
||||
<el-form ref="form" inline :model="artFrom" @submit.native.prevent>
|
||||
<el-form-item label="关键字:">
|
||||
<el-input v-model="artFrom.keywords" placeholder="请输入提货点名称/电话" class="selWidth" size="small">
|
||||
<el-button slot="append" icon="el-icon-search" @click="search" />
|
||||
|
||||
@@ -31,12 +31,16 @@ public class SmsConstants {
|
||||
public static final String SMS_API_TEMP_LIST_URI = "sms/template";
|
||||
// 发送短信
|
||||
public static final String SMS_API_SEND_URI = "sms/send";
|
||||
// 获取发送状态
|
||||
public static final String SMS_API_SEND_STATUS = "sms/status";
|
||||
|
||||
//接口异常错误码
|
||||
public static final Integer SMS_ERROR_CODE = 400;
|
||||
|
||||
//短信发送队列key
|
||||
public static final String SMS_SEND_KEY = "sms_send_list";
|
||||
// 发送短信后状态同步key
|
||||
public static final String SMS_SEND_RESULT_KEY = "sms_send_result_list";
|
||||
|
||||
// 短信模版配置开关常量
|
||||
public static final String SMS_CONFIG_VERIFICATION_CODE = "verificationCode";// 验证码
|
||||
|
||||
@@ -12,11 +12,9 @@ import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Key;
|
||||
import java.security.Security;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -539,47 +537,48 @@ public class CrmebUtil {
|
||||
|
||||
/**
|
||||
* 同比率计算 //同比增长率= ((当前周期 - 上一个周期) ÷ 上一个周期 ) *100%
|
||||
* @param now 当前周期
|
||||
* @param last 上一个周期
|
||||
* @param i1 当前周期
|
||||
* @param i2 上一个周期
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-05-06
|
||||
* @
|
||||
*/
|
||||
public static String getRate(Integer now, Integer last){
|
||||
int diff = now - last;
|
||||
if(diff == 0){
|
||||
return "0%";
|
||||
}
|
||||
|
||||
return (((now - last) / last) * 100) + "%";
|
||||
public static int getRate(Integer i1, Integer i2){
|
||||
BigDecimal b1 = new BigDecimal(i1);
|
||||
BigDecimal b2 = new BigDecimal(i2);
|
||||
return getRate(b1, b2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同比率计算 //同比增长率= ((当前周期 - 上一个周期) ÷ 上一个周期 ) *100%
|
||||
* @param now 当前周期
|
||||
* @param last 上一个周期
|
||||
* @param b1 当前周期
|
||||
* @param b2 上一个周期
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-05-06
|
||||
* @
|
||||
*/
|
||||
public static String getRate(BigDecimal now, BigDecimal last){
|
||||
public static int getRate(BigDecimal b1, BigDecimal b2){
|
||||
//计算差值
|
||||
BigDecimal subtract = now.subtract(now);
|
||||
BigDecimal zero = new BigDecimal(BigInteger.ZERO);
|
||||
if(subtract.equals(zero)){
|
||||
|
||||
if(b2.equals(b1)){
|
||||
//数值一样,说明没有增长
|
||||
return "0%";
|
||||
return Constants.NUM_ZERO;
|
||||
}
|
||||
|
||||
if(b2.equals(BigDecimal.ZERO)){
|
||||
//b2是0
|
||||
return Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
|
||||
return (b1.subtract(b2)).divide(b2, 2, BigDecimal.ROUND_UP).multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue();
|
||||
|
||||
|
||||
// BigDecimal.setScale();//用于格式化小数点
|
||||
// setScale(1);//表示保留以为小数,默认用四舍五入方式
|
||||
// setScale(1,BigDecimal.ROUND_DOWN);//直接删除多余的小数位,如2.35会变成2.3
|
||||
// setScale(1,BigDecimal.ROUND_UP);//进位处理,2.35变成2.4
|
||||
// setScale(1,BigDecimal.ROUND_HALF_UP);//四舍五入,2.35变成2.4
|
||||
// setScaler(1,BigDecimal.ROUND_HALF_DOWN);//四舍五入,2.35变成2.3,如果是5则向下舍
|
||||
|
||||
|
||||
return subtract.divide(last, 0, BigDecimal.ROUND_UP).multiply(new BigDecimal(100)) + "%";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
package com.zbkj.crmeb.express.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 快递公司表
|
||||
* </p>
|
||||
*
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("eb_express")
|
||||
@ApiModel(value="Express对象", description="快递公司表")
|
||||
public class Express implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "快递公司id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "快递公司简称")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "快递公司全称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Boolean isShow;
|
||||
|
||||
|
||||
}
|
||||
package com.zbkj.crmeb.express.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 快递公司表
|
||||
* </p>
|
||||
*
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("eb_express")
|
||||
@ApiModel(value="Express对象", description="快递公司表")
|
||||
public class Express implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "快递公司id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "快递公司简称")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "快递公司全称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Integer isShow;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ public class ExpressRequest implements Serializable {
|
||||
@NotNull(message = "排序数字必须填写")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否显示", required = true)
|
||||
@ApiModelProperty(value = "是否显示 0=否 1=是", required = true)
|
||||
@NotNull(message = "请选择是否弃用")
|
||||
private Boolean isShow;
|
||||
private Integer isShow;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ public class ExpressSearchRequest implements Serializable {
|
||||
@ApiModelProperty(value = "搜索关键字", required = true)
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "是否显示", required = true)
|
||||
private Boolean isShow = null;
|
||||
@ApiModelProperty(value = "是否显示 0=否 1=是", required = true)
|
||||
private Integer isShow;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ExpressController {
|
||||
pageParamRequest.setLimit(Constants.EXPORT_MAX_LIMIT);
|
||||
|
||||
ExpressSearchRequest expressSearchRequest = new ExpressSearchRequest();
|
||||
expressSearchRequest.setIsShow(true);
|
||||
expressSearchRequest.setIsShow(1);
|
||||
return CommonResult.success(CommonPage.restPage(expressService.getList(expressSearchRequest, pageParamRequest)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,8 +92,6 @@ public class SmsRecordController {
|
||||
@RequestMapping(value = "/record/list", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<SmsRecord>> getList(@ModelAttribute SmsRecordRequest smsRecordRequest,
|
||||
@ModelAttribute PageParamRequest pageParamRequest){
|
||||
SmsRecord smsRecord = new SmsRecord();
|
||||
BeanUtils.copyProperties(smsRecordRequest, smsRecord);
|
||||
CommonPage<SmsRecord> smsRecordCommonPage =
|
||||
CommonPage.restPage(smsRecordService.getList(smsRecordRequest, pageParamRequest));
|
||||
return CommonResult.success(smsRecordCommonPage);
|
||||
|
||||
@@ -22,4 +22,6 @@ public class SendSmsVo {
|
||||
// 发送参数
|
||||
private String param;
|
||||
|
||||
private String content;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,4 +30,12 @@ public interface SmsRecordService extends IService<SmsRecord> {
|
||||
* @return 保存结果
|
||||
*/
|
||||
boolean save(SmsRecord smsRecord);
|
||||
|
||||
|
||||
// 短信状态同步
|
||||
void consumeSmsStatus();
|
||||
|
||||
// 更新短信实际发送状态嘛
|
||||
void updateSmsStatus(List<Integer> recordIds);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.zbkj.crmeb.sms.request.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Mr.Zhang
|
||||
@@ -44,6 +45,11 @@ public interface SmsService{
|
||||
boolean pushCodeToList(String phone, Integer tag,HashMap<String, Object> pram);
|
||||
|
||||
void push(String phone,String tempKey,Integer msgTempId,boolean valid, HashMap<String,Object> mapPram);
|
||||
/**
|
||||
* 根据发送id同步发送短信结果
|
||||
* @param recordIds 短信发送id
|
||||
*/
|
||||
void pushByAsyncStatus(List<Integer> recordIds);
|
||||
|
||||
void consume();
|
||||
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
package com.zbkj.crmeb.sms.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.common.PageParamRequest;
|
||||
import com.constants.SmsConstants;
|
||||
import com.exception.CrmebException;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.utils.RedisUtil;
|
||||
import com.utils.RestTemplateUtil;
|
||||
import com.zbkj.crmeb.sms.model.SmsRecord;
|
||||
import com.zbkj.crmeb.sms.dao.SmsRecordDao;
|
||||
import com.zbkj.crmeb.sms.request.SmsRecordRequest;
|
||||
import com.zbkj.crmeb.sms.service.SmsRecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -23,8 +35,13 @@ public class SmsRecordServiceImpl extends ServiceImpl<SmsRecordDao, SmsRecord> i
|
||||
|
||||
@Resource
|
||||
private SmsRecordDao dao;
|
||||
@Autowired
|
||||
private RestTemplateUtil restTemplateUtil;
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SmsRecordServiceImpl.class);
|
||||
/**
|
||||
* 短信发送记录
|
||||
* @param request 请求参数
|
||||
@@ -51,5 +68,85 @@ public class SmsRecordServiceImpl extends ServiceImpl<SmsRecordDao, SmsRecord> i
|
||||
public boolean save(SmsRecord smsRecord) {
|
||||
return dao.insert(smsRecord) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新短信记录实际发送状态嘛
|
||||
* @param recordIds 待更新短信发送id
|
||||
*/
|
||||
@Override
|
||||
public void updateSmsStatus(List<Integer> recordIds) {
|
||||
HashMap<String, List<Integer>> pram = new HashMap<>();
|
||||
pram.put("record_id", recordIds);
|
||||
String result = restTemplateUtil.postJsonData(
|
||||
SmsConstants.SMS_API_URL + SmsConstants.SMS_API_SEND_STATUS,
|
||||
JSONObject.parseObject(JSONObject.toJSONString(pram)));
|
||||
|
||||
JSONObject joResult;
|
||||
try{
|
||||
joResult = checkResult(result);
|
||||
}catch (Exception e1){
|
||||
joResult = JSONObject.parseObject(result);
|
||||
}
|
||||
|
||||
int resultCode = joResult.getInteger("status");
|
||||
String message = joResult.getString("msg");
|
||||
JSONObject data = joResult.getJSONObject("data");
|
||||
String smsRecodeId = (data.containsKey("id") ? data.getString("id") : "0");
|
||||
|
||||
}
|
||||
|
||||
// 短信发送状态同步队列消费者
|
||||
@Async
|
||||
public void consumeSmsStatus() {
|
||||
Long size = redisUtil.getListSize(SmsConstants.SMS_SEND_RESULT_KEY);
|
||||
logger.info("SmsServiceImpl.consumeSmsStatus | size:" + size);
|
||||
if(size > 0){
|
||||
for (int i = 0; i < size; i++) {
|
||||
//如果10秒钟拿不到一个数据,那么退出循环
|
||||
Object data = redisUtil.getRightPop(SmsConstants.SMS_SEND_RESULT_KEY, 10L);
|
||||
if(null == data){
|
||||
continue;
|
||||
}
|
||||
try{
|
||||
List<Integer> recordIds = (List<Integer>) JSONObject.parseObject(data.toString());
|
||||
updateSmsStatus(recordIds);
|
||||
}catch (Exception e){
|
||||
redisUtil.lPush(SmsConstants.SMS_SEND_RESULT_KEY, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检测结构请求返回的数据
|
||||
* @param result 接口返回的结果
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-16
|
||||
* @return JSONObject
|
||||
*/
|
||||
private JSONObject checkResult(String result){
|
||||
if(StringUtils.isBlank(result)){
|
||||
throw new CrmebException("短信平台接口异常,没任何数据返回!");
|
||||
}
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if(SmsConstants.SMS_ERROR_CODE.equals(jsonObject.getInteger("status"))){
|
||||
throw new CrmebException("短信平台接口" + jsonObject.getString("msg"));
|
||||
}
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
private JSONObject checkResult(JSONObject result){
|
||||
if(null == result){
|
||||
throw new CrmebException("短信平台接口异常,没任何数据返回!");
|
||||
}
|
||||
if(SmsConstants.SMS_ERROR_CODE.equals(result.getInteger("status"))){
|
||||
throw new CrmebException("短信平台接口" + result.getString("msg"));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -438,12 +440,22 @@ public class SmsServiceImpl implements SmsService {
|
||||
JSONObject data = joResult.getJSONObject("data");
|
||||
String smsRecodeId = (data.containsKey("id") ? data.getString("id") : "0");
|
||||
|
||||
SmsRecord smsRecord = new SmsRecord(0,sendSmsVo.getUid(), sendSmsVo.getMobile(),sendSmsVo.getParam(), "", sendSmsVo.getTemplate().toString() ,resultCode,Integer.parseInt(smsRecodeId), message);
|
||||
// 注意这里的状态仅仅是调用是否成功的状态 需要等待5分钟一周另外一个任务去查询发送状态后再更新status数据
|
||||
SmsRecord smsRecord = new SmsRecord(0,sendSmsVo.getUid(), sendSmsVo.getMobile(),sendSmsVo.getContent(),
|
||||
"", sendSmsVo.getTemplate().toString(),
|
||||
resultCode,Integer.parseInt(smsRecodeId), message);
|
||||
smsRecordService.save(smsRecord);
|
||||
|
||||
// 添加到短信实际发送状态队列
|
||||
if(smsRecodeId.length() > 0){
|
||||
List<Integer> recordsIds = new ArrayList<>();
|
||||
recordsIds.add(Integer.parseInt(smsRecodeId));
|
||||
pushByAsyncStatus(recordsIds);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 短信队列消费者
|
||||
*/
|
||||
@@ -536,6 +548,16 @@ public class SmsServiceImpl implements SmsService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加短信发送状态同步队列
|
||||
* @param recordIds 短信发送id
|
||||
*/
|
||||
@Override
|
||||
public void pushByAsyncStatus(List<Integer> recordIds) {
|
||||
if(null == recordIds) return;
|
||||
redisUtil.lPush(SmsConstants.SMS_SEND_RESULT_KEY, JSONObject.toJSONString(recordIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册手机号码
|
||||
* @param phone 手机号码
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zbkj.crmeb.statistics.service.impl;
|
||||
|
||||
import com.constants.Constants;
|
||||
import com.utils.CrmebUtil;
|
||||
import com.utils.DateUtil;
|
||||
import com.zbkj.crmeb.statistics.response.HomeRateResponse;
|
||||
import com.zbkj.crmeb.statistics.service.HomeService;
|
||||
@@ -57,22 +58,11 @@ public class HomeServiceImpl implements HomeService {
|
||||
|
||||
|
||||
//日同比
|
||||
int dayRate = Constants.NUM_ZERO;
|
||||
if(!today.equals(BigDecimal.ZERO)){
|
||||
dayRate = Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
if(!yesterday.equals(BigDecimal.ZERO)){
|
||||
dayRate = today.subtract(yesterday).divide(yesterday).multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue();
|
||||
}
|
||||
int dayRate = CrmebUtil.getRate(today, yesterday);
|
||||
|
||||
//周同比
|
||||
int weekRate = Constants.NUM_ZERO;
|
||||
if(!week.equals(BigDecimal.ZERO)){
|
||||
weekRate = Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
if(!preWeek.equals(BigDecimal.ZERO)){
|
||||
weekRate = week.subtract(preWeek).divide(preWeek).multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue();
|
||||
}
|
||||
int weekRate = CrmebUtil.getRate(week, preWeek);
|
||||
|
||||
|
||||
return new HomeRateResponse(yesterday, dayRate, weekRate, all);
|
||||
}
|
||||
@@ -104,22 +94,11 @@ public class HomeServiceImpl implements HomeService {
|
||||
|
||||
|
||||
//日同比
|
||||
int dayRate = Constants.NUM_ZERO;
|
||||
if(today != Constants.NUM_ZERO){
|
||||
dayRate = Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
if(yesterday != Constants.NUM_ZERO){
|
||||
dayRate = ((today - yesterday) / yesterday) * Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
int dayRate = CrmebUtil.getRate(today, yesterday);
|
||||
|
||||
//周同比
|
||||
int weekRate = Constants.NUM_ZERO;
|
||||
if(week != Constants.NUM_ZERO){
|
||||
weekRate = Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
if(preWeek != Constants.NUM_ZERO){
|
||||
weekRate = ((weekRate - preWeek) / preWeek) * Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
int weekRate = CrmebUtil.getRate(week, preWeek);
|
||||
|
||||
|
||||
return new HomeRateResponse(yesterday, dayRate, weekRate, all);
|
||||
}
|
||||
@@ -151,22 +130,11 @@ public class HomeServiceImpl implements HomeService {
|
||||
|
||||
|
||||
//日同比
|
||||
int dayRate = Constants.NUM_ZERO;
|
||||
if(today != Constants.NUM_ZERO){
|
||||
dayRate = Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
if(yesterday != Constants.NUM_ZERO){
|
||||
dayRate = ((today - yesterday) / yesterday) * Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
int dayRate = CrmebUtil.getRate(today, yesterday);
|
||||
|
||||
//周同比
|
||||
int weekRate = Constants.NUM_ZERO;
|
||||
if(week != Constants.NUM_ZERO){
|
||||
weekRate = Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
if(preWeek != Constants.NUM_ZERO){
|
||||
weekRate = ((weekRate - preWeek) / preWeek) * Constants.NUM_ONE_HUNDRED;
|
||||
}
|
||||
int weekRate = CrmebUtil.getRate(week, preWeek);
|
||||
|
||||
|
||||
return new HomeRateResponse(yesterday, dayRate, weekRate, all);
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
QueryWrapper<StoreOrder> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("sum(pay_price) as pay_price").
|
||||
eq("paid", 1).
|
||||
eq("is_del", 1);
|
||||
eq("is_del", 0);
|
||||
if(null != userId){
|
||||
queryWrapper.eq("uid", userId);
|
||||
}
|
||||
@@ -659,7 +659,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
public int getOrderCount(Integer userId, String date) {
|
||||
LambdaQueryWrapper<StoreOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(StoreOrder::getPaid,1)
|
||||
.eq(StoreOrder::getIsDel, 1);
|
||||
.eq(StoreOrder::getIsDel, 0);
|
||||
|
||||
if(null != userId){
|
||||
lambdaQueryWrapper.eq(StoreOrder::getUid, userId);
|
||||
|
||||
@@ -55,10 +55,10 @@ public class SystemAdminController {
|
||||
@ApiOperation(value = "分页列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SystemAdmin>> getList(@Validated SystemAdminRequest systemAdminRequest, PageParamRequest pageParamRequest){
|
||||
public CommonResult<CommonPage<SystemAdminResponse>> getList(@Validated SystemAdminRequest systemAdminRequest, PageParamRequest pageParamRequest){
|
||||
SystemAdmin systemAdmin = new SystemAdmin();
|
||||
BeanUtils.copyProperties(systemAdminRequest, systemAdmin);
|
||||
CommonPage<SystemAdmin> systemAdminCommonPage = CommonPage.restPage(systemAdminService.getList(systemAdminRequest, pageParamRequest));
|
||||
CommonPage<SystemAdminResponse> systemAdminCommonPage = CommonPage.restPage(systemAdminService.getList(systemAdminRequest, pageParamRequest));
|
||||
return CommonResult.success(systemAdminCommonPage);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zbkj.crmeb.system.response;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -25,6 +26,8 @@ public class SystemAdminResponse implements Serializable {
|
||||
|
||||
private String roles;
|
||||
|
||||
private String roleNames;
|
||||
|
||||
private String lastIp;
|
||||
|
||||
private Integer lastTime;
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* @since 2020-04-13
|
||||
*/
|
||||
public interface SystemAdminService extends IService<SystemAdmin> {
|
||||
List<SystemAdmin> getList(SystemAdminRequest request, PageParamRequest pageParamRequest);
|
||||
List<SystemAdminResponse> getList(SystemAdminRequest request, PageParamRequest pageParamRequest);
|
||||
|
||||
SystemAdminResponse getInfo(SystemAdminRequest request) throws Exception;
|
||||
|
||||
|
||||
@@ -11,16 +11,23 @@ import com.zbkj.crmeb.authorization.manager.TokenManager;
|
||||
import com.zbkj.crmeb.authorization.model.TokenModel;
|
||||
import com.zbkj.crmeb.system.dao.SystemAdminDao;
|
||||
import com.zbkj.crmeb.system.model.SystemAdmin;
|
||||
import com.zbkj.crmeb.system.model.SystemRole;
|
||||
import com.zbkj.crmeb.system.request.SystemAdminAddRequest;
|
||||
import com.zbkj.crmeb.system.request.SystemAdminRequest;
|
||||
import com.zbkj.crmeb.system.request.SystemRoleSearchRequest;
|
||||
import com.zbkj.crmeb.system.response.SystemAdminResponse;
|
||||
import com.zbkj.crmeb.system.service.SystemAdminService;
|
||||
import com.zbkj.crmeb.system.service.SystemRoleService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Mr.Zhang
|
||||
@@ -33,12 +40,15 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminDao, SystemAd
|
||||
@Resource
|
||||
private SystemAdminDao dao;
|
||||
|
||||
@Autowired
|
||||
private SystemRoleService systemRoleService;
|
||||
|
||||
@Resource
|
||||
private TokenManager tokenManager;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SystemAdmin> getList(SystemAdminRequest request, PageParamRequest pageParamRequest){
|
||||
public List<SystemAdminResponse> getList(SystemAdminRequest request, PageParamRequest pageParamRequest){
|
||||
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
||||
|
||||
//带SystemAdminRequest类的多条件查询
|
||||
@@ -76,7 +86,29 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminDao, SystemAd
|
||||
if(null != systemAdmin.getStatus()){
|
||||
lambdaQueryWrapper.eq(SystemAdmin::getStatus, systemAdmin.getStatus());
|
||||
}
|
||||
return dao.selectList(lambdaQueryWrapper);
|
||||
List<SystemAdmin> systemAdmins = dao.selectList(lambdaQueryWrapper);
|
||||
List<SystemAdminResponse> systemAdminResponses = new ArrayList<>();
|
||||
PageParamRequest pageRole = new PageParamRequest();
|
||||
pageRole.setLimit(999);
|
||||
List<SystemRole> roleList = systemRoleService.getList(new SystemRoleSearchRequest(), pageRole);
|
||||
// for (SystemRole systemRole : roleList) {
|
||||
for (SystemAdmin admin : systemAdmins) {
|
||||
SystemAdminResponse sar = new SystemAdminResponse();
|
||||
BeanUtils.copyProperties(admin, sar);
|
||||
if(StringUtils.isBlank(admin.getRoles())) break;
|
||||
List<Integer> roleIds = CrmebUtil.stringToArrayInt(admin.getRoles());
|
||||
List<String> roleNames = new ArrayList<>();
|
||||
for (Integer roleId : roleIds) {
|
||||
List<SystemRole> hasRoles = roleList.stream().filter(e -> e.getId() == roleId).collect(Collectors.toList());
|
||||
if(hasRoles.size()> 0){
|
||||
roleNames.add(hasRoles.stream().map(SystemRole::getRoleName).collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
sar.setRoleNames(StringUtils.join(roleNames,","));
|
||||
systemAdminResponses.add(sar);
|
||||
}
|
||||
// }
|
||||
return systemAdminResponses;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -156,16 +188,17 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminDao, SystemAd
|
||||
throw new CrmebException("管理员已存在");
|
||||
}
|
||||
|
||||
SystemAdminRequest systemAdminRequest = new SystemAdminRequest();
|
||||
BeanUtils.copyProperties(systemAdminAddRequest, systemAdminRequest);
|
||||
|
||||
// 执行新增管理员操作
|
||||
String pwd = CrmebUtil.encryptPassword(systemAdminAddRequest.getPwd(), systemAdminAddRequest.getAccount());
|
||||
systemAdminAddRequest.setPwd(pwd);
|
||||
SystemAdmin systemAdmin = new SystemAdmin();
|
||||
BeanUtils.copyProperties(systemAdminAddRequest, systemAdmin);
|
||||
|
||||
// 执行新增管理员操作
|
||||
String pwd = CrmebUtil.encryptPassword(systemAdmin.getPwd(), systemAdmin.getAccount());
|
||||
systemAdminAddRequest.setPwd(pwd); // 设置为加密后的密码
|
||||
SystemAdminResponse systemAdminResponse = new SystemAdminResponse();
|
||||
BeanUtils.copyProperties(systemAdminAddRequest, systemAdminResponse);
|
||||
if(dao.insert(systemAdmin) <= 0){
|
||||
throw new CrmebException("新增管理员失败");
|
||||
}
|
||||
return systemAdminResponse;
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
@@ -88,7 +88,6 @@ public interface UserService extends IService<User> {
|
||||
|
||||
Map<Object, Object> getAddUserCountGroupDate(String date);
|
||||
|
||||
|
||||
boolean bind(UserBindingRequest request);
|
||||
|
||||
UserCenterResponse getUserCenter();
|
||||
|
||||
@@ -638,14 +638,14 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
||||
dateLimitUtilVo dateLimit = DateUtil.getDateLimit(date);
|
||||
queryWrapper.between("create_time", dateLimit.getStartTime(), dateLimit.getEndTime());
|
||||
}
|
||||
queryWrapper.groupBy("create_time").orderByAsc("create_time");
|
||||
queryWrapper.groupBy("left(create_time, 10)").orderByAsc("create_time");
|
||||
List<User> list = userDao.selectList(queryWrapper);
|
||||
if(list.size() < 1){
|
||||
return map;
|
||||
}
|
||||
|
||||
for (User user : list) {
|
||||
map.put(user.getCreateTime(), user.getUid());
|
||||
map.put(DateUtil.dateToStr(user.getCreateTime(), Constants.DATE_FORMAT_DATE), user.getUid());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,22 @@
|
||||
#开始时间 时间戳
|
||||
startTime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
|
||||
#jar包文件路径及名称(目录按照各自配置)
|
||||
APP_NAME=/www/wwwroot/api.java.crmeb.net/Crmeb.jar
|
||||
#接口项目站点路径(目录按照各自配置)
|
||||
#APP_PATH=/www/wwwroot/api.java.crmeb.net/
|
||||
APP_PATH=/Library/WebServer/Documents/zhongbang/java/crmeb
|
||||
|
||||
#日志文件路径及名称(目录按照各自配置)
|
||||
LOG_FILE=/www/wwwroot/api.java.crmeb.net/crmeb_out.log
|
||||
#jar包文件名称
|
||||
APP_NAME=$APP_PATH/target/Crmeb.jar
|
||||
|
||||
#日志文件名称
|
||||
LOG_FILE=$APP_PATH/crmeb_out.log
|
||||
|
||||
#安装文件
|
||||
INSTALL_FILE=$APP_PATH/install.txt
|
||||
|
||||
#启动环境 # 如果需要配置数据和redis,请在 application-prod.yml中修改, 用jar命令修改即可
|
||||
APP_YML=--spring.profiles.active=prod #prod代表 读取 application-prod.yml 配置文件
|
||||
APP_YML=--spring.profiles.active=prod
|
||||
|
||||
|
||||
#数据库配置
|
||||
|
||||
@@ -65,17 +73,6 @@ if test -e $APP_NAME;then
|
||||
sleep 1s
|
||||
fi
|
||||
|
||||
fail=`grep "Error" $LOG_FILE`
|
||||
if [[ "$fail" != "" ]]
|
||||
then
|
||||
echo "项目启动失败"
|
||||
tail -f $LOG_FILE
|
||||
break
|
||||
else
|
||||
# echo "Crmeb Running ......."
|
||||
sleep 1s
|
||||
fi
|
||||
|
||||
done
|
||||
echo "Crmeb Started Success"
|
||||
|
||||
@@ -90,7 +87,7 @@ echo "本次运行时间: "$total"s"
|
||||
echo "当前时间:"$endTime
|
||||
|
||||
|
||||
#消息推送到企业微信群, 可根据自己的情况配置
|
||||
#消息推送到企业微信群
|
||||
# curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4f7df494-cece-49c2-8e04-60610c937b4a' \
|
||||
# -H 'Content-Type: application/json' \
|
||||
# -d '
|
||||
@@ -102,6 +99,28 @@ echo "当前时间:"$endTime
|
||||
# }
|
||||
# }'
|
||||
|
||||
host="www.xx.net"; #此处填写自己的前端访问域名
|
||||
domain="https://www.xx.com"; #此处填写自己的前端访问域名 带http/https
|
||||
version="crmeb_java_1.0"; #版本号, 此处不需要修改
|
||||
ip="111.111.111.111"; #您当前服务器的IP
|
||||
|
||||
if test -e $INSTALL_FILE;then
|
||||
echo '已经统计过首次安装'
|
||||
else
|
||||
#开源不易,首次安装统计
|
||||
curl 'http://shop.crmeb.net/index.php/admin/server.upgrade_api/updatewebinfo' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '
|
||||
{
|
||||
"host": "'$host'",
|
||||
"https": "'$domain'",
|
||||
"version": "'$version'",
|
||||
"ip": "'$ip'"
|
||||
}'
|
||||
touch $INSTALL_FILE
|
||||
echo "install" > $INSTALL_FILE
|
||||
fi
|
||||
|
||||
##实时查看启动日志
|
||||
# #tail -f $LOG_FILE
|
||||
# pid1=;
|
||||
|
||||
18158
crmeb_java_v1.0.sql
18158
crmeb_java_v1.0.sql
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user