前台填写问卷时将社区修改成输入关键字进行搜索后进行选择。

幢列表修改成输入关键字进行搜索后进行选择。
This commit is contained in:
范露尧
2023-07-10 18:31:49 +08:00
parent 1f278407c8
commit fbbabeb690
12 changed files with 209 additions and 63 deletions

View File

@@ -109,17 +109,18 @@ namespace Ewide.Core
public List<string> GetAllKeys() public List<string> GetAllKeys()
{ {
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic; //const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
var entries = _memoryCache.GetType().GetField("_entries", flags).GetValue(_memoryCache); //var entries = _memoryCache.GetType().GetField("_entries", flags).GetValue(_memoryCache);
var cacheItems = entries.GetType().GetProperty("Keys").GetValue(entries) as ICollection<object>; //entries as IDictionary; //var cacheItems = entries.GetType().GetProperty("Keys").GetValue(entries) as ICollection<object>; //entries as IDictionary;
var keys = new List<string>(); //var keys = new List<string>();
if (cacheItems == null) return keys; //if (cacheItems == null) return keys;
return cacheItems.Select(u => u.ToString()).ToList(); //return cacheItems.Select(u => u.ToString()).ToList();
//foreach (DictionaryEntry cacheItem in cacheItems) ////foreach (DictionaryEntry cacheItem in cacheItems)
//{ ////{
// keys.Add(cacheItem.Key.ToString()); //// keys.Add(cacheItem.Key.ToString());
//} ////}
//return keys; ////return keys;
return new List<string>();
} }
} }

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -21,7 +21,7 @@
<h3 style="text-align:center;">宁波既有建筑外墙脱落问卷调查</h3> <h3 style="text-align:center;">宁波既有建筑外墙脱落问卷调查</h3>
<el-form ref="formRef" :model="pageData.form" label-position="left" require-asterisk-position="right" label-width="160px" style="margin-top:15px;"> <el-form ref="formRef" :model="pageData.form" label-position="left" require-asterisk-position="right" label-width="160px" style="margin-top:15px;">
<el-form-item label="1.社区/小区名:" prop="communityId" :rules="[{ required: true, trigger: 'blur', message: '请选择社区/小区' }]"> <el-form-item label="1.社区/小区名:" prop="communityId" :rules="[{ required: true, trigger: 'blur', message: '请选择社区/小区' }]">
<el-select v-model="pageData.communityItem" filterable clearable placeholder="请选择" @change="(v,v2)=>funHandles.onChangeSelectCommunity(v,pageData)" style="width:100%"> <el-select v-model="pageData.communityItem" filterable clearable remote reserve-keyword :remote-method="(v,v2)=>funHandles.getCommunitys(v,pageData)" placeholder="请输入关键字后进行选择" @change="(v,v2)=>funHandles.onChangeSelectCommunity(v,pageData)" style="width:100%" no-data-text="没有这个社区">
<el-option v-for="item in pageData.communitys" :key="item.id" :label="item.name" :value="JSON.stringify(item)"> <el-option v-for="item in pageData.communitys" :key="item.id" :label="item.name" :value="JSON.stringify(item)">
</el-option> </el-option>
</el-select> </el-select>
@@ -72,13 +72,13 @@
<span style="margin-left: 20px; color: #909399">例如:漏水、开裂、脱落</span> <span style="margin-left: 20px; color: #909399">例如:漏水、开裂、脱落</span>
</el-form-item> </el-form-item>
<el-form-item label="8.楼栋信息:" v-show="pageData?.form?.isExistProblem=='1'"> <el-form-item label="8.楼栋信息:" v-show="pageData?.form?.isExistProblem=='1'">
<el-select v-model="pageData.buildingItemId" filterable clearable placeholder="请选择" style="width:100%"> <el-select v-model="pageData.buildingItemId" filterable clearable remote reserve-keyword :remote-method="(v,v2)=>funHandles.getBuildings(v,pageData)" no-data-text="没有这幢" placeholder="请输入关键字后进行选择" style="width:100%" @change="(v,v2)=>funHandles.onChangeSelectBuildings(v,pageData,formRef,childFormRef)">
<el-option v-for="item in pageData.buildings" :key="item.id" :label="item.buildingName" :value="item.id"> <el-option v-for="item in pageData.form.searchBuildings" :key="item.id" :label="item.buildingName" :value="item.id">
<span style="float: left">{{ item.buildingName }}</span> <span style="float: left">{{ item.buildingName }}</span>
<span style="float: right;color: var(--el-text-color-secondary);font-size: 11px;">{{ item.address }}</span> <span style="float: right;color: var(--el-text-color-secondary);font-size: 11px;">{{ item.address }}</span>
</el-option> </el-option>
</el-select> </el-select>
<div v-for="buildingItem in pageData.form.buildings" v-show="buildingItem?.id==pageData.buildingItemId"> <div v-for="buildingItem in pageData.buildings" v-show="buildingItem?.id==pageData.buildingItemId">
<el-space wrap alignment="start" style="margin:20px 0"> <el-space wrap alignment="start" style="margin:20px 0">
<div style="width:350px"><label style="color: #606266; display:inline-block;width: 80px">地址:</label>{{ XEUtils.find(pageData.buildings, item => item.id === pageData.buildingItemId)?.address }}</div> <div style="width:350px"><label style="color: #606266; display:inline-block;width: 80px">地址:</label>{{ XEUtils.find(pageData.buildings, item => item.id === pageData.buildingItemId)?.address }}</div>
<div style="width:350px"><label style="color: #606266; display:inline-block;width:80px">幢名称:</label>{{ XEUtils.find(pageData.buildings, item => item.id === pageData.buildingItemId)?.buildingName }}</div> <div style="width:350px"><label style="color: #606266; display:inline-block;width:80px">幢名称:</label>{{ XEUtils.find(pageData.buildings, item => item.id === pageData.buildingItemId)?.buildingName }}</div>
@@ -91,6 +91,12 @@
<div style="width:350px"><label style="color: #606266; display:inline-block;width:80px">物业单位:</label>{{ XEUtils.find(pageData.buildings, item => item.id === pageData.buildingItemId)?.wuYeUnit }}</div> <div style="width:350px"><label style="color: #606266; display:inline-block;width:80px">物业单位:</label>{{ XEUtils.find(pageData.buildings, item => item.id === pageData.buildingItemId)?.wuYeUnit }}</div>
</el-space> </el-space>
<el-form ref="childFormRef" :model="buildingItem" label-position="top" inline-message> <el-form ref="childFormRef" :model="buildingItem" label-position="top" inline-message>
<!--<el-form-item prop="isproblem" label="是否存在问题" :rules="[{ required: true, trigger: ['change', 'blur'], message: '请选择是否存在问题' }]">
<el-radio-group v-model="buildingItem.isproblem">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
</el-radio-group>
</el-form-item>-->
<el-form-item prop="curwallproblems" label="8.1 墙体问题的类型是" :rules="[{ required: true, trigger: ['change', 'blur'], message: '请选择墙体问题' }]"> <el-form-item prop="curwallproblems" label="8.1 墙体问题的类型是" :rules="[{ required: true, trigger: ['change', 'blur'], message: '请选择墙体问题' }]">
<el-checkbox-group v-model="buildingItem.curwallproblems"> <el-checkbox-group v-model="buildingItem.curwallproblems">
<el-checkbox v-for="w in staticData.wallproblems" :label="w" :key="w">{{w}}</el-checkbox> <el-checkbox v-for="w in staticData.wallproblems" :label="w" :key="w">{{w}}</el-checkbox>
@@ -213,39 +219,27 @@
</el-form> </el-form>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="problemismodify" label="问题发生后是否请人修复了?" v-if="pageData?.form?.isExistProblem=='1'" :rules="[{ required: true, trigger: ['blur'], message: '请选择问题发生后是否请人修复' }]">
<el-form-item prop="problemismodify" label="14.问题发生后是否请人修复了?" v-if="pageData?.form?.isExistProblem=='1'" :rules="[{ required: true, trigger: ['blur'], message: '请选择问题发生后是否请人修复' }]">
<el-radio-group v-model="pageData.form.problemismodify"> <el-radio-group v-model="pageData.form.problemismodify">
<el-radio label="1"></el-radio> <el-radio label="1"></el-radio>
<el-radio label="0"></el-radio> <el-radio label="0"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="15.请提供修复单位的名称:" v-if="pageData.form?.problemismodify=='1'"> <el-form-item label="请提供修复单位的名称:" v-if="pageData.form?.problemismodify=='1'">
<el-input type="textarea" autosize placeholder="请提供修复单位的名称。" v-model="pageData.form.problemmodifyunitname"> <el-input type="textarea" autosize placeholder="请提供修复单位的名称。" v-model="pageData.form.problemmodifyunitname">
rm rm
</el-form-item> </el-form-item>
<el-form-item label="16.修复后的部位是否再次发生问题?" v-if="pageData.form?.problemismodify=='1'"> <el-form-item label="修复后的部位是否再次发生问题?" v-if="pageData.form?.problemismodify=='1'">
<el-radio-group v-model="pageData.form.problemmodifyisagain"> <el-radio-group v-model="pageData.form.problemmodifyisagain">
<el-radio label="1">有再发生</el-radio> <el-radio label="1">有再发生</el-radio>
<el-radio label="0">没有</el-radio> <el-radio label="0">没有</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
20.若您愿意接受我们的现场调查,请惠赐您的联系方式。谢谢! 若您愿意接受我们的现场调查,请惠赐您的联系方式。谢谢!
<el-input type="textarea" autosize placeholder="" v-model="pageData.form.contract"> <el-input type="textarea" autosize placeholder="" v-model="pageData.form.contract">
</el-form-item> </el-form-item>
<!--@*<el-form-item label="手机号码:" prop="phone" :rules="[{ validator: checkPhone, required: true, trigger: 'blur' }]">
<el-input v-model="form.phone"></el-input>
</el-form-item>
<el-form-item label="验证码" prop="code" v-if="!isshowmyinfo" :rules="[{ validator: checkCode, required: true, trigger: 'blur' }]">
<el-input type="text" maxlength="4" placeholder="验证码" v-model="form.code">
<template slot="append">
<el-button :disabled="disabled" @click="getCode">{{ valiBtn }}</el-button>
</template>
</el-input>
</el-form-item>*@-->
<el-form-item v-if="!isshowmyinfo"> <el-form-item v-if="!isshowmyinfo">
<el-button type="primary" @click.prevent="funHandles.onSubmit(formRef,childFormRef,pageData)"> 提 交 </el-button> <el-button type="primary" @click.prevent="funHandles.onSubmit(formRef,childFormRef,pageData)"> 提 交 </el-button>
<!--<el-button @click.prevent="showinfo()">我的报名</el-button>--> <!--<el-button @click.prevent="showinfo()">我的报名</el-button>-->
@@ -315,7 +309,7 @@
data.key = await funHandles.verifyKey(); data.key = await funHandles.verifyKey();
} while (!data.key); } while (!data.key);
data.communitys = await funHandles.getCommunitys(); await funHandles.getCommunitys("", data);
}, },
verifyKey: async () => { verifyKey: async () => {
const key = await ElMessageBox.prompt('请输入授权码', { const key = await ElMessageBox.prompt('请输入授权码', {
@@ -349,8 +343,10 @@
window.location.reload();//刷新当前页面 window.location.reload();//刷新当前页面
} }
}, },
getCommunitys: async (queryString) => { getCommunitys: async (queryString, data) => {
try { try {
if (queryString == undefined || queryString == "")
return;
window.loadingInstance = ElLoading.service({ lock: true, text: '加载中' }); window.loadingInstance = ElLoading.service({ lock: true, text: '加载中' });
const response = await axios({ const response = await axios({
@@ -360,6 +356,7 @@
responseType: "json", responseType: "json",
}); });
window.loadingInstance?.close(); window.loadingInstance?.close();
data.communitys = response.data.data;
return response.data.data; return response.data.data;
} catch (error) { } catch (error) {
window.loadingInstance?.close(); window.loadingInstance?.close();
@@ -368,7 +365,6 @@
} }
}, },
onChangeSelectCommunity: async (v, data) => { onChangeSelectCommunity: async (v, data) => {
//debugger;
if (v) { if (v) {
const { name, id } = JSON.parse(v) const { name, id } = JSON.parse(v)
try { try {
@@ -377,7 +373,7 @@
const response = (window.cacheCommunitysData && window.cacheCommunitysData[id]) ?? await axios({ const response = (window.cacheCommunitysData && window.cacheCommunitysData[id]) ?? await axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' }, headers: { 'Content-Type': 'application/json;charset=UTF-8' },
method: 'get', method: 'get',
url: '/gb/yjb/api/outsidewall/Community/' + id, url: '/gb/yjb/api/outsidewall/Communitys/' + id,
responseType: "json", responseType: "json",
}); });
window.loadingInstance?.close(); window.loadingInstance?.close();
@@ -389,20 +385,20 @@
if (!data.form) data.form = {}; if (!data.form) data.form = {};
data.form.communityId = id; data.form.communityId = id;
data.form.communityName = name; data.form.communityName = name;
data.form.buildings = response.data.data?.map(x => ( //data.form.buildings = response.data.data?.map(x => (
{ // {
id: x.id, // id: x.id,
address: x.address, // address: x.address,
buildingName: x.buildingName, // buildingName: x.buildingName,
levelCount: x.levelCount, // levelCount: x.levelCount,
houseHolds: x.houseHolds, // houseHolds: x.houseHolds,
buildingUnit: x.buildingUnit, // buildingUnit: x.buildingUnit,
desingerUnit: x.desingerUnit, // desingerUnit: x.desingerUnit,
constructionUnit: x.constructionUnit, // constructionUnit: x.constructionUnit,
monitorUnit: x.monitorUnit, // monitorUnit: x.monitorUnit,
wuYeUnit: x.wuYeUnit, // wuYeUnit: x.wuYeUnit,
} // }
)) ?? []; //)) ?? [];
data.form.buildcount = data.buildings.length;//楼栋数 data.form.buildcount = data.buildings.length;//楼栋数
data.form.householdcount = data.buildings.reduce((a, key) => { return a + key.houseHolds }, 0);//住户总数 data.form.householdcount = data.buildings.reduce((a, key) => { return a + key.houseHolds }, 0);//住户总数
data.form.totalfloorage = data.buildings.reduce((a, key) => { return a + key.areaCount }, 0);//总建筑面积 data.form.totalfloorage = data.buildings.reduce((a, key) => { return a + key.areaCount }, 0);//总建筑面积
@@ -416,6 +412,111 @@
data.form = {} data.form = {}
} }
}, },
getBuildings: async (v, data) => {
if (v == undefined || v == "")
return;
const response = await axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
method: 'get',
url: `/gb/yjb/api/outsidewall/Community/${data.form.communityId}?querystring=${v ?? ''}`,
responseType: "json",
});
if (!window.cacheCommunitysData) window.cacheCommunitysData = [];
if (!window.cacheCommunitysData[data.form.communityId]) window.cacheCommunitysData[data.form.communityId] = response;
//data.buildings = response.data.data;
data.form.searchBuildings = response.data.data?.map(x => (
{
id: x.id,
address: x.address,
buildingName: x.buildingName,
levelCount: x.levelCount,
houseHolds: x.houseHolds,
buildingUnit: x.buildingUnit,
desingerUnit: x.desingerUnit,
constructionUnit: x.constructionUnit,
monitorUnit: x.monitorUnit,
wuYeUnit: x.wuYeUnit,
}
)) ?? [];
},
onChangeSelectBuildings: async (v, data, formEl, childFormEl) => {
if (v) {
try {
let isAllChildValid = false;
if (data?.form?.isExistProblem == '0') { isAllChildValid = true; }
else {
//验证
var waitValid = data.form?.buildingsForm
if (waitValid?.length > 0) {
for (let ii = 0; ii < waitValid.length; ii++) {
let _fe = waitValid[ii]?.formEl;
const isValid = await _fe?.validate(valid => {
if (!valid) {
data.buildingItemId = waitValid[ii].building.id;
}
});
if (isValid == false) {
ElMessageBox.alert('幢信息问卷未填写完整', '提示', { type: 'warning' });
return;
}
}
isAllChildValid = true;
}
else {
//ElMessageBox.alert('存在问题请展开幢信息进行问卷填写', '提示', { type: 'warning' });
}
const fromMerges = childFormEl.map((x, ii) => ({ formEl: x, building: data.buildings[ii] }));
//let validateFroms = [].concat(data?.form.buildingsForm?.filter(x => x.building.curwallproblems?.length > 0));
//if (validateFroms.length > 0) {
// for (let ii = 0; ii < validateFroms.length; ii++) {
// let _fe = validateFroms[ii]?.formEl;
// const isValid = _fe ?? await _fe?.validate(valid => {
// if (!valid) {
// data.buildingItemId = validateFroms[ii].building.id;
// }
// });
// if (isValid == false) {
// ElMessageBox.alert('幢信息问卷未填写完整', '提示', { type: 'warning' });
// return;
// }
// }
// isAllChildValid = true;
//}
//else {
// ElMessageBox.alert('存在问题请展开幢信息进行问卷填写', '提示', { type: 'warning' });
//}
window.loadingInstance = ElLoading.service({ lock: true, text: '加载中' });
if (!data.form.buildings) {
data.form.buildings = []
}
if (!data.form.buildingsForm) {
data.form.buildingsForm = []
}
var c = window.cacheCommunitysData[data.form.communityId].data.data.filter(a => a.id == v)
data.form.buildings.push(c[0])
data.form.buildingsForm.push(fromMerges.filter(x => x.building.id == data.buildingItemId)[0])
window.loadingInstance?.close();
}
} catch (error) {
window.loadingInstance?.close();
console.log(error)
ElMessageBox.alert(error.message, '异常', { type: 'error' });
}
} else {
}
},
onSubmit: (formEl, childFormEl, data) => { onSubmit: (formEl, childFormEl, data) => {
console.log('submit!'); console.log('submit!');
formEl.validate(async (valid) => { formEl.validate(async (valid) => {
@@ -423,18 +524,16 @@
let isAllChildValid = false; let isAllChildValid = false;
if (data?.form?.isExistProblem == '0') { isAllChildValid = true; } if (data?.form?.isExistProblem == '0') { isAllChildValid = true; }
else { else {
const fromMerges = childFormEl.map((x, ii) => ({ formEl: x, building: data.form.buildings[ii] })); var waitValid = data.form?.buildingsForm?.filter(a => a.building.curwallproblems.length > 0)
if (waitValid?.length > 0) {
const validateFroms = [].concat(fromMerges.filter(x => x.building.id == data.buildingItemId), fromMerges.filter(x => x.building.curwallproblems?.length > 0)); for (let ii = 0; ii < waitValid.length; ii++) {
let _fe = waitValid[ii]?.formEl;
if (validateFroms.length > 0) { const isValid = await _fe?.validate(valid => {
for (let ii = 0; ii < validateFroms.length; ii++) {
const isValid = await validateFroms[ii].formEl.validate(valid => {
if (!valid) { if (!valid) {
data.buildingItemId = validateFroms[ii].building.id; data.buildingItemId = waitValid[ii].building.id;
} }
}); });
if (!isValid) { if (isValid == false) {
ElMessageBox.alert('幢信息问卷未填写完整', '提示', { type: 'warning' }); ElMessageBox.alert('幢信息问卷未填写完整', '提示', { type: 'warning' });
return; return;
} }
@@ -444,6 +543,30 @@
else { else {
ElMessageBox.alert('存在问题请展开幢信息进行问卷填写', '提示', { type: 'warning' }); ElMessageBox.alert('存在问题请展开幢信息进行问卷填写', '提示', { type: 'warning' });
} }
//const fromMerges = childFormEl.map((x, ii) => ({ formEl: x, building: data.form.buildings[ii] }));
////const validateFroms = [].concat(fromMerges.filter(x => x.building.id == data.buildingItemId), fromMerges.filter(x => x.building.curwallproblems?.length > 0));
//let validateFroms = [].concat(data?.form.buildings.filter(x => x.id == data.buildingItemId), data?.form.buildings.filter(x => x.curwallproblems?.length > 0));
//if (validateFroms.length > 0) {
// for (let ii = 0; ii < validateFroms.length; ii++) {
// const isValid = await validateFroms[ii].formEl.validate(valid => {
// if (!valid) {
// data.buildingItemId = validateFroms[ii].building.id;
// }
// });
// if (!isValid) {
// ElMessageBox.alert('幢信息问卷未填写完整', '提示', { type: 'warning' });
// return;
// }
// }
// isAllChildValid = true;
//}
//else {
// ElMessageBox.alert('存在问题请展开幢信息进行问卷填写', '提示', { type: 'warning' });
//}
} }
if (isAllChildValid) { if (isAllChildValid) {
@@ -452,9 +575,10 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
debugger
window.loadingInstance = ElLoading.service({ lock: true, text: '提交中...请稍候' }); window.loadingInstance = ElLoading.service({ lock: true, text: '提交中...请稍候' });
try { try {
data.form.buildings = data.form.buildings.filter(a => a.curwallproblems?.length > 0)
const response = await axios({ const response = await axios({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
method: 'post', method: 'post',

View File

@@ -109,6 +109,7 @@ namespace Vote.Services.ApiController
wallproblemtoward = a.wallproblemtoward, wallproblemtoward = a.wallproblemtoward,
WuYeUnit = a.WuYeUnit WuYeUnit = a.WuYeUnit
}) })
.OrderByDescending(a => a.createtime)//.OrderBy((a, b) => b.communityName)
.WithCache(60 * 60).ToListAsync(); .WithCache(60 * 60).ToListAsync();
var ids = entity.Select(a => a.Id).ToArray(); var ids = entity.Select(a => a.Id).ToArray();
var photos = await repoutside_wall_building_photo.AsQueryable() var photos = await repoutside_wall_building_photo.AsQueryable()
@@ -141,7 +142,7 @@ namespace Vote.Services.ApiController
var entity = await repoutside_wall.AsQueryable() var entity = await repoutside_wall.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(args.communityId), a => a.communityId == args.communityId) .WhereIF(!string.IsNullOrWhiteSpace(args.communityId), a => a.communityId == args.communityId)
.WhereIF(!string.IsNullOrWhiteSpace(args.submitCode), a => a.submitCode == args.submitCode) .WhereIF(!string.IsNullOrWhiteSpace(args.submitCode), a => a.submitCode == args.submitCode)
.OrderByDescending(a=>a.createtime).OrderBy(a=>a.communityName) .OrderByDescending(a => a.createtime).OrderBy(a => a.communityName)
.WithCache(60 * 60).ToListAsync(); .WithCache(60 * 60).ToListAsync();
var ids = entity.Select(a => a.Id).ToArray(); var ids = entity.Select(a => a.Id).ToArray();
var photos = await repoutside_wall_photo.AsQueryable() var photos = await repoutside_wall_photo.AsQueryable()
@@ -359,8 +360,8 @@ namespace Vote.Services.ApiController
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[AllowAnonymous] [AllowAnonymous]
[HttpGet("community/{id}")] [HttpGet("communitys/{id}")]
public async Task<dynamic> GetCommunityInfo(string id) public async Task<List<SanjuBuilding>> GetCommunityInfo(string id)
{ {
var cacheKey = "cache_building_" + id; var cacheKey = "cache_building_" + id;
List<SanjuBuilding> building = _memoryCache.Get<List<SanjuBuilding>>(cacheKey); List<SanjuBuilding> building = _memoryCache.Get<List<SanjuBuilding>>(cacheKey);
@@ -378,6 +379,18 @@ namespace Vote.Services.ApiController
return building; return building;
} }
/// <summary> /// <summary>
/// 获取三居系统中的社区
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet("community/{id}")]
public async Task<dynamic> GetCommunityInfo(string id, string querystring)
{
if (string.IsNullOrWhiteSpace(querystring))
return new List<SanjuBuilding>();
return (await GetCommunityInfo(id)).Where(a => a.Address.Contains(querystring)).ToList();
}
/// <summary>
/// 提交 /// 提交
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
@@ -400,7 +413,7 @@ namespace Vote.Services.ApiController
wall.Id = Guid.NewGuid().ToString(); wall.Id = Guid.NewGuid().ToString();
wall.createtime = DateTime.Now; wall.createtime = DateTime.Now;
wall.isdeleted = 0; wall.isdeleted = 0;
wall = await repoutside_wall.InsertReturnEntityAsync(wall); await repoutside_wall.InsertAsync(wall);
if (args.fileList != null) if (args.fileList != null)
{ {
foreach (var item in args.fileList) foreach (var item in args.fileList)

View File

@@ -179,6 +179,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Vote.Services.ApiController.OutsideWallService.GetCommunityInfo(System.String,System.String)">
<summary>
获取三居系统中的社区
</summary>
<returns></returns>
</member>
<member name="M:Vote.Services.ApiController.OutsideWallService.Submit(Vote.Services.Dto.OutsideWallInput,System.String)"> <member name="M:Vote.Services.ApiController.OutsideWallService.Submit(Vote.Services.Dto.OutsideWallInput,System.String)">
<summary> <summary>
提交 提交