Commit 1d4d36e0 by songyinghui

Merge branch 'feature-content4' of git.gicdev.com:haoban3.0/haoban-manage3.0 into feature-content4

parents 3ed6a8ab eea31c6b
...@@ -315,4 +315,12 @@ public interface ExternalClerkRelatedApiService { ...@@ -315,4 +315,12 @@ public interface ExternalClerkRelatedApiService {
int getCountExternalClerk(String wxEnterpriseId, String staffId, List<Integer> statusFlags); int getCountExternalClerk(String wxEnterpriseId, String staffId, List<Integer> statusFlags);
int updateExternalStatus(String wxEnterpriseId , String externalUserid,int status) ; int updateExternalStatus(String wxEnterpriseId , String externalUserid,int status) ;
/**
* 根据外部联系人id查询memberId
* @param wxEnterpriseId wx企业id
* @param externalUserId 外部联系人id(不区分自建和第三方)
* @return
*/
com.gic.api.base.commons.ServiceResponse<String> getMemberIdByExternalId(String wxEnterpriseId,String externalUserId);
} }
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface MaterialApiService { public interface MaterialApiService {
boolean hasCategoryNameExsit(String categoryName, String categoryParentId, String categoryId); boolean hasCategoryNameExsit(String categoryName, String categoryParentId, String categoryId,String wxEnterpriseId);
void insertCategory(MaterialCategoryDTO materialCategoryDTO); void insertCategory(MaterialCategoryDTO materialCategoryDTO);
......
package com.gic.haoban.manage.api.service;
import java.util.Map;
/**
* 自建应用api,实现在gic-qywx-self模块
*/
public interface QywxSelfApiService {
Map<String,Object> selfPost(String url, String json, String ip) ;
Map<String,Object> selfGet(String url, String ip) ;
Map<String,Object> selfUpload(String url, String fileUrl, String fileName, String ip) ;
Map<String,Object> selfImage(String url, String fileName, String ip , byte[] data) ;
}
...@@ -188,6 +188,7 @@ public interface StaffMapper { ...@@ -188,6 +188,7 @@ public interface StaffMapper {
*/ */
List<String> queryStaffIdsWithEnterpriseId(@Param("wxEnterpriseIds") List<String> wxEnterpriseIds); List<String> queryStaffIdsWithEnterpriseId(@Param("wxEnterpriseIds") List<String> wxEnterpriseIds);
Integer getNumByActiveCode(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("activeCode")String activeCode); TabHaobanStaff getNumByActiveCode(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("activeCode")String activeCode);
void updateOccupyFlagByStaffId(@Param("staffId") String staffId);
} }
\ No newline at end of file
...@@ -422,4 +422,11 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -422,4 +422,11 @@ public interface TabHaobanExternalClerkRelatedMapper {
List<TabHaobanExternalClerkRelated> getAddTimeByMemberId(@Param("memberId") String memberId, @Param("enterpriseId") String enterpriseId); List<TabHaobanExternalClerkRelated> getAddTimeByMemberId(@Param("memberId") String memberId, @Param("enterpriseId") String enterpriseId);
/**
* 根据外部联系人id查询memberId
* @param wxEnterpriseId
* @param externalUserId
* @return
*/
String getMemberIdByExternalId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserId") String externalUserId);
} }
\ No newline at end of file
...@@ -20,7 +20,9 @@ public interface TabHaobanMaterialCategoryMapper { ...@@ -20,7 +20,9 @@ public interface TabHaobanMaterialCategoryMapper {
int updateByPrimaryKey(TabHaobanMaterialCategory record); int updateByPrimaryKey(TabHaobanMaterialCategory record);
TabHaobanMaterialCategory selectByCategoryNameAndParentId(@Param("categoryName")String categoryName, @Param("categoryParentId")String categoryParentId); TabHaobanMaterialCategory selectByCategoryNameAndParentId(@Param("categoryName")String categoryName,
@Param("categoryParentId")String categoryParentId,
@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanMaterialCategory> listCategory(@Param("wxEnterpriseId")String wxEnterpriseId); List<TabHaobanMaterialCategory> listCategory(@Param("wxEnterpriseId")String wxEnterpriseId);
......
...@@ -57,6 +57,30 @@ public class TabHaobanStaff implements Serializable { ...@@ -57,6 +57,30 @@ public class TabHaobanStaff implements Serializable {
private Date activeTime; private Date activeTime;
private Date expireTime; private Date expireTime;
private String activeCode; private String activeCode;
/**
* 其他占用许可是否自动激活 0否1是
*/
private Integer occupyFlag;
/**
* 成员的删除时间
*/
private Date delTime;
public Date getDelTime() {
return delTime;
}
public void setDelTime(Date delTime) {
this.delTime = delTime;
}
public Integer getOccupyFlag() {
return occupyFlag;
}
public void setOccupyFlag(Integer occupyFlag) {
this.occupyFlag = occupyFlag;
}
public Date getActiveTime() { public Date getActiveTime() {
return activeTime; return activeTime;
......
...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service; ...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO; import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO; import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import org.apache.ibatis.annotations.Param;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
...@@ -114,4 +115,12 @@ public interface ExternalClerkRelatedService { ...@@ -114,4 +115,12 @@ public interface ExternalClerkRelatedService {
void deleteByWxEnterpriseId(String wxEnterpriseId,List<String> enterpriseIdList); void deleteByWxEnterpriseId(String wxEnterpriseId,List<String> enterpriseIdList);
List<TabHaobanExternalClerkRelated> getAddTimeByMemberId(String memberId, String enterpriseId); List<TabHaobanExternalClerkRelated> getAddTimeByMemberId(String memberId, String enterpriseId);
/**
* 根据外部联系人id查询memberId
* @param wxEnterpriseId
* @param externalUserId
* @return
*/
String getMemberIdByExternalId(String wxEnterpriseId,String externalUserId);
} }
...@@ -6,7 +6,7 @@ import com.gic.haoban.manage.api.dto.MaterialCategoryDTO; ...@@ -6,7 +6,7 @@ import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
public interface MaterialCategoryService { public interface MaterialCategoryService {
MaterialCategoryDTO hasCategoryNameExsit(String categoryName, String categoryParentId); MaterialCategoryDTO hasCategoryNameExsit(String categoryName, String categoryParentId,String wxEnterpriseId);
void insert(MaterialCategoryDTO materialCategoryDTO); void insert(MaterialCategoryDTO materialCategoryDTO);
......
...@@ -92,6 +92,8 @@ public interface PreDealService { ...@@ -92,6 +92,8 @@ public interface PreDealService {
*/ */
public int countByTaskId(String taskId, int dataType, int status); public int countByTaskId(String taskId, int dataType, int status);
public int countByTaskId(String taskId);
/** /**
* 获取任务数量 * 获取任务数量
* *
......
...@@ -17,7 +17,7 @@ import com.gic.member.api.dto.info.MemberPersonalInfoDTO; ...@@ -17,7 +17,7 @@ import com.gic.member.api.dto.info.MemberPersonalInfoDTO;
import com.gic.member.api.dto.info.MemberSummaryInfoDTO; import com.gic.member.api.dto.info.MemberSummaryInfoDTO;
import com.gic.member.api.dto.info.qo.QueryMemberInfoDTO; import com.gic.member.api.dto.info.qo.QueryMemberInfoDTO;
import com.gic.member.api.service.MemberOutApiService; import com.gic.member.api.service.MemberOutApiService;
import com.gic.order.api.service.sharding.OrderApiService; import com.gic.order.api.service.member.MemberOrderReadApiService;
import com.gic.orderecommerce.api.constant.OrderChannelEnum; import com.gic.orderecommerce.api.constant.OrderChannelEnum;
import com.gic.orderecommerce.api.dto.MallEorderDTO; import com.gic.orderecommerce.api.dto.MallEorderDTO;
import com.gic.orderecommerce.api.service.EcommerceOrderOutputApiService; import com.gic.orderecommerce.api.service.EcommerceOrderOutputApiService;
...@@ -58,7 +58,7 @@ public class InteractRecordMessageBuilder { ...@@ -58,7 +58,7 @@ public class InteractRecordMessageBuilder {
@Autowired @Autowired
private EcommerceOrderOutputApiService ecommerceOrderOutputApiService; private EcommerceOrderOutputApiService ecommerceOrderOutputApiService;
@Autowired @Autowired
private OrderApiService orderApiService; private MemberOrderReadApiService memberOrderReadApiService;
/** /**
* 计算互动记录的访问次数 * 计算互动记录的访问次数
...@@ -153,8 +153,8 @@ public class InteractRecordMessageBuilder { ...@@ -153,8 +153,8 @@ public class InteractRecordMessageBuilder {
* @return * @return
*/ */
public boolean queryMemberHasOrder(String memberId, String enterpriseId) { public boolean queryMemberHasOrder(String memberId, String enterpriseId) {
Integer countOfSale = orderApiService.getCountOfSale(memberId, enterpriseId); ServiceResponse<Integer> response = memberOrderReadApiService.countByMember(enterpriseId, memberId, null);
if (countOfSale != null && countOfSale > 0) { if (null != response && response.getResult() != null && response.getResult() > 0) {
return true; return true;
} }
for (OrderChannelEnum value : OrderChannelEnum.values()) { for (OrderChannelEnum value : OrderChannelEnum.values()) {
......
package com.gic.haoban.manage.service.service.content.adaptor; package com.gic.haoban.manage.service.service.content.adaptor;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.DataApiUtils;
import com.gic.haoban.manage.api.enums.content.MaterialReportType; import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.service.util.DataTargetHttpUtils; import com.gic.haoban.manage.service.util.DataTargetHttpUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -76,26 +78,23 @@ public class MaterialDataAdaptor { ...@@ -76,26 +78,23 @@ public class MaterialDataAdaptor {
if (MaterialReportType.MONTH.getCode().equals(reportType)) { if (MaterialReportType.MONTH.getCode().equals(reportType)) {
apolloKey = CLERK_MONTH_DATA; apolloKey = CLERK_MONTH_DATA;
} }
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>(); Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams);
if (org.apache.commons.lang3.StringUtils.isNotBlank(clerkId)) { if (org.apache.commons.lang3.StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId); inlineParams.put("clerkId", clerkId);
} }
inlineParams.put("enterpriseId", enterpriseId); inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("bizDate", bizDate); inlineParams.put("bizDate", bizDate);
inlineParams.put("storeId", storeId); inlineParams.put("storeId", storeId);
inlineParams.put("orderByField", "storeId asc"); inlineParams.put("orderByFields", 2);
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), apolloKey); inlineParams.put("orderByType", 1);
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
if (result.get("data") == null) { if (result.get("data") == null) {
return null; return null;
} }
JSONObject jsonObject = DataApiUtils.getPageOne(result);
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class); if (jsonObject.isEmpty()) {
if (CollectionUtils.isEmpty(jsonObjects)) {
return null; return null;
} }
JSONObject jsonObject = jsonObjects.get(0);
int useMatlNum = jsonObject.getIntValue("useMatlNum"); int useMatlNum = jsonObject.getIntValue("useMatlNum");
BigDecimal convSalesAmt = Optional.ofNullable(jsonObject.getBigDecimal("convSalesAmt")).orElse(BigDecimal.ZERO); BigDecimal convSalesAmt = Optional.ofNullable(jsonObject.getBigDecimal("convSalesAmt")).orElse(BigDecimal.ZERO);
String amountUnit = ""; String amountUnit = "";
...@@ -124,27 +123,23 @@ public class MaterialDataAdaptor { ...@@ -124,27 +123,23 @@ public class MaterialDataAdaptor {
if (MaterialReportType.MONTH.getCode().equals(reportType)) { if (MaterialReportType.MONTH.getCode().equals(reportType)) {
apolloKey = AREA_MONTH_DATA; apolloKey = AREA_MONTH_DATA;
} }
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>(); Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams);
if (org.apache.commons.lang3.StringUtils.isNotBlank(clerkId)) { if (org.apache.commons.lang3.StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId); inlineParams.put("clerkId", clerkId);
} }
inlineParams.put("enterpriseId", enterpriseId); inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("bizDate", bizDate); inlineParams.put("bizDate", bizDate);
inlineParams.put("orderByField", "clerkId asc");
if (CollectionUtils.isNotEmpty(storeIds)) { if (CollectionUtils.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ",")); inlineParams.put("storeId", StringUtils.join(storeIds, ","));
} }
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), apolloKey); Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
if (result.get("data") == null) { if (result.get("data") == null) {
return null; return null;
} }
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class); JSONObject jsonObject = DataApiUtils.getPageOne(result);
if (CollectionUtils.isEmpty(jsonObjects)) { if (jsonObject.isEmpty()) {
return null; return null;
} }
JSONObject jsonObject = jsonObjects.get(0);
BigDecimal dayAvgUseMatlNum = jsonObject.getBigDecimal("dayAvgUseMatlNum"); BigDecimal dayAvgUseMatlNum = jsonObject.getBigDecimal("dayAvgUseMatlNum");
BigDecimal convSalesAmt = Optional.ofNullable(jsonObject.getBigDecimal("convSalesAmt")).orElse(BigDecimal.ZERO); BigDecimal convSalesAmt = Optional.ofNullable(jsonObject.getBigDecimal("convSalesAmt")).orElse(BigDecimal.ZERO);
String amountUnit = ""; String amountUnit = "";
......
...@@ -547,4 +547,9 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ ...@@ -547,4 +547,9 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
public List<TabHaobanExternalClerkRelated> getAddTimeByMemberId(String memberId, String enterpriseId) { public List<TabHaobanExternalClerkRelated> getAddTimeByMemberId(String memberId, String enterpriseId) {
return this.mapper.getAddTimeByMemberId(memberId,enterpriseId); return this.mapper.getAddTimeByMemberId(memberId,enterpriseId);
} }
@Override
public String getMemberIdByExternalId(String wxEnterpriseId, String externalUserId) {
return this.mapper.getMemberIdByExternalId(wxEnterpriseId,externalUserId);
}
} }
...@@ -20,8 +20,8 @@ public class MaterialCategoryServiceImpl implements MaterialCategoryService{ ...@@ -20,8 +20,8 @@ public class MaterialCategoryServiceImpl implements MaterialCategoryService{
private TabHaobanMaterialCategoryMapper mapper; private TabHaobanMaterialCategoryMapper mapper;
@Override @Override
public MaterialCategoryDTO hasCategoryNameExsit(String categoryName, String categoryParentId) { public MaterialCategoryDTO hasCategoryNameExsit(String categoryName, String categoryParentId,String wxEnterpriseId) {
return EntityUtil.changeEntityByJSON(MaterialCategoryDTO.class, mapper.selectByCategoryNameAndParentId(categoryName,categoryParentId)); return EntityUtil.changeEntityByJSON(MaterialCategoryDTO.class, mapper.selectByCategoryNameAndParentId(categoryName,categoryParentId,wxEnterpriseId));
} }
@Override @Override
......
...@@ -10,6 +10,7 @@ import com.gic.haoban.manage.api.enums.PreDealTypeEnum; ...@@ -10,6 +10,7 @@ import com.gic.haoban.manage.api.enums.PreDealTypeEnum;
import com.gic.haoban.manage.service.dao.mapper.PreDealLogMapper; import com.gic.haoban.manage.service.dao.mapper.PreDealLogMapper;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog; import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import com.gic.haoban.manage.service.service.PreDealService; import com.gic.haoban.manage.service.service.PreDealService;
import com.gic.redis.data.util.RedisUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -92,8 +93,16 @@ public class PreDealServiceImpl implements PreDealService { ...@@ -92,8 +93,16 @@ public class PreDealServiceImpl implements PreDealService {
@Override @Override
public boolean checkTask(String taskId, int dataType) { public boolean checkTask(String taskId, int dataType) {
int i = preDealLogMapper.checkTask(taskId, dataType, PreDealStatusEnum.pre.getVal()); String key = taskId+"_checkTask"+dataType ;
return i == 0; Object o = null ; //RedisUtil.getCache(key) ;
if(null == o) {
int i = preDealLogMapper.checkTask(taskId, dataType, PreDealStatusEnum.pre.getVal());
boolean flag = (i==0) ;
RedisUtil.setCache(key,flag,60*3l);
return flag ;
}else {
return (boolean) o ;
}
} }
@Override @Override
...@@ -107,6 +116,19 @@ public class PreDealServiceImpl implements PreDealService { ...@@ -107,6 +116,19 @@ public class PreDealServiceImpl implements PreDealService {
} }
@Override @Override
public int countByTaskId(String taskId) {
String key = taskId+"countByTaskId" ;
Object o = null ; //RedisUtil.getCache(key) ;
if(null == o) {
int count = this.preDealLogMapper.countByTaskId(taskId,-1,0) ;
RedisUtil.setCache(key,count,60*3l);
return count ;
}else {
return (int) o ;
}
}
@Override
public int countExcepAndPreByTaskId(String taskId, int dataType) { public int countExcepAndPreByTaskId(String taskId, int dataType) {
return preDealLogMapper.countExcepAndPreByTaskId(taskId, dataType); return preDealLogMapper.countExcepAndPreByTaskId(taskId, dataType);
} }
...@@ -170,14 +192,30 @@ public class PreDealServiceImpl implements PreDealService { ...@@ -170,14 +192,30 @@ public class PreDealServiceImpl implements PreDealService {
@Override @Override
public boolean checkFriendTask(String taskId, int dataType) { public boolean checkFriendTask(String taskId, int dataType) {
int i = preDealLogMapper.checkTaskFriend(taskId, null, dataType); String key = taskId+"_checkFriendTask"+dataType ;
return i == 0; Object o = null ; //RedisUtil.getCache(key) ;
if(null == o) {
int i = preDealLogMapper.checkTaskFriend(taskId, null, dataType);
boolean flag = (i==0) ;
RedisUtil.setCache(key,flag,60*3l);
return flag ;
}else {
return (boolean) o ;
}
} }
@Override @Override
public boolean checkFriendTaskByPDataId(String taskId, String pDataId, int dataType) { public boolean checkFriendTaskByPDataId(String taskId, String pDataId, int dataType) {
int i = preDealLogMapper.checkTaskFriend(taskId, pDataId, dataType); String key = taskId+"_checkFriendTaskByPDataId"+dataType ;
return i == 0; Object o = null ; //RedisUtil.getCache(key) ;
if(null == o) {
int i = preDealLogMapper.checkTaskFriend(taskId, pDataId, dataType);
boolean flag = (i==0) ;
RedisUtil.setCache(key,flag,60*3l);
return flag ;
}else {
return (boolean) o ;
}
} }
@Override @Override
......
...@@ -146,6 +146,10 @@ public class WelcomeSendServiceImpl implements WelcomeSendService { ...@@ -146,6 +146,10 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
&& (state.startsWith(Manage3Constants.HM) || state.startsWith(Manage3Constants.DT))) { && (state.startsWith(Manage3Constants.HM) || state.startsWith(Manage3Constants.DT))) {
WelcomeReferBO welcomeReferBo = getWelcomeReferBo(state); WelcomeReferBO welcomeReferBo = getWelcomeReferBo(state);
welcomeBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, welcomeReferBo); welcomeBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, welcomeReferBo);
//单人活码欢迎语未配置时,取欢迎语的配置进行发送
if(state.startsWith(Manage3Constants.HM) && welcomeBO == null){
welcomeBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId);
}
} else { } else {
welcomeBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId); welcomeBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId);
} }
...@@ -158,7 +162,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService { ...@@ -158,7 +162,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
String content = welcomeBO.getWelcomeContent(); String content = welcomeBO.getWelcomeContent();
if (content.contains("<微信昵称>")) { if (content.contains("<微信昵称>")) {
String nickName = this.getExternalUserName(qwDTO, externalUserId); String nickName = this.getExternalUserName(qwDTO, externalUserId);
//这里对“$”符号和”\\“符号进行转处理 //这里对“$”符号和”\\“符号进行转处理
nickName = java.util.regex.Matcher.quoteReplacement(nickName); nickName = java.util.regex.Matcher.quoteReplacement(nickName);
content = content.replaceAll("<微信昵称>", nickName); content = content.replaceAll("<微信昵称>", nickName);
} }
......
...@@ -459,6 +459,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -459,6 +459,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
return syncCheckDTO; return syncCheckDTO;
} }
TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId); TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId);
/*int status = syncTask.getStatusFlag() ;
if(status != 4) {
int count = this.preDealService.countByTaskId(taskId) ;
if(count <= 0) {
this.syncTaskService.updateTaskStatus(taskId,4) ;
}
}*/
syncCheckDTO.setSyncStatus(syncTask.getStatusFlag()); syncCheckDTO.setSyncStatus(syncTask.getStatusFlag());
PreDealLogInfoDTO dealLogInfoDTO = preDealService.getLastPreDataByTaskId(taskId); PreDealLogInfoDTO dealLogInfoDTO = preDealService.getLastPreDataByTaskId(taskId);
......
...@@ -30,6 +30,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; ...@@ -30,6 +30,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO; import com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO;
import com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo; import com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.WxUserAddLogService; import com.gic.haoban.manage.service.service.hm.WxUserAddLogService;
import com.gic.member.api.dto.MemberDTO; import com.gic.member.api.dto.MemberDTO;
...@@ -94,6 +95,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -94,6 +95,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private MemberService memberService; private MemberService memberService;
@Autowired
private ExternalClerkRelatedService externalClerkRelatedService;
/** /**
* 查询会员在企业下的好友关系 * 查询会员在企业下的好友关系
...@@ -774,4 +777,9 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -774,4 +777,9 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
public int updateExternalStatus(String wxEnterpriseId, String externalUserid,int status) { public int updateExternalStatus(String wxEnterpriseId, String externalUserid,int status) {
return this.tabHaobanExternalClerkRelatedMapper.updateExternalStatus(wxEnterpriseId,externalUserid,status); return this.tabHaobanExternalClerkRelatedMapper.updateExternalStatus(wxEnterpriseId,externalUserid,status);
} }
@Override
public com.gic.api.base.commons.ServiceResponse<String> getMemberIdByExternalId(String wxEnterpriseId, String externalUserId) {
return com.gic.api.base.commons.ServiceResponse.success(externalClerkRelatedService.getMemberIdByExternalId(wxEnterpriseId,externalUserId));
}
} }
...@@ -72,8 +72,8 @@ public class MaterialApiServiceImpl implements MaterialApiService { ...@@ -72,8 +72,8 @@ public class MaterialApiServiceImpl implements MaterialApiService {
private static Logger logger = LoggerFactory.getLogger(MaterialApiServiceImpl.class); private static Logger logger = LoggerFactory.getLogger(MaterialApiServiceImpl.class);
@Override @Override
public boolean hasCategoryNameExsit(String categoryName, String categoryParentId, String categoryId) { public boolean hasCategoryNameExsit(String categoryName, String categoryParentId, String categoryId,String wxEnterpriseId) {
MaterialCategoryDTO category = materialCategoryService.hasCategoryNameExsit(categoryName, categoryParentId); MaterialCategoryDTO category = materialCategoryService.hasCategoryNameExsit(categoryName, categoryParentId,wxEnterpriseId);
if (category != null) { if (category != null) {
if (category.getCategoryId().equals(categoryId)) { if (category.getCategoryId().equals(categoryId)) {
return false; return false;
......
...@@ -705,7 +705,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -705,7 +705,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String clerkId = staffClerkRelationDTO.getClerkId(); String clerkId = staffClerkRelationDTO.getClerkId();
String clerkCode = staffClerkRelationDTO.getClerkCode(); String clerkCode = staffClerkRelationDTO.getClerkCode();
String enterpriseId = staffClerkRelationDTO.getEnterpriseId(); String enterpriseId = staffClerkRelationDTO.getEnterpriseId();
ClerkDTO clerk = clerkService.getClerkByClerkCode(enterpriseId, clerkCode); //统一根据导购id查询
ClerkDTO clerk = clerkService.getClerkByClerkId(clerkId);
log.info("【新增外部联系人】创建member,clerkCode={},unionid:{}", clerkCode, unionId); log.info("【新增外部联系人】创建member,clerkCode={},unionid:{}", clerkCode, unionId);
if (clerk == null) { if (clerk == null) {
log.info("【新增外部联系人】创建member,导购为空返回:{}", clerkCode); log.info("【新增外部联系人】创建member,导购为空返回:{}", clerkCode);
...@@ -1850,14 +1851,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -1850,14 +1851,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.info("好友不同开平:{}", JSONObject.toJSONString(externalUserDTO)); log.info("好友不同开平:{}", JSONObject.toJSONString(externalUserDTO));
return this.saveExternalUser(externalUserDTO); return this.saveExternalUser(externalUserDTO);
} }
String clerkCode = staffClerkRelationDTO.getClerkCode(); //统一根据导购id查询
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), clerkCode); ClerkDTO clerk = clerkService.getClerkByClerkId(clerkId);
if (clerk == null) { if (clerk == null) {
return "导购不存在:" + clerkCode; return "导购不存在:" + clerkId;
} }
String qrcodeParam = clerk.getQrcodeParam(); String qrcodeParam = clerk.getQrcodeParam();
if (StringUtils.isBlank(qrcodeParam)) { if (StringUtils.isBlank(qrcodeParam)) {
log.info("导购码不存在:" + clerkCode); log.info("导购码不存在:" + clerkId);
qrcodeParam = "clerk_clerk_"+clerk.getClerkId() ; qrcodeParam = "clerk_clerk_"+clerk.getClerkId() ;
} }
String memberId = this.getMeberId(enterpriseId, externalUserDTO.getUnionId(), externalUserDTO.getName(), externalUserDTO.getAvatar(), qrcodeParam, externalUserDTO.getExternalUserId(), wxEnterpriseRelated.getWxEnterpriseType(), 1) ; String memberId = this.getMeberId(enterpriseId, externalUserDTO.getUnionId(), externalUserDTO.getName(), externalUserDTO.getAvatar(), qrcodeParam, externalUserDTO.getExternalUserId(), wxEnterpriseRelated.getWxEnterpriseType(), 1) ;
......
...@@ -1183,15 +1183,13 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1183,15 +1183,13 @@ public class StaffApiServiceImpl implements StaffApiService {
return com.gic.api.base.commons.ServiceResponse.failure("-9999","成员userid不存在!"); return com.gic.api.base.commons.ServiceResponse.failure("-9999","成员userid不存在!");
} }
String staffId = staff.getStaffId(); String staffId = staff.getStaffId();
groupChatService.initStaffGroupChat(staffId);
staffMapper.updateActiveStatusById(staffId,timeStampDate,expireTimeDate,activeCode);
StaffActiveDataDTO activeDataDTO = wxEnterpriseActiveDataService.getWxEnterpriseActiveDataByWxEnterpriseId(wxEnterprise.getWxEnterpriseId()); StaffActiveDataDTO activeDataDTO = wxEnterpriseActiveDataService.getWxEnterpriseActiveDataByWxEnterpriseId(wxEnterprise.getWxEnterpriseId());
if (null == activeDataDTO){ if (null == activeDataDTO){
logger.info("查询不到企业微信id->{}的许可账号统计信息!",wxEnterprise.getWxEnterpriseId()); logger.info("查询不到企业微信id->{}的许可账号统计信息!",wxEnterprise.getWxEnterpriseId());
}else { }else {
//需要区分激活码,待转移状态的激活码不需要处理 //需要区分激活码,待转移状态的激活码不需要处理
Integer num = staffMapper.getNumByActiveCode(wxEnterprise.getWxEnterpriseId(), activeCode); TabHaobanStaff haobanStaff = staffMapper.getNumByActiveCode(wxEnterprise.getWxEnterpriseId(), activeCode);
if (num==0){ if (null == haobanStaff){
//已使用的加1,已激活的加1,未激活的减1 //已使用的加1,已激活的加1,未激活的减1
Integer used = activeDataDTO.getUsed(); Integer used = activeDataDTO.getUsed();
Integer inactive = activeDataDTO.getInactive(); Integer inactive = activeDataDTO.getInactive();
...@@ -1205,8 +1203,18 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1205,8 +1203,18 @@ public class StaffApiServiceImpl implements StaffApiService {
activeDataDTO.setInactive(inactive); activeDataDTO.setInactive(inactive);
activeDataDTO.setActivated(activated); activeDataDTO.setActivated(activated);
wxEnterpriseActiveDataService.updateByStaffActiveDataDTO(activeDataDTO); wxEnterpriseActiveDataService.updateByStaffActiveDataDTO(activeDataDTO);
}else {
//判断是否是其它占用的许可被当天激活
Date delTime = haobanStaff.getDelTime();
Date now = new Date();
int days = DateUtil.daysBetween(delTime, now);
if(days == 0){
staffMapper.updateOccupyFlagByStaffId(haobanStaff.getStaffId());
}
} }
} }
staffMapper.updateActiveStatusById(staffId,timeStampDate,expireTimeDate,activeCode);
groupChatService.initStaffGroupChat(staffId);
} }
return com.gic.api.base.commons.ServiceResponse.success(true); return com.gic.api.base.commons.ServiceResponse.success(true);
} }
......
...@@ -231,5 +231,6 @@ ...@@ -231,5 +231,6 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService"
ref="commissionTaskApiService" timeout="10000" /> ref="commissionTaskApiService" timeout="10000" />
<dubbo:reference id="memberOrderReadApiService" interface="com.gic.order.api.service.member.MemberOrderReadApiService" timeout="10000" retries="0" check="false" />
</beans> </beans>
\ No newline at end of file
...@@ -27,14 +27,16 @@ ...@@ -27,14 +27,16 @@
<result column="open_concat_flag" property="openConcatFlag"/> <result column="open_concat_flag" property="openConcatFlag"/>
<result column="active_time" property="activeTime" jdbcType="TIMESTAMP"/> <result column="active_time" property="activeTime" jdbcType="TIMESTAMP"/>
<result column="expire_time" property="expireTime" jdbcType="TIMESTAMP"/> <result column="expire_time" property="expireTime" jdbcType="TIMESTAMP"/>
<result column="del_time" property="delTime" jdbcType="TIMESTAMP"/>
<result column="active_code" property="activeCode" jdbcType="VARCHAR"/> <result column="active_code" property="activeCode" jdbcType="VARCHAR"/>
<result column="occupy_flag" property="occupyFlag" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
staff_id staff_id
, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion, , wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img, active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,open_concat_flag,active_time,expire_time,active_code sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,open_concat_flag,active_time,expire_time,active_code,occupy_flag,del_time
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -323,7 +325,7 @@ ...@@ -323,7 +325,7 @@
<!-- 其他占用 --> <!-- 其他占用 -->
<if test="occupy != null and 1==occupy"> <if test="occupy != null and 1==occupy">
and a.status_flag = 0 and a.del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.status_flag = 0 and a.del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.occupy_flag = 0
</if> </if>
<!-- --> <!-- -->
<if test="occupy != null and 2==occupy"> <if test="occupy != null and 2==occupy">
...@@ -621,7 +623,12 @@ ...@@ -621,7 +623,12 @@
</update> </update>
<select id="getOccupyNum" resultType="java.lang.Integer"> <select id="getOccupyNum" resultType="java.lang.Integer">
SELECT count(*) FROM tab_haoban_staff WHERE status_flag = 0 and del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and wx_enterprise_id = #{wxEnterpriseId} SELECT count(*) FROM tab_haoban_staff
WHERE status_flag = 0
and del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
and expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
and wx_enterprise_id = #{wxEnterpriseId}
and occupy_flag = 0
</select> </select>
<select id="getExpiringNum" resultType="java.lang.Integer"> <select id="getExpiringNum" resultType="java.lang.Integer">
...@@ -646,8 +653,15 @@ ...@@ -646,8 +653,15 @@
#{wxEnterpriseId} #{wxEnterpriseId}
</foreach> </foreach>
</select> </select>
<select id="getNumByActiveCode" resultType="java.lang.Integer"> <select id="getNumByActiveCode" resultMap="BaseResultMap">
SELECT count(*) FROM tab_haoban_staff WHERE wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode} SELECT <include refid="Base_Column_List" /> FROM tab_haoban_staff WHERE wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode} limit 1
</select> </select>
<update id="updateOccupyFlagByStaffId">
update tab_haoban_staff set
occupy_flag = 1,
update_time = now()
where staff_id= #{staffId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -859,4 +859,11 @@ ...@@ -859,4 +859,11 @@
AND enterprise_id = #{enterpriseId} AND enterprise_id = #{enterpriseId}
</select> </select>
<select id="getMemberIdByExternalId" resultType="java.lang.String">
select member_id
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
and (external_user_id = #{externalUserId} or self_external_userid = #{externalUserId}) and status_flag =1
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
where category_name = #{categoryName,jdbcType=VARCHAR} where category_name = #{categoryName,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
and category_parent_id = #{categoryParentId} and category_parent_id = #{categoryParentId}
and wx_enterprise_id = #{wxEnterpriseId}
</select> </select>
<select id="listCategory" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="listCategory" resultMap="BaseResultMap" parameterType="java.lang.String" >
......
...@@ -47,7 +47,7 @@ public class MaterialController extends WebBaseController { ...@@ -47,7 +47,7 @@ public class MaterialController extends WebBaseController {
if (StringUtils.isAnyBlank(categoryParentId, categoryName)) { if (StringUtils.isAnyBlank(categoryParentId, categoryName)) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
boolean flag = materialApiService.hasCategoryNameExsit(categoryName, categoryParentId, null); boolean flag = materialApiService.hasCategoryNameExsit(categoryName, categoryParentId, null,wxEnterpriseId);
if (flag) { if (flag) {
return resultResponse(HaoBanErrCode.ERR_10015); return resultResponse(HaoBanErrCode.ERR_10015);
} }
...@@ -75,6 +75,8 @@ public class MaterialController extends WebBaseController { ...@@ -75,6 +75,8 @@ public class MaterialController extends WebBaseController {
public HaobanResponse categoryEdit(MaterialCategoryDTO materialCategoryDTO) { public HaobanResponse categoryEdit(MaterialCategoryDTO materialCategoryDTO) {
String categoryName = materialCategoryDTO.getCategoryName(); String categoryName = materialCategoryDTO.getCategoryName();
String categoryId = materialCategoryDTO.getCategoryId(); String categoryId = materialCategoryDTO.getCategoryId();
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
if (StringUtils.isAnyBlank(categoryName, categoryId)) { if (StringUtils.isAnyBlank(categoryName, categoryId)) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
...@@ -83,7 +85,7 @@ public class MaterialController extends WebBaseController { ...@@ -83,7 +85,7 @@ public class MaterialController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_10016); return resultResponse(HaoBanErrCode.ERR_10016);
} }
String categoryParentId = dto.getCategoryParentId(); String categoryParentId = dto.getCategoryParentId();
boolean flag = materialApiService.hasCategoryNameExsit(categoryName, categoryParentId, materialCategoryDTO.getCategoryId()); boolean flag = materialApiService.hasCategoryNameExsit(categoryName, categoryParentId, materialCategoryDTO.getCategoryId(),wxEnterpriseId);
if (flag) { if (flag) {
return resultResponse(HaoBanErrCode.ERR_10015); return resultResponse(HaoBanErrCode.ERR_10015);
} }
......
...@@ -9,6 +9,8 @@ import java.util.List; ...@@ -9,6 +9,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.gic.web.common.utils.DataApiUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -46,7 +48,6 @@ import com.gic.haoban.manage.api.service.hm.HmPageApiService; ...@@ -46,7 +48,6 @@ import com.gic.haoban.manage.api.service.hm.HmPageApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService; import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService;
import com.gic.haoban.manage.api.service.out.WelcomeApiService; import com.gic.haoban.manage.api.service.out.WelcomeApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl; import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl;
import com.gic.haoban.manage.web.qo.hm.data.HmLinkChartQO; import com.gic.haoban.manage.web.qo.hm.data.HmLinkChartQO;
import com.gic.haoban.manage.web.qo.hm.data.HmLinkClerkListQO; import com.gic.haoban.manage.web.qo.hm.data.HmLinkClerkListQO;
...@@ -652,13 +653,13 @@ public class HmLinkController { ...@@ -652,13 +653,13 @@ public class HmLinkController {
jsonObject.put("linkType", "1,2"); jsonObject.put("linkType", "1,2");
} }
if (qdto.getStartDate() != null) { if (qdto.getStartDate() != null) {
jsonObject.put("startTime", DateUtil.datetimeToString19(qdto.getStartDate())); jsonObject.put("startDate", DateUtil.datetimeToString19(qdto.getStartDate()));
} }
if (qdto.getEndDate() != null) { if (qdto.getEndDate() != null) {
jsonObject.put("endTime", DateUtil.datetimeToString19(qdto.getEndDate())); jsonObject.put("endDate", DateUtil.datetimeToString19(qdto.getEndDate()));
} }
if (StringUtils.isNotBlank(qdto.getSearchParams())) { if (StringUtils.isNotBlank(qdto.getSearchParams())) {
jsonObject.put("linkSelect", qdto.getSearchParams()); jsonObject.put("vagueQuery", qdto.getSearchParams());
} }
List<String> creatorIdList = CreatorUtils.getCreatorIdList(0); List<String> creatorIdList = CreatorUtils.getCreatorIdList(0);
if (CollectionUtils.isNotEmpty(creatorIdList)) { if (CollectionUtils.isNotEmpty(creatorIdList)) {
...@@ -670,13 +671,28 @@ public class HmLinkController { ...@@ -670,13 +671,28 @@ public class HmLinkController {
if (StringUtils.isBlank(qdto.getSortType())) { if (StringUtils.isBlank(qdto.getSortType())) {
qdto.setSortType("desc"); qdto.setSortType("desc");
} }
jsonObject.put("orderByField", qdto.getSortColumn() + " " + qdto.getSortType()); jsonObject.put("orderByType", DataApiUtils.getOrderByType(qdto.getSortType()));
JSONObject param = DataStatisticsParamUtils.getParam(basePageInfo, jsonObject); Map<String, Integer> orderByFieldMap = new HashMap<String, Integer>(8){{
Page page = DataStatisticsParamUtils put("createTime", 13);
.getPage(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_list, param)); put("addNumT", 6);
if (page == null) { put("addNum", 7);
return RestResponse.successResult(); put("clickTimesT", 8);
} put("clickTimes", 9);
put("clickNumT", 10);
put("clickNum", 11);
}};
jsonObject.put("orderByFields", DataApiUtils.getOrderByFields(qdto.getSortColumn(), "createTime",orderByFieldMap));
// jsonObject.put("orderByField", qdto.getSortColumn() + " " + qdto.getSortType());
jsonObject.put("pageNum", basePageInfo.getPageNum());
jsonObject.put("pageSize", basePageInfo.getPageSize());
// Page page = DataStatisticsParamUtils
// .getPage(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_list, param));
// if (page == null) {
// return RestResponse.successResult();
// }
Map<String, Object> res = DataApiUtils.http(jsonObject.toJSONString(), StatisticsApolloKeyConstant.data_haoban_link_list);
Page page = DataApiUtils.getPageData(res);
Page<HmLinkListVO> retPage = EntityUtil.changeEntityByJSON(Page.class, page); Page<HmLinkListVO> retPage = EntityUtil.changeEntityByJSON(Page.class, page);
if (CollectionUtils.isEmpty(page.getResult())) { if (CollectionUtils.isEmpty(page.getResult())) {
return RestResponse.successResult(retPage); return RestResponse.successResult(retPage);
...@@ -753,9 +769,10 @@ public class HmLinkController { ...@@ -753,9 +769,10 @@ public class HmLinkController {
jsonObject.put("enterpriseId", loginUser.getEnterpriseId()); jsonObject.put("enterpriseId", loginUser.getEnterpriseId());
jsonObject.put("linkId", qo.getLinkId()); jsonObject.put("linkId", qo.getLinkId());
JSONObject param = DataStatisticsParamUtils.getParamNoPage(jsonObject); JSONObject param = DataStatisticsParamUtils.getParamNoPage(jsonObject);
// DataStatisticsParamUtils.responseOne(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_overview, param));
// HmLinkStatisticsVO vo = new HmLinkStatisticsVO(); // HmLinkStatisticsVO vo = new HmLinkStatisticsVO();
return DataStatisticsParamUtils Map<String, Object> res = DataApiUtils.http(jsonObject.toJSONString(), StatisticsApolloKeyConstant.data_haoban_link_overview);
.responseOne(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_overview, param)); return RestResponse.successResult(getDataOne(res));
} }
// 统计图表 // 统计图表
...@@ -773,8 +790,8 @@ public class HmLinkController { ...@@ -773,8 +790,8 @@ public class HmLinkController {
jsonObject.put("enterpriseId", loginUser.getEnterpriseId()); jsonObject.put("enterpriseId", loginUser.getEnterpriseId());
jsonObject.put("linkId", linkId); jsonObject.put("linkId", linkId);
jsonObject.put("startTime", df.format(startTime)); jsonObject.put("startDate", df.format(startTime));
jsonObject.put("endTime", df.format(endTime)); jsonObject.put("endDate", df.format(endTime));
// 日期填充 // 日期填充
List<String> dateList = DateUtils.getDateList(startTimeStr, endTimeStr, null); List<String> dateList = DateUtils.getDateList(startTimeStr, endTimeStr, null);
// 用于链接添加趋势图数据 企业+链接+日期 // 用于链接添加趋势图数据 企业+链接+日期
...@@ -786,12 +803,17 @@ public class HmLinkController { ...@@ -786,12 +803,17 @@ public class HmLinkController {
apolloKey = "data_haoban_link_add_trend_m"; apolloKey = "data_haoban_link_add_trend_m";
clickApolloKey = "data_haoban_link_click_trend_m"; clickApolloKey = "data_haoban_link_click_trend_m";
} }
JSONObject param = DataStatisticsParamUtils.getParamNoPage(jsonObject); // JSONObject param = DataStatisticsParamUtils.getParamNoPage(jsonObject);
StatisticsDTO newDTO = DataHttpUtil.post(apolloKey, param); // StatisticsDTO newDTO = DataHttpUtil.post(apolloKey, param);
Map<String, JSONObject> newMap = getTrendMap(newDTO);
Map<String, Object> res = DataApiUtils.http(jsonObject.toJSONString(), apolloKey);
List<JSONObject> resList = DataApiUtils.getDataList(res);
Map<String, JSONObject> newMap = getTrendMapNew(resList);
// //
StatisticsDTO clickDTO = DataHttpUtil.post(clickApolloKey, param); // StatisticsDTO clickDTO = DataHttpUtil.post(clickApolloKey, param);
Map<String, JSONObject> clickMap = getTrendMap(clickDTO); Map<String, Object> clerkRes = DataApiUtils.http(jsonObject.toJSONString(), clickApolloKey);
List<JSONObject> clerkResList = DataApiUtils.getDataList(clerkRes);
Map<String, JSONObject> clickMap = getTrendMapNew(clerkResList);
List<JSONObject> resultList = new ArrayList<>(); List<JSONObject> resultList = new ArrayList<>();
for (String date : dateList) { for (String date : dateList) {
JSONObject vo = new JSONObject(); JSONObject vo = new JSONObject();
...@@ -820,8 +842,22 @@ public class HmLinkController { ...@@ -820,8 +842,22 @@ public class HmLinkController {
public RestResponse<Object> statisticsClerk(@RequestBody HmLinkClerkListQO qo) { public RestResponse<Object> statisticsClerk(@RequestBody HmLinkClerkListQO qo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
qo.getInFields().setEnterpriseId(loginUser.getEnterpriseId()); qo.getInFields().setEnterpriseId(loginUser.getEnterpriseId());
return DataStatisticsParamUtils
.responsePage(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_detail, qo)); JSONObject paramJson = (JSONObject) JSON.toJSON(qo.getInFields());
DataApiUtils.dealParamJson(paramJson, "linkSelect1", "vagueQueryStore");
DataApiUtils.dealParamJson(paramJson, "linkSelect2", "vagueQueryClerk");
DataApiUtils.dealParamJson(paramJson, "startTime", "startDate");
DataApiUtils.dealParamJson(paramJson, "endTime", "endDate");
Map<String, Integer> orderByFieldMap = new HashMap<String, Integer>(8){{
put("addNumT", 8);
put("addNum", 9);
}};
paramJson.put("orderByType", DataApiUtils.getOrderByType( qo.getInFields().getOrderByField()));
paramJson.put("orderByFields", DataApiUtils.getOrderByFields( qo.getInFields().getOrderByField(),
"addNum", orderByFieldMap));
Map<String, Object> res = DataApiUtils.http(paramJson.toJSONString(), StatisticsApolloKeyConstant.data_haoban_link_detail);
return RestResponse.successResult(DataApiUtils.getPageData(res));
} }
/** /**
...@@ -851,4 +887,19 @@ public class HmLinkController { ...@@ -851,4 +887,19 @@ public class HmLinkController {
return newMap; return newMap;
} }
private static Map<String, JSONObject> getTrendMapNew(List<JSONObject> list) {
Map<String, JSONObject> newMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(list)) {
for (JSONObject temp : list) {
newMap.put(temp.getString("bizDate"), temp);
}
}
return newMap;
}
public static JSONObject getDataOne(Map<String, Object> res) {
List<JSONObject> list = DataApiUtils.getDataList(res);
return CollectionUtils.isNotEmpty(list) ? list.get(0) : null;
}
} }
...@@ -10,6 +10,9 @@ import java.util.Map; ...@@ -10,6 +10,9 @@ import java.util.Map;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.dto.statistics.StatisticsPage;
import com.gic.web.common.utils.DataApiUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -48,7 +51,6 @@ import com.gic.haoban.manage.api.service.hm.HmClerkRelationApiService; ...@@ -48,7 +51,6 @@ import com.gic.haoban.manage.api.service.hm.HmClerkRelationApiService;
import com.gic.haoban.manage.api.service.hm.HmGroupApiService; import com.gic.haoban.manage.api.service.hm.HmGroupApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService; import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.dto.HmOverviewDTO; import com.gic.haoban.manage.web.dto.HmOverviewDTO;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.hm.HmBatchModifyQO; import com.gic.haoban.manage.web.qo.hm.HmBatchModifyQO;
...@@ -57,7 +59,6 @@ import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO; ...@@ -57,7 +59,6 @@ import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO;
import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO; import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO; import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO; import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO;
import com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils;
import com.gic.haoban.manage.web.utils.statistics.DateUtils; import com.gic.haoban.manage.web.utils.statistics.DateUtils;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO; import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO;
import com.gic.haoban.manage.web.vo.hm.HmTrendVO; import com.gic.haoban.manage.web.vo.hm.HmTrendVO;
...@@ -196,8 +197,31 @@ public class HmQrcodeController { ...@@ -196,8 +197,31 @@ public class HmQrcodeController {
hmIds.forEach(c -> stringBuffer.append(c).append(",")); hmIds.forEach(c -> stringBuffer.append(c).append(","));
hmQrcodeListQO.getInFields().setHmId(stringBuffer.toString()); hmQrcodeListQO.getInFields().setHmId(stringBuffer.toString());
} }
StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO); // StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO);
List<HmQrcodeListDTO> data = JSON.parseArray(JSON.toJSONString(statisticsDTO.getData()), HmQrcodeListDTO.class); // List<HmQrcodeListDTO> data = JSON.parseArray(JSON.toJSONString(statisticsDTO.getData()), HmQrcodeListDTO.class);
JSONObject paramJson = (JSONObject) JSON.toJSON(hmQrcodeListQO.getInFields());
paramJson.put("pageNum", hmQrcodeListQO.getPageNo());
paramJson.put("pageSize", hmQrcodeListQO.getPageSize());
DataApiUtils.dealParamJson(paramJson, "startTime", "startDate");
DataApiUtils.dealParamJson(paramJson, "endTime", "endDate");
Map<String, Integer> orderByFieldMap = new HashMap<String, Integer>(8){{
put("createTime", 15);
put("addNumT", 6);
put("addNum", 7);
}};
paramJson.put("orderByType", DataApiUtils.getOrderByType( hmQrcodeListQO.getInFields().getOrderByField()));
paramJson.put("orderByFields", DataApiUtils.getOrderByFields( hmQrcodeListQO.getInFields().getOrderByField(),
"createTime", orderByFieldMap));
Map<String, Object> res = DataApiUtils.http(paramJson.toJSONString(), StatisticsApolloKeyConstant.data_haoban_hm_list);
List<HmQrcodeListDTO> data = DataApiUtils.parsePageDataList(res, HmQrcodeListDTO.class);
Page resPage = DataApiUtils.getPageData(res);
StatisticsDTO statisticsDTO = new StatisticsDTO();
StatisticsPage page = EntityUtil.changeEntityNew(StatisticsPage.class, resPage);
statisticsDTO.setPage(page);
statisticsDTO.setErrorCode(1);
statisticsDTO.setSuccess(true);
if (CollectionUtils.isNotEmpty(data)) { if (CollectionUtils.isNotEmpty(data)) {
for (HmQrcodeListDTO hmQrcodeListDTO : data) { for (HmQrcodeListDTO hmQrcodeListDTO : data) {
List<HmStoreDTO> storeDTOList = new ArrayList<>(); List<HmStoreDTO> storeDTOList = new ArrayList<>();
...@@ -368,18 +392,34 @@ public class HmQrcodeController { ...@@ -368,18 +392,34 @@ public class HmQrcodeController {
Integer type = hmTrendQO.getInFields().getType(); Integer type = hmTrendQO.getInFields().getType();
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
hmTrendQO.getInFields().setEnterpriseId(loginUser.getEnterpriseId()); hmTrendQO.getInFields().setEnterpriseId(loginUser.getEnterpriseId());
StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_overview, hmTrendQO); // StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_overview, hmTrendQO);
HmOverviewDTO hmOverviewDTO = JSON.parseObject(JSON.toJSONString(statisticsDTO.getOne()), HmOverviewDTO.class); // HmOverviewDTO hmOverviewDTO = JSON.parseObject(JSON.toJSONString(statisticsDTO.getOne()), HmOverviewDTO.class);
JSONObject paramJson = (JSONObject) JSON.toJSON(hmTrendQO.getInFields());
Map<String, Object> res = DataApiUtils.http(paramJson.toJSONString(), StatisticsApolloKeyConstant.data_haoban_hm_overview);
List<HmOverviewDTO> resList = DataApiUtils.parseDataList(res, HmOverviewDTO.class);
HmOverviewDTO hmOverviewDTO = CollectionUtils.isEmpty(resList) ? null : resList.get(0);
HmTrendVO hmTrendVO = EntityUtil.changeEntityNew(HmTrendVO.class, hmOverviewDTO); HmTrendVO hmTrendVO = EntityUtil.changeEntityNew(HmTrendVO.class, hmOverviewDTO);
List<Map> list = new ArrayList<>(); List<Map> list = new ArrayList<>();
Map<String, Object> trendRes = null;
DataApiUtils.dealParamJson(paramJson, "startTime", "startDate");
DataApiUtils.dealParamJson(paramJson, "endTime", "endDate");
if (type == 1) { if (type == 1) {
//天 //天
StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_d, hmTrendQO); // StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_d, hmTrendQO);
list = JSON.parseArray(JSON.toJSONString(dto.getData()), Map.class); trendRes = DataApiUtils.http(paramJson.toJSONString(),
StatisticsApolloKeyConstant.data_haoban_hm_trend_d);
} else if (type == 2) { } else if (type == 2) {
//月 //月
StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_m, hmTrendQO); // StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_m, hmTrendQO);
list = JSON.parseArray(JSON.toJSONString(dto.getData()), Map.class); trendRes = DataApiUtils.http(paramJson.toJSONString(),
StatisticsApolloKeyConstant.data_haoban_hm_trend_m);
}
if (trendRes != null) {
list = JSON.parseArray(JSON.toJSONString(DataApiUtils.getDataList(trendRes)), Map.class);
} }
if (hmTrendVO == null) { if (hmTrendVO == null) {
hmTrendVO = new HmTrendVO(); hmTrendVO = new HmTrendVO();
...@@ -456,12 +496,34 @@ public class HmQrcodeController { ...@@ -456,12 +496,34 @@ public class HmQrcodeController {
} }
Integer hmType = hmQrcodeDTO.getHmType(); Integer hmType = hmQrcodeDTO.getHmType();
StatisticsDTO statisticsDTO = null; StatisticsDTO statisticsDTO = null;
JSONObject paramJson = (JSONObject) JSON.toJSON(hmDetailClerkListQO.getInFields());
paramJson.put("pageNum", hmDetailClerkListQO.getPageNo());
paramJson.put("pageSize", hmDetailClerkListQO.getPageSize());
Map<String, Integer> orderByFieldMap = new HashMap<String, Integer>(8){{
put("addNumT", 9);
put("addNum", 10);
}};
DataApiUtils.dealParamJson(paramJson, "storeSelect", "vagueQueryStore");
DataApiUtils.dealParamJson(paramJson, "clerkSelect", "vagueQueryClerk");
DataApiUtils.dealParamJson(paramJson, "startTime", "startDate");
DataApiUtils.dealParamJson(paramJson, "endTime", "endDate");
paramJson.put("orderByType", DataApiUtils.getOrderByType( hmDetailClerkListQO.getInFields().getOrderByField()));
paramJson.put("orderByFields", DataApiUtils.getOrderByFields( hmDetailClerkListQO.getInFields().getOrderByField(),
"addNum", orderByFieldMap));
Map<String, Object> res = null;
Page page = new Page();
if (hmType == 1) { if (hmType == 1) {
statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_single_detail, hmDetailClerkListQO); // statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_single_detail, hmDetailClerkListQO);
res = DataApiUtils.http(paramJson.toJSONString(), StatisticsApolloKeyConstant.data_haoban_hm_single_detail);
page.setResult(DataApiUtils.getDataList(res));
} else if (hmType == 2) { } else if (hmType == 2) {
statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_many_detail, hmDetailClerkListQO); // statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_many_detail, hmDetailClerkListQO);
res = DataApiUtils.http(paramJson.toJSONString(), StatisticsApolloKeyConstant.data_haoban_hm_many_detail);
page = DataApiUtils.getPageData(res);
} }
return DataStatisticsParamUtils.responsePage(statisticsDTO);
return RestResponse.successResult(page);
} }
......
package com.gic.haoban.manage.web.exception; package com.gic.haoban.manage.web.exception;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.ShowFrontMessageException; import com.gic.haoban.base.api.common.ShowFrontMessageException;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.controller.WebBaseController; import com.gic.haoban.manage.web.controller.WebBaseController;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.marketing.api.exception.ErrmsgException;
import com.gic.web.common.exception.DataApiException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException; import org.springframework.validation.BindException;
...@@ -140,4 +143,30 @@ public class GlobalExceptionHandler extends WebBaseController { ...@@ -140,4 +143,30 @@ public class GlobalExceptionHandler extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_4); return resultResponse(HaoBanErrCode.ERR_4);
} }
/**
* valid 异常告警
* @param response
* @param ex
* @return
*/
@ResponseBody
@ExceptionHandler(ErrmsgException.class)
public RestResponse rrrmsgException(HttpServletResponse response, ErrmsgException ex) {
logger.info("exceoprion:{}", ex);
return RestResponse.failure("-1", ex.getMessage());
}
/**
* 数据组API错误
* @param response
* @param ex
* @return
*/
@ResponseBody
@ExceptionHandler(DataApiException.class)
public RestResponse dataApiException(HttpServletResponse response, DataApiException ex) {
logger.info("DataApiException异常信息:{}", ex);
return RestResponse.failure(ex.getCode(), ex.getMessage());
}
} }
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
...@@ -47,6 +48,7 @@ public class MaidianLogController extends WebBaseController { ...@@ -47,6 +48,7 @@ public class MaidianLogController extends WebBaseController {
} }
StoreDTO store = storeService.getStore(maidianLogDTO.getStoreId()); StoreDTO store = storeService.getStore(maidianLogDTO.getStoreId());
if (store != null) { if (store != null) {
//好办无关业务,暂不替换
com.gic.clerk.api.dto.ClerkDTO clerkDTO = clerkService.getClerkByClerkCode(store.getEnterpriseId(), maidianLogDTO.getClerkCode()); com.gic.clerk.api.dto.ClerkDTO clerkDTO = clerkService.getClerkByClerkCode(store.getEnterpriseId(), maidianLogDTO.getClerkCode());
maidianLogDTO.setEnterpriseId(store.getEnterpriseId()); maidianLogDTO.setEnterpriseId(store.getEnterpriseId());
if (clerkDTO != null) { if (clerkDTO != null) {
......
...@@ -114,7 +114,8 @@ public class StoreController extends WebBaseController { ...@@ -114,7 +114,8 @@ public class StoreController extends WebBaseController {
logger.info("非当前商户,直接跳过={},{}", gicEnterpriseId, enterpriseId); logger.info("非当前商户,直接跳过={},{}", gicEnterpriseId, enterpriseId);
continue; continue;
} }
ClerkDTO clerk = clerkService.getClerkByClerkCode(enterpriseId, staffClerkRelationDTO.getClerkCode()); //统一根据导购id查询
ClerkDTO clerk = clerkService.getClerkByClerkId(staffClerkRelationDTO.getClerkId());
if (clerk == null) { if (clerk == null) {
continue; continue;
} }
......
...@@ -234,7 +234,7 @@ public class WxStaffController extends WebBaseController { ...@@ -234,7 +234,7 @@ public class WxStaffController extends WebBaseController {
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId,
enterpriseId, clerkCodeList); enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream() Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
.collect(Collectors.toMap(StaffClerkRelationDTO::getClerkCode, s -> s)); .collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, s -> s));
List<StoreClerkVO> resultList = new ArrayList<>(); List<StoreClerkVO> resultList = new ArrayList<>();
for (ClerkDTO dto : clerkDTOS) { for (ClerkDTO dto : clerkDTOS) {
String clerkCode = dto.getClerkCode(); String clerkCode = dto.getClerkCode();
...@@ -244,7 +244,7 @@ public class WxStaffController extends WebBaseController { ...@@ -244,7 +244,7 @@ public class WxStaffController extends WebBaseController {
vo.setClerkType(dto.getClerkType()); vo.setClerkType(dto.getClerkType());
vo.setClerkImg(dto.getImageUrl()); vo.setClerkImg(dto.getImageUrl());
vo.setClerkName(dto.getClerkName()); vo.setClerkName(dto.getClerkName());
StaffClerkRelationDTO related = bindCodeMap.get(clerkCode); StaffClerkRelationDTO related = bindCodeMap.get(dto.getClerkId());
if (related != null) { if (related != null) {
vo.setStaffId(related.getStaffId()); vo.setStaffId(related.getStaffId());
vo.setBindFlag(1); vo.setBindFlag(1);
...@@ -1099,13 +1099,13 @@ public class WxStaffController extends WebBaseController { ...@@ -1099,13 +1099,13 @@ public class WxStaffController extends WebBaseController {
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId,
enterpriseId, clerkCodeList); enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream() Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
.collect(Collectors.toMap(StaffClerkRelationDTO::getClerkCode, s -> s)); .collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, s -> s));
List<BindClerkVO> bindList = new ArrayList<>(); List<BindClerkVO> bindList = new ArrayList<>();
List<BindClerkVO> unBindList = new ArrayList<>(); List<BindClerkVO> unBindList = new ArrayList<>();
for (ClerkDTO dto : list) { for (ClerkDTO dto : list) {
BindClerkVO vo = EntityUtil.changeEntityNew(BindClerkVO.class, dto); BindClerkVO vo = EntityUtil.changeEntityNew(BindClerkVO.class, dto);
if (bindCodeMap.containsKey(dto.getClerkCode())) { if (bindCodeMap.containsKey(dto.getClerkId())) {
String staffId = bindCodeMap.get(dto.getClerkCode()).getStaffId(); String staffId = bindCodeMap.get(dto.getClerkId()).getStaffId();
StaffDTO staffDTO = staffApiService.selectById(staffId); StaffDTO staffDTO = staffApiService.selectById(staffId);
vo.setStaffId(staffId); vo.setStaffId(staffId);
String phoneNumber = dto.getPhoneNumber(); String phoneNumber = dto.getPhoneNumber();
...@@ -1148,13 +1148,13 @@ public class WxStaffController extends WebBaseController { ...@@ -1148,13 +1148,13 @@ public class WxStaffController extends WebBaseController {
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId,
enterpriseId, clerkCodeList); enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream() Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
.collect(Collectors.toMap(StaffClerkRelationDTO::getClerkCode, s -> s)); .collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, s -> s));
List<BindClerkVO> bindList = new ArrayList<>(); List<BindClerkVO> bindList = new ArrayList<>();
List<BindClerkVO> unBindList = new ArrayList<>(); List<BindClerkVO> unBindList = new ArrayList<>();
for (ClerkDTO dto : list) { for (ClerkDTO dto : list) {
BindClerkVO vo = EntityUtil.changeEntityByJSON(BindClerkVO.class, dto); BindClerkVO vo = EntityUtil.changeEntityByJSON(BindClerkVO.class, dto);
if (bindCodeMap.containsKey(dto.getClerkCode())) { if (bindCodeMap.containsKey(dto.getClerkId())) {
String staffId = bindCodeMap.get(dto.getClerkCode()).getStaffId(); String staffId = bindCodeMap.get(dto.getClerkId()).getStaffId();
StaffDTO staffDTO = staffApiService.selectById(staffId); StaffDTO staffDTO = staffApiService.selectById(staffId);
vo.setStaffId(staffId); vo.setStaffId(staffId);
vo.setNationCode(dto.getNationcode()); vo.setNationCode(dto.getNationcode());
...@@ -1195,8 +1195,8 @@ public class WxStaffController extends WebBaseController { ...@@ -1195,8 +1195,8 @@ public class WxStaffController extends WebBaseController {
staffId); staffId);
String storeId = mainDTO == null ? "" : mainDTO.getStoreId(); String storeId = mainDTO == null ? "" : mainDTO.getStoreId();
for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) { for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) {
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), //统一根据导购id查询
staffClerkRelationDTO.getClerkCode()); ClerkDTO clerk = clerkService.getClerkByClerkId(staffClerkRelationDTO.getClerkId());
if (clerk != null) { if (clerk != null) {
StoreDTO store = storeService.getStore(clerk.getStoreId()); StoreDTO store = storeService.getStore(clerk.getStoreId());
// 主门店标志 // 主门店标志
...@@ -1608,7 +1608,8 @@ public class WxStaffController extends WebBaseController { ...@@ -1608,7 +1608,8 @@ public class WxStaffController extends WebBaseController {
logger.info("非当前商户,直接跳过={},{}", gicEnterpriseId, enterpriseId); logger.info("非当前商户,直接跳过={},{}", gicEnterpriseId, enterpriseId);
continue; continue;
} }
ClerkDTO clerk = clerkService.getClerkByClerkCode(enterpriseId, staffClerkRelationDTO.getClerkCode()); //统一根据导购id查询
ClerkDTO clerk = clerkService.getClerkByClerkId(staffClerkRelationDTO.getClerkId());
if (clerk == null) { if (clerk == null) {
continue; continue;
} }
......
package com.gic.haoban.manage.web.controller.content; package com.gic.haoban.manage.web.controller.content;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Constant; import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
...@@ -15,10 +16,13 @@ import com.gic.content.api.service.ContentMaterialApiService; ...@@ -15,10 +16,13 @@ import com.gic.content.api.service.ContentMaterialApiService;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor; import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor;
import com.gic.haoban.manage.web.qo.content.ContentAuditMaterialQO; import com.gic.haoban.manage.web.qo.content.ContentAuditMaterialQO;
import com.gic.haoban.manage.web.qo.content.ContentMaterialSaveQO; import com.gic.haoban.manage.web.qo.content.ContentMaterialSaveQO;
import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialConvsVO;
import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialDataVO; import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialDataVO;
import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialVO; import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -30,6 +34,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -30,6 +34,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 好办-创作中心 * 好办-创作中心
...@@ -46,6 +52,8 @@ public class ContentCreativeController { ...@@ -46,6 +52,8 @@ public class ContentCreativeController {
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private ClerkStoreAdaptor clerkStoreAdaptor; private ClerkStoreAdaptor clerkStoreAdaptor;
@Autowired
private MaterialDataAdaptor materialDataAdaptor;
/** /**
* 创建素材 * 创建素材
...@@ -120,6 +128,9 @@ public class ContentCreativeController { ...@@ -120,6 +128,9 @@ public class ContentCreativeController {
return RestResponse.failure(response.getCode(), response.getMessage()); return RestResponse.failure(response.getCode(), response.getMessage());
} }
ContentMaterialVO detailVO = EntityUtil.changeEntityByJSON(ContentMaterialVO.class, response.getResult()); ContentMaterialVO detailVO = EntityUtil.changeEntityByJSON(ContentMaterialVO.class, response.getResult());
Map<Long, ContentMaterialConvsVO> map = materialDataAdaptor.queryCreativeConvsMap(enterpriseId, Lists.newArrayList(detailVO.getContentMaterialId()), null);
ContentMaterialConvsVO materialConvsVO = map.get(detailVO.getContentMaterialId());
detailVO.setConvs(materialConvsVO);
return RestResponse.successResult(detailVO); return RestResponse.successResult(detailVO);
} }
...@@ -132,11 +143,36 @@ public class ContentCreativeController { ...@@ -132,11 +143,36 @@ public class ContentCreativeController {
@RequestMapping("/page-material") @RequestMapping("/page-material")
public RestResponse<Page<ContentMaterialVO>> pageAuditMaterial(@RequestBody ContentAuditMaterialQO auditMaterialQO) { public RestResponse<Page<ContentMaterialVO>> pageAuditMaterial(@RequestBody ContentAuditMaterialQO auditMaterialQO) {
ContentMaterialPageQDTO pageQDTO = new ContentMaterialPageQDTO(); ContentMaterialPageQDTO pageQDTO = new ContentMaterialPageQDTO();
pageQDTO.setEnterpriseId(auditMaterialQO.getEnterpriseId()); String enterpriseId = auditMaterialQO.getEnterpriseId();
pageQDTO.setEnterpriseId(enterpriseId);
pageQDTO.setStoreId(auditMaterialQO.getStoreId()); pageQDTO.setStoreId(auditMaterialQO.getStoreId());
pageQDTO.setClerkId(auditMaterialQO.getClerkId()); pageQDTO.setClerkId(auditMaterialQO.getClerkId());
pageQDTO.setQueryScene(MaterialSearchSceneEnum.HAOBAN_AUDIT.value); pageQDTO.setQueryScene(MaterialSearchSceneEnum.HAOBAN_AUDIT.value);
//todo 是否有转化查询 Integer convsFlag = auditMaterialQO.getConvsFlag();
// 分页数据总数(无转化查询取素材分页数据,有转化查询取数据组返回的分页数据)
Integer totalCount = null;
//素材对应转化数据map
Map<Long, ContentMaterialConvsVO> map = null;
//转化数据过滤的素材id列表
List<Long> filterMaterialIdList = null;
boolean convs = convsFlag != null && convsFlag == Constant.FLAG_TRUE;
//是否有转化查询
if (convs) {
ServiceResponse<List<Long>> listIdResponse = contentMaterialApiService.listMaterialIdBySearch(pageQDTO);
if (!listIdResponse.isSuccess() || CollectionUtils.isEmpty(listIdResponse.getResult())) {
return RestResponse.successResult(new Page<>());
}
List<Long> materialIdList = listIdResponse.getResult();
Page<ContentMaterialConvsVO> dataPage = materialDataAdaptor.queryCreativeConvs(enterpriseId, materialIdList, auditMaterialQO.getBasePageInfo());
if (dataPage == null || CollectionUtils.isEmpty(dataPage.getResult())) {
return RestResponse.successResult(new Page<>());
}
List<ContentMaterialConvsVO> result = dataPage.getResult();
map = result.stream().collect(Collectors.toMap(ContentMaterialConvsVO::getContentMaterialId, t -> t));
filterMaterialIdList = result.stream().map(ContentMaterialConvsVO::getContentMaterialId).collect(Collectors.toList());
totalCount = dataPage.getTotalCount();
}
pageQDTO.setContentMaterialIdList(filterMaterialIdList);
ServiceResponse<Page<ContentMaterialDTO>> response = contentMaterialApiService.pageMaterial(pageQDTO, auditMaterialQO.getBasePageInfo()); ServiceResponse<Page<ContentMaterialDTO>> response = contentMaterialApiService.pageMaterial(pageQDTO, auditMaterialQO.getBasePageInfo());
if (!response.isSuccess() || CollectionUtils.isEmpty(response.getResult().getResult())) { if (!response.isSuccess() || CollectionUtils.isEmpty(response.getResult().getResult())) {
return RestResponse.successResult(new Page<>()); return RestResponse.successResult(new Page<>());
...@@ -144,11 +180,28 @@ public class ContentCreativeController { ...@@ -144,11 +180,28 @@ public class ContentCreativeController {
Page<ContentMaterialDTO> page = response.getResult(); Page<ContentMaterialDTO> page = response.getResult();
Page<ContentMaterialVO> result = new Page<>(); Page<ContentMaterialVO> result = new Page<>();
List<ContentMaterialVO> list = EntityUtil.changeEntityListByJSON(ContentMaterialVO.class, response.getResult().getResult()); List<ContentMaterialVO> list = EntityUtil.changeEntityListByJSON(ContentMaterialVO.class, response.getResult().getResult());
result.setTotalCount(page.getTotalCount()); if (totalCount == null) {
totalCount = page.getTotalCount();
}
result.setTotalCount(totalCount);
result.setResult(list); result.setResult(list);
result.setCurrentPage(page.getCurrentPage()); result.setCurrentPage(page.getCurrentPage());
result.setPageSize(page.getPageSize()); result.setPageSize(page.getPageSize());
//todo 转化数据 if (!convs) {
List<Long> materialIdList = list.stream().map(ContentMaterialVO::getContentMaterialId).collect(Collectors.toList());
BasePageInfo pageInfo = new BasePageInfo();
pageInfo.setPageNum(1);
pageInfo.setPageSize(materialIdList.size());
map = materialDataAdaptor.queryCreativeConvsMap(enterpriseId, materialIdList, pageInfo);
}
//列表转化数据
if (CollectionUtils.isNotEmpty(list)) {
for (ContentMaterialVO materialVO : list) {
Long contentMaterialId = materialVO.getContentMaterialId();
ContentMaterialConvsVO materialConvsVO = map.get(contentMaterialId);
materialVO.setConvs(materialConvsVO);
}
}
return RestResponse.successResult(result); return RestResponse.successResult(result);
} }
...@@ -161,7 +214,8 @@ public class ContentCreativeController { ...@@ -161,7 +214,8 @@ public class ContentCreativeController {
@RequestMapping("/material-data") @RequestMapping("/material-data")
public RestResponse<ContentMaterialDataVO> auditMaterialData(@RequestBody ContentAuditMaterialQO auditMaterialQO) { public RestResponse<ContentMaterialDataVO> auditMaterialData(@RequestBody ContentAuditMaterialQO auditMaterialQO) {
ContentMaterialPageQDTO pageQDTO = new ContentMaterialPageQDTO(); ContentMaterialPageQDTO pageQDTO = new ContentMaterialPageQDTO();
pageQDTO.setEnterpriseId(auditMaterialQO.getEnterpriseId()); String enterpriseId = auditMaterialQO.getEnterpriseId();
pageQDTO.setEnterpriseId(enterpriseId);
pageQDTO.setStoreId(auditMaterialQO.getStoreId()); pageQDTO.setStoreId(auditMaterialQO.getStoreId());
pageQDTO.setClerkId(auditMaterialQO.getClerkId()); pageQDTO.setClerkId(auditMaterialQO.getClerkId());
pageQDTO.setQueryScene(MaterialSearchSceneEnum.HAOBAN_AUDIT.value); pageQDTO.setQueryScene(MaterialSearchSceneEnum.HAOBAN_AUDIT.value);
...@@ -174,7 +228,13 @@ public class ContentCreativeController { ...@@ -174,7 +228,13 @@ public class ContentCreativeController {
ContentMaterialDataVO materialDataVO = new ContentMaterialDataVO(); ContentMaterialDataVO materialDataVO = new ContentMaterialDataVO();
materialDataVO.setAuditCount(auditResponse.getResult()); materialDataVO.setAuditCount(auditResponse.getResult());
materialDataVO.setCreateCount(response.getResult()); materialDataVO.setCreateCount(response.getResult());
//todo 转化数据 //转化数据
ServiceResponse<List<Long>> idListResponse = contentMaterialApiService.listMaterialIdBySearch(pageQDTO);
if (!idListResponse.isSuccess()) {
return RestResponse.failure("-1", "请求失败");
}
ContentMaterialConvsVO materialConvsVO = materialDataAdaptor.queryCreativeConvsOverview(enterpriseId, idListResponse.getResult());
materialDataVO.setConvs(materialConvsVO);
return RestResponse.successResult(materialDataVO); return RestResponse.successResult(materialDataVO);
} }
......
...@@ -7,19 +7,16 @@ import com.gic.api.base.commons.ServiceResponse; ...@@ -7,19 +7,16 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.column.ContentColumnListDTO; import com.gic.content.api.dto.column.ContentColumnListDTO;
import com.gic.content.api.dto.material.ContentMaterialDTO; import com.gic.content.api.dto.material.ContentMaterialDTO;
import com.gic.content.api.dto.material.ContentMaterialFrontDTO;
import com.gic.content.api.dto.material.ContentMaterialShareInfoDTO; import com.gic.content.api.dto.material.ContentMaterialShareInfoDTO;
import com.gic.content.api.enums.ColumnEnum; import com.gic.content.api.enums.ColumnEnum;
import com.gic.content.api.enums.MaterialSearchSceneEnum; import com.gic.content.api.enums.MaterialSearchSceneEnum;
import com.gic.content.api.qdto.column.ContentColumnClerkQDTO; import com.gic.content.api.qdto.column.ContentColumnClerkQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageQDTO; import com.gic.content.api.qdto.material.ContentMaterialPageQDTO;
import com.gic.content.api.qdto.material.ContentMaterialShareQDTO; import com.gic.content.api.qdto.material.ContentMaterialShareQDTO;
import com.gic.content.api.service.ContentColumnApiService; import com.gic.content.api.service.ContentColumnApiService;
import com.gic.content.api.service.ContentMaterialApiService; import com.gic.content.api.service.ContentMaterialApiService;
import com.gic.content.api.service.ContentMaterialShareApiService; import com.gic.content.api.service.ContentMaterialShareApiService;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.web.controller.commission.CommissionManager; import com.gic.haoban.manage.web.controller.commission.CommissionManager;
import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor; import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor; import com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor;
...@@ -43,11 +40,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -43,11 +40,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
......
...@@ -17,9 +17,7 @@ import com.gic.haoban.manage.api.enums.content.MaterialReportType; ...@@ -17,9 +17,7 @@ import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor; import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor; import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor;
import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO; import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO; import com.gic.haoban.manage.web.qo.content.statistics.*;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStatisticsBaseQO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO; import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO; import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO; import com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO;
...@@ -171,8 +169,7 @@ public class MaterialDataStaticsController { ...@@ -171,8 +169,7 @@ public class MaterialDataStaticsController {
} else { } else {
storeIds.add(materialStatisticsBaseQO.getStoreId()); storeIds.add(materialStatisticsBaseQO.getStoreId());
} }
Page<MaterialClerkUsedDataVO> clerkUsedData = materialDataAdaptor.queryMaterialClerkUsedData(materialStatisticsBaseQO.getEnterpriseId(), storeIds, Page<MaterialClerkUsedDataVO> clerkUsedData = materialDataAdaptor.queryMaterialClerkUsedData(materialStatisticsBaseQO,storeIds);
materialStatisticsBaseQO.getFixedDateDiff(), materialStatisticsBaseQO.getOrderByField(), materialStatisticsBaseQO.getOrder(), materialStatisticsBaseQO.getPageNum(), materialStatisticsBaseQO.getPageSize());
return RestResponse.successResult(clerkUsedData); return RestResponse.successResult(clerkUsedData);
} }
...@@ -182,15 +179,14 @@ public class MaterialDataStaticsController { ...@@ -182,15 +179,14 @@ public class MaterialDataStaticsController {
* @return * @return
*/ */
@RequestMapping(path = "/content/material/store/data") @RequestMapping(path = "/content/material/store/data")
public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUsedData(@RequestBody MaterialAnalyzeDataQO materialStatisticsBaseQO) { public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUsedData(@RequestBody MaterialStoreAnalyzeDataQO materialStatisticsBaseQO) {
List<String> storeIds = new ArrayList<>(); List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) { if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId()); storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId());
} else { } else {
storeIds.add(materialStatisticsBaseQO.getStoreId()); storeIds.add(materialStatisticsBaseQO.getStoreId());
} }
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO.getEnterpriseId(), storeIds, Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO,storeIds);
materialStatisticsBaseQO.getFixedDateDiff(), materialStatisticsBaseQO.getOrderByField(), materialStatisticsBaseQO.getOrder(), materialStatisticsBaseQO.getPageNum(), materialStatisticsBaseQO.getPageSize());
if (CollectionUtils.isNotEmpty(storeUsedData.getResult())) { if (CollectionUtils.isNotEmpty(storeUsedData.getResult())) {
List<String> tempStoreIds = storeUsedData.getResult() List<String> tempStoreIds = storeUsedData.getResult()
.stream() .stream()
...@@ -273,7 +269,7 @@ public class MaterialDataStaticsController { ...@@ -273,7 +269,7 @@ public class MaterialDataStaticsController {
* @return * @return
*/ */
@RequestMapping(path = "/content/material/store/used/data") @RequestMapping(path = "/content/material/store/used/data")
public RestResponse<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(@RequestBody MaterialReportQO materialReportQO) { public RestResponse<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(@RequestBody MaterialStoreReportQO materialReportQO) {
List<String> storeIds = new ArrayList<>(); List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) { if (StringUtils.isBlank(materialReportQO.getStoreId())) {
...@@ -391,7 +387,7 @@ public class MaterialDataStaticsController { ...@@ -391,7 +387,7 @@ public class MaterialDataStaticsController {
* @return * @return
*/ */
@RequestMapping(path = "/content/material/store/used/data/list") @RequestMapping(path = "/content/material/store/used/data/list")
public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUseReportList(@RequestBody MaterialReportQO materialReportQO) { public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUseReportList(@RequestBody MaterialStoreReportQO materialReportQO) {
List<String> storeIds = new ArrayList<>(); List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) { if (StringUtils.isBlank(materialReportQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId()); storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId());
......
...@@ -254,6 +254,10 @@ public class GicOrderController { ...@@ -254,6 +254,10 @@ public class GicOrderController {
if(!(orderDetailVO.getOrderStep().equals("2") || orderDetailVO.getOrderStep().equals("4"))) { if(!(orderDetailVO.getOrderStep().equals("2") || orderDetailVO.getOrderStep().equals("4"))) {
return RestResponse.failure("9999", "核销订单不存在"); return RestResponse.failure("9999", "核销订单不存在");
} }
Date pickOverTime = detail.getOrderInfo().getPickUpOverTime() ;
if(null != pickOverTime && pickOverTime.before(new Date())) {
return RestResponse.failure("9999", "此订单自提时间已截止");
}
return RestResponse.successResult(orderDetailVO); return RestResponse.successResult(orderDetailVO);
} else { } else {
return RestResponse.failure("9999", ret.getMessage()); return RestResponse.failure("9999", ret.getMessage());
......
package com.gic.haoban.manage.web.exception; package com.gic.haoban.manage.web.exception;
import com.gic.commons.exception.DataApiException;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.ShowFrontMessageException; import com.gic.haoban.base.api.common.ShowFrontMessageException;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
...@@ -133,4 +134,17 @@ public class GlobalExceptionHandler extends WebBaseController { ...@@ -133,4 +134,17 @@ public class GlobalExceptionHandler extends WebBaseController {
public HaobanResponse controllerNoLoginException(HttpServletResponse response, NoLoginException ex) { public HaobanResponse controllerNoLoginException(HttpServletResponse response, NoLoginException ex) {
return resultResponse(HaoBanErrCode.ERR_4); return resultResponse(HaoBanErrCode.ERR_4);
} }
/**
* 数据组API错误
* @param response
* @param ex
* @return
*/
@ResponseBody
@ExceptionHandler(DataApiException.class)
public HaobanResponse dataApiException(HttpServletResponse response, DataApiException ex) {
logger.info("DataApiException异常信息", ex);
return resultResponse(HaoBanErrCode.ERR_3);
}
} }
...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.web.qo.content.statistics; ...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data; import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/** /**
* @Author MUSI * @Author MUSI
* @Date 2023/3/23 1:00 PM * @Date 2023/3/23 1:00 PM
...@@ -30,4 +33,17 @@ public class MaterialAnalyzeDataQO extends MaterialStatisticsBaseQO { ...@@ -30,4 +33,17 @@ public class MaterialAnalyzeDataQO extends MaterialStatisticsBaseQO {
* desc * desc
*/ */
private String order; private String order;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("useMatlDayNum", 11);
map.put("useMatlNum", 12);
map.put("singleMatlAvgCnt", 13);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
} }
...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.web.qo.content.statistics; ...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data; import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/** /**
* @Author MUSI * @Author MUSI
* @Date 2023/3/23 12:48 PM * @Date 2023/3/23 12:48 PM
...@@ -38,4 +41,24 @@ public class MaterialReportQO extends MaterialStatisticsBaseQO { ...@@ -38,4 +41,24 @@ public class MaterialReportQO extends MaterialStatisticsBaseQO {
* 业务周期 * 业务周期
*/ */
private String bizDate; private String bizDate;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("useMatlNum", 5);
map.put("useMatlNumRank", 6);
map.put("useMatlNumRatio", 7);
map.put("userClickNum", 8);
map.put("userClickNumRatio", 9);
map.put("convUserNum", 10);
map.put("convUserNumRatio", 11);
map.put("convSalesAmt", 12);
map.put("convSalesAmtRank", 13);
map.put("convSalesAmtRatio", 14);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
} }
package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author MUSI
* @Date 2023/3/23 1:00 PM
* @Description
* @Version
**/
@Data
public class MaterialStoreAnalyzeDataQO extends MaterialStatisticsBaseQO {
private static final long serialVersionUID = 3422937373665522931L;
/**
* 时间筛选
* 1 过去7天(默认选中),2 过去30天,3 过去60天,4 过去90天,5本周,6 本月,7 上月,8 上上月,9 上上上月
*/
private Integer fixedDateDiff;
/**
* 排序字段
* 日均使用导购占比
* 转化客户数
*/
private String orderByField;
/**
* asc
* desc
*/
private String order;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("dayAvgUseMatlNum", 5);
map.put("dayAvgUseRate", 6);
map.put("clickUserNum", 7);
map.put("convUserNum", 8);
map.put("convSalesNmt", 9);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
}
package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author MUSI
* @Date 2023/3/23 12:48 PM
* @Description
* @Version
* 素材
**/
@Data
public class MaterialStoreReportQO extends MaterialStatisticsBaseQO {
private static final long serialVersionUID = -4105397589798480404L;
/**
* 数据类型
* 1 周报; 2 月报
* @see com.gic.haoban.manage.api.enums.content.MaterialReportType
*/
private Integer reportType;
/**
* 排序字段
* 日均使用导购占比
* 转化客户数
*/
private String orderByField;
/**
* asc
* desc
*/
private String order;
/**
* 业务周期
*/
private String bizDate;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("dayAvgUseMatlNum", 4);
map.put("dayAvgUseMatlNumRatio", 5);
map.put("dayAvgUseBindProportion", 6);
map.put("dayAvgUseBindProportionRatio", 7);
map.put("userClickNum", 8);
map.put("userClickNumRatio", 9);
map.put("convUserNum", 10);
map.put("convUserNumRatio", 11);
map.put("convSalesAmt", 12);
map.put("convSalesAmtRank", 13);
map.put("convSalesAmtRatio", 14);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
}
...@@ -5,14 +5,27 @@ import java.io.Serializable; ...@@ -5,14 +5,27 @@ import java.io.Serializable;
public class ContentMaterialConvsVO implements Serializable { public class ContentMaterialConvsVO implements Serializable {
/** /**
* 素材id
*/
private Long contentMaterialId;
/**
* 转化人数 * 转化人数
*/ */
private Integer convsNum; private Integer convsNum = 0;
/** /**
* 转化金额 * 转化金额
*/ */
private Double convsAmt; private Double convsAmt = 0.0;
public Long getContentMaterialId() {
return contentMaterialId;
}
public void setContentMaterialId(Long contentMaterialId) {
this.contentMaterialId = contentMaterialId;
}
public Integer getConvsNum() { public Integer getConvsNum() {
return convsNum; return convsNum;
...@@ -29,4 +42,14 @@ public class ContentMaterialConvsVO implements Serializable { ...@@ -29,4 +42,14 @@ public class ContentMaterialConvsVO implements Serializable {
public void setConvsAmt(Double convsAmt) { public void setConvsAmt(Double convsAmt) {
this.convsAmt = convsAmt; this.convsAmt = convsAmt;
} }
public void setConvs(ContentMaterialConvsVO convs) {
if (convs == null) {
this.setConvsNum(0);
this.setConvsAmt(0.0);
return;
}
this.setConvsNum(convs.getConvsNum());
this.setConvsAmt(convs.getConvsAmt());
}
} }
...@@ -3,7 +3,7 @@ package com.gic.haoban.manage.web.vo.content.creative; ...@@ -3,7 +3,7 @@ package com.gic.haoban.manage.web.vo.content.creative;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class ContentMaterialDataVO implements Serializable { public class ContentMaterialDataVO extends ContentMaterialConvsVO implements Serializable {
/** /**
* 创建数 * 创建数
...@@ -15,16 +15,6 @@ public class ContentMaterialDataVO implements Serializable { ...@@ -15,16 +15,6 @@ public class ContentMaterialDataVO implements Serializable {
*/ */
private Long auditCount; private Long auditCount;
/**
* 转化人数
*/
private Integer convsNum;
/**
* 转化金额
*/
private Double convsAmt;
public Long getCreateCount() { public Long getCreateCount() {
return createCount; return createCount;
} }
...@@ -41,19 +31,4 @@ public class ContentMaterialDataVO implements Serializable { ...@@ -41,19 +31,4 @@ public class ContentMaterialDataVO implements Serializable {
this.auditCount = auditCount; this.auditCount = auditCount;
} }
public Integer getConvsNum() {
return convsNum;
}
public void setConvsNum(Integer convsNum) {
this.convsNum = convsNum;
}
public Double getConvsAmt() {
return convsAmt;
}
public void setConvsAmt(Double convsAmt) {
this.convsAmt = convsAmt;
}
} }
...@@ -7,7 +7,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -7,7 +7,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
public class ContentMaterialVO { public class ContentMaterialVO extends ContentMaterialConvsVO{
/** /**
* 素材id * 素材id
*/ */
...@@ -111,16 +111,6 @@ public class ContentMaterialVO { ...@@ -111,16 +111,6 @@ public class ContentMaterialVO {
*/ */
private ContentAuditorVO auditor; private ContentAuditorVO auditor;
/**
* 转化人数
*/
private Integer convsNum;
/**
* 转化金额
*/
private Double convsAmt;
public Long getContentMaterialId() { public Long getContentMaterialId() {
return contentMaterialId; return contentMaterialId;
} }
...@@ -305,20 +295,5 @@ public class ContentMaterialVO { ...@@ -305,20 +295,5 @@ public class ContentMaterialVO {
this.auditor = auditor; this.auditor = auditor;
} }
public Integer getConvsNum() {
return convsNum;
}
public void setConvsNum(Integer convsNum) {
this.convsNum = convsNum;
}
public Double getConvsAmt() {
return convsAmt;
}
public void setConvsAmt(Double convsAmt) {
this.convsAmt = convsAmt;
}
} }
...@@ -151,12 +151,47 @@ public class OrderRefundDetailVO implements Serializable { ...@@ -151,12 +151,47 @@ public class OrderRefundDetailVO implements Serializable {
private Integer usePoint ; private Integer usePoint ;
private Integer goodsType; private Integer goodsType;
private String goodsReferId ; private String goodsReferId ;
/**
* 运费金额
*/
private double refundFreightPrice;
/** /**
* 订单卡券状态(新增) * 订单卡券状态(新增)
*/ */
private OrderCouponDetailDTO orderCouponDetail; private OrderCouponDetailDTO orderCouponDetail;
/**
* 退的储值类型 800 储值卡 900 礼品卡
*/
private String refundStoredType;
/**
* 退的储值金额
*/
private Double refundStoredValue;
public double getRefundFreightPrice() {
return refundFreightPrice;
}
public void setRefundFreightPrice(double refundFreightPrice) {
this.refundFreightPrice = refundFreightPrice;
}
public String getRefundStoredType() {
return refundStoredType;
}
public Double getRefundStoredValue() {
return refundStoredValue;
}
public void setRefundStoredType(String refundStoredType) {
this.refundStoredType = refundStoredType;
}
public void setRefundStoredValue(Double refundStoredValue) {
this.refundStoredValue = refundStoredValue;
}
public Integer getUsePoint() { public Integer getUsePoint() {
return usePoint; return usePoint;
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<dubbo:reference interface="com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService" <dubbo:reference interface="com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService"
id="staffMemberRelationApiService"/> id="staffMemberRelationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MaterialApiService" id="materialApiService" /> <dubbo:reference interface="com.gic.haoban.manage.api.service.MaterialApiService" id="materialApiService" timeout="20000"/>
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseService" id="enterpriseService"/> <dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseService" id="enterpriseService"/>
......
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