Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_bugfix

dev_shibei_match
wangchao 5 years ago
parent
commit
5de7c6ebb3
  1. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  5. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java
  6. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
  7. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  8. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  9. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
  10. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml
  11. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  12. 2
      epmet-module/epmet-point/epmet-point-server/pom.xml
  13. 14
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  14. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  15. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  16. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/PaConstant.java
  17. 11
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java

@ -209,4 +209,8 @@ public class LatestActInfoDTO implements Serializable {
*/ */
private String delFlag; private String delFlag;
/**
* 数据库新增ACT_INFO_ID字段act_info.id
*/
private String actInfoId;
} }

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -32,6 +32,11 @@ public class RePublishFormDTO implements Serializable {
@Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class})
private List<PublishActContentFormDTO> actContent; private List<PublishActContentFormDTO> actContent;
/**
* 发布之前如果点击了预览此列有值
*/
private String actDraftId;
/** /**
* 活动id * 活动id
*/ */

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-heart-server: epmet-heart-server:
container_name: epmet-heart-server-dev container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.34 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.35
ports: ports:
- "8111:8111" - "8111:8111"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.34</version> <version>0.0.35</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId> <artifactId>epmet-heart</artifactId>

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java

@ -22,6 +22,7 @@ import com.epmet.dto.result.work.ActPreviewResultDTO;
import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO;
import com.epmet.entity.LatestActInfoEntity; import com.epmet.entity.LatestActInfoEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 最近一次编辑的活动信息 * 最近一次编辑的活动信息
@ -67,4 +68,14 @@ public interface LatestActInfoDao extends BaseDao<LatestActInfoEntity> {
* @Date 2020/7/27 17:10 * @Date 2020/7/27 17:10
**/ **/
int updateToDelById(String id); int updateToDelById(String id);
/**
* @return int
* @param actDraftId
* @param actInfoId
* @author yinzuomei
* @description
* @Date 2020/8/4 15:26
**/
int updateActInfoId(@Param("actDraftId") String actDraftId, @Param("actInfoId") String actInfoId);
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java

@ -178,5 +178,8 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
* 审核开关1报名人员需要人工审核0不需要 * 审核开关1报名人员需要人工审核0不需要
*/ */
private Boolean auditSwitch; private Boolean auditSwitch;
/**
* 数据库新增ACT_INFO_ID字段act_info.id
*/
private String actInfoId;
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -165,6 +165,11 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
logger.info("修改活动草稿actDraftId",formDTO.getActDraftId()); logger.info("修改活动草稿actDraftId",formDTO.getActDraftId());
latestActInfoDTO.setId(formDTO.getActDraftId()); latestActInfoDTO.setId(formDTO.getActDraftId());
} }
//如果是重新编辑活动进来的,保存草稿的时候,记录活动id的关系
if(StringUtils.isNotBlank(formDTO.getActId())){
logger.info("重新编辑活动act_id="+formDTO.getActId());
latestActInfoDTO.setActInfoId(formDTO.getActId());
}
latestActInfoDTO.setCustomerId(formDTO.getCustomerId()); latestActInfoDTO.setCustomerId(formDTO.getCustomerId());
//活动标题 //活动标题
latestActInfoDTO.setTitle(formDTO.getTitle()); latestActInfoDTO.setTitle(formDTO.getTitle());

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -93,6 +93,9 @@ public class WorkActServiceImpl implements WorkActService {
private ActGrantPointLogDao actGrantPointLogDao; private ActGrantPointLogDao actGrantPointLogDao;
@Autowired @Autowired
private UserKindnessTimeLogDao userKindnessTimeLogDao; private UserKindnessTimeLogDao userKindnessTimeLogDao;
@Autowired
private LatestActInfoDao latestActInfoDao;
/** /**
* @return void * @return void
* @author yinzuomei * @author yinzuomei
@ -151,7 +154,11 @@ public class WorkActServiceImpl implements WorkActService {
logger.info("发布活动,审核成功"); logger.info("发布活动,审核成功");
actInfoDao.insert(actInfoEntity); actInfoDao.insert(actInfoEntity);
//如果用户之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
if(StringUtils.isNotBlank(formDTO.getActDraftId())){
logger.info("更新latest_act_info表的act_info_id字段");
latestActInfoDao.updateActInfoId(formDTO.getActDraftId(),actInfoEntity.getId());
}
List<ActContentEntity> actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); List<ActContentEntity> actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId());
for(ActContentEntity actContentEntity:actContentEntityList){ for(ActContentEntity actContentEntity:actContentEntityList){
actContentDao.insert(actContentEntity); actContentDao.insert(actContentEntity);
@ -1216,6 +1223,10 @@ public class WorkActServiceImpl implements WorkActService {
/*if(rePublishFormDTO.getNoticePassedPeople()){ /*if(rePublishFormDTO.getNoticePassedPeople()){
this.noticePassedPeople(originalActInfo,newActInfoEntity); this.noticePassedPeople(originalActInfo,newActInfoEntity);
}*/ }*/
//如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){
latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId());
}
return publishActResultDTO; return publishActResultDTO;
} }

3
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql

@ -11,7 +11,7 @@
Target Server Version : 50728 Target Server Version : 50728
File Encoding : 65001 File Encoding : 65001
Date: 31/07/2020 17:50:23 Date: 04/08/2020 15:40:16
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@ -420,6 +420,7 @@ CREATE TABLE `latest_act_info` (
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间', `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识', `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识',
`ACT_INFO_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'act_info.id',
PRIMARY KEY (`ID`) USING BTREE PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '最近一次编辑的活动信息' ROW_FORMAT = Compact; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '最近一次编辑的活动信息' ROW_FORMAT = Compact;

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

@ -39,6 +39,7 @@
<result property="updatedBy" column="UPDATED_BY"/> <result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/> <result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/> <result property="delFlag" column="DEL_FLAG"/>
<result property="actInfoId" column="ACT_INFO_ID"/>
</resultMap> </resultMap>
<!-- 查询当前用户保留的活动记录 --> <!-- 查询当前用户保留的活动记录 -->
@ -50,6 +51,7 @@
WHERE WHERE
lai.DEL_FLAG = '0' lai.DEL_FLAG = '0'
AND lai.CREATED_BY = #{userId} AND lai.CREATED_BY = #{userId}
AND (lai.act_info_id is null or trim(lai.act_info_id) ='')
</select> </select>
<resultMap type="com.epmet.dto.result.work.LatestDraftActInfoResultDTO" id="LatestDraftActInfoResultMap"> <resultMap type="com.epmet.dto.result.work.LatestDraftActInfoResultDTO" id="LatestDraftActInfoResultMap">
@ -123,4 +125,11 @@
<update id="updateToDelById" parameterType="java.lang.String"> <update id="updateToDelById" parameterType="java.lang.String">
update latest_act_info set DEL_FLAG='1' where id=#{id} update latest_act_info set DEL_FLAG='1' where id=#{id}
</update> </update>
<!-- 发布活动成功后,更新草稿表里的活动id -->
<update id="updateActInfoId" parameterType="map">
UPDATE latest_act_info
SET ACT_INFO_ID = #{actInfoId}
WHERE id = #{actDraftId}
</update>
</mapper> </mapper>

2
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-point-server: epmet-point-server:
container_name: epmet-point-server-dev container_name: epmet-point-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.24 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.27
ports: ports:
- "8112:8112" - "8112:8112"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.24</version> <version>0.0.27</version>
<parent> <parent>
<artifactId>epmet-point</artifactId> <artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>

14
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java

@ -195,14 +195,22 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
@Override @Override
public InitPointRuleResultDTO initPointRule() { public InitPointRuleResultDTO initPointRule() {
Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList();
log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult));
if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) { if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) {
log.error("获取所有客户列表失败"); throw new RenException("获取所有客户列表失败");
} }
List<CustomerDTO> customerDTOList = customerListResult.getData(); List<CustomerDTO> customerDTOList = customerListResult.getData();
List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null); List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null);
if (CollectionUtils.isEmpty(ruleDefaultEntities)) {
log.warn("initPointRule pointRuleDefaultDao.selectList return empty");
throw new RenException("获取默认规则失败");
}
List<String> haveInitCustomerIds = baseDao.selectCustomerIds(); List<String> haveInitCustomerIds = baseDao.selectCustomerIds();
if (haveInitCustomerIds == null) {
haveInitCustomerIds = new ArrayList<>();
}
List<PointRuleEntity> insertList = new ArrayList<>(); List<PointRuleEntity> insertList = new ArrayList<>();
ruleDefaultEntities.forEach(defaultRule -> { for (PointRuleDefaultEntity defaultRule : ruleDefaultEntities) {
for (CustomerDTO customerDTO : customerDTOList) { for (CustomerDTO customerDTO : customerDTOList) {
if (haveInitCustomerIds.contains(customerDTO.getId())) { if (haveInitCustomerIds.contains(customerDTO.getId())) {
continue; continue;
@ -211,7 +219,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
entity.setCustomerId(customerDTO.getId()); entity.setCustomerId(customerDTO.getId());
insertList.add(entity); insertList.add(entity);
} }
}); }
this.insertBatch(insertList, 100); this.insertBatch(insertList, 100);
InitPointRuleResultDTO result = new InitPointRuleResultDTO(); InitPointRuleResultDTO result = new InitPointRuleResultDTO();
result.setCustomerTotal(customerDTOList.size()); result.setCustomerTotal(customerDTOList.size());

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-third-server: epmet-third-server:
container_name: epmet-third-server-dev container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.99 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.100
ports: ports:
- "8110:8110" - "8110:8110"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.99</version> <version>0.0.100</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/PaConstant.java

@ -82,4 +82,8 @@ public interface PaConstant {
* 更新客户Id信息失败 * 更新客户Id信息失败
*/ */
String UPDATE_CUSTOMER_EXCEPTION = "更新客户Id信息失败"; String UPDATE_CUSTOMER_EXCEPTION = "更新客户Id信息失败";
/**
* 更新客户初始化状态失败
*/
String UPDATE_ISINITIALIZE_EXCEPTION = "更新客户初始化状态失败";
} }

11
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java

@ -90,6 +90,8 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust
private CustomerMpService customerMpService; private CustomerMpService customerMpService;
@Autowired @Autowired
private CpUserDetailRedis cpUserDetailRedis; private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private PaCustomerDao paCustomerDao;
@Override @Override
public PageData<PaCustomerDTO> page(Map<String, Object> params) { public PageData<PaCustomerDTO> page(Map<String, Object> params) {
@ -533,6 +535,15 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust
throw new RenException(PaConstant.UPDATE_CUSTOMER_EXCEPTION); throw new RenException(PaConstant.UPDATE_CUSTOMER_EXCEPTION);
} }
//5.修改pa_customer表初始化状态
PaCustomerDTO paCustomer = new PaCustomerDTO();
paCustomer.setIsInitialize(NumConstant.ONE);
paCustomer.setId(formDTO.getNewCustomerId());
if (paCustomerDao.updateCustomerById(paCustomer) < NumConstant.ONE){
logger.error(String.format("修改pa_customer表初始化状态失败,待修改初始化状态的客户Id为->%s", paCustomer.getId()));
throw new RenException(PaConstant.UPDATE_ISINITIALIZE_EXCEPTION);
}
} }
} }
Loading…
Cancel
Save