Commit cd6e5442 by jinxin

Merge remote-tracking branch 'origin/developer' into developer

parents 8b9516e3 fc1504ab
......@@ -469,15 +469,20 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping("staff-export")
public HaobanResponse staffExport(HttpServletRequest request, HttpServletResponse response, String departmentId, Integer activeFlag, Integer relationFlag, String keyWord, String permitState,BasePageInfo pageInfo) {
List<String> departmentIdSet = new ArrayList<>();
departmentIdSet.add(departmentId);
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
boolean needDep = true ;
if(StringUtils.isBlank(departmentId)){
needDep = false ;
DepartmentDTO dto = this.departmentApiService.getRootByEnterpriseId(wxEnterpriseId) ;
departmentId = dto.getDepartmentId() ;
}
List<String> departmentIdSet = new ArrayList<>();
departmentIdSet.add(departmentId);
List<DepartmentDTO> relationList = departmentApiService.listSonByDepartmentIds(departmentIdSet, wxEnterpriseId);
Map<String, DepartmentDTO> departmentMap = new HashMap<>();
Map<String, DepartmentDTO> departmentMap = relationList.stream().collect(Collectors.toMap(DepartmentDTO::getDepartmentId, s -> s));
List<String> departmentIds = new ArrayList<>();
if(CollectionUtil.isNotEmpty(relationList)){
departmentMap = relationList.stream().collect(Collectors.toMap(DepartmentDTO::getDepartmentId, s -> s));
if(!needDep) {
departmentIds = relationList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toList());
}
List<StaffDTO> staffAllList = Lists.newArrayListWithCapacity(5000);
......
......@@ -151,9 +151,12 @@ public class TargetController {
@ResponseBody
public RestResponse getTargetAnalysisStoreDetail(QueryDataStatisticsCommonQO qo, PageQo pageQo,
String sortField, String sortType, @RequestParam(defaultValue = "1") Integer type) {
List<String> keyList = TargetAnalysisUtils.map.get(type.toString());
JSONObject jsonObject = getCommon(qo, type <= 3 ? false : true);
if (StringUtils.isNotBlank(sortField)) {
jsonObject.put("orderByField", sortField + " " + sortType);
} else {
jsonObject.put("orderByField", keyList.get(3) + " desc ");
}
Map<String, Object> res = DataTargetHttpUtils.http(DataTargetHttpUtils.getParam(pageQo, jsonObject).toJSONString(),
type <=3 ? (qo.getTimeType() == 1 ? "data_mbr_target_store_detail_year" : "data_mbr_target_store_detail_month") : (qo.getTimeType() == 1 ?
......@@ -166,7 +169,6 @@ public class TargetController {
}
JSONObject totalJson = (JSONObject) totalRes.getResult();
JSONObject total = new JSONObject();
List<String> keyList = TargetAnalysisUtils.map.get(type.toString());
for (String key : keyList) {
total.put(key, totalJson.get(key));
}
......@@ -174,7 +176,7 @@ public class TargetController {
total.put("storeName", "合计");
total.put("storeCode", "合计");
List<JSONObject> dataList = page.getResult();
List<JSONObject> resultList = page.getResult();
List<JSONObject> resultList = new ArrayList<>();
resultList.add(total);
if (CollectionUtils.isNotEmpty(dataList)) {
for (JSONObject obj : dataList) {
......@@ -230,13 +232,11 @@ public class TargetController {
JSONObject jsonObject = new JSONObject();
jsonObject.put("entId", qo.getEnterpriseId());
jsonObject.put("enterpriseId", qo.getEnterpriseId());
if (qo.getTimeType() == 1) {
jsonObject.put("year", qo.getTime());
jsonObject.put("yearDate", qo.getTime());
} else {
jsonObject.put("month", qo.getTime());
jsonObject.put("monthDate", qo.getTime());
}
jsonObject.put("year", qo.getTime());
jsonObject.put("yearDate", qo.getTime());
jsonObject.put("month", qo.getTime());
jsonObject.put("monthDate", qo.getTime());
jsonObject.put("storeId", getStoreIdList(qo).stream().collect(Collectors.joining(",")));
return jsonObject;
}
......
......@@ -131,6 +131,9 @@ public class DataTargetHttpUtils {
head.put("Content-Type", "application/json");
head.put("API-TOKEN", token);
Map<String, Object> res = HttpClient.getWinxinResByJson(url, jsonParam, head);
if (!isSuccess(res)) {
throw new TargetException((String) res.get("errorInfo"));
}
LOGGER.info("调用接口{},返回结果:{}", url, res);
return res;
}
......
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