Browse Source

Merge branch 'master' into lingshanjiedao_master

master
wxz 3 years ago
parent
commit
85b01fbeb6
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  3. 15
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java
  4. 15
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  5. 12
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java
  6. 14
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java
  7. 26
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  8. 41
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  9. 51
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerInitFormDTO.java
  10. 14
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  11. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  12. 69
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -57,6 +57,7 @@ import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
@ -418,6 +419,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
* @param customerId * @param customerId
* @param userId * @param userId
*/ */
@Async
@Override @Override
public void execAsyncExcelImport(Path filePath, String importTaskId, String customerId, String userId) { public void execAsyncExcelImport(Path filePath, String importTaskId, String customerId, String userId) {
try { try {

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -73,6 +73,7 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
@ -602,6 +603,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
* @param customerId * @param customerId
* @param userId * @param userId
*/ */
@Async
@Override @Override
public void execAsyncExcelImport(Path filePath, String importTaskId, String customerId, String userId) { public void execAsyncExcelImport(Path filePath, String importTaskId, String customerId, String userId) {
try { try {

15
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java

@ -1,8 +1,10 @@
package com.epmet.dto.form; package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -20,10 +22,16 @@ public class CommonArticleListFormDTO implements Serializable {
* */ * */
public interface ArticleBannerInternalGroup{} public interface ArticleBannerInternalGroup{}
/**
* 烟台需求周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧
*
*/
public interface YanTaiShowGroup extends CustomerClientShowGroup {
}
/** /**
* 网格Id * 网格Id
* */ * */
@NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class,YanTaiShowGroup.class})
private String gridId; private String gridId;
/** /**
@ -34,6 +42,7 @@ public class CommonArticleListFormDTO implements Serializable {
/** /**
* 标签名称(高级配置里的参数) * 标签名称(高级配置里的参数)
* */ * */
@NotBlank(message = "标签名称不能为空",groups = YanTaiShowGroup.class)
private String tagName; private String tagName;
/** /**
* 排除的标签名称(高级配置里的参数) * 排除的标签名称(高级配置里的参数)
@ -44,4 +53,8 @@ public class CommonArticleListFormDTO implements Serializable {
*/ */
private Integer isTop; private Integer isTop;
@NotNull(message = "pageNo不能为空", groups = YanTaiShowGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空", groups = YanTaiShowGroup.class)
private Integer pageSize;
} }

15
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -331,6 +331,21 @@ public class ArticleController {
return new Result<List<ArticleLatestResultDTO>>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); return new Result<List<ArticleLatestResultDTO>>().ok(articleService.getLatestArticleList(commonArticleListFormDTO));
} }
/**
* @param formDTO
* @return 烟台钉钉应用实时动态周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧
* 包括最新活动
*/
@PostMapping("article-list-ytding")
public Result<PageData<ArticleLatestResultDTO>> pageArticleListByTagName(@RequestBody CommonArticleListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CommonArticleListFormDTO.YanTaiShowGroup.class);
return new Result<PageData<ArticleLatestResultDTO>>().ok(articleService.pageArticleListByTagName(formDTO.getPageNo(),
formDTO.getPageSize(),
formDTO.getGridId(),
formDTO.getTagName()));
}
/** /**
* @param articlePageFormDTO * @param articlePageFormDTO
* @return List<ArticleListResultDTO> * @return List<ArticleListResultDTO>

12
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java

@ -167,4 +167,16 @@ public interface ArticleDao extends BaseDao<ArticleEntity> {
List<SubjectListResultDTO> subjectList(@Param("pidList")List<String> pidList); List<SubjectListResultDTO> subjectList(@Param("pidList")List<String> pidList);
List<PublishedListResultDTO> selectAllArticle(ArticleListFormDTO formDTO); List<PublishedListResultDTO> selectAllArticle(ArticleListFormDTO formDTO);
/**
* 根据标签名查询文章列表
* @param gridId
* @param tagName
* @param customerId
* @return
*/
List<ArticleLatestResultDTO> pageArticleListByTagName(@Param("gridId")String gridId,
@Param("tagName")String tagName,
@Param("customerId")String customerId,
@Param("agencyId")String agencyId);
} }

14
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java

@ -278,4 +278,18 @@ public interface ArticleService extends BaseService<ArticleEntity> {
* @param currentOperUserId * @param currentOperUserId
*/ */
void delete(List<String> articleIds,String customerId,String currentOperUserId); void delete(List<String> articleIds,String customerId,String currentOperUserId);
/**
* 烟台钉钉居民端需求来源烟台钉钉应用实时动态周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧
*
* @param pageNo
* @param pageSize
* @param gridId
* @param tagName
* @return
*/
PageData<ArticleLatestResultDTO> pageArticleListByTagName(Integer pageNo,
Integer pageSize,
String gridId,
String tagName);
} }

26
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -42,10 +42,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.*; import com.epmet.constant.*;
import com.epmet.dao.*; import com.epmet.dao.*;
@ -2007,5 +2004,24 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} }
} }
/**
* 烟台钉钉居民端需求来源烟台钉钉应用实时动态周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧
*
* @param pageNo
* @param pageSize
* @param gridId
* @param tagName
* @return
*/
@Override
public PageData<ArticleLatestResultDTO> pageArticleListByTagName(Integer pageNo, Integer pageSize, String gridId, String tagName) {
PageHelper.startPage(pageNo, pageSize);
List<ArticleLatestResultDTO> list = baseDao.pageArticleListByTagName(
gridId,
tagName,
EpmetRequestHolder.getLoginUserCustomerId(),
null);
PageInfo<ArticleLatestResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
} }

41
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

@ -481,6 +481,7 @@
WHERE del_flag = '0' WHERE del_flag = '0'
AND article_id = a.id AND article_id = a.id
AND agency_id = #{publishRangeId} AND agency_id = #{publishRangeId}
and PUBLISH_STATUS='published'
) )
</when> </when>
<otherwise> <otherwise>
@ -489,6 +490,7 @@
WHERE del_flag = '0' WHERE del_flag = '0'
AND article_id = a.id AND article_id = a.id
AND grid_id = #{publishRangeId} AND grid_id = #{publishRangeId}
and PUBLISH_STATUS='published'
) )
</otherwise> </otherwise>
</choose> </choose>
@ -506,4 +508,43 @@
ORDER BY a.publish_date DESC, a.updated_time DESC ORDER BY a.publish_date DESC, a.updated_time DESC
</select> </select>
<!-- 根据标签名,查询文章列表 -->
<select id="pageArticleListByTagName" parameterType="map" resultType="com.epmet.dto.result.ArticleLatestResultDTO">
SELECT
distinct art.id as articleId,
art.TITLE as articleTitle,
art.PUBLISHER_NAME as publishName,
art.PUBLISH_DATE as publishDate,
(
select ac.IMG_URL from article_cover ac
where ac.ARTICLE_ID=art.id
and ac.DEL_FLAG='0'
and ac.AUDIT_STATUS='pass'
limit 1
)as articleCoverImg
FROM
article art
LEFT JOIN article_tags t
ON ( art.id = t.ARTICLE_ID
AND t.DEL_FLAG = '0' )
inner join article_publish_range apr
on(art.ID=apr.ARTICLE_ID
and apr.DEL_FLAG='0'
and apr.PUBLISH_STATUS='published')
WHERE
art.DEL_FLAG = '0'
AND art.CUSTOMER_ID = #{customerId}
<if test="tagName != null and tagName != '' ">
AND t.TAG_NAME LIKE concat ( '%', #{tagName}, '%' )
</if>
<if test="gridId != null and gridId != '' ">
and apr.GRID_ID=#{gridId}
</if>
<if test="agencyId != null and agencyId != '' ">
AND art.org_id_path like concat('%',#{agencyId},'%')
</if>
ORDER BY
art.PUBLISH_DATE DESC,
art.CREATED_TIME DESC
</select>
</mapper> </mapper>

51
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerInitFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -12,11 +13,55 @@ import java.io.Serializable;
@Data @Data
public class CustomerInitFormDTO implements Serializable { public class CustomerInitFormDTO implements Serializable {
public interface GetCustomerDetailGroup { /**
} * 初始化带小程序的客户
*/
public interface InitMiniAppCustomerGroup {}
/**
* 初始化本地客户
*/
public interface InitLocalCustomerGroup {}
@NotBlank(message = "客户Id不能为空", groups = {GetCustomerDetailGroup.class}) @NotBlank(message = "客户Id不能为空", groups = {InitMiniAppCustomerGroup.class})
private String customerId; private String customerId;
@NotNull(message = "缺少paCustomer信息", groups = InitLocalCustomerGroup.class)
private PaCustomer paCustomer;
@NotNull(message = "缺少paCustomerAgency信息", groups = InitLocalCustomerGroup.class)
private PaCustomerAgency paAgency;
@NotNull(message = "缺少paUser信息", groups = InitLocalCustomerGroup.class)
private PaUser paUser;
@Data
public static class PaCustomer {
private String customerName;
private String isInitialize;
private String source;
private String type;
}
@Data
public static class PaCustomerAgency {
private String id;
private String agencyName;
private String areaCode;
private String city;
private String customerId;
private String district;
private String level;
private String levelNum;
private Integer partybranchnum;
private String province;
}
@Data
public static class PaUser {
private String gender;
private String phone;
private String realName;
}
} }

14
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -257,11 +257,23 @@ public class CustomerController {
**/ **/
@PostMapping("init") @PostMapping("init")
public Result init(@RequestBody CustomerInitFormDTO formDTO) { public Result init(@RequestBody CustomerInitFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerInitFormDTO.GetCustomerDetailGroup.class); ValidatorUtils.validateEntity(formDTO, CustomerInitFormDTO.InitMiniAppCustomerGroup.class);
customerService.init(formDTO); customerService.init(formDTO);
return new Result(); return new Result();
} }
/**
* 本地初始化客户不经过小程序
* @param formDTO
* @return
*/
@PostMapping("initLocally")
public Result initLocally(@RequestBody CustomerInitFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerInitFormDTO.InitLocalCustomerGroup.class);
customerService.initLocal(formDTO);
return new Result();
}
/** /**
* desc:获取所有未删除的客户 * desc:获取所有未删除的客户
* @return * @return

5
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -166,6 +166,11 @@ public interface CustomerService extends BaseService<CustomerEntity> {
**/ **/
void init(CustomerInitFormDTO formDTO); void init(CustomerInitFormDTO formDTO);
/**
* 本地初始化(不走小程序)
*/
void initLocal(CustomerInitFormDTO input);
/** /**
* desc获取所有客户列表 * desc获取所有客户列表
* @return * @return

69
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -22,6 +22,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
@ -585,6 +586,74 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
} }
@Override
public void initLocal(CustomerInitFormDTO input) {
//1.调用epmet-third服务,根据客户Id查询第三方服务中的客户、组织、管理员等信息
//PaUserDTO paUser = ConvertUtils.mapToEntity(map3, PaUserDTO.class);
String customerId = IdWorker.getIdStr();
String agencyId = IdWorker.getIdStr();
//2.校验当前客户是否已初始化,不存在则初始客户信息
CustomerEntity entity = baseDao.selectById(customerId);
if (null != entity) {
throw new RenException(EpmetErrorCode.OPER_CUSTOMER_EXISTS.getCode());
}
CustomerInitFormDTO.PaCustomer paCustomer = input.getPaCustomer();
CustomerInitFormDTO.PaCustomerAgency paCustomerAgency = input.getPaAgency();
CustomerInitFormDTO.PaUser paUser = input.getPaUser();
paCustomerAgency.setId(agencyId);
//2-1.新增客户信息
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setId(customerId);
customerEntity.setCustomerName(paCustomer.getCustomerName());
customerEntity.setTitle("");
customerEntity.setOrganizationNumber("");
customerEntity.setOrganizationImg("");
customerEntity.setValidityTime(getValidityTime());
customerEntity.setOrganizationLevel(paCustomerAgency.getLevel());
customerEntity.setLogo("");
//新客户默认可以创建三个网格
customerEntity.setGridNumber(NumConstant.THREE);
if (baseDao.insert(customerEntity) < NumConstant.ONE) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ERROR.getCode());
}
// *.发送初始化客户信息到mq,让监听者完成初始化操作
InitCustomerMQMsg msgContent = new InitCustomerMQMsg();
msgContent.setCustomerId(customerId);
msgContent.setAgency(constructAgencyInfo4CustomerInit(ConvertUtils.sourceToTarget(paCustomerAgency, PaCustomerAgencyDTO.class)));
msgContent.setStaff(constructStaffInfo4CustomerInit(agencyId, ConvertUtils.sourceToTarget(paUser, PaUserDTO.class)));
SystemMsgFormDTO systemMsgFormDTO = new SystemMsgFormDTO();
systemMsgFormDTO.setMessageType(SystemMessageType.INIT_CUSTOMER);
systemMsgFormDTO.setContent(msgContent);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO);
if (! sendMsgResult.success()) {
throw new RenException("发送(初始化客户信息)系统消息到message服务失败:{}", sendMsgResult.getInternalMsg());
}
//2021.1.25 sun 新增初始化客户积分规则和评价指标权重 start
//8.客户初始化已有的积分规则
Result<InitPointRuleResultDTO> resultPoint = epmetPointOpenFeignClient.initPointRule(customerId);
if (!resultPoint.success()) {
throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg());
}
//9.新客户初始化评价指标 权重
InitCustomerIndexForm indexForm = new InitCustomerIndexForm();
indexForm.setCustomerId(customerId);
Result<Boolean> resultData = dataStatisticalOpenFeignClient.initCustomerIndex(indexForm);
if (!resultData.success()) {
throw new RenException(resultData.getCode(), resultData.getInternalMsg());
}
//2021.1.25 end
}
private InitCustomerMQMsg.InitCustomerStaff constructStaffInfo4CustomerInit(String agencyId, PaUserDTO paUser) { private InitCustomerMQMsg.InitCustomerStaff constructStaffInfo4CustomerInit(String agencyId, PaUserDTO paUser) {
InitCustomerMQMsg.InitCustomerStaff staff = new InitCustomerMQMsg.InitCustomerStaff(); InitCustomerMQMsg.InitCustomerStaff staff = new InitCustomerMQMsg.InitCustomerStaff();
staff.setAgencyId(agencyId); staff.setAgencyId(agencyId);

Loading…
Cancel
Save