Commit 91fc7e04 authored by 赵啸非's avatar 赵啸非

添加宜宾环境

parent 5efb5820
......@@ -1276,7 +1276,7 @@ dict|object|字典对象|-
参数名称|类型|备注|必填|其它
---|---|---|---|---
id|Long|站点ID|是|-
areaName|String|区域名称|是|-
siteName|String|站点名称|否|前后添加%%可进行模糊查找
**请求样例:**
......@@ -1284,7 +1284,8 @@ siteName|String|站点名称|否|前后添加%%可进行模糊查找
```
{
"areaCode":"510105521000"
"areaName":"宜宾市",
"siteName":"%高县%",
}
```
......@@ -5241,6 +5242,47 @@ msg|String|消息|-
```
### 通过部门获取业务列表
**请求URL:** window/getBusinessByDept
**请求方式:** POST
**内容类型:** application/json;charset=utf-8
**简要描述:** 通过部门获取业务列表
**请求参数:**
参数名称|类型|备注|必填|其它
---|---|---|---|---
id|Long|部门id|是|-
**请求样例:**
```
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
data|array|结果集列表|数组
**响应消息样例:**
```
{
"code":1,
"msg":"成功"
}
```
### 添加业务到窗口
**请求URL:** window/addBusinessToWindow
......
......@@ -3,9 +3,13 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.site.model.SiteEntity;
import java.util.List;
/**
* DeptService
*
......@@ -30,5 +34,9 @@ public interface DeptService extends ICRUDCacheService<DeptEntity,Long> {
Rest<String> syncDeptBySiteId(SiteEntity siteEntity, Context context);
Rest<List<BusinessEntity>> getBusinessByDept(DeptQuery deptQuery, Context context);
void deleteGovBySiteId(Long siteId, Context context);
}
\ No newline at end of file
......@@ -8,6 +8,9 @@ import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.MatterHtmlParseUtil;
import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.model.BusinessQuery;
import com.mortals.xhx.module.business.service.BusinessService;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
......@@ -17,6 +20,12 @@ import com.mortals.xhx.module.matters.model.MattersDeptQuery;
import com.mortals.xhx.module.matters.service.MattersDeptService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.module.window.model.WindowBusinessEntity;
import com.mortals.xhx.module.window.model.WindowBusinessQuery;
import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.model.WindowQuery;
import com.mortals.xhx.module.window.service.WindowBusinessService;
import com.mortals.xhx.module.window.service.WindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -25,6 +34,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* DeptService
......@@ -42,6 +52,13 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
private DeptService deptService;
@Autowired
private MattersDeptService mattersDeptService;
@Autowired
private WindowService windowService;
@Autowired
private BusinessService businessService;
@Autowired
private WindowBusinessService windowBusinessService;
@Override
protected String getExtKey(DeptEntity data) {
......@@ -109,6 +126,23 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
return Rest.ok("当前站点同步添加部门成功!");
}
@Override
public Rest<List<BusinessEntity>> getBusinessByDept(DeptQuery deptQuery, Context context) {
//查询部门窗口
List<WindowEntity> windowEntities = windowService.find(new WindowQuery().deptId(deptQuery.getId()));
//查询窗口业务
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
windowBusinessQuery.setWindowIdList(windowEntities.stream().map(WindowEntity::getId).collect(Collectors.toList()));
List<WindowBusinessEntity> windowBusinessEntities = windowBusinessService.find(windowBusinessQuery);
BusinessQuery businessQuery = new BusinessQuery();
businessQuery.setIdList(windowBusinessEntities.stream().map(WindowBusinessEntity::getSiteBusinessId).collect(Collectors.toList()));
List<BusinessEntity> businessEntities = businessService.find(businessQuery);
return Rest.ok(businessEntities);
}
@Override
public void deleteGovBySiteId(Long siteId, Context context) {
Map<String, Object> condition = new HashMap<>();
......
package com.mortals.xhx.module.dept.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -8,12 +9,17 @@ import com.mortals.framework.model.OrderCol;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.vo.SiteAreaVo;
import com.mortals.xhx.module.site.service.SiteService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -21,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -74,10 +81,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
public String syncDeptBySiteId(Long siteId) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
SiteEntity siteEntity = siteService.get(siteId, getContext());
try {
Rest<String> rest = this.service.syncDeptBySiteId(siteEntity, getContext());
jsonObject.put(KEY_RESULT_MSG, rest.getMsg());
......@@ -93,4 +97,30 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
}
/**
* 根据部门查询业务
*/
@PostMapping(value = "getBusinessByDept")
@UnAuth
public String getBusinessByDept(@RequestBody DeptQuery deptQuery) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据部门查询业务" + this.getModuleDesc();
try {
if (ObjectUtils.isEmpty(deptQuery.getId())) {
throw new AppException("参数部门id不能为空!");
}
Rest<List<BusinessEntity>> rest = this.service.getBusinessByDept(deptQuery, getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, rest.getData());
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
}
\ No newline at end of file
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