Commit 0b165c81 by guojx

Merge remote-tracking branch 'origin/feature-canvas' into feature-canvas

parents a1d8d24e fe47fbe7
......@@ -6,6 +6,10 @@ public class CombinedQDTO implements Serializable {
private static final long serialVersionUID = -28454620622119889L;
/**
* 企业id
*/
private String enterpriseId;
/**
* 主图url
*/
private String imageUrl;
......@@ -27,11 +31,16 @@ public class CombinedQDTO implements Serializable {
private String lineTwo;
/**
* 1群发 2朋友圈
* 1群发 2朋友圈 3合成图片
*/
private Integer mediaType;
/**
* 额外参数
*/
private String extend = "";
/**
* 导购id(作标识)
*/
private String clerkId;
......@@ -41,6 +50,14 @@ public class CombinedQDTO implements Serializable {
*/
private String businessId;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getImageUrl() {
return imageUrl;
}
......@@ -89,8 +106,16 @@ public class CombinedQDTO implements Serializable {
this.mediaType = mediaType;
}
public String getExtend() {
return extend;
}
public void setExtend(String extend) {
this.extend = extend;
}
public String getUnionString() {
return this.getImageUrl() + this.getQrCodeUrl() + this.getShowStyle() + this.getLineOne() + this.getLineTwo() + this.getMediaType();
return this.getImageUrl() + this.getQrCodeUrl() + this.getShowStyle() + this.getLineOne() + this.getLineTwo() + this.getMediaType() + this.getExtend();
}
public String getClerkId() {
......
......@@ -39,6 +39,8 @@ public interface WxUserAddLogMapper {
*/
public List<TabWxUserAddLog> listAllForDel(String externalUserid);
TabWxUserAddLog getForTask(@Param("externalUserid") String externalUserid) ;
/**
*
* @Title: selectNewLog
......
......@@ -19,6 +19,7 @@ import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
import com.gic.haoban.manage.service.service.hm.HmLinkService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.gic.haoban.manage.service.service.hm.WxUserAddLogService;
import com.gic.haoban.task.api.service.TelTaskApiService;
import com.gic.member.api.dto.es.MemberDataDTO;
import com.gic.member.tag.api.dto.MemberTagDTO;
import com.gic.member.tag.api.dto.MemberTagItemDTO;
......@@ -49,6 +50,8 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
private MemberTagApiService memberTagApiService;
@Autowired
private HmClerkRelationService hmClerkRelationService;
@Autowired
private TelTaskApiService telTaskApiService;
@Override
public void save(WxUserAddLogQDTO qdto) {
......@@ -158,6 +161,13 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
entity.setFriendStoreId(qdto.getFriendStoreId());
entity.setDelType(qdto.getDelType());
entity.setDelIsSingle(qdto.getDelIsSingle());
if(null != qdto.getAddWay() && qdto.getAddWay().equals(202) && null != entity.getMemberId()) {
TabWxUserAddLog delUser = this.wxUserAddLogMapper.getForTask(externalUserid) ;
if(null != delUser && null != delUser.getStoreId() && delUser.getStoreId().equals(entity.getStoreId())) {
String overClerkId = delUser.getClerkId() ;
this.telTaskApiService.distributeTask(qdto.getEnterpriseId(), overClerkId , Arrays.asList(entity.getMemberId()), entity.getClerkId());
}
}
this.wxUserAddLogMapper.insert(entity);
}catch(Exception e) {
log.info("异常",e);
......
......@@ -8,10 +8,16 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.HttpClient;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.service.util.ApolloUtils;
import com.gic.haoban.manage.api.qdto.combined.CombinedQDTO;
import com.gic.haoban.manage.service.context.combined.ImageCombined;
import com.gic.redis.data.util.RedisUtil;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
......@@ -48,6 +54,8 @@ public class MaterialServiceImpl implements MaterialService {
@Autowired
private WxEnterpriseService wxEnterpriseService ;
@Autowired
private EnterpriseService enterpriseService;
@Autowired
private QywxSuiteApiService qywxSuiteApiService ;
@Autowired
private Config config;
......@@ -375,11 +383,26 @@ public class MaterialServiceImpl implements MaterialService {
arr = imageUrl.split("/");
}
JSONResponse json = null;
Integer mediaType = combinedQDTO.getMediaType();
if (Objects.equals(1,mediaType)) {
json = qywxSuiteApiService.uploadMedia(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), combinedImageData, arr[arr.length - 1], QywxMediaTypeEnum.IMAGE.getCode(), qwDTO.isSelf(), qwDTO.getUrlHost());
}else if (Objects.equals(2,mediaType)) {
json = qywxSuiteApiService.uploadAttachment(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), combinedImageData, arr[arr.length - 1], QywxMediaTypeEnum.IMAGE.getCode(), qwDTO.isSelf(), qwDTO.getUrlHost());
} else if (Objects.equals(3, mediaType)) {
EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(combinedQDTO.getEnterpriseId());
if (enterprise == null) {
return jsonResponse;
}
CloudFileInfo uploadInfo = CloudFileUtil.uploadFile(combinedImageData, "jpg", CloudFileTypeEnum.IMAGE, enterprise.getFactoryCode(), CloudFileBusinessOptEnum.COMMON) ;
String orgFileUrl = uploadInfo.getOrgFileUrl();
if (StringUtils.isBlank(orgFileUrl)) {
return jsonResponse;
}
json = new JSONResponse();
json.setErrorCode(0);
json.setSuccess(true);
json.setResult(orgFileUrl);
}
return json;
} catch (Exception e) {
......
......@@ -253,5 +253,6 @@
<dubbo:reference id="coupCardDistributionService" interface="com.gic.marketing.api.service.CoupCardDistributionService" timeout="30000" retries="0" check="false"/>
<dubbo:reference id="enterpriseWxaLinkService" interface="com.gic.enterprise.api.service.EnterpriseWxaLinkService" timeout="30000" retries="0" check="false"/>
<dubbo:reference id="qywxGroupSendCanvasApiService" interface="com.gic.haoban.task.manage.api.service.QywxGroupSendCanvasApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.haoban.task.api.service.TelTaskApiService" id="telTaskApiService" timeout="10000" retries="0" check="false" />
</beans>
\ No newline at end of file
......@@ -171,6 +171,15 @@
create_time asc
</select>
<select id="getForTask"
resultMap="result-map-tabHaobanWxUserAddLog">
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_user_add_log where
external_userid=#{externalUserid} and status_flag = 2 and add_channel = 4 order by
create_time desc limit 1
</select>
<select id="selectNewLog" resultMap="result-map-tabHaobanWxUserAddLog">
select
<include refid="Base_Column_List"/>
......
......@@ -35,7 +35,8 @@ import java.util.stream.Collectors;
* 导购任务-好办小程序
*/
@Controller
@RequestMapping("clerk/task")
public class ClerkTaskController {
private static Logger logger = LoggerFactory.getLogger(ClerkTaskController.class);
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.column.ContentColumnListDTO;
import com.gic.content.api.dto.material.ContentMaterialDTO;
......@@ -244,6 +245,9 @@ public class ContentMaterialController {
}
ContentMaterialShareQDTO contentMaterialShareQDTO = new ContentMaterialShareQDTO();
BeanUtils.copyProperties(contentMaterialShareQO, contentMaterialShareQDTO);
if(null != contentMaterialShareQO.getMarketingTime()) {
contentMaterialShareQDTO.setMarketingTime(DateUtil.strToDate(contentMaterialShareQO.getMarketingTime(),"yyyy-MM-dd HH:mm:ss"));
}
ServiceResponse<ContentMaterialShareInfoDTO> serviceResponse = contentMaterialShareApiService.shareContentMaterial(contentMaterialShareQDTO);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
......
......@@ -5,6 +5,8 @@ import java.io.Serializable;
public class CombinedQO implements Serializable {
private static final long serialVersionUID = -28454620622119889L;
private String enterpriseId;
private String wxEnterpriseId;
/**
* 主图url
......@@ -40,6 +42,14 @@ public class CombinedQO implements Serializable {
*/
private String businessId;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
......
package com.gic.haoban.manage.web.qo.content;
import java.io.Serializable;
import java.util.Date;
/**
* @Author MUSI
......@@ -57,6 +58,37 @@ public class ContentMaterialShareQO implements Serializable {
*/
private Integer isPreview;
//活动id
private Long canvasId;
// 节点id
private Long nodeId;
// 营销时间(任务创建时间)
private String marketingTime ;
public Long getCanvasId() {
return canvasId;
}
public void setCanvasId(Long canvasId) {
this.canvasId = canvasId;
}
public Long getNodeId() {
return nodeId;
}
public void setNodeId(Long nodeId) {
this.nodeId = nodeId;
}
public String getMarketingTime() {
return marketingTime;
}
public void setMarketingTime(String marketingTime) {
this.marketingTime = marketingTime;
}
public String getEnterpriseId() {
return enterpriseId;
}
......
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