Commit 2f08fdb5 authored by 赵啸非's avatar 赵啸非

添加级联删除事项材料

parent bc63325f
#生产环境
NODE_ENV = "test"
VUE_APP_API_BASE_URL=http://192.168.0.98:11078
......@@ -4,8 +4,11 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"test": "vue-cli-service build --mode test",
"build:prod": "vue-cli-service build --model prod"
},
"dependencies": {
"@babel/parser": "^7.7.4",
......
// 事项api
import local from "@/utils/local"
import request from '@/utils/request'
let baseUrl = local.getLocal('baseUrl')?local.getLocal('baseUrl') :'http://192.168.0.98:11074'
let siteId = local.getLocal('siteId')?local.getLocal('siteId') :'3'
let devicenum = local.getLocal('devicenum')?local.getLocal('devicenum') :'90-2B-34-BF-1B-48'
//let baseUrl = local.getLocal('baseUrl') ? local.getLocal('baseUrl') : 'http://localhost:17002'
let baseUrl = local.getLocal('baseUrl') ? local.getLocal('baseUrl') : 'http://192.168.0.98:11078'
let siteId = local.getLocal('siteId') ? local.getLocal('siteId') : '3'
let devicenum = local.getLocal('devicenum') ? local.getLocal('devicenum') : '90-2B-34-BF-1B-48'
// 首页数据展示
export const getHomeInfo = (data) => {
return request({
url:`${baseUrl}/fm/home/info`,
method: "post",
data:{
siteId,
devicenum,
...data
},
});
return request({
url: `${baseUrl}/sampleform/home/info`,
method: "post",
data: {
siteId,
devicenum,
...data
},
});
};
// 获取部门列表
export const getdeptList = (data) => {
return request({
url: `${baseUrl}/fm/home/dept/list`,
url: `${baseUrl}/sampleform/home/dept/list`,
method: "post",
data:{
siteId,
...data
data: {
siteId,
...data
},
});
};
......@@ -32,35 +34,35 @@ export const getdeptList = (data) => {
// 查询事项列表
export const getWriteMatterList = (data) => {
return request({
url: `${baseUrl}/fm/matter/list`,
method: "post",
data:{
siteId,
...data
},
url: `${baseUrl}/sampleform/matter/list`,
method: "post",
data: {
siteId,
...data
},
});
};
};
// 查询材料列表
export const getMaterialsList = (data) => {
return request({
url:`${baseUrl}/fm/matter/datum/list`,
method: "post",
data:{
siteId,
...data
},
url: `${baseUrl}/sampleform/matter/datum/list`,
method: "post",
data: {
siteId,
...data
},
});
};
};
// 表单合成
export const mergeFormToDocx = (data) => {
// 表单合成
export const mergeFormToDocx = (data) => {
return request({
url:`${baseUrl}/fm/home/mergeFormToDocx`,
method: "post",
data:{
siteId,
...data
},
url: `${baseUrl}/sampleform/home/mergeFormToDocx`,
method: "post",
data: {
siteId,
...data
},
});
};
\ No newline at end of file
};
\ No newline at end of file
......@@ -8,7 +8,7 @@ import local from "@/utils/local"
axios.defaults.timeout = 15 * 1000
// 设置统一服务器地址
// axios.defaults.baseURL = process.env.VUE_APP_API_BASE_URL
axios.defaults.baseURL = process.env.VUE_APP_API_BASE_URL
// 请求拦截
axios.interceptors.request.use(config => {
let token = local.getLocal('token')
......
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
transpileDependencies: true,
productionSourceMap: false,
assetsDir: 's',
lintOnSave:false,
devServer: {
port: 9086,
hot: "only",//自动保存
proxy: {
'/sampleform': {
target: 'http://localhost:17002',
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
}
}
}
})
......@@ -42,9 +42,9 @@
</el-table-column>
<el-table-column
show-overflow-tooltip
label="部门编号"
label="部门名称"
align="center"
prop="deptCode"
prop="deptName"
width="80"
>
</el-table-column>
......@@ -91,6 +91,7 @@ import TableHeader from "@/components/TableHeader.vue";
import {getPubdatumList} from "@/api/libray";
import {addPubdatum} from "@/api/materials";
import local from "@/utils/local";
import { mapGetters } from "vuex";
export default {
components: {
......@@ -136,7 +137,7 @@ export default {
this.$emit("update:libVisible", val);
},
},
// ...mapGetters(["deptList"]),
...mapGetters(["deptList"]),
},
methods: {
// 系统事项列表
......
......@@ -33,7 +33,7 @@
<script>
// import formViewer from "@/components/formDes/formViewer.vue";
import formBuilder from "@/components/formDes/formBuilder.vue";
//import formBuilder from "@/components/formDes/formBuilder.vue";
// import { regionData } from "element-china-area-data";
export default {
props: {
......@@ -52,7 +52,7 @@ export default {
},
components: {
// formViewer,
formBuilder,
//formBuilder,
},
data() {
return {
......
......@@ -5,4 +5,6 @@ import lombok.Data;
@Data
public class HomeQueryPdu {
private Long siteId;
private String devicenum;
}
......@@ -17,8 +17,13 @@ import com.mortals.xhx.feign.base.pdu.DeptPdu;
import com.mortals.xhx.feign.base.pdu.SitePdu;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.module.home.pdu.HomeQueryPdu;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
import com.mortals.xhx.module.hotword.model.HotwordQuery;
import com.mortals.xhx.module.hotword.service.HotwordService;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumQuery;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.matter.service.MatterService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,34 +40,34 @@ public class HomeController extends BaseJsonBodyController {
@Autowired
private IApiBaseManagerFeign iApiBaseManagerFeign;
// @Autowired
// private IApiDeviceFeign iApiDeviceFeign;
@Autowired
private MatterDatumService matterDatumService;
@Autowired
private MatterService matterService;
@Autowired
private HotwordService hotwordService;
@Autowired
private ParamService paramService;
@PostMapping({"site/list"})
public Rest<Object> list() {
IUser user = this.getCurUser();
if(user==null){
if (user == null) {
throw new AppException("用户未登录");
}
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "查询用户站点列表" ;
String busiDesc = "查询用户站点列表";
int code=1;
int code = 1;
try {
if(StringUtils.isNotEmpty(user.getSiteIds())){
if (StringUtils.isNotEmpty(user.getSiteIds())) {
SitePdu sitePdu = new SitePdu();
List<String> siteIds = Arrays.asList(user.getSiteIds().split(","));
List<Long> idList = new ArrayList<>();
siteIds.forEach(s -> {
idList.add(DataUtil.converStr2Long(s,0));
idList.add(DataUtil.converStr2Long(s, 0));
});
sitePdu.setIdList(idList);
String resp = iApiBaseManagerFeign.getSitesByQuery(sitePdu);
......@@ -70,12 +75,12 @@ public class HomeController extends BaseJsonBodyController {
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取用户站点列表树数据失败:" + apiResp.getMsg());
}
if(apiResp.getData().get("data")!=null) {
if (apiResp.getData().get("data") != null) {
model.put("data", apiResp.getData().get("data"));
}else {
} else {
model.put("data", Collections.emptyList());
}
}else {
} else {
model.put("data", Collections.emptyList());
}
model.put("message_info", busiDesc + "成功");
......@@ -101,12 +106,12 @@ public class HomeController extends BaseJsonBodyController {
// }
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "查询站点部门列表" ;
String busiDesc = "查询站点部门列表";
int code=1;
int code = 1;
try {
if(queryPdu.getSiteId()!=null){
if (queryPdu.getSiteId() != null) {
DeptPdu deptPdu = new DeptPdu();
deptPdu.setSiteId(queryPdu.getSiteId());
deptPdu.setSize(-1);
......@@ -115,12 +120,12 @@ public class HomeController extends BaseJsonBodyController {
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取用户站点部门列表失败:" + apiResp.getMsg());
}
if(apiResp.getData().get("data")!=null) {
if (apiResp.getData().get("data") != null) {
model.put("data", apiResp.getData().get("data"));
}else {
} else {
model.put("data", Collections.emptyList());
}
}else {
} else {
model.put("data", Collections.emptyList());
}
model.put("message_info", busiDesc + "成功");
......@@ -139,36 +144,37 @@ public class HomeController extends BaseJsonBodyController {
@PostMapping({"info"})
@UnAuth
public Rest<Object> homePageInfo() {
public Rest<Object> homePageInfo(@RequestBody HomeQueryPdu homeQueryPdu) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "获取首页数据" ;
int code=1;
String busiDesc = "获取首页数据";
int code = VALUE_RESULT_SUCCESS;
try {
model.put("hotWords", paramService.getHotWords());
MatterEntity matterQuery = new MatterEntity();
int matterCont = matterService.count(matterQuery,this.getContext());
matterQuery.setIsRecommend(1);
List<MatterEntity> matterList = matterService.find(matterQuery,this.getContext());
model.put("matterList",matterList); //热门事项
model.put("matterCont",matterCont); //入驻事项数量
MatterDatumEntity matterDatumQuery = new MatterDatumEntity();
int datumCont = matterDatumService.count(matterDatumQuery,this.getContext());
matterDatumQuery.setIsRecommend(1);
List<MatterDatumEntity> datumList = matterDatumService.find(matterDatumQuery,this.getContext());
model.put("datumList",datumList); //热门表单
model.put("datumCont",datumCont); //入驻表单数量
model.put("localPrint",20); //本地打印数量
model.put("onlineSubmit",20); //在线提交数量
model.put("dayThrift",66); //今日节约
model.put("totalThrift",996); //累计节约
List<HotwordEntity> hotwordEntities = hotwordService.find(new HotwordQuery().siteId(homeQueryPdu.getSiteId()));
model.put("hotWords", hotwordEntities);
MatterQuery matterQuery = new MatterQuery();
matterQuery.setSiteId(homeQueryPdu.getSiteId());
int matterCont = matterService.count(matterQuery, this.getContext());
matterQuery.setIsRecommend(YesNoEnum.YES.getValue());
List<MatterEntity> matterList = matterService.find(matterQuery, this.getContext());
model.put("matterList", matterList); //热门事项
model.put("matterCont", matterCont); //入驻事项数量
MatterDatumQuery matterDatumQuery = new MatterDatumQuery();
matterDatumQuery.setSiteId(homeQueryPdu.getSiteId());
int datumCont = matterDatumService.count(matterDatumQuery, this.getContext());
matterDatumQuery.setIsRecommend(YesNoEnum.YES.getValue());
List<MatterDatumEntity> datumList = matterDatumService.find(matterDatumQuery, this.getContext());
model.put("datumList", datumList); //热门表单
model.put("datumCont", datumCont); //入驻表单数量
model.put("localPrint", 20); //本地打印数量
model.put("onlineSubmit", 20); //在线提交数量
model.put("dayThrift", 66); //今日节约
model.put("totalThrift", 996); //累计节约
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
code = VALUE_RESULT_FAILURE;
this.doException(this.request, busiDesc, model, var9);
}
......
package com.mortals.xhx.module.matter.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterEntity;
......@@ -6,16 +7,24 @@ import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 事项申请材料视图对象
*
* @author zxfei
* @date 2022-09-27
*/
* 事项申请材料视图对象
*
* @author zxfei
* @date 2022-09-27
*/
@Data
public class MatterVo extends BaseEntityLong {
/** 材料数量 */
/**
* 材料数量
*/
private Integer datumCount;
/**
* 是否终端访问,默认否
*/
private Integer isTerminal = 0;
}
\ No newline at end of file
package com.mortals.xhx.module.matter.service.impl;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -45,6 +46,12 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
protected void findAfter(MatterEntity entity, PageInfo pageInfo, Context context, List<MatterEntity> list) throws AppException {
for (MatterEntity matterEntity : list) {
matterEntity.setDatumCount(matterEntity.getMatterDatumList().size());
if (entity.getIsTerminal() == YesNoEnum.YES.getValue()) {
String str = "<span style=\"color:red;font-weight:bold\">%s</span>";
//终端访问,标红查询参数
String replaceStr = StrUtil.replace(entity.getMatterName(), entity.getMatterName(), String.format(str, entity.getMatterName()));
entity.setMatterName(replaceStr);
}
}
}
......
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