Commit 153cf177 authored by 赵啸非's avatar 赵啸非

添加站点更新日志

parent 31a2585b
...@@ -12,6 +12,7 @@ import com.mortals.xhx.common.code.IsBusinessEnum; ...@@ -12,6 +12,7 @@ import com.mortals.xhx.common.code.IsBusinessEnum;
import com.mortals.xhx.module.business.model.BusinessEntity; import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.service.BusinessService; import com.mortals.xhx.module.business.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -21,31 +22,30 @@ import java.util.HashMap; ...@@ -21,31 +22,30 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* * 站点业务
* 站点业务 *
* * @author zxfei
* @author zxfei * @date 2022-01-13
* @date 2022-01-13 */
*/
@RestController @RestController
@RequestMapping("business") @RequestMapping("business")
public class BusinessController extends BaseCRUDJsonBodyMappingController<BusinessService,BusinessEntity,Long> { public class BusinessController extends BaseCRUDJsonBodyMappingController<BusinessService, BusinessEntity, Long> {
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
public BusinessController(){ public BusinessController() {
super.setModuleDesc( "站点业务"); super.setModuleDesc("站点业务");
} }
@Override @Override
protected void init( Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "isBusiness", paramService.getParamBySecondOrganize("Business","isBusiness")); this.addDict(model, "isBusiness", paramService.getParamBySecondOrganize("Business", "isBusiness"));
this.addDict(model, "canorder", paramService.getParamBySecondOrganize("Business","canorder")); this.addDict(model, "canorder", paramService.getParamBySecondOrganize("Business", "canorder"));
this.addDict(model, "cantake", paramService.getParamBySecondOrganize("Business","cantake")); this.addDict(model, "cantake", paramService.getParamBySecondOrganize("Business", "cantake"));
this.addDict(model, "datashow", paramService.getParamBySecondOrganize("Business","datashow")); this.addDict(model, "datashow", paramService.getParamBySecondOrganize("Business", "datashow"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("Business","status")); this.addDict(model, "status", paramService.getParamBySecondOrganize("Business", "status"));
this.addDict(model, "businessType", paramService.getParamBySecondOrganize("Business","businessType")); this.addDict(model, "businessType", paramService.getParamBySecondOrganize("Business", "businessType"));
super.init(model, context); super.init(model, context);
} }
...@@ -63,10 +63,10 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine ...@@ -63,10 +63,10 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine
public String addBusinessToSite(@RequestBody Map<String, Object> map) { public String addBusinessToSite(@RequestBody Map<String, Object> map) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String businessIds=(String)map.get("businessIds"); String businessIds = (String) map.get("businessIds");
Long siteId= DataUtil.converObj2Long(map.get("siteId")); Long siteId = DataUtil.converObj2Long(map.get("siteId"));
try { try {
this.service.addBusinessToSite(businessIds,siteId,getContext()); this.service.addBusinessToSite(businessIds, siteId, getContext());
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "添加业务到站点成功!"); jsonObject.put(KEY_RESULT_MSG, "添加业务到站点成功!");
...@@ -79,7 +79,6 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine ...@@ -79,7 +79,6 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine
} }
/** /**
* 查询业务扁平结构 * 查询业务扁平结构
*/ */
...@@ -93,7 +92,9 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine ...@@ -93,7 +92,9 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine
Result<BusinessEntity> result = this.service.flatList(query, pageInfo, getContext()); Result<BusinessEntity> result = this.service.flatList(query, pageInfo, getContext());
model.put(KEY_RESULT_DATA, result.getList()); model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo()); parsePageInfo(model, result.getPageInfo());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!"); jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!");
......
...@@ -55,17 +55,17 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -55,17 +55,17 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
@Override @Override
protected void doListBefore(DeptEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(DeptEntity query, Map<String, Object> model, Context context) throws AppException {
if(ObjectUtils.isEmpty(query.getOrderColList())){ if (ObjectUtils.isEmpty(query.getOrderColList())) {
query.setOrderColList(new ArrayList<OrderCol>() { query.setOrderColList(new ArrayList<OrderCol>() {
{ {
add(new OrderCol("a.sort", OrderCol.ASCENDING)); add(new OrderCol("a.sort", OrderCol.ASCENDING));
add(new OrderCol("a.createTime", OrderCol.DESCENDING)); add(new OrderCol("a.createTime", OrderCol.DESCENDING));
} }
}); });
}else { } else {
query.getOrderColList().add(new OrderCol("a.createTime", OrderCol.DESCENDING)); query.getOrderColList().add(new OrderCol("a.createTime", OrderCol.DESCENDING));
} }
if(!ObjectUtils.isEmpty(query.getFilter())&& YesNoEnum.YES.getValue()==query.getFilter()){ if (!ObjectUtils.isEmpty(query.getFilter()) && YesNoEnum.YES.getValue() == query.getFilter()) {
//过滤部门事项数据为0的部门 //过滤部门事项数据为0的部门
query.setTotalStart(1); query.setTotalStart(1);
} }
...@@ -121,7 +121,9 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -121,7 +121,9 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
throw new AppException("参数部门ids不能为空!"); throw new AppException("参数部门ids不能为空!");
} }
Rest<Map<String, List<DeptVo>>> rest = this.service.getBusinessByDept(deptQuery, getContext()); Rest<Map<String, List<DeptVo>>> rest = this.service.getBusinessByDept(deptQuery, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
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);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!"); jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
...@@ -147,7 +149,9 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -147,7 +149,9 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
throw new AppException("业务id不能为空!"); throw new AppException("业务id不能为空!");
} }
Rest<Map<String, List<DeptVo>>> rest = this.service.getDeptListByBusiness(deptQuery, getContext()); Rest<Map<String, List<DeptVo>>> rest = this.service.getDeptListByBusiness(deptQuery, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
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);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!"); jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
...@@ -173,7 +177,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -173,7 +177,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
// throw new AppException("部门编码已存在!"); // throw new AppException("部门编码已存在!");
// } // }
if(entity.newEntity()){ if (entity.newEntity()) {
entity.setSource(SourceEnum.自定义.getValue()); entity.setSource(SourceEnum.自定义.getValue());
} }
......
...@@ -63,7 +63,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -63,7 +63,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
*/ */
@Override @Override
protected void doListBefore(MatterEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(MatterEntity query, Map<String, Object> model, Context context) throws AppException {
if(ObjectUtils.isEmpty(query.getEventTypeShowNotList())){ if (ObjectUtils.isEmpty(query.getEventTypeShowNotList())) {
ArrayList<String> notList = new ArrayList<>(); ArrayList<String> notList = new ArrayList<>();
notList.add("行政处罚"); notList.add("行政处罚");
query.setEventTypeShowNotList(notList); query.setEventTypeShowNotList(notList);
...@@ -148,7 +148,9 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -148,7 +148,9 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
jsonObject.put(KEY_RESULT_MSG, rest.getMsg()); jsonObject.put(KEY_RESULT_MSG, rest.getMsg());
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
this.recordSysLog(this.request, rest.getMsg()); this.recordSysLog(this.request, rest.getMsg());
}
} catch (Exception e) { } catch (Exception e) {
log.error("获取异常", e); log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
...@@ -165,7 +167,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -165,7 +167,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询差集" + this.getModuleDesc(); String busiDesc = "查询差集" + this.getModuleDesc();
int code=VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
PageInfo pageInfo = buildPageInfo(query); PageInfo pageInfo = buildPageInfo(query);
Result<MatterEntity> result = this.getService().findSubList(query, pageInfo, context); Result<MatterEntity> result = this.getService().findSubList(query, pageInfo, context);
...@@ -173,7 +175,9 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -173,7 +175,9 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
model.put(PAGEINFO_KEY, result.getPageInfo()); model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo()); parsePageInfo(model, result.getPageInfo());
model.put(MESSAGE_INFO, busiDesc + "成功"); model.put(MESSAGE_INFO, busiDesc + "成功");
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
} catch (Exception e) { } catch (Exception e) {
code = VALUE_RESULT_FAILURE; code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e); this.doException(request, busiDesc, model, e);
......
...@@ -15,6 +15,7 @@ import com.mortals.xhx.module.site.model.SiteBusinessTreeSelect; ...@@ -15,6 +15,7 @@ import com.mortals.xhx.module.site.model.SiteBusinessTreeSelect;
import com.mortals.xhx.module.site.service.SiteBusinessService; import com.mortals.xhx.module.site.service.SiteBusinessService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -119,7 +120,9 @@ public class SiteBusinessController extends BaseCRUDJsonBodyMappingController<Si ...@@ -119,7 +120,9 @@ public class SiteBusinessController extends BaseCRUDJsonBodyMappingController<Si
Result<SiteBusinessEntity> result = this.service.flatList(query, pageInfo, getContext()); Result<SiteBusinessEntity> result = this.service.flatList(query, pageInfo, getContext());
model.put(KEY_RESULT_DATA, result.getList()); model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo()); parsePageInfo(model, result.getPageInfo());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询站点业务列表成功!"); jsonObject.put(KEY_RESULT_MSG, "查询站点业务列表成功!");
......
...@@ -105,7 +105,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -105,7 +105,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
} }
model.put("siteTree", siteTree); model.put("siteTree", siteTree);
this.init(model, getContext()); this.init(model, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} catch (Exception e) { } catch (Exception e) {
...@@ -134,7 +136,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -134,7 +136,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
List<SiteTreeSelect> siteTree = this.service.getSiteTree(context); List<SiteTreeSelect> siteTree = this.service.getSiteTree(context);
model.put("siteTree", siteTree); model.put("siteTree", siteTree);
this.init(model, getContext()); this.init(model, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} catch (Exception e) { } catch (Exception e) {
...@@ -159,7 +163,7 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -159,7 +163,7 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
List<SiteEntity> siteEntities = this.service.find(new SiteQuery().siteName(site.getSiteName())); List<SiteEntity> siteEntities = this.service.find(new SiteQuery().siteName(site.getSiteName()));
if (!ObjectUtils.isEmpty(siteEntities)) { if (!ObjectUtils.isEmpty(siteEntities)) {
site.setAreaCodeList(siteEntities.stream().map(i->i.getAreaCode()).collect(Collectors.toList())); site.setAreaCodeList(siteEntities.stream().map(i -> i.getAreaCode()).collect(Collectors.toList()));
} }
/* if (!ObjectUtils.isEmpty(siteEntity)) { /* if (!ObjectUtils.isEmpty(siteEntity)) {
...@@ -171,15 +175,15 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -171,15 +175,15 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
List<AreaEntity> areaEntities = areaService.find(new AreaQuery().name(site.getAreaName())); List<AreaEntity> areaEntities = areaService.find(new AreaQuery().name(site.getAreaName()));
if (!ObjectUtils.isEmpty(areaEntities)) { if (!ObjectUtils.isEmpty(areaEntities)) {
// site.setAreaCode(areaEntity.getAreaCode()); // site.setAreaCode(areaEntity.getAreaCode());
site.setAreaCodeList(areaEntities.stream().map(i->i.getAreaCode()).collect(Collectors.toList())); site.setAreaCodeList(areaEntities.stream().map(i -> i.getAreaCode()).collect(Collectors.toList()));
} }
} }
if(ObjectUtils.isEmpty(site.getAreaCodeList())){ if (ObjectUtils.isEmpty(site.getAreaCodeList())) {
site.setAreaCodeList(Arrays.asList(site.getAreaCode())); site.setAreaCodeList(Arrays.asList(site.getAreaCode()));
} }
List<SiteEntity> siteEntityList =site.getAreaCodeList().stream().flatMap(areaCode->{ List<SiteEntity> siteEntityList = site.getAreaCodeList().stream().flatMap(areaCode -> {
return this.service.getFlatSitesByAreaCode(areaCode, getContext()).stream(); return this.service.getFlatSitesByAreaCode(areaCode, getContext()).stream();
}).distinct().collect(Collectors.toList()); }).distinct().collect(Collectors.toList());
//List<SiteEntity> siteEntityList = this.service.getFlatSitesByAreaCode(site.getAreaCode(), getContext()); //List<SiteEntity> siteEntityList = this.service.getFlatSitesByAreaCode(site.getAreaCode(), getContext());
...@@ -187,8 +191,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -187,8 +191,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
if (!ObjectUtils.isEmpty(site.getSiteName())) { if (!ObjectUtils.isEmpty(site.getSiteName())) {
siteEntityList = siteEntityList.stream().filter(item -> site.getSiteName().equals(item.getSiteName())).collect(Collectors.toList()); siteEntityList = siteEntityList.stream().filter(item -> site.getSiteName().equals(item.getSiteName())).collect(Collectors.toList());
} }
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, siteEntityList); jsonObject.put(KEY_RESULT_DATA, siteEntityList);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!"); jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!");
...@@ -213,8 +218,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -213,8 +218,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
String siteIds = site.getAreaCodeList().stream().flatMap(areaId -> String siteIds = site.getAreaCodeList().stream().flatMap(areaId ->
this.service.getFlatSitesByAreaCode(areaId, getContext()).stream() this.service.getFlatSitesByAreaCode(areaId, getContext()).stream()
).map(item -> item.getId().toString()).distinct().collect(Collectors.joining(",")); ).map(item -> item.getId().toString()).distinct().collect(Collectors.joining(","));
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, siteIds); jsonObject.put(KEY_RESULT_DATA, siteIds);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!"); jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!");
......
...@@ -7,6 +7,7 @@ import com.mortals.xhx.base.system.param.service.ParamService; ...@@ -7,6 +7,7 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.business.model.BusinessEntity; import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.site.model.*; import com.mortals.xhx.module.site.model.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -71,7 +72,10 @@ public class SiteHallController extends BaseCRUDJsonBodyMappingController<SiteHa ...@@ -71,7 +72,10 @@ public class SiteHallController extends BaseCRUDJsonBodyMappingController<SiteHa
int code = VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
Rest<List<BusinessEntity>> rest = this.service.getBusinessByHall(siteHall, getContext()); Rest<List<BusinessEntity>> rest = this.service.getBusinessByHall(siteHall, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
model.put(KEY_RESULT_DATA, rest.getData()); model.put(KEY_RESULT_DATA, rest.getData());
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -16,6 +16,7 @@ import com.mortals.xhx.module.window.model.WindowEntity; ...@@ -16,6 +16,7 @@ import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.service.WindowBusinessService; import com.mortals.xhx.module.window.service.WindowBusinessService;
import com.mortals.xhx.module.window.service.WindowService; import com.mortals.xhx.module.window.service.WindowService;
import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -66,10 +67,10 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe ...@@ -66,10 +67,10 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
public String addBusinessToSite(@RequestBody Map<String, Object> map) { public String addBusinessToSite(@RequestBody Map<String, Object> map) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String businessIds=(String)map.get("businessIds"); String businessIds = (String) map.get("businessIds");
Long windowId= DataUtil.converObj2Long(map.get("windowId")); Long windowId = DataUtil.converObj2Long(map.get("windowId"));
try { try {
this.service.addBusinessToWindow(businessIds,windowId,getContext()); this.service.addBusinessToWindow(businessIds, windowId, getContext());
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "添加业务到窗口成功!"); jsonObject.put(KEY_RESULT_MSG, "添加业务到窗口成功!");
...@@ -82,7 +83,6 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe ...@@ -82,7 +83,6 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
} }
@PostMapping(value = "subHalllist") @PostMapping(value = "subHalllist")
@UnAuth @UnAuth
public Rest<Object> subHalllist(@RequestBody WindowEntity query) { public Rest<Object> subHalllist(@RequestBody WindowEntity query) {
...@@ -90,7 +90,7 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe ...@@ -90,7 +90,7 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询差集" + this.getModuleDesc(); String busiDesc = "查询差集" + this.getModuleDesc();
int code=VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
PageInfo pageInfo = buildPageInfo(query); PageInfo pageInfo = buildPageInfo(query);
Result<WindowEntity> result = this.getService().findSubHallList(query, pageInfo, context); Result<WindowEntity> result = this.getService().findSubHallList(query, pageInfo, context);
...@@ -98,7 +98,9 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe ...@@ -98,7 +98,9 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
model.put(PAGEINFO_KEY, result.getPageInfo()); model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo()); parsePageInfo(model, result.getPageInfo());
model.put(MESSAGE_INFO, busiDesc + "成功"); model.put(MESSAGE_INFO, busiDesc + "成功");
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
}
} catch (Exception e) { } catch (Exception e) {
code = VALUE_RESULT_FAILURE; code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e); this.doException(request, busiDesc, model, e);
......
...@@ -3,17 +3,7 @@ ...@@ -3,17 +3,7 @@
POST {{baseUrl}}/dept/list POST {{baseUrl}}/dept/list
Content-Type: application/json Content-Type: application/json
{ {"isBkb":1,"siteId":1,"page":"1","size":"10","orderColList":[{"colName":"sort","sortKind":"desc"}]}
"siteId":1,
"page":1,
"size":1,
"orderColList":[
{
"colName":"sort",
"sortKind":"desc"
}
]
}
###部门更新与保存 ###部门更新与保存
......
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