Commit 9de08755 by jinxin

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

parents 7292619d 46c767a4
......@@ -72,7 +72,7 @@ public class TransferActiveCodeDTO implements Serializable {
log.append("失败明细:");
for (int i=1;i<=this.failedList.size();i++){
Map<String, String> stringMap = this.failedList.get(i - 1);
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+");");
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因错误码:"+stringMap.get("errorCode")+");");
}
//去掉末尾的分号
String substring = log.substring(0, log.toString().length() - 1);
......
......@@ -994,6 +994,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Map<String,String> stringMap = new HashMap<>(8);
stringMap.put("handoverStaffName",handoverStaff.getStaffName());
stringMap.put("takeoverStaffName",takeOverStaff.getStaffName());
stringMap.put("errorCode",String.valueOf(dto.getErrcode()));
failedList.add(stringMap);
}
}
......@@ -1012,6 +1013,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Map<String,String> stringMap = new HashMap<>(8);
stringMap.put("handoverStaffName",handoverStaff.getStaffName());
stringMap.put("takeoverStaffName",takeOverStaff.getStaffName());
stringMap.put("errorCode",listServiceResponse.getCode());
failedList.add(stringMap);
});
result.setFailedList(failedList);
......
......@@ -45,7 +45,7 @@ public class EmojiFilterUtil {
// 到这里铁定包含
StringBuilder buf = null;
int len = source.length();
if (len > 20 && isPhrase) {
if (len > 100 && isPhrase) {
return "*";
}
for (int i = 0; i < len; i++) {
......
......@@ -50,7 +50,7 @@ public class TargetController {
@RequestMapping(value = "valid-target-store")
@ResponseBody
public RestResponse<Integer> validTargetStore(QueryDataStatisticsCommonQO qo) {
List<String> storeIdList = getStoreIdList(qo);
List<String> storeIdList = getStoreIdList(qo, false);
QueryNewDataTargetConfigQDTO param = new QueryNewDataTargetConfigQDTO();
param.setStoreIdList(storeIdList);
param.setEnterpriseId(qo.getEnterpriseId());
......@@ -232,23 +232,78 @@ public class TargetController {
JSONObject jsonObject = new JSONObject();
jsonObject.put("entId", qo.getEnterpriseId());
jsonObject.put("enterpriseId", qo.getEnterpriseId());
jsonObject.put("year", qo.getTime());
jsonObject.put("yearDate", qo.getTime());
jsonObject.put("month", qo.getTime());
if (qo.getTimeType() == 1) {
jsonObject.put("year", qo.getTime());
} else {
jsonObject.put("month", qo.getTime());
}
jsonObject.put("monthDate", qo.getTime());
jsonObject.put("storeId", getStoreIdList(qo).stream().collect(Collectors.joining(",")));
jsonObject.put("storeId", getStoreIdList(qo, true).stream().collect(Collectors.joining(",")));
return jsonObject;
}
private List<String> getStoreIdList(QueryDataStatisticsCommonQO qo) {
private List<String> getStoreIdList(QueryDataStatisticsCommonQO qo, boolean isRelease) {
List<String> storeIdList;
if (StringUtils.isBlank(qo.getStoreId())) {
List<String> storeIdList = storeAuthUtils.queryClerkStoreIds(qo.getClerkId(), qo.getWxEnterpriseId());
return storeIdList;
storeIdList = storeAuthUtils.queryClerkStoreIds(qo.getClerkId(), qo.getWxEnterpriseId());
} else {
List<String> storeIdList = new ArrayList<>();
storeIdList = new ArrayList<>();
storeIdList.add(qo.getStoreId());
}
if (!isRelease) {
return storeIdList;
}
List<String> targetStoreIdList = getReleaseStore(qo, 1);
//交集 (已发布的门店数据统计过滤)
if (CollectionUtils.isEmpty(targetStoreIdList)) {
targetStoreIdList = new ArrayList<>();
targetStoreIdList.add("-123456789");
}
if (CollectionUtils.isEmpty(storeIdList)) {
//全部权限,则给出发布门店数据
return targetStoreIdList;
} else {
storeIdList.retainAll(targetStoreIdList);
if (CollectionUtils.isEmpty(storeIdList)) {
storeIdList.add("-1234567890");
}
}
return storeIdList;
}
public List<String> getReleaseStore(QueryDataStatisticsCommonQO params, Integer releaseFlag) {
List<String> storeIdList = new ArrayList<>();
QueryNewDataTargetConfigQDTO qdto = new QueryNewDataTargetConfigQDTO();
qdto.setEnterpriseId(params.getEnterpriseId());
if (StringUtils.isNotBlank(params.getTime())) {
qdto.setTargetYear(params.getTime().substring(0, 4));
}
qdto.setReleaseFlag(releaseFlag);
BasePageInfo basePageInfo = new BasePageInfo();
basePageInfo.setPageNum(1);
basePageInfo.setPageSize(1000);
ServiceResponse<Page<NewDataTargetConfigDTO>> res = newDataTargetConfigApiService.queryNewDataTargetConfig(qdto, basePageInfo);
Page<NewDataTargetConfigDTO> page = res.getResult();
Integer total = page.getTotalCount();
if (total <= 0) {
return null;
}
List<NewDataTargetConfigDTO> list = page.getResult();
for (NewDataTargetConfigDTO dto : list) {
storeIdList.add(dto.getStoreId());
}
int pageNum = total / 1000 + 1;
if (pageNum > 1) {
for (int i = 2; i < pageNum; i++) {
basePageInfo.setPageNum(i);
res = newDataTargetConfigApiService.queryNewDataTargetConfig(qdto, basePageInfo);
List<NewDataTargetConfigDTO> temp = res.getResult().getResult();
for (NewDataTargetConfigDTO dto : temp) {
storeIdList.add(dto.getStoreId());
}
}
}
return storeIdList;
}
}
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