Commit 5b0ca954 by 王祖波

Merge branch 'feature-content4-2' into test_branch

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
parents a89f671f f10113be
......@@ -4,6 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import java.util.List;
......@@ -64,4 +65,19 @@ public interface MessageApiService {
ServiceResponse<Void> sendOrderMessage(String enterpriseId, NoticeMessageTypeEnum noticeType, String relationId,
String refundStoreId , String clerkId, String memberId, List<String> valueList);
/**
* 通过通讯录-鸿星尔克
* @param wxEnterpriseId
* @param staffName
* @param qwDTO
* @param qwUserId
* @param mainDeptId
* @param position
* @param gender
* @param mobile
* @param nationcode
*/
public void updateForSyncStaff(String wxEnterpriseId, String staffName , WxEnterpriseQwDTO qwDTO , String qwUserId , String mainDeptId , String position ,
Integer gender, String mobile , String nationcode) ;
}
......@@ -111,7 +111,7 @@ public class InteractRecordBuilder {
List<String> visitGoodsIds = extendInfo.getGoodsIds();
if (CollectionUtils.isEmpty(visitGoodsIds)) {
log.info("组装浏览商品信息, 商品信息不存在 {}", interactRecord.getExtendInfo());
return null;
return extendInfo;
}
// 拼接商品信息
List<InteractRecordExtendInfoBO.ExtendGoodsInfo> extendGoodsInfos =
......
......@@ -545,6 +545,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
return "没有数据同步或权限没设置全部";
}
logger.info("企微部门数={}",list.size());
syncTaskService.updateTaskStatus(taskId, SyncTaskStatusEnum.group_sync.getVal());
List<TabHaobanPreDealLog> dealLogList = list.stream().map(dto -> {
TabHaobanPreDealLog dealLog = new TabHaobanPreDealLog();
dealLog.setDataId(dto.getId().toString());
......@@ -915,6 +916,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
return false;
}
if(type==0) {
this.syncTaskService.updateTaskStatus(taskId,4) ;
logger.info("部门成功,开始同步成员:{}", taskId);
String key = "haoban_sync_department_task_" + taskId;
RedisUtil.lock(key, 3L);
......
......@@ -214,9 +214,9 @@ public class MessageApiServiceImpl implements MessageApiService {
// 鸿星尔克
"e034e2bd5d0b44d3bf553c9f8204094c",
// 润臣测试环境
"ca66a01b79474c40b3e7c7f93daf1a3b",
"b18ffdc9d0644912865a248859914d80",
// 尊兴
"c0c2186a947440aa8c0afbdd869ec043",
"fb40256db41142a196b21ccf03e58507",
// 金华悦行
"ac451a350eed4a96958dd5c7377f8bd9");
return wxSet.contains(wxEnterpriseId);
......@@ -230,11 +230,12 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param secret
*/
private void dealClerkUser(QywxCallBackDTO dto, String enterpriseId, String secret, String staffName , WxEnterpriseQwDTO qwDTO) {
log.info("鸿星尔克={}",JSONObject.toJSONString(dto));
ClerkQwDTO clerkQwDTO = new ClerkQwDTO();
clerkQwDTO.setEnterpriseId(enterpriseId);
String mainDeptId = dto.getMainDepartment();
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> departments = qywxDepartmentApiService
.listSelfDepartment(dto.getAuthCorpId(), secret, Integer.valueOf(mainDeptId),qwDTO.getUrlHost());
.listSelfDepartment(qwDTO.getDkCorpid(), secret, Integer.valueOf(mainDeptId),qwDTO.getUrlHost());
if (CollectionUtils.isEmpty(departments)) {
log.info("通过主部门查询部门列表为空 mainDeptId:{}", mainDeptId);
return;
......@@ -523,6 +524,22 @@ public class MessageApiServiceImpl implements MessageApiService {
log.info("处理部门end:{}", JSON.toJSONString(qywxCallBackDTO));
}
public void updateForSyncStaff(String wxEnterpriseId, String staffName , WxEnterpriseQwDTO qwDTO , String qwUserId , String mainDeptId , String position ,
Integer gender, String mobile , String nationcode ) {
boolean suitWxEnterpriseIid = checkSuitEnterpriseId(wxEnterpriseId);
if (suitWxEnterpriseIid) {
QywxCallBackDTO qwUser = new QywxCallBackDTO() ;
qwUser.setUserid(qwUserId);
qwUser.setChangeType("create_user");
qwUser.setMainDepartment(mainDeptId);
qwUser.setPosition(position);
qwUser.setGender(gender);
qwUser.setMobile(mobile);
qwUser.setTelephone(nationcode);
// 鸿星尔克定制
dealErKe(qwUser, wxEnterpriseId, staffName,qwDTO);
}
}
/**
* 处理鸿星尔克定制需求
*
......
......@@ -32,6 +32,7 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.enums.SyncTaskTypeEnum;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.MessageApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
......@@ -131,6 +132,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private HaobanQywxFeeOrderAccountService haobanQywxFeeOrderAccountService;
@Autowired
private HaobanQywxFeeOrderService haobanQywxFeeOrderService;
@Autowired
private MessageApiService messageApiService ;
@Override
public StaffDTO selectById(String staffId) {
......@@ -355,6 +358,8 @@ public class StaffApiServiceImpl implements StaffApiService {
staff.setActiveFlag(0);
staff.setCreateTime(new Date());
staffService.add(staff);
this.messageApiService.updateForSyncStaff(wxEnterpriseId,staff.getStaffName(),qwDTO,staff.getWxUserId(),
user.getMain_department(),user.getPosition(),staff.getSex(),user.getMobile(), staff.getNationCode());
} else {
staffService.updateByPrimaryKey(staff);
}
......
......@@ -629,7 +629,7 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseRelatedService.listByEnterpriseId(contentMaterialROleInitQDTO.getEnterpriseId());
if (CollectionUtils.isEmpty(tabHaobanWxEnterprises)) {
logger.info("【flushRightOneTime】企业 {} 未关联企微 ", contentMaterialROleInitQDTO.getEnterpriseId());
return ServiceResponse.success();
continue;
}
for (TabHaobanWxEnterprise wxEnterpris : tabHaobanWxEnterprises) {
......
......@@ -203,7 +203,6 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
return dealLog;
}).collect(Collectors.toList());
this.preDealService.insert(preDealLogList);
this.syncTaskService.updateTaskStatus(taskId,4) ;
}
return null ;
}
......
......@@ -7,6 +7,7 @@ import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
......@@ -35,10 +36,13 @@ public class ChatTest {
@Autowired
private HandoverOperationApiService handoverOperationApiService;
@Autowired
private StaffApiService staffApiService ;
@Test
public void test() {
this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ;
this.staffApiService.updateStaffHead("ca66a01b79474c40b3e7c7f93daf1a3b","d7c29cb654b543d1966181c2ec2186ea","https://pic01-10001430.image.myqcloud.com/04564abc-5e82-4ba7-9ef3-39803438bb2c") ;
// this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ;
}
@Test
......
package com.gic.haoban.manage.web.controller.content;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.aigc.AIGCContent;
import com.gic.content.api.qdto.aigc.ContentAIGCQDTO;
import com.gic.content.api.service.common.ThirdApiService;
import com.gic.haoban.manage.web.qo.content.ContentAIGCQO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* 好办-三方接口
*/
@RestController()
public class ContentThirdController {
private static final Logger log = LoggerFactory.getLogger(ContentThirdController.class);
@Autowired
private ThirdApiService thirdApiService;
/**
* AIGC生成文案
* @param aigcQO
* @return
*/
@RequestMapping("/third/aigc")
@ResponseBody
public RestResponse<AIGCContent> aigc(@RequestBody ContentAIGCQO aigcQO) {
String clerkId = aigcQO.getClerkId();
ContentAIGCQDTO aigcQDTO = EntityUtil.changeEntityNew(ContentAIGCQDTO.class, aigcQO);
aigcQDTO.setUserId(clerkId);
ServiceResponse<AIGCContent> response = thirdApiService.aigc(aigcQDTO);
if (!response.isSuccess()) {
return RestResponse.failure(response.getCode(), response.getMessage());
}
return RestResponse.successResult(response.getResult());
}
}
package com.gic.haoban.manage.web.qo.content;
/**
* Created by wangzubo on 2023/9/12.
*/
import java.io.Serializable;
import java.util.List;
public class ContentAIGCQO implements Serializable {
private static final long serialVersionUID = 1L;
private String enterpriseId;
private String clerkId;
/**
* 商品id列表
*/
private List<String> goodsIdList;
/**
* 营销节点
*/
private String holiday;
/**
* 营销主题
*/
private String theme;
/**
* 营销折扣
*/
private String discount;
/**
* 穿着场景
*/
private String scene;
/**
* 自定义描述
*/
private String customDescription;
/**
* 文案长度
*/
private String length;
/**
* 文案类型
*/
private String type;
/**
* 文案风格
*/
private String style;
/**
* 标题风格
*/
private String titleStyle;
/**
* title:标题content:内容 null为全部
*/
private String contentType;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public List<String> getGoodsIdList() {
return goodsIdList;
}
public void setGoodsIdList(List<String> goodsIdList) {
this.goodsIdList = goodsIdList;
}
public String getHoliday() {
return holiday;
}
public void setHoliday(String holiday) {
this.holiday = holiday;
}
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public String getDiscount() {
return discount;
}
public void setDiscount(String discount) {
this.discount = discount;
}
public String getScene() {
return scene;
}
public void setScene(String scene) {
this.scene = scene;
}
public String getCustomDescription() {
return customDescription;
}
public void setCustomDescription(String customDescription) {
this.customDescription = customDescription;
}
public String getLength() {
return length;
}
public void setLength(String length) {
this.length = length;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getTitleStyle() {
return titleStyle;
}
public void setTitleStyle(String titleStyle) {
this.titleStyle = titleStyle;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
}
......@@ -121,6 +121,7 @@
<dubbo:reference interface="com.gic.content.api.service.ContentColumnApiService" id="contentColumnApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.content.api.service.ContentMaterialApiService" id="contentMaterialApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.content.api.service.ContentMaterialShareApiService" id="contentMaterialShareApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.content.api.service.common.ThirdApiService" id="thirdApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference id="settingApiService" interface="com.gic.haoban.app.aggregation.api.service.SettingApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference id="newDataTargetConfigApiService" interface="com.gic.enterprise.api.service.target.NewDataTargetConfigApiService" timeout="100000" retries="0" check="false" />
<dubbo:reference interface="com.gic.store.goods.service.GoodsInfoOutApiService" id="goodsInfoOutApiService" timeout="100000" retries="0" check="false" />
......
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