Commit 9a0f1222 by 徐高华

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

parents a3eac062 5e76a33e
......@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.pojo.qo;
import com.gic.haoban.base.api.common.BasePageInfo;
import java.util.List;
/**
* @Author MUSI
* @Date 2022/7/4 10:54 AM
......@@ -17,6 +19,8 @@ public class WelcomeRelationQO extends BasePageInfo {
private String searchContent;
private List<Integer> statusList;
public String getWelcomeId() {
return welcomeId;
}
......@@ -40,4 +44,12 @@ public class WelcomeRelationQO extends BasePageInfo {
public void setSearchContent(String searchContent) {
this.searchContent = searchContent;
}
public List<Integer> getStatusList() {
return statusList;
}
public void setStatusList(List<Integer> statusList) {
this.statusList = statusList;
}
}
......@@ -161,7 +161,10 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
return Boolean.TRUE;
}
welcomeTemplateRelation.setUpdateTime(new Date());
welcomeTemplateRelation.setStatus(WelcomeRelationStatusEnum.DISABLE.getCode());
welcomeTemplateRelation.setStatus(hmWelcomeRelationBO.getStatus());
if (welcomeTemplateRelation.getStatus() == null){
welcomeTemplateRelation.setStatus(WelcomeRelationStatusEnum.DISABLE.getCode());
}
welcomeTemplateRelationMapper.updateByPrimaryKeySelective(welcomeTemplateRelation);
// 定义
......
......@@ -24,6 +24,7 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config;
......@@ -162,7 +163,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
int saveResult = hmQrcodeService.insert(hmQrcodeQDTO);
if (saveResult == 1) {
// save welcome relation
this.updateWelcomeRelation(hmQrcodeQDTO);
this.updateWelcomeRelation(hmQrcodeQDTO, null);
}
return ServiceResponse.success();
......@@ -314,7 +315,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
int updateResult = hmQrcodeService.update(hmQrcodeQDTO);
if (updateResult == 1) {
// 更新欢迎语引用次数
this.updateWelcomeRelation(hmQrcodeQDTO);
hmQrcodeQDTO.setHmCode(hmQrcodeBO.getHmCode());
this.updateWelcomeRelation(hmQrcodeQDTO, null);
}
return ServiceResponse.success();
}
......@@ -423,7 +425,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
*
* @param hmQrcodeQDTO
*/
private void updateWelcomeRelation(HmQrcodeQDTO hmQrcodeQDTO) {
private void updateWelcomeRelation(HmQrcodeQDTO hmQrcodeQDTO, Integer status) {
HmWelcomeRelationBO welcomeRelationBo = new HmWelcomeRelationBO();
welcomeRelationBo.setEnterpriseId(hmQrcodeQDTO.getEnterpriseId());
welcomeRelationBo.setWxEnterpriseId(hmQrcodeQDTO.getWxEnterpriseId());
......@@ -432,6 +434,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
welcomeRelationBo.setReferCode(hmQrcodeQDTO.getHmCode());
welcomeRelationBo.setReferName(hmQrcodeQDTO.getName());
welcomeRelationBo.setType(HmWelcomeReferType.HM.getCode());
welcomeRelationBo.setStatus(status);
welcomeRelationService.updateWelcomeRelation(welcomeRelationBo);
}
......@@ -645,6 +648,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
GicLogRecordEvaluationContext.putAttribute("logContent", logContent);
hmQrcodeService.deleteById(hmId);
HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO();
hmQrcodeQDTO.setHmId(hmId);
this.updateWelcomeRelation(hmQrcodeQDTO, WelcomeRelationStatusEnum.DEPRECATED.getCode());
return ServiceResponse.success();
}
......
......@@ -7,13 +7,18 @@ import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.hm.HmWelcomeRelationDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeRelationQDTO;
import com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmWelcomeRelationApiService;
import com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO;
import com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO;
import com.gic.haoban.manage.service.service.hm.WelcomeRelationService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
/**
* @Author MUSI
* @Date 2022/7/4 10:52 AM
......@@ -39,12 +44,22 @@ public class HmWelcomeRelationApiServiceImpl implements HmWelcomeRelationApiServ
}
WelcomeRelationQO welcomeRelationQo = new WelcomeRelationQO();
welcomeRelationQo.setWelcomeId(queryWelcomeRelationQdto.getWelcomeId());
welcomeRelationQo.setStatus(WelcomeRelationStatusEnum.ENABLE.getCode());
welcomeRelationQo.setStatusList(Arrays.asList(WelcomeRelationStatusEnum.ENABLE.getCode(), WelcomeRelationStatusEnum.DEPRECATED.getCode()));
welcomeRelationQo.setSearchContent(queryWelcomeRelationQdto.getSearchContent());
welcomeRelationQo.setPageNum(queryWelcomeRelationQdto.getPageNum());
welcomeRelationQo.setPageSize(queryWelcomeRelationQdto.getPageSize());
Page<HmWelcomeRelationBO> welcomeRelationPage = welcomeRelationService.queryWelcomeRelationPage(welcomeRelationQo);
Page<HmWelcomeRelationDTO> welcomeRelationDTOPage = PageUtil.changeToCurrentPage(welcomeRelationPage, HmWelcomeRelationDTO.class);
List<HmWelcomeRelationDTO> result = welcomeRelationDTOPage.getResult();
if (!CollectionUtils.isEmpty(result)){
for (HmWelcomeRelationDTO welcomeRelationBO : result) {
if (HmWelcomeReferType.LINK.getCode().equals(welcomeRelationBO.getType())){
// 链接状态不展示
welcomeRelationBO.setStatus(null);
}
}
}
welcomeRelationDTOPage.setResult(result);
return ServiceResponse.success(welcomeRelationDTOPage);
}
}
......@@ -180,6 +180,12 @@
<if test="searchContent != null and searchContent != ''">
and (refer_code = #{searchContent} or refer_name like CONCAT('%', #{searchContent}, '%') )
</if>
<if test="statusList != null and statusList.size > 0">
and `status` in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status}
</foreach>
</if>
</where>
</select>
......
......@@ -129,7 +129,7 @@ public class HmPageServiceTest {
@Test
public void welcomeTest(){
QueryWelcomeRelationQDTO qdto = new QueryWelcomeRelationQDTO();
qdto.setWelcomeId("04af9e55515d4352be0b2a3119005ce9");
qdto.setWelcomeId("7f12bdab4fb543e8977f96e30fc8eddb");
//qdto.setSearchContent("测试");
ServiceResponse<Page<HmWelcomeRelationDTO>> serviceResponse = welcomeRelationApiService.queryWelcomeRelation(qdto);
System.out.println(JSON.toJSONString(serviceResponse));
......
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