From 9fa82e0217d54a38dd1546094d8d15cb43e827b0 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 22 四月 2025 11:22:47 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/api/common/PublicCloudController.java | 19 ----
admin/src/utils/request/index.js | 2
admin/src/views/index.vue | 65 +++++++++++++---
server/src/main/java/com/doumee/core/utils/DateUtil.java | 17 ++++
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java | 91 +++++++++++++++-------
server/src/main/java/com/doumee/dao/business/model/Workorder.java | 3
server/src/main/resources/application-pro.yml | 19 +++-
admin/src/components/business/OperaWorkorderDetailDbhWindow.vue | 2
8 files changed, 147 insertions(+), 71 deletions(-)
diff --git a/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue b/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue
index 2a9ff24..245d85b 100644
--- a/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue
+++ b/admin/src/components/business/OperaWorkorderDetailDbhWindow.vue
@@ -95,7 +95,7 @@
<div class="company">
鍛樺伐锛�<span> {{ item.userName }} / {{item.companyName}}</span>
<div style="display: block" >鏃堕棿锛�<span>{{item.createDate}}</span></div>
- <div class="dealinfo" v-if="item.param2||item.remark||(item.multifileList !=null && item.multifileList.length)">
+ <div class="dealinfo" v-if="item.param2 || item.remark || (item.multifileList !=null && item.multifileList.length)">
<div style="display: block" v-if="item.param2" >澶勭悊浜猴細<span>{{item.param2}}</span></div>
<div style="display: block" v-if="item.remark" >璇存槑锛�<span>{{item.remark}}</span></div>
<div style="display: block;margin-top:10px" v-if="item.multifileList !=null && item.multifileList.length">
diff --git a/admin/src/utils/request/index.js b/admin/src/utils/request/index.js
index 5340ed0..07bb6d9 100644
--- a/admin/src/utils/request/index.js
+++ b/admin/src/utils/request/index.js
@@ -57,7 +57,7 @@
// 鏈櫥褰�
if (response.data.code === 401) {
if (response.config.autoLogin !== false) {
- window.location.href = process.env.VUE_APP_ROUTER_MODE === 'history' ? (process.env.VUE_APP_CONTEXT_PATH + '/#/login') : (process.env.VUE_APP_CONTEXT_PATH + '/login')
+ window.location.href = process.env.VUE_APP_ROUTER_MODE === 'hash' ? (process.env.VUE_APP_CONTEXT_PATH + '/#/login') : (process.env.VUE_APP_CONTEXT_PATH + '/login')
}
return Promise.reject(response.data)
}
diff --git a/admin/src/views/index.vue b/admin/src/views/index.vue
index 687f6f2..b090fe8 100644
--- a/admin/src/views/index.vue
+++ b/admin/src/views/index.vue
@@ -72,7 +72,17 @@
<div class="df mb50" >
<div class="wrap static1">
<div class="header" style="text-align: center">
- <div class="home_title" style="text-align: center;width: 100%">鍚勭被鍨嬪伐鍗曞崰姣旂粺璁�</div>
+ <div class="home_title" style="text-align: center;width: 80%">鍚勭被鍨嬪伐鍗曞崰姣旂粺璁★紙{{searchForm.timeName}}锛�</div>
+ <div style="text-align: right;width: 150px;font-size: 12px;height: 25px">
+ <el-form :model="searchForm" label-width="100px" inline >
+ <el-select v-model="searchForm.timeType" :popper-append-to-body="true" clearable placeholder="鏃堕棿鑼冨洿" @change="reloadDataByType()">
+ <el-option value="0" label="鏈懆"/>
+ <el-option value="1" label="鏈湀"/>
+ <el-option value="2" label="鏈搴�"/>
+ <el-option value="3" label="鏈勾"/>
+ </el-select>
+ </el-form>
+ </div>
</div>
<div class="echart" style="height: 400px" >
<div id="circleChart0"></div>
@@ -135,10 +145,15 @@
},
data () {
return {
+ searchForm: {
+ timeType: null,
+ timeName: '鍏ㄩ儴'
+ },
colors,
nowDate: '',
nowWeek: '',
headerData: {},
+ headerData1: {},
staticData0: {},
staticData01: {},
staticData1: {},
@@ -169,6 +184,23 @@
this.getWorkBody2()
this.getWorkBody3()
// this.getWorkBody()
+ },
+ reloadDataByType () {
+ getIndexData({timeType: this.searchForm.timeType }).then(res => {
+ if (this.searchForm.timeType == '0') {
+ this.searchForm.timeName = '鏈懆'
+ } else if (this.searchForm.timeType =='1') {
+ this.searchForm.timeName = '鏈湀'
+ } else if (this.searchForm.timeType =='2') {
+ this.searchForm.timeName = '鏈搴�'
+ } else if (this.searchForm.timeType == '3') {
+ this.searchForm.timeName = '鏈勾'
+ } else {
+ this.searchForm.timeName = '鍏ㄩ儴'
+ }
+ this.headerData1 =res || []
+ this.initAllData()
+ })
},
getWorkBody0 () {
getWorkOrderData({ queryType: 0, orderType: 0 }).then(res => {
@@ -213,18 +245,22 @@
getWorkHead () {
getIndexData({ }).then(res => {
this.headerData = res || {}
- var cdata = []
- cdata.push({ name: '璺岀粖婊戜簨浠�', value: res.dbhNum || 0 })
- cdata.push({ name: 'DCA浜嬩欢', value: res.dcaChildNum || 0 })
- cdata.push({ name: 'SHE浜嬩欢', value: res.sheNum || 0 })
- this.initEchartCircleDo('circleChart0', '鍚勭被鍨嬩簨浠跺伐鍗曚笂鎶ョ粺璁�', '', cdata)
- var xdata = ['SHE浜嬩欢', '璺岀粖婊戜簨浠�', 'DCA浜嬩欢']
- var ydata = []
- ydata.push({ name: '宸茶В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#f07e6f', data: [res.sheNum || 0, res.dbhYesNum || 0, res.dcaChildYesNum || 0] })
- ydata.push({ name: '鏈В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#8383ff', data: [0, res.dbhNoNum || 0, res.dcaChildNoNum || 0] })
- ydata.push({ name: '鎬诲崟閲�', type: 'bar', unit: '娆�', color: '#29aeff', data: [res.sheNum || 0, res.dbhNum || 0, res.dcaChildNum || 0] })
- this.initEchartDataDo('鍚勭被鍨嬩簨浠剁姸鎬佺粺璁�', 'circleChart1', xdata, ydata)
+ this.headerData1 = res || {}
+ this.initAllData()
})
+ },
+ initAllData(){
+ var cdata = []
+ cdata.push({ name: '璺岀粖婊戜簨浠�', value: this.headerData1.dbhNum || 0 })
+ cdata.push({ name: 'DCA浜嬩欢', value: this.headerData1.dcaChildNum || 0 })
+ cdata.push({ name: 'SHE浜嬩欢', value: this.headerData1.sheNum || 0 })
+ this.initEchartCircleDo('circleChart0', '鍚勭被鍨嬩簨浠跺伐鍗曚笂鎶ョ粺璁�', '', cdata)
+ var xdata = ['SHE浜嬩欢', '璺岀粖婊戜簨浠�', 'DCA浜嬩欢']
+ var ydata = []
+ ydata.push({ name: '宸茶В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#f07e6f', data: [this.headerData1.sheNum || 0, this.headerData1.dbhYesNum || 0, this.headerData1.dcaChildYesNum || 0] })
+ ydata.push({ name: '鏈В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#8383ff', data: [0, this.headerData1.dbhNoNum || 0, this.headerData1.dcaChildNoNum || 0] })
+ ydata.push({ name: '鎬诲崟閲�', type: 'bar', unit: '娆�', color: '#29aeff', data: [this.headerData1.sheNum || 0, this.headerData1.dbhNum || 0, this.headerData1.dcaChildNum || 0] })
+ this.initEchartDataDo('鍚勭被鍨嬩簨浠剁姸鎬佺粺璁�', 'circleChart1', xdata, ydata)
},
updateDate () {
this.nowDate = dayjs().format('YYYY骞碝鏈圖鏃�')
@@ -477,6 +513,11 @@
</script>
<style lang="scss" scoped>
+
+::v-deep .el-input--small .el-input__inner {
+ height: 30px !important; // 杩欓噷灏辨槸淇敼榛樿楂樺害
+ width: 120px;
+}
div {
box-sizing: border-box;
}
diff --git a/server/src/main/java/com/doumee/api/common/PublicCloudController.java b/server/src/main/java/com/doumee/api/common/PublicCloudController.java
index bf5b3e1..f288004 100644
--- a/server/src/main/java/com/doumee/api/common/PublicCloudController.java
+++ b/server/src/main/java/com/doumee/api/common/PublicCloudController.java
@@ -192,26 +192,7 @@
}
index = index + 1;
}
-
}
-// while (it.hasNext()) {
-// MultipartFile file = multipartRequest.getFile(it.next());
-// String originname = file.getOriginalFilename();
-// is = file.getInputStream();
-// String endType = originname.substring(originname.lastIndexOf("."),originname.length());
-// String date = DateUtil.getNowShortDate();
-// String fName = date+"/"+ UUID.randomUUID()+endType;
-// String fileName = folder+"/"+fName;
-// boolean r = ftp.uploadInputstream(is,fileName);
-// if(r){
-// JSONObject fileJSON = new JSONObject();
-// fileJSON.put("url", prefixPath+fileName);
-// fileJSON.put("imgaddr", fName);
-// fileJSON.put("imgname", fileName);
-// fileJSON.put("originname", originname);
-// jsonArray.add(fileJSON);
-// }
-// }
context.put("data",jsonArray);
}
} catch (Exception e) {
diff --git a/server/src/main/java/com/doumee/core/utils/DateUtil.java b/server/src/main/java/com/doumee/core/utils/DateUtil.java
index d906a52..dcf6ec1 100644
--- a/server/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -3542,6 +3542,23 @@
cal.set(Calendar.DATE, 1);
return getDayStartTime(cal.getTime());
}
+ public static Date getBeginDayOfSeason(int addYears) {
+ Integer nowMonth = getNowMonth();
+ int month = Calendar.JANUARY;
+ Integer quarter = (nowMonth - 1) / 3 + 1;//瀛e害
+ if(quarter == 2){
+ month = Calendar.APRIL;
+ }else if(quarter == 3){
+ month = Calendar.JUNE;
+ }else if(quarter == 4){
+ month = Calendar.OCTOBER;
+ }
+ Calendar cal = Calendar.getInstance();
+ cal.set(Calendar.YEAR, getNowYearNum()+addYears);
+ cal.set(Calendar.MONTH, month);
+ cal.set(Calendar.DATE, 1);
+ return getDayStartTime(cal.getTime());
+ }
// 鑾峰彇鏈勾鐨勭粨鏉熸椂闂�
public static Date getEndDayOfYear(int addYears){
diff --git a/server/src/main/java/com/doumee/dao/business/model/Workorder.java b/server/src/main/java/com/doumee/dao/business/model/Workorder.java
index 1058066..c59d449 100644
--- a/server/src/main/java/com/doumee/dao/business/model/Workorder.java
+++ b/server/src/main/java/com/doumee/dao/business/model/Workorder.java
@@ -226,6 +226,9 @@
@ApiModelProperty("鏂囦欢璺緞鍓嶇紑")
@TableField(exist = false)
private String path;
+ @ApiModelProperty("鏃堕棿閫夐」 0鏈懆 1鏈湀 2鏈搴� 3鏈勾")
+ @TableField(exist = false)
+ private Integer timeType;
@ApiModelProperty(value = "涓嶇鍚堥棶棰樺垪琛�")
@TableField(exist = false)
diff --git a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
index 7cc0471..1a32444 100644
--- a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
@@ -1330,10 +1330,13 @@
@Override
public WorkorderIndexNumVO getIndexData(Workorder workorder) {
WorkorderIndexNumVO model = new WorkorderIndexNumVO();
+ Date startdate = getStartDateByType(workorder.getTimeType());
//鏌ヨ浠婂勾鎵�鏈夌殑鏁版嵁
List<Workorder> list = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
.select("type,count(id) as num")
.eq(Workorder::getIsdeleted,Constants.ZERO)
+ .ge(startdate!=null,Workorder::getCreateDate,startdate)
+// .lt(endDate!=null,Workorder::getCreateDate,endDate)
.groupBy(Workorder::getType ));
if(list !=null){
for(Workorder w : list){
@@ -1352,34 +1355,12 @@
}
}
}
- List<Workorder> todays = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
- .select("type,count(id) as num")
- .eq(Workorder::getIsdeleted,Constants.ZERO)
- .apply("to_days(create_date)=to_days(now())")
- .groupBy(Workorder::getType ));
- if(todays !=null){
- for(Workorder w : todays){
- if(Constants.equalsInteger(w.getType(),Constants.ZERO)){
- //SHE
- model.setTodaySheNum(Constants.formatLongNum(w.getNum()));
- }else if(Constants.equalsInteger(w.getType(),Constants.ONE)){
- //DCA鎻愪氦鏁�
- model.setTodayDcaNum(Constants.formatLongNum(w.getNum()));
- }else if(Constants.equalsInteger(w.getType(),Constants.TWO)){
- //DCA瀛愬伐鍗�
- model.setTodayDcaChildNum(Constants.formatLongNum(w.getNum()));
- }else if(Constants.equalsInteger(w.getType(),Constants.THREE)){
- //璺岀粖婊�
- model.setTodayDbhNum(Constants.formatLongNum(w.getNum()));
- }
- }
- }
-
List<Workorder> yeslist = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
.select("type,count(id) as num")
.eq(Workorder::getIsdeleted,Constants.ZERO)
.in(Workorder::getStatus,Constants.THREE,Constants.FOUR,Constants.FIVE)
.in(Workorder::getType,Constants.THREE,Constants.TWO)
+ .ge(startdate!=null,Workorder::getCreateDate,startdate)
.groupBy(Workorder::getType ));
if(yeslist !=null){
for(Workorder w : yeslist){
@@ -1394,16 +1375,64 @@
}
}
}
- Workorder dcaList = workorderMapper.selectJoinOne(Workorder.class,new MPJLambdaWrapper<Workorder>()
- .select("sum(dca_yes_num) as dcaYesNum,sum(dca_no_num) as dcaNoNum")
- .eq(Workorder::getIsdeleted,Constants.ZERO)
- .eq(Workorder::getType,Constants.ONE) );
- if(dcaList !=null){
- //DCA绗﹀悎椤瑰拰涓嶇鍚堥」缁熻
- model.setDcaYesNum((long)Constants.formatIntegerNum(dcaList.getDcaYesNum()));
- model.setDcaNoNum((long)Constants.formatIntegerNum(dcaList.getDcaNoNum()));
+ if(workorder.getTimeType() == null){
+ List<Workorder> todays = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
+ .select("type,count(id) as num")
+ .eq(Workorder::getIsdeleted,Constants.ZERO)
+ .apply("to_days(create_date)=to_days(now())")
+ .groupBy(Workorder::getType ));
+ if(todays !=null){
+ for(Workorder w : todays){
+ if(Constants.equalsInteger(w.getType(),Constants.ZERO)){
+ //SHE
+ model.setTodaySheNum(Constants.formatLongNum(w.getNum()));
+ }else if(Constants.equalsInteger(w.getType(),Constants.ONE)){
+ //DCA鎻愪氦鏁�
+ model.setTodayDcaNum(Constants.formatLongNum(w.getNum()));
+ }else if(Constants.equalsInteger(w.getType(),Constants.TWO)){
+ //DCA瀛愬伐鍗�
+ model.setTodayDcaChildNum(Constants.formatLongNum(w.getNum()));
+ }else if(Constants.equalsInteger(w.getType(),Constants.THREE)){
+ //璺岀粖婊�
+ model.setTodayDbhNum(Constants.formatLongNum(w.getNum()));
+ }
+ }
+ }
+ Workorder dcaList = workorderMapper.selectJoinOne(Workorder.class,new MPJLambdaWrapper<Workorder>()
+ .select("sum(dca_yes_num) as dcaYesNum,sum(dca_no_num) as dcaNoNum")
+ .eq(Workorder::getIsdeleted,Constants.ZERO)
+ .eq(Workorder::getType,Constants.ONE) );
+ if(dcaList !=null){
+ //DCA绗﹀悎椤瑰拰涓嶇鍚堥」缁熻
+ model.setDcaYesNum((long)Constants.formatIntegerNum(dcaList.getDcaYesNum()));
+ model.setDcaNoNum((long)Constants.formatIntegerNum(dcaList.getDcaNoNum()));
+ }
}
+
+
+
return model;
}
+ private Date getStartDateByType(Integer timeType) {
+ Date date = null;
+ if(timeType == null){
+ return null;
+ } else if (timeType == 0) {
+ //鏈懆
+ date = DateUtil.getBeginDayOfWeek(0);
+ }else if (timeType == 1) {
+ //鏈湀
+ date = DateUtil.getBeginDayOfMonth(0);
+ }else if (timeType == 2) {
+ //鏈搴�
+ date = DateUtil.getBeginDayOfSeason(0);
+ }else if (timeType == 3) {
+ //鏈勾
+ date = DateUtil.getBeginDayOfYear(0);
+ }
+
+ return date;
+ }
+
}
diff --git a/server/src/main/resources/application-pro.yml b/server/src/main/resources/application-pro.yml
index 7597a07..120d276 100644
--- a/server/src/main/resources/application-pro.yml
+++ b/server/src/main/resources/application-pro.yml
@@ -20,17 +20,22 @@
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
mail:
- host: smtp.exmail.qq.com
- username: jp@doumee.com
- password: 2Jz9HFW2U7vRnCRu
- default-encoding: UTF-8
+ host: smtp.163.com
+ port: 465
+ username: your-email@163.com
+ password: your-authorization-code
+ protocol: smtps
properties:
mail:
smtp:
auth: true
- starttls:
- enable: true
- required: true
+ starttls:
+ enable: true
+ ssl:
+ trust: smtp.163.com
+ socketFactory:
+ class: javax.net.ssl.SSLSocketFactory
+ port: 465
debug_model: true
--
Gitblit v1.9.3