Commit 766e9f9d authored by 王晓旭's avatar 王晓旭
parents b4ba2459 619b968b
...@@ -478,7 +478,7 @@ export default { ...@@ -478,7 +478,7 @@ export default {
size: this.rightSize, size: this.rightSize,
matterName: `%${this.rightSearchVal}%`, matterName: `%${this.rightSearchVal}%`,
siteId: this.siteId, siteId: this.siteId,
deptCode: this.leftDept, deptCode: this.deptSearch,
...search, ...search,
}); });
let { pageInfo, data } = res.data.data; let { pageInfo, data } = res.data.data;
......
...@@ -238,8 +238,8 @@ ...@@ -238,8 +238,8 @@
<span v-else>--</span> <span v-else>--</span>
</template> </template>
<!-- 所属窗口 --> <!-- 所属窗口 -->
<template slot="windowName" slot-scope="text"> <template slot="windowId" slot-scope="text">
{{ text.windowName ? text.windowName : "--" }} {{ text.windowId ? filterWindow(text.windowId) : "--" }}
</template> </template>
<!-- 创建时间 --> <!-- 创建时间 -->
<template slot="time" slot-scope="text"> <template slot="time" slot-scope="text">
...@@ -357,7 +357,7 @@ const columns = [ ...@@ -357,7 +357,7 @@ const columns = [
{ {
title: "所属窗口", title: "所属窗口",
scopedSlots: { scopedSlots: {
customRender: "windowName", customRender: "windowId",
}, },
}, },
{ {
...@@ -400,6 +400,7 @@ export default { ...@@ -400,6 +400,7 @@ export default {
siteId: local.getLocal("siteId"), siteId: local.getLocal("siteId"),
deptData: [], // 部门数据 deptData: [], // 部门数据
windowData: [], // 窗口数据 windowData: [], // 窗口数据
windowFilterData: [], // 过滤工作人员所属窗口数据
WorkmanData: [], // 工作人员列表 WorkmanData: [], // 工作人员列表
deptSearch: "", //部门搜索 deptSearch: "", //部门搜索
windowSearch: "", // 窗口搜索 windowSearch: "", // 窗口搜索
...@@ -445,6 +446,9 @@ export default { ...@@ -445,6 +446,9 @@ export default {
}); });
let { data } = res.data.data; let { data } = res.data.data;
this.windowData = data; this.windowData = data;
if (!this.deptSearch) {
this.windowFilterData = data;
}
}, },
// 获取工作人员列表 // 获取工作人员列表
async getWorkmanData(search = {}) { async getWorkmanData(search = {}) {
...@@ -637,6 +641,15 @@ export default { ...@@ -637,6 +641,15 @@ export default {
}); });
return name; return name;
}, },
// 过滤窗口
filterWindow(id) {
let fromnum = "--";
let row = this.windowFilterData.find((v) => v.id == id);
if (row) {
fromnum = row.fromnum;
}
return fromnum;
},
}, },
}; };
</script> </script>
......
...@@ -46,10 +46,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -46,10 +46,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
private ValidCodeService validCodeService; private ValidCodeService validCodeService;
@Autowired @Autowired
private ResourceService resourceService; private ResourceService resourceService;
@Autowired
private MenuService menuService;
// @Autowired
// private ITokenService tokenService;
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired @Autowired
......
...@@ -388,4 +388,19 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -388,4 +388,19 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
// } // }
// }).count(); // }).count();
} }
public static void main(String[] args) throws Exception {
//eba467f81fb265befdf1f6ab041d39ab 原始admin密码
System.out.println(SecurityUtil.md5DoubleEncoding("adminADMIN@123!@#"));
//宜宾一体化账号密码
System.out.println(SecurityUtil.md5DoubleEncoding("yibinYTH@123!@#"));
//P@ssw0rd123
System.out.println(SecurityUtil.md5DoubleEncoding("P@ssw0rd123"));
}
} }
\ No newline at end of file
...@@ -434,14 +434,14 @@ public class MatterDatumEntity extends MatterDatumVo { ...@@ -434,14 +434,14 @@ public class MatterDatumEntity extends MatterDatumVo {
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getMaterialName().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) return false; if (obj == null) return false;
if (obj instanceof MatterDatumEntity) { if (obj instanceof MatterDatumEntity) {
MatterDatumEntity tmp = (MatterDatumEntity) obj; MatterDatumEntity tmp = (MatterDatumEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getMaterialName() == tmp.getMaterialName()) {
return true; return true;
} }
} }
......
...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 事项申请材料 * 事项申请材料
...@@ -58,4 +59,21 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat ...@@ -58,4 +59,21 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
entity.setDatumFileList(matterDatumFileEntities); entity.setDatumFileList(matterDatumFileEntities);
return super.viewAfter(id, model, entity, context); return super.viewAfter(id, model, entity, context);
} }
/**
* @param query
* @param model
* @param context
* @return
* @throws AppException
*/
@Override
protected int doListAfter(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException {
List<MatterDatumEntity> matterDatumEntities = (List<MatterDatumEntity>) model.get(KEY_RESULT_DATA);
//去重复
List<MatterDatumEntity> collect = matterDatumEntities.stream().distinct().collect(Collectors.toList());
model.put(KEY_RESULT_DATA,collect);
return super.doListAfter(query, model, context);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
...@@ -25,6 +26,7 @@ import com.mortals.xhx.module.workman.model.WorkmanEntity; ...@@ -25,6 +26,7 @@ import com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.model.WorkmanQuery; import com.mortals.xhx.module.workman.model.WorkmanQuery;
import com.mortals.xhx.module.workman.service.WorkmanService; import com.mortals.xhx.module.workman.service.WorkmanService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -209,9 +211,9 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -209,9 +211,9 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
protected void saveAfter(WindowEntity entity, Context context) throws AppException { protected void saveAfter(WindowEntity entity, Context context) throws AppException {
super.saveAfter(entity, context); super.saveAfter(entity, context);
//判断是否存在id,如果不存在 查询后获取 //判断是否存在id,如果不存在 查询后获取
if(entity.newEntity()){ if (entity.newEntity()) {
WindowEntity windowEntity = this.selectOne(new WindowQuery().siteId(entity.getSiteId()).fromnum(entity.getFromnum())); WindowEntity windowEntity = this.selectOne(new WindowQuery().siteId(entity.getSiteId()).fromnum(entity.getFromnum()));
if(!ObjectUtils.isEmpty(windowEntity)){ if (!ObjectUtils.isEmpty(windowEntity)) {
entity.setId(windowEntity.getId()); entity.setId(windowEntity.getId());
} }
} }
...@@ -238,4 +240,37 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -238,4 +240,37 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
log.error("异常:", e); log.error("异常:", e);
} }
} }
/**
* @param list
* @param updateSupport
* @param context
* @return
*/
@Override
public String importList(List<WindowEntity> list, Boolean updateSupport, Context context) {
if (ObjectUtils.isEmpty(list)) {
throw new AppException("导入数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (WindowEntity entity : list) {
entity.setCreateUserId(this.getContextUserId(context));
entity.setCreateTime(new Date());
this.save(entity, context);
successNum++;
}
successMsg.insert(0, "数据导入成功!共 " + successNum + " 条");
if (failureNum > 0) {
failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确");
successMsg.append("\n");
successMsg.append(failureMsg);
}
return successMsg.toString();
}
} }
\ No newline at end of file
package com.mortals.xhx.module.workman.model.vo; package com.mortals.xhx.module.workman.model.vo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.model.WorkmanQuery;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.PictureData; import org.apache.poi.ss.usermodel.PictureData;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
import java.util.List;
/** /**
* 工作人员视图对象 * 工作人员视图对象
* *
...@@ -28,4 +34,24 @@ public class WorkmanVo extends BaseEntityLong { ...@@ -28,4 +34,24 @@ public class WorkmanVo extends BaseEntityLong {
private String filePath; private String filePath;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<WorkmanQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<WorkmanQuery> andConditionList;
public static void main(String[] args) {
WorkmanEntity workmanEntity = new WorkmanEntity();
ArrayList<WorkmanQuery> andConditionList = new ArrayList<>();
WorkmanQuery workmanQuery = new WorkmanQuery();
workmanQuery.setName("张三");
workmanQuery.setNumber("123");
andConditionList.add(workmanQuery);
workmanEntity.setAndConditionList(andConditionList);
System.out.println(JSON.toJSONString(workmanEntity));
}
} }
\ No newline at end of file
...@@ -80,6 +80,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -80,6 +80,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
} else { } else {
entity.setLoginPwd(null); entity.setLoginPwd(null);
} }
//判断党员是否其它选项,如果 //判断党员是否其它选项,如果
} }
...@@ -262,9 +264,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -262,9 +264,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
return successMsg.toString(); return successMsg.toString();
} }
public static void main(String[] args) throws Exception {
System.out.println(SecurityUtil.md5DoubleEncoding("adminADMIN123!@#"));
}
} }
\ No newline at end of file
...@@ -14,7 +14,9 @@ Content-Type: application/json ...@@ -14,7 +14,9 @@ Content-Type: application/json
{ {
"page":1, "page":1,
"size":10
"size":10,
"andConditionList":[{"name":"%张三%","number":"%123%","deptName":"%123%","windowName":"%123%"}]
} }
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
"@vue/cli-service": "~5.0.0", "@vue/cli-service": "~5.0.0",
"browserslist": "^4.21.4", "browserslist": "^4.21.4",
"caniuse-lite": "^1.0.30001442", "caniuse-lite": "^1.0.30001442",
"filemanager-webpack-plugin": "^8.0.0",
"less": "^4.0.0", "less": "^4.0.0",
"less-loader": "^8.0.0", "less-loader": "^8.0.0",
"postcss": "^8.4.12", "postcss": "^8.4.12",
......
...@@ -553,4 +553,5 @@ ...@@ -553,4 +553,5 @@
.addclass { .addclass {
background: linear-gradient(90deg, #5ab6ff 0%, #2e9aff 100%) !important; background: linear-gradient(90deg, #5ab6ff 0%, #2e9aff 100%) !important;
color: #fff !important; color: #fff !important;
border:none !important
} }
...@@ -24,7 +24,8 @@ export default { ...@@ -24,7 +24,8 @@ export default {
index:{ index:{
type:Number, type:Number,
default:0 default:0
} },
type:[String]
}, },
data(){ data(){
return{ return{
...@@ -63,7 +64,7 @@ export default { ...@@ -63,7 +64,7 @@ export default {
if(src.search(/http/ig)>-1){ if(src.search(/http/ig)>-1){
return `${src}` return `${src}`
}else{ }else{
return `${process.env.VUE_APP_API_BASE_URL}/${src}` return this.type=='php'?`${process.env.VUE_APP_API_PHP_URL}/${src}`:`${process.env.VUE_APP_API_BASE_URL}/${src}`
} }
}, },
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<a-form-item label="联系电话:">{{ formState.phone || '--' }}</a-form-item> <a-form-item label="联系电话:">{{ formState.phone || '--' }}</a-form-item>
<a-form-item label="身份证号:">{{ formState.idcard_IDCardNo || '--' }}</a-form-item> <a-form-item label="身份证号:">{{ formState.idcard_IDCardNo || '--' }}</a-form-item>
<a-form-item label="注册时间:">{{ formState.update_time || '--' }}</a-form-item> <a-form-item label="注册时间:">{{ formState.update_time || '--' }}</a-form-item>
<a-form-item label="注册来源:">{{ regType[formState.register_type] || '--' }}</a-form-item> <a-form-item label="注册来源:">{{ regType[formState.register_type] || '现场注册' }}</a-form-item>
<a-form-item label="户籍地址:">{{ formState.idcard_Address || '--' }}</a-form-item> <a-form-item label="户籍地址:">{{ formState.idcard_Address || '--' }}</a-form-item>
</a-form> </a-form>
</div> </div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
{{ formState.idcard_Name }}<a-tag color="green" class="info_tag">实名认证</a-tag> {{ formState.idcard_Name }}<a-tag color="green" class="info_tag">实名认证</a-tag>
</div> </div>
<a-row> <a-row>
<a-col :span="8">年龄:{{ formState.idcard_Name }}</a-col> <a-col :span="8">年龄:{{ formState.age }}岁</a-col>
<a-col :span="8">性别:{{ formState.idcard_Sex || '--' }}</a-col> <a-col :span="8">性别:{{ formState.idcard_Sex || '--' }}</a-col>
<a-col :span="8">民族:{{ formState.idcard_Nation }}</a-col> <a-col :span="8">民族:{{ formState.idcard_Nation }}</a-col>
</a-row> </a-row>
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</div> </div>
<div class="tabFont ellipsis"> <div class="tabFont ellipsis">
样表全称:{{ 样表全称:{{
record.materialFullName ? record.materialFullName : "--" record.materiaFullName ? record.materiaFullName : "--"
}} }}
</div> </div>
</template> </template>
...@@ -216,7 +216,7 @@ export default { ...@@ -216,7 +216,7 @@ export default {
"matterName", "matterName",
"matterFullName", "matterFullName",
"materialName", "materialName",
"materialFullName", "materiaFullName",
"idName", "idName",
"idCard", "idCard",
"mobile", "mobile",
...@@ -242,6 +242,8 @@ export default { ...@@ -242,6 +242,8 @@ export default {
}, },
// 获取报表列表 // 获取报表列表
async togetPrintList(searchForm = {}) { async togetPrintList(searchForm = {}) {
let list = [];
let listTotal = 0;
let pramse = { let pramse = {
page: this.tablePagination.current, page: this.tablePagination.current,
size: this.tablePagination.pageSize, size: this.tablePagination.pageSize,
...@@ -261,8 +263,13 @@ export default { ...@@ -261,8 +263,13 @@ export default {
if (code == 1) { if (code == 1) {
this.tableSourceData = data.data; this.tableSourceData = data.data;
this.tablePagination.total = data.total; this.tablePagination.total = data.total;
return data.data; list = data.data;
listTotal = data.total;
} }
return {
data: list,
total: listTotal,
};
}, },
// 重置搜索 // 重置搜索
handleReset() { handleReset() {
...@@ -304,10 +311,9 @@ export default { ...@@ -304,10 +311,9 @@ export default {
1: "本地打印", 1: "本地打印",
2: "在线提交", 2: "在线提交",
}; };
let data = [];
if (this.tableSelectedKeys.length && this.tableSelectedRows.length) { if (this.tableSelectedKeys.length && this.tableSelectedRows.length) {
// 深度克隆避免影响页面表格展示 // 深度克隆避免影响页面表格展示
data = this.$_.cloneDeep(this.tableSelectedRows); let data = this.$_.cloneDeep(this.tableSelectedRows);
data.forEach((item) => { data.forEach((item) => {
Object.keys(obj).forEach((keys) => { Object.keys(obj).forEach((keys) => {
if (item.type == keys) { if (item.type == keys) {
...@@ -315,27 +321,61 @@ export default { ...@@ -315,27 +321,61 @@ export default {
} }
}); });
}); });
} else { export2Excel(
data = this.$_.cloneDeep( this.tHeader,
await this.togetPrintList({ page: 1, size: -1 }) this.filterVal,
data,
"填单记录报表" + this.$moment().format("YYYYMMDDHHmmss")
); );
if (!data.length) return; } else {
for (let item of data) { this.dataSection(this.togetPrintList, {}, (data) => {
Object.keys(obj).forEach((key) => { if (!data.length) {
if (item.type == key) { this.$message.warning("暂无数据");
item.type = obj[key]; return;
}
});
} }
data.forEach((item) => {
Object.keys(obj).forEach((keys) => {
if (item.type == keys) {
item.type = obj[keys];
} }
});
});
export2Excel( export2Excel(
this.tHeader, this.tHeader,
this.filterVal, this.filterVal,
data, data,
"填单记录报表" + this.$moment().format("YYYYMMDDHHmmss") "填单记录报表" + this.$moment().format("YYYYMMDDHHmmss")
); );
});
}
this.btnLoading = false; this.btnLoading = false;
}, },
// 数据切片
async dataSection(fn, searchForm, callback) {
let dataList = [];
let page = 1;
let size = 1000;
let execute = async () => {
let { data, total } = await fn({ page, size, ...searchForm });
dataList = [...dataList, ...data];
this.$app.progressFile.show = true;
this.$app.progressFile.percent = parseInt(
(dataList.length / total) * 100
);
if (dataList.length >= total || data.length == 0) {
if (callback) callback(dataList);
this.$app.progressFile.show = false;
this.$app.progressFile.percent = 1;
return;
}
setTimeout(() => {
page += 1;
execute();
});
};
execute();
},
}, },
}; };
</script> </script>
......
...@@ -47,14 +47,14 @@ ...@@ -47,14 +47,14 @@
<div class="infoBox"> <div class="infoBox">
<span class="infoTitle imgBox">身份证人像面:</span> <span class="infoTitle imgBox">身份证人像面:</span>
<span class="infoContent"> <span class="infoContent">
<thumbImage v-if="userInfo.z_img" :src="userInfo.z_img" fileType="img" /> <thumbImage type="php" v-if="userInfo.z_img" :src="userInfo.z_img" fileType="img" />
<span v-else>--</span> <span v-else>--</span>
</span> </span>
</div> </div>
<div class="infoBox"> <div class="infoBox">
<span class="infoTitle imgBox">身份证国徽面:</span> <span class="infoTitle imgBox">身份证国徽面:</span>
<span class="infoContent"> <span class="infoContent">
<thumbImage v-if="userInfo.b_img" :src="userInfo.b_img" fileType="img" /> <thumbImage type="php" v-if="userInfo.b_img" :src="userInfo.b_img" fileType="img" />
<span v-else>--</span> <span v-else>--</span>
</span> </span>
</div> </div>
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
</a-select> </a-select>
<a-select v-model="searchForm.id"> <a-select v-model="searchForm.id">
<a-select-option value=""> 全部设备 </a-select-option> <a-select-option value=""> 全部设备 </a-select-option>
<a-select-option :value="0">
小程序
</a-select-option>
<a-select-option v-for="item in deviceData" :key="item.id" :value="item.id"> <a-select-option v-for="item in deviceData" :key="item.id" :value="item.id">
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
......
...@@ -190,6 +190,8 @@ export default { ...@@ -190,6 +190,8 @@ export default {
this.togetBillList(); this.togetBillList();
}, },
async togetBillList(searchForm = {}) { async togetBillList(searchForm = {}) {
let list = [];
let listTotal = 0;
let pramse = { let pramse = {
page: this.tablePagination.current, page: this.tablePagination.current,
size: this.tablePagination.pageSize, size: this.tablePagination.pageSize,
...@@ -208,8 +210,13 @@ export default { ...@@ -208,8 +210,13 @@ export default {
if (code == 1) { if (code == 1) {
this.tableSourceData = data.data; this.tableSourceData = data.data;
this.tablePagination.total = data.total; this.tablePagination.total = data.total;
return data.data; list = data.data;
listTotal = data.total;
} }
return {
data: list,
total: listTotal,
};
}, },
// 重置 // 重置
...@@ -248,22 +255,21 @@ export default { ...@@ -248,22 +255,21 @@ export default {
// 导出 // 导出
async handleExportTable() { async handleExportTable() {
this.btnLoading = true; this.btnLoading = true;
let data = [];
if (this.tableSelectedKeys.length && this.tableSelectedRows.length) { if (this.tableSelectedKeys.length && this.tableSelectedRows.length) {
let data = [];
// 深度克隆避免影响页面表格展示 // 深度克隆避免影响页面表格展示
data = this.$_.cloneDeep(this.tableSelectedRows); data = this.$_.cloneDeep(this.tableSelectedRows);
} else { export2Excel(
data = this.$_.cloneDeep( this.tHeader,
await this.togetBillList({ page: 1, size: -1 }) this.filterVal,
data,
"样表记录报表" + this.$moment().format("YYYYMMDDHHmmss")
); );
if (!data.length) return; } else {
// for (let item of data) { this.dataSection(this.togetBillList, {}, (data) => {
// Object.keys(obj).forEach((key) => { if (!data.length) {
// if (item.type == key) { this.$message.warning("暂无数据");
// item.type = obj[key]; return;
// }
// });
// }
} }
export2Excel( export2Excel(
this.tHeader, this.tHeader,
...@@ -271,8 +277,36 @@ export default { ...@@ -271,8 +277,36 @@ export default {
data, data,
"样表记录报表" + this.$moment().format("YYYYMMDDHHmmss") "样表记录报表" + this.$moment().format("YYYYMMDDHHmmss")
); );
});
}
this.btnLoading = false; this.btnLoading = false;
}, },
// 数据切片
async dataSection(fn, searchForm, callback) {
let dataList = [];
let page = 1;
let size = 1000;
let execute = async () => {
let { data, total } = await fn({ page, size, ...searchForm });
dataList = [...dataList, ...data];
this.$app.progressFile.show = true;
this.$app.progressFile.percent = parseInt(
(dataList.length / total) * 100
);
if (dataList.length >= total || data.length == 0) {
if (callback) callback(dataList);
this.$app.progressFile.show = false;
this.$app.progressFile.percent = 1;
return;
}
setTimeout(() => {
page += 1;
execute();
});
};
execute();
},
}, },
}; };
</script> </script>
......
...@@ -190,6 +190,7 @@ export default { ...@@ -190,6 +190,7 @@ export default {
async censusListInterface() { async censusListInterface() {
this.siteId = Storage.get(2, "siteId"); this.siteId = Storage.get(2, "siteId");
let res = await censusListInterface({ siteId: this.siteId }); let res = await censusListInterface({ siteId: this.siteId });
if (res.code == 1) {
let { let {
CensusType_1, CensusType_1,
CensusType_2, CensusType_2,
...@@ -207,6 +208,7 @@ export default { ...@@ -207,6 +208,7 @@ export default {
this.CensusType_4 = CensusType_4.filter((v) => v.status != 0); this.CensusType_4 = CensusType_4.filter((v) => v.status != 0);
if (CensusType_5 && CensusType_5.length) if (CensusType_5 && CensusType_5.length)
this.CensusType_5 = CensusType_5.filter((v) => v.status != 0); this.CensusType_5 = CensusType_5.filter((v) => v.status != 0);
}
}, },
// 查看数据 // 查看数据
handleCkeck(path) { handleCkeck(path) {
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<div <div
class="list flex aic jcb" class="list flex aic jcb"
v-for="(i, j) in listArr[active].curInfo" v-for="(i, j) in listArr[active].curInfo"
:key="j"
> >
<div class="app-name">{{ i.appName }}</div> <div class="app-name">{{ i.appName }}</div>
<img <img
...@@ -163,10 +164,11 @@ export default { ...@@ -163,10 +164,11 @@ export default {
this.searchVal = ""; this.searchVal = "";
}, },
handleDowload(url, systemServiceName) { handleDowload(url, systemServiceName) {
console.log(systemServiceName); let index = url.lastIndexOf(".");
let suffix = url.slice(index);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = url;
a.download = systemServiceName; a.download = systemServiceName + suffix;
a.click(); a.click();
}, },
//获取列表 //获取列表
...@@ -176,7 +178,6 @@ export default { ...@@ -176,7 +178,6 @@ export default {
i.curInfo = []; i.curInfo = [];
}); });
this.listArr = [...res.data.data]; this.listArr = [...res.data.data];
console.log(this.listArr);
this.getServiceList(); this.getServiceList();
}); });
}, },
......
<template> <template>
<div class="menuMgmt"> <div class="menuMgmt">
<div class="header_box"> <div class="header_box">
<a-button type="primary" class="addclass" @click="showEditModal(1)">新增</a-button> <a-button type="primary" class="addclass" @click="showEditModal(1)"
>新增</a-button
>
<span> <span>
<a-input v-model="searchForm.name" placeholder="请输入菜单名称搜索"> <a-input v-model="searchForm.name" placeholder="请输入菜单名称搜索">
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
...@@ -13,7 +15,9 @@ ...@@ -13,7 +15,9 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-button type="primary" class="addclass" @click="searchData">搜索</a-button> <a-button type="primary" class="addclass" @click="searchData"
>搜索</a-button
>
<a-button @click="resetSearch">重置</a-button> <a-button @click="resetSearch">重置</a-button>
</span> </span>
</div> </div>
...@@ -89,7 +93,7 @@ export default { ...@@ -89,7 +93,7 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
EditModalVisible: false, EditModalVisible: false,
searchForm: { searchForm: {
name: undefined, name: "",
parentId: "", parentId: "",
}, },
tableLoading: false, tableLoading: false,
...@@ -218,8 +222,8 @@ export default { ...@@ -218,8 +222,8 @@ export default {
// 搜索 // 搜索
async searchData() { async searchData() {
if (this.searchForm.parentId || this.searchForm.name) { if (this.searchForm.parentId || this.searchForm.name) {
let obj = {...this.searchForm} let obj = { ...this.searchForm };
obj.name = '%'+this.searchForm.name+'%' obj.name = "%" + this.searchForm.name + "%";
let res = await menuList({ let res = await menuList({
page: this.tablePagination.current, page: this.tablePagination.current,
size: -1, size: -1,
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
:columns="tableHeaders" :columns="tableHeaders"
:dataSource="tableSourceData" :dataSource="tableSourceData"
> >
<template slot="network" slot-scope="text, record, index"> <template slot="network" slot-scope="text">
<span <span
v-for="(item, idx) of dict.network" v-for="(item, idx) of dict.network"
v-show="text.indexOf(idx) != -1" v-show="text.indexOf(idx) != -1"
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</span> </span>
</template> </template>
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record">
<a-button type="link" @click="openDetails(record)">编辑</a-button> <a-button type="link" @click="openDetails(record)">编辑</a-button>
<a-popconfirm <a-popconfirm
title="确定要删除此应用吗?" title="确定要删除此应用吗?"
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
}, },
], ],
query: { query: {
interfaceName: undefined, interfaceName: "",
interfaceSource: "", interfaceSource: "",
interfaceTag: "", interfaceTag: "",
productId: this.$route.query.id, productId: this.$route.query.id,
...@@ -188,6 +188,7 @@ export default { ...@@ -188,6 +188,7 @@ export default {
page: this.tablePagination.current, page: this.tablePagination.current,
size: this.tablePagination.pageSize, size: this.tablePagination.pageSize,
...this.query, ...this.query,
interfaceName: `%${this.query.interfaceName}%`,
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
let { data, total, dict } = res.data; let { data, total, dict } = res.data;
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<div class="PoliticsShow-Container"> <div class="PoliticsShow-Container">
<div class="header_box"> <div class="header_box">
<div> <div>
<a-button <a-button type="primary" class="addclass" @click="openDetails()">
type="primary"
class="addclass"
@click="openDetails()"
>
<span>新增</span> <span>新增</span>
</a-button> </a-button>
</div> </div>
...@@ -30,10 +26,7 @@ ...@@ -30,10 +26,7 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-button <a-button type="primary" class="addclass" @click="getList()"
type="primary"
class="addclass"
@click="getList()"
>搜索</a-button >搜索</a-button
> >
</span> </span>
...@@ -50,11 +43,11 @@ ...@@ -50,11 +43,11 @@
:columns="tableHeaders" :columns="tableHeaders"
:dataSource="tableSourceData" :dataSource="tableSourceData"
> >
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record">
<a-button <a-button
type="link" type="link"
v-if="record.appFileUrl" v-if="record.appFileUrl"
@click="handleDowload(record.appFileUrl)" @click="handleDowload(record.appFileUrl, record.appName)"
>下载应用</a-button >下载应用</a-button
> >
<a-button type="link" @click="openDetails(record)">编辑</a-button> <a-button type="link" @click="openDetails(record)">编辑</a-button>
...@@ -83,6 +76,7 @@ export default { ...@@ -83,6 +76,7 @@ export default {
name: "PortalAdminVueAlerting", name: "PortalAdminVueAlerting",
data() { data() {
return { return {
api: process.env.VUE_APP_API_IMG_URL,
tableHeaders: [ tableHeaders: [
{ {
title: "序号", title: "序号",
...@@ -194,11 +188,12 @@ export default { ...@@ -194,11 +188,12 @@ export default {
} }
}); });
}, },
handleDowload(url) { handleDowload(url, fileName) {
let arr = url.split("/"); let index = url.lastIndexOf(".");
let suffix = url.slice(index);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = process.env.VUE_APP_API_BASE_URL + "/" + url; a.href = this.api + url;
a.download = arr[arr.length - 1]; a.download = fileName + suffix;
a.click(); a.click();
}, },
openDetails(item) { openDetails(item) {
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
:columns="tableHeaders" :columns="tableHeaders"
:dataSource="tableSourceData" :dataSource="tableSourceData"
> >
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record">
<a-button <a-button
type="link" type="link"
v-if="record.docFileUrl" v-if="record.docFileUrl"
@click="handleDowload(record.docFileUrl)" @click="handleDowload(record.docFileUrl, record.docName)"
>下载</a-button >下载</a-button
> >
<a-button type="link" @click="openDetails(record)">编辑</a-button> <a-button type="link" @click="openDetails(record)">编辑</a-button>
...@@ -63,6 +63,7 @@ export default { ...@@ -63,6 +63,7 @@ export default {
name: "PortalAdminVueAlerting", name: "PortalAdminVueAlerting",
data() { data() {
return { return {
api: process.env.VUE_APP_API_IMG_URL,
tableHeaders: [ tableHeaders: [
{ {
title: "序号", title: "序号",
...@@ -159,11 +160,12 @@ export default { ...@@ -159,11 +160,12 @@ export default {
} }
}); });
}, },
handleDowload(url) { handleDowload(url, fileName) {
let arr = url.split("/"); let index = url.lastIndexOf(".");
let suffix = url.slice(index);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = process.env.VUE_APP_API_BASE_URL + "/" + url; a.href = this.api + url;
a.download = arr[arr.length - 1]; a.download = fileName + suffix;
a.click(); a.click();
}, },
openDetails(item) { openDetails(item) {
......
const { defineConfig } = require("@vue/cli-service"); const { defineConfig } = require("@vue/cli-service");
const FileManagerPlugin = require("filemanager-webpack-plugin"); // 压缩文件夹
const isDev = process.env.NODE_ENV === "development";
let plugins = [];
// 避免打本地启项目时自动打zip包
if (!isDev) {
plugins.push(
new FileManagerPlugin({
events: {
onEnd: {
// mkdir: ["./dist"],
delete: ["./zip/"],
copy: [{ source: "./dist", destination: "./zip/dist" }],
archive: [{ source: "./zip", destination: "./zip/门户系统.zip" }],
},
},
})
);
}
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: true, transpileDependencies: true,
lintOnSave: false, lintOnSave: false,
// 打包目录 // 打包目录
outputDir: "dist", outputDir: "dist",
configureWebpack: { configureWebpack: {
plugins: [...plugins], plugins: [],
}, },
devServer: { devServer: {
proxy: { proxy: {
......
This diff is collapsed.
ALTER TABLE mortals_xhx_product_interface ADD COLUMN `authInfo` varchar(255) COMMENT '授权信息' ;
ALTER TABLE mortals_xhx_product_interface ADD COLUMN `flowInfo` varchar(255) COMMENT '流控信息' ;
-- ----------------------------
-- 产品接口表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product_interface_log`;
CREATE TABLE mortals_xhx_product_interface_log(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`interfaceId` bigint(20) COMMENT '接口id',
`requestParameters` text COMMENT '请求参数',
`version` varchar(255) COMMENT '版本号',
`content` varchar(255) COMMENT '内容说明',
`remark` varchar(255) COMMENT '备注',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='产品接口';
...@@ -61,7 +61,7 @@ exec "$JAVACMD" $JAVA_OPTS \ ...@@ -61,7 +61,7 @@ exec "$JAVACMD" $JAVA_OPTS \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \ -Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5505 \ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=21072 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
...@@ -16,11 +16,13 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,11 +16,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Base64; import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* token验证处理 * token验证处理
...@@ -48,7 +50,7 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -48,7 +50,7 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
@Value("${token.prefix:}") @Value("${token.prefix:}")
private String tokenPrefix; private String tokenPrefix;
protected static final Long MILLIS_SECOND = 1000l; protected static final Long MILLIS_SECOND = 1l;
protected static final Long MILLIS_MINUTE = 60 * MILLIS_SECOND; protected static final Long MILLIS_MINUTE = 60 * MILLIS_SECOND;
...@@ -235,6 +237,15 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -235,6 +237,15 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
public String createToken(IUser user) { public String createToken(IUser user) {
// String token = IdUtil.fastSimpleUUID(); // String token = IdUtil.fastSimpleUUID();
// user.setToken(token); // user.setToken(token);
//todo 删除当前用户之前的令牌
if (!user.isAdmin()) {
Set<String> keys = cacheService.scan(SysConstains.LOGIN_TOKEN_KEY + user.getId());
if (!ObjectUtils.isEmpty(keys)) {
for (String key : keys) {
cacheService.del(key);
}
}
}
refreshToken(user); refreshToken(user);
Map<String, Object> claims = new HashMap<>(); Map<String, Object> claims = new HashMap<>();
claims.put(SysConstains.LOGIN_USER_KEY, user.getToken()); claims.put(SysConstains.LOGIN_USER_KEY, user.getToken());
......
...@@ -41,8 +41,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -41,8 +41,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private MenuService menuService; private MenuService menuService;
@Autowired @Autowired
private ICacheService cacheService;
@Autowired
private IAuthTokenService authTokenService; private IAuthTokenService authTokenService;
@Autowired @Autowired
private IApiModelFeign apiModelFeign; private IApiModelFeign apiModelFeign;
...@@ -67,9 +65,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -67,9 +65,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
userEntity.setLoginTime(System.currentTimeMillis()); userEntity.setLoginTime(System.currentTimeMillis());
String tmpToken = userEntity.getId() + ":" + IdUtil.fastSimpleUUID(); String tmpToken = userEntity.getId() + ":" + IdUtil.fastSimpleUUID();
userEntity.setToken(tmpToken); userEntity.setToken(tmpToken);
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime()); userEntity.setExpireTime(DateUtils.addCurrDate(3).getTime());
String token = authTokenService.createToken(userEntity); String token = authTokenService.createToken(userEntity);
//删除之前登录的token
data.put("token", token); data.put("token", token);
List<MenuEntity> menuList = menuService.findTreeMenuByUser(userEntity); List<MenuEntity> menuList = menuService.findTreeMenuByUser(userEntity);
userEntity.setMenuList(menuList); userEntity.setMenuList(menuList);
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
public enum LimitStrategyEnum {
不限流(0, "不限流"),
一万次日(1, "10000次/日"),
一千次日(2, "1000次/日"),
一百次日(3, "100次/日"),
一千次小时(4, "1000次/小时"),
一百次小时(5, "100次/小时"),
一百次分钟(6, "100次/分钟"),
十次分钟(7, "10次/分钟"),
一次分钟(8, "1次/分钟");
private Integer value;
private String desc;
LimitStrategyEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static LimitStrategyEnum getByValue(Integer value) {
for (LimitStrategyEnum statusEnum : LimitStrategyEnum.values()) {
if (statusEnum.getValue() == value) {
return statusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (LimitStrategyEnum item : LimitStrategyEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.module.product.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import java.util.List;
/**
* 产品接口Dao
* 产品接口 DAO接口
*
* @author zxfei
* @date 2023-07-18
*/
public interface ProductInterfaceLogDao extends ICRUDDao<ProductInterfaceLogEntity,Long>{
}
package com.mortals.xhx.module.product.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.product.dao.ProductInterfaceLogDao;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 产品接口DaoImpl DAO接口
*
* @author zxfei
* @date 2023-07-18
*/
@Repository("productInterfaceLogDao")
public class ProductInterfaceLogDaoImpl extends BaseCRUDDaoMybatis<ProductInterfaceLogEntity,Long> implements ProductInterfaceLogDao {
}
package com.mortals.xhx.module.product.model; package com.mortals.xhx.module.product.model;
import java.util.List;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.vo.ProductInterfaceVo; import com.mortals.xhx.module.product.model.vo.ProductInterfaceVo;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import lombok.Data; import lombok.Data;
/** /**
* 产品接口实体对象 * 产品接口实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-05-29 * @date 2023-07-18
*/ */
@Data @Data
public class ProductInterfaceEntity extends ProductInterfaceVo { public class ProductInterfaceEntity extends ProductInterfaceVo {
...@@ -38,7 +45,7 @@ public class ProductInterfaceEntity extends ProductInterfaceVo { ...@@ -38,7 +45,7 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
/** /**
* 超时时间(秒) * 超时时间(秒)
*/ */
private Long timeoutValue; private Integer timeoutValue;
/** /**
* 限流策略1:分钟,2:小时 * 限流策略1:分钟,2:小时
*/ */
...@@ -91,6 +98,25 @@ public class ProductInterfaceEntity extends ProductInterfaceVo { ...@@ -91,6 +98,25 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
* 异常返回示例 * 异常返回示例
*/ */
private String abnormalResponse; private String abnormalResponse;
/**
* 授权信息
*/
private String authInfo;
/**
* 流控信息
*/
private String flowInfo;
/**
* 产品接口信息
*/
private List<ProductInterfaceLogEntity> productInterfaceLogList=new ArrayList<>();;
public List<ProductInterfaceLogEntity> getProductInterfaceLogList(){
return productInterfaceLogList;
}
public void setProductInterfaceLogList(List<ProductInterfaceLogEntity> productInterfaceLogList){
this.productInterfaceLogList = productInterfaceLogList;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -121,7 +147,7 @@ public class ProductInterfaceEntity extends ProductInterfaceVo { ...@@ -121,7 +147,7 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
this.requestUrl = ""; this.requestUrl = "";
this.timeoutValue = -1L; this.timeoutValue = -1;
this.limitStrategy = -1; this.limitStrategy = -1;
...@@ -148,5 +174,9 @@ public class ProductInterfaceEntity extends ProductInterfaceVo { ...@@ -148,5 +174,9 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
this.normalResponse = ""; this.normalResponse = "";
this.abnormalResponse = ""; this.abnormalResponse = "";
this.authInfo = "";
this.flowInfo = "";
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.product.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.vo.ProductInterfaceLogVo;
import lombok.Data;
/**
* 产品接口实体对象
*
* @author zxfei
* @date 2023-07-18
*/
@Data
public class ProductInterfaceLogEntity extends ProductInterfaceLogVo {
private static final long serialVersionUID = 1L;
/**
* 接口id
*/
private Long interfaceId;
/**
* 请求参数
*/
private String requestParameters;
/**
* 版本号
*/
private String version;
/**
* 内容说明
*/
private String content;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ProductInterfaceLogEntity) {
ProductInterfaceLogEntity tmp = (ProductInterfaceLogEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.interfaceId = -1L;
this.requestParameters = "";
this.version = "";
this.content = "";
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.product.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 产品接口视图对象
*
* @author zxfei
* @date 2023-07-18
*/
@Data
public class ProductInterfaceLogVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.product.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import com.mortals.xhx.module.product.dao.ProductInterfaceLogDao;
/**
* ProductInterfaceLogService
*
* 产品接口 service接口
*
* @author zxfei
* @date 2023-07-18
*/
public interface ProductInterfaceLogService extends ICRUDService<ProductInterfaceLogEntity,Long>{
ProductInterfaceLogDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.product.service; package com.mortals.xhx.module.product.service;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.product.dao.ProductInterfaceDao;
import com.mortals.xhx.module.product.model.ProductInterfaceEntity; import com.mortals.xhx.module.product.model.ProductInterfaceEntity;
/**
* ProductInterfaceService
*
* 产品接口 service接口
*
* @author zxfei
* @date 2023-02-22
*/
public interface ProductInterfaceService extends ICRUDService<ProductInterfaceEntity,Long>{
/**
* ProductInterfaceService
* <p>
* 产品接口 service接口
*
* @author zxfei
* @date 2023-02-22
*/
public interface ProductInterfaceService extends ICRUDService<ProductInterfaceEntity, Long> {
ProductInterfaceDao getDao();
} }
\ No newline at end of file
package com.mortals.xhx.module.product.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.product.dao.ProductInterfaceLogDao;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import com.mortals.xhx.module.product.service.ProductInterfaceLogService;
import lombok.extern.slf4j.Slf4j;
/**
* ProductInterfaceLogService
* 产品接口 service实现
*
* @author zxfei
* @date 2023-07-18
*/
@Service("productInterfaceLogService")
@Slf4j
public class ProductInterfaceLogServiceImpl extends AbstractCRUDServiceImpl<ProductInterfaceLogDao, ProductInterfaceLogEntity, Long> implements ProductInterfaceLogService {
}
\ No newline at end of file
package com.mortals.xhx.module.product.service.impl; package com.mortals.xhx.module.product.service.impl;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
...@@ -7,25 +8,77 @@ import com.mortals.framework.model.Context; ...@@ -7,25 +8,77 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.product.dao.ProductInterfaceDao; import com.mortals.xhx.module.product.dao.ProductInterfaceDao;
import com.mortals.xhx.module.product.model.ProductInterfaceEntity; import com.mortals.xhx.module.product.model.ProductInterfaceEntity;
import com.mortals.xhx.module.product.service.ProductInterfaceService; import com.mortals.xhx.module.product.service.ProductInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import com.mortals.xhx.module.product.model.ProductInterfaceLogQuery;
import com.mortals.xhx.module.product.service.ProductInterfaceLogService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/** /**
* ProductInterfaceService * ProductInterfaceService
* 产品接口 service实现 * 产品接口 service实现
* *
* @author zxfei * @author zxfei
* @date 2023-02-22 * @date 2023-07-18
*/ */
@Service("productInterfaceService") @Service("productInterfaceService")
@Slf4j
public class ProductInterfaceServiceImpl extends AbstractCRUDServiceImpl<ProductInterfaceDao, ProductInterfaceEntity, Long> implements ProductInterfaceService { public class ProductInterfaceServiceImpl extends AbstractCRUDServiceImpl<ProductInterfaceDao, ProductInterfaceEntity, Long> implements ProductInterfaceService {
@Autowired
private ProductInterfaceLogService productInterfaceLogService;
@Override
protected void saveAfter(ProductInterfaceEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getProductInterfaceLogList())) {
entity.getProductInterfaceLogList().stream().peek(item -> {
item.setInterfaceId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
productInterfaceLogService.save(entity.getProductInterfaceLogList());
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(ProductInterfaceEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getProductInterfaceLogList())) {
// Long[] productInterfaceLogIds = productInterfaceLogService.find(new ProductInterfaceLogQuery().interfaceId(entity.getId())).stream().map(ProductInterfaceLogEntity::getId).toArray(Long[]::new);
// productInterfaceLogService.remove(productInterfaceLogIds, context);
entity.getProductInterfaceLogList().stream().peek(item -> {
item.setInterfaceId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date());
}).count();
productInterfaceLogService.save(entity.getProductInterfaceLogList());
}
super.updateAfter(entity, context);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<ProductInterfaceLogEntity> productInterfaceLoglist = productInterfaceLogService.find(new ProductInterfaceLogQuery().interfaceIdList(Arrays.asList(ids)));
productInterfaceLogService.removeList(productInterfaceLoglist, context);
super.removeAfter(ids, context, result);
}
@Override @Override
protected void validData(ProductInterfaceEntity entity, Context context) throws AppException { protected void validData(ProductInterfaceEntity entity, Context context) throws AppException {
if(entity.getProductId()==null){ if (entity.getProductId() == null) {
throw new AppException("产品id不能为空"); throw new AppException("产品id不能为空");
} }
if(StringUtils.isEmpty(entity.getInterfaceName())){ if (StringUtils.isEmpty(entity.getInterfaceName())) {
throw new AppException("接口名称不能为空"); throw new AppException("接口名称不能为空");
} }
if(StringUtils.isEmpty(entity.getVersionNumber())){ if (StringUtils.isEmpty(entity.getVersionNumber())) {
throw new AppException("版本号不能为空"); throw new AppException("版本号不能为空");
} }
} }
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.product.web; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.product.web;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.LimitStrategyEnum;
import com.mortals.xhx.module.param.service.ParamService; import com.mortals.xhx.module.param.service.ParamService;
import com.mortals.xhx.module.product.model.ProductInterfaceEntity; import com.mortals.xhx.module.product.model.ProductInterfaceEntity;
import com.mortals.xhx.module.product.service.ProductInterfaceService; import com.mortals.xhx.module.product.service.ProductInterfaceService;
...@@ -32,7 +33,7 @@ public class ProductInterfaceController extends BaseCRUDJsonBodyMappingControlle ...@@ -32,7 +33,7 @@ public class ProductInterfaceController extends BaseCRUDJsonBodyMappingControlle
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "requestType", paramService.getParamBySecondOrganize("ProductInterface","requestType")); this.addDict(model, "requestType", paramService.getParamBySecondOrganize("ProductInterface","requestType"));
this.addDict(model, "requestProtocol", paramService.getParamBySecondOrganize("ProductInterface","requestProtocol")); this.addDict(model, "requestProtocol", paramService.getParamBySecondOrganize("ProductInterface","requestProtocol"));
this.addDict(model, "limitStrategy", paramService.getParamBySecondOrganize("ProductInterface","limitStrategy")); this.addDict(model, "limitStrategy", LimitStrategyEnum.getEnumMap());
this.addDict(model, "contentType", paramService.getParamBySecondOrganize("ProductInterface","contentType")); this.addDict(model, "contentType", paramService.getParamBySecondOrganize("ProductInterface","contentType"));
this.addDict(model, "network", paramService.getParamBySecondOrganize("ProductInterface","network")); this.addDict(model, "network", paramService.getParamBySecondOrganize("ProductInterface","network"));
this.addDict(model, "interfaceTag", paramService.getParamBySecondOrganize("ProductInterface","interfaceTag")); this.addDict(model, "interfaceTag", paramService.getParamBySecondOrganize("ProductInterface","interfaceTag"));
......
package com.mortals.xhx.module.product.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.product.model.ProductInterfaceLogEntity;
import com.mortals.xhx.module.product.service.ProductInterfaceLogService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 产品接口
*
* @author zxfei
* @date 2023-07-18
*/
@RestController
@RequestMapping("product/interface/log")
public class ProductInterfaceLogController extends BaseCRUDJsonBodyMappingController<ProductInterfaceLogService,ProductInterfaceLogEntity,Long> {
public ProductInterfaceLogController(){
super.setModuleDesc( "产品接口");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###产品接口列表
POST {{baseUrl}}/product/interface/log/list
Content-Type: application/json
{
"page":1,
"size":10
}
###产品接口更新与保存
POST {{baseUrl}}/product/interface/log/save
Authorization: {{authToken}}
Content-Type: application/json
{
"interfaceId":62,
"requestParameters":"pb92dy",
"version":"8lkpuh",
"content":"e7kwqt",
"remark":"riyuuu",
}
> {%
client.global.set("ProductInterfaceLog_id", JSON.parse(response.body).data.id);
%}
###产品接口查看
GET {{baseUrl}}/product/interface/log/info?id={{ProductInterfaceLog_id}}
Accept: application/json
###产品接口编辑
GET {{baseUrl}}/product/interface/log/edit?id={{ProductInterfaceLog_id}}
Accept: application/json
###产品接口删除
GET {{baseUrl}}/product/interface/log/delete?id={{ProductInterfaceLog_id}}
Authorization: {{authToken}}
Accept: application/json
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
public enum LimitStrategyEnum {
不限流(0, "不限流"),
一万次日(1, "10000次/日"),
一千次日(2, "1000次/日"),
一百次日(3, "100次/日"),
一千次小时(4, "1000次/小时"),
一百次小时(5, "100次/小时"),
一百次分钟(6, "100次/分钟"),
十次分钟(7, "10次/分钟"),
一次分钟(8, "1次/分钟");
private Integer value;
private String desc;
LimitStrategyEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static LimitStrategyEnum getByValue(Integer value) {
for (LimitStrategyEnum statusEnum : LimitStrategyEnum.values()) {
if (statusEnum.getValue() == value) {
return statusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (LimitStrategyEnum item : LimitStrategyEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
...@@ -124,6 +124,15 @@ spring: ...@@ -124,6 +124,15 @@ spring:
metadata: metadata:
response-timeout: 200000 response-timeout: 200000
connect-timeout: 200000 connect-timeout: 200000
# etl数据清洗
- id: etl-manager
#uri: http://192.168.0.98:21080
uri: lb://etl-manager
predicates:
- Path=/etl/**
metadata:
response-timeout: 200000
connect-timeout: 200000
nacos: nacos:
# Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类 # Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类
discovery: discovery:
......
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