Commit a5562f8d authored by “yiyousong”'s avatar “yiyousong”
parents baff5fed f1a2155d
...@@ -7226,6 +7226,68 @@ data|object|数据对象|- ...@@ -7226,6 +7226,68 @@ data|object|数据对象|-
``` ```
### 批量保存更新窗口事项
**请求URL:** window/matter/batchSave
**请求方式:** POST
**内容类型:** application/json;charset=utf-8
**简要描述:** 保存或更新窗口事项:id为空时为新增保存,否则为更新提交
**请求参数:**
参数名称|类型|备注|必填|其它
---|---|---|---|---
windowId|Long|窗口ID|是|-
windowName|String|窗口名称|是|-
siteMatterId|Long|站点事项ID|是|-
matterName|String|事项名称|是|-
deptId|Long|部门ID|是|-
deptName|String|部门名称|是|-
isShow|Integer|是否显示 (1.是,0.否)|是|-
sort|Integer|排序|是|-
**请求样例:**
```
[
{
"windowId":1,
"windowName":"mtv5rh",
"siteMatterId":6893,
"matterName":"epawga",
"deptId":5288,
"deptName":"ivpfm8",
"isShow":1,
"sort":1,
}]
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
**响应消息样例:**
```
{
"msg":"批量新增成功",
"code":1,
"data":{}
}
}
```
### 删除窗口事项 ### 删除窗口事项
**请求URL:** window/matter/delete **请求URL:** window/matter/delete
......
...@@ -39,13 +39,13 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> { ...@@ -39,13 +39,13 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> {
Rest<String> syncDeptBySiteId(SiteEntity siteEntity, Context context); Rest<String> syncDeptBySiteId(SiteEntity siteEntity, Context context);
Rest<Map<Long, List<DeptVo>>> getBusinessByDept(DeptQuery deptQuery, Context context); Rest<Map<String, List<DeptVo>>> getBusinessByDept(DeptQuery deptQuery, Context context);
void deleteGovBySiteId(Long siteId, Context context); void deleteGovBySiteId(Long siteId, Context context);
Rest<Map<Long,List<DeptVo>>> getDeptListByBusiness(DeptQuery deptQuery, Context context); Rest<Map<String,List<DeptVo>>> getDeptListByBusiness(DeptQuery deptQuery, Context context);
......
...@@ -131,10 +131,10 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -131,10 +131,10 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
} }
@Override @Override
public Rest<Map<Long, List<DeptVo>>> getBusinessByDept(DeptQuery deptQuery, Context context) { public Rest<Map<String, List<DeptVo>>> getBusinessByDept(DeptQuery deptQuery, Context context) {
List<DeptVo> businessDeptList = this.dao.getBusinessByDept(deptQuery); List<DeptVo> businessDeptList = this.dao.getBusinessByDept(deptQuery);
Map<Long, List<DeptVo>> collect = businessDeptList.parallelStream().collect(Collectors.groupingBy(x -> x.getId())); Map<String, List<DeptVo>> collect = businessDeptList.parallelStream().collect(Collectors.groupingBy(x -> x.getId().toString()));
return Rest.ok(collect); return Rest.ok(collect);
......
...@@ -110,7 +110,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -110,7 +110,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
if (ObjectUtils.isEmpty(deptQuery.getIdList())) { if (ObjectUtils.isEmpty(deptQuery.getIdList())) {
throw new AppException("参数部门ids不能为空!"); throw new AppException("参数部门ids不能为空!");
} }
Rest<Map<Long, List<DeptVo>>> rest = this.service.getBusinessByDept(deptQuery, getContext()); Rest<Map<String, List<DeptVo>>> rest = this.service.getBusinessByDept(deptQuery, getContext());
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, rest.getData()); jsonObject.put(KEY_RESULT_DATA, rest.getData());
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
...@@ -136,7 +136,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -136,7 +136,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
if (ObjectUtils.isEmpty(deptQuery.getSiteBusinessIdList())) { if (ObjectUtils.isEmpty(deptQuery.getSiteBusinessIdList())) {
throw new AppException("业务id不能为空!"); throw new AppException("业务id不能为空!");
} }
Rest<Map<Long, List<DeptVo>>> rest = this.service.getDeptListByBusiness(deptQuery, getContext()); Rest<Map<String, List<DeptVo>>> rest = this.service.getDeptListByBusiness(deptQuery, getContext());
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, rest.getData()); jsonObject.put(KEY_RESULT_DATA, rest.getData());
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
......
...@@ -6,6 +6,7 @@ import com.mortals.framework.ap.GlobalSysInfo; ...@@ -6,6 +6,7 @@ import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.util.HttpUtil; import com.mortals.framework.util.HttpUtil;
import com.mortals.xhx.module.window.model.WindowMatterQuery;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
...@@ -60,13 +61,35 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte ...@@ -60,13 +61,35 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte
*/ */
@Override @Override
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
Arrays.asList(ids).forEach(id->{ Arrays.asList(ids).forEach(id -> {
WindowMatterEntity windowMatterEntity = this.get(id, context); WindowMatterEntity windowMatterEntity = this.get(id, context);
pushChangeMsg(windowMatterEntity); pushChangeMsg(windowMatterEntity);
}); });
super.removeBefore(ids, context); super.removeBefore(ids, context);
} }
/**
* @param entity
* @param context
* @return
* @throws AppException
*/
@Override
public WindowMatterEntity save(WindowMatterEntity entity, Context context) throws AppException {
this.saveBefore(entity, context);
//校验是否存在
WindowMatterQuery windowMatterQuery = new WindowMatterQuery();
windowMatterQuery.setWindowId(entity.getWindowId());
windowMatterQuery.setSiteMatterId(entity.getSiteMatterId());
int count = this.count(windowMatterQuery, context);
if (count == 0) {
this.dao.insert(entity);
this.saveAfter(entity, context);
}
return entity;
}
/** /**
* @param entity * @param entity
* @param context * @param context
...@@ -78,12 +101,12 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte ...@@ -78,12 +101,12 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
private void pushChangeMsg(WindowMatterEntity entity) { private void pushChangeMsg(WindowMatterEntity entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090");
phpUrl+="/api/window/winNameChange"; phpUrl += "/api/window/winNameChange";
HashMap<String, Object> paramsMap = new HashMap<>(); HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("windowid", entity.getWindowId()); paramsMap.put("windowid", entity.getWindowId());
paramsMap.put("typeinfo",0); paramsMap.put("typeinfo", 0);
String resp = null; String resp = null;
try { try {
Map<String, String> header = new HashMap<>(); Map<String, String> header = new HashMap<>();
......
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