Commit 46c4c573 by 徐高华

Merge branch 'feature/五月需求迭代' of…

Merge branch 'feature/五月需求迭代' of http://git.gicdev.com/haoban3.0/haoban-manage3.0.git into feature/五月需求迭代
parents 515bbb32 4a07de20
......@@ -152,7 +152,17 @@ public class StaffApiServiceImpl implements StaffApiService {
List<String> staffIds = new ArrayList<>();
//查询所属品牌成员id
if(StrUtil.isNotBlank(enterpriseIdParam)){
staffIds = staffClerkRelationService.listAllStaffIdByEnterpriseId(enterpriseIdParam, wxEnterpriseId);
//-1表示查询成员所属商户是无归属的
if ("-1".equals(enterpriseIdParam)){
staffIds = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
relationFlag = 0;
}else {
staffIds = staffClerkRelationService.listAllStaffIdByEnterpriseId(enterpriseIdParam, wxEnterpriseId);
relationFlag = 1;
}
if (CollectionUtils.isEmpty(staffIds)){
return new Page<>();
}
}else {
if (relationFlag != null) {
staffIds = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
......@@ -163,6 +173,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
StaffListBO staffListBO = EntityUtil.changeEntityByJSON(StaffListBO.class, staffListDTO);
staffListBO.setStaffIds(staffIds);
staffListBO.setRelationFlag(relationFlag);
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
Page<StaffDTO> page = PageUtil.changePageHelperToCurrentPage(staffService.pageStaff(staffListBO), StaffDTO.class);
List<StaffDTO> staffDTOList = page.getResult();
......@@ -178,14 +189,18 @@ public class StaffApiServiceImpl implements StaffApiService {
staffDTOList.forEach(one -> {
if(relationIdList.contains(one.getStaffId())){
one.setRelationFlag(1);
//查询导购关联关系表,找到对应的
//查询导购关联关系表,找到对应的商户名称
List<String> enterpriseNameList = new ArrayList<>(8);
relationDTOList.forEach(a->{
if (a.getStaffId().equals(one.getStaffId())){
enterpriseNameList.add(map.get(a.getEnterpriseId()));
for (StaffClerkRelationDTO dto : relationDTOList){
if (dto.getStaffId().equals(one.getStaffId())){
enterpriseNameList.add(map.get(dto.getEnterpriseId()));
}
});
one.setEnterpriseNameList(enterpriseNameList);
}
if (CollUtil.isNotEmpty(enterpriseNameList)){
//对商户名称去重
enterpriseNameList = enterpriseNameList.stream().distinct().collect(Collectors.toList());
one.setEnterpriseNameList(enterpriseNameList);
}
}else {
one.setRelationFlag(0);
}
......
package com.gic.haoban.manage.web.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.common.anno.IgnoreLogin;
import com.gic.haoban.manage.api.dto.TabHaobanAppLogDTO;
import com.gic.haoban.manage.api.service.TabHaobanAppLogApiService;
import com.gic.haoban.manage.web.qo.TabHaobanAppLogQO;
import jdk.nashorn.internal.ir.annotations.Ignore;
import com.gic.log.record.bean.WebErrorLogReport;
import com.gic.log.record.util.LogWebErrorLogReportUtil;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @description:
* @Author: wenhua
......@@ -25,16 +23,14 @@ public class TabHaobanAppLogController {
private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(TabHaobanAppLogController.class);
@Autowired
private TabHaobanAppLogApiService tabHaobanAppLogApiService;
@RequestMapping("/insert_log")
@ResponseBody
@IgnoreLogin
@com.gic.web.common.ano.IgnoreLogin
public RestResponse<Boolean> insertLog(@RequestBody TabHaobanAppLogQO qo) {
public RestResponse<Boolean> insertLog(@RequestBody WebErrorLogReport qo) {
logger.info("插入日志的参数:{}", JSON.toJSONString(qo));
tabHaobanAppLogApiService.insert(JSONObject.parseObject(JSONObject.toJSONString(qo), TabHaobanAppLogDTO.class));
qo.setCreateTime(new Date());
LogWebErrorLogReportUtil.pushWebErrorLogReport(qo);
return RestResponse.successResult();
}
......
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