Commit 3787af53 by 墨竹

Merge branch 'feature-0808' into developer

parents f4a28a00 e7b38ca7
...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.pojo.qo; ...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.pojo.qo;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import java.util.List;
/** /**
* @Author MUSI * @Author MUSI
* @Date 2022/7/4 10:54 AM * @Date 2022/7/4 10:54 AM
...@@ -17,6 +19,8 @@ public class WelcomeRelationQO extends BasePageInfo { ...@@ -17,6 +19,8 @@ public class WelcomeRelationQO extends BasePageInfo {
private String searchContent; private String searchContent;
private List<Integer> statusList;
public String getWelcomeId() { public String getWelcomeId() {
return welcomeId; return welcomeId;
} }
...@@ -40,4 +44,12 @@ public class WelcomeRelationQO extends BasePageInfo { ...@@ -40,4 +44,12 @@ public class WelcomeRelationQO extends BasePageInfo {
public void setSearchContent(String searchContent) { public void setSearchContent(String searchContent) {
this.searchContent = 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 { ...@@ -161,7 +161,10 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
return Boolean.TRUE; return Boolean.TRUE;
} }
welcomeTemplateRelation.setUpdateTime(new Date()); 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); welcomeTemplateRelationMapper.updateByPrimaryKeySelective(welcomeTemplateRelation);
// 定义 // 定义
......
...@@ -142,48 +142,23 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -142,48 +142,23 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
return null; return null;
} }
List<StaffClerkInfoDTO> infoDTOS = EntityUtil.changeEntityListByJSON(StaffClerkInfoDTO.class, list); List<StaffClerkInfoDTO> infoDTOS = EntityUtil.changeEntityListByJSON(StaffClerkInfoDTO.class, list);
Map<String, String> nameMap = new HashMap<>();
infoDTOS.forEach(infoDTO -> { infoDTOS.forEach(infoDTO -> {
//企业 EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(infoDTO.getEnterpriseId());
if (!nameMap.containsKey(infoDTO.getEnterpriseId())) { if (enterpriseDTO != null) {
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(infoDTO.getEnterpriseId()); infoDTO.setBrandName(enterpriseDTO.getBrandName());
if (null != enterpriseDTO) { infoDTO.setEnterpriseName(enterpriseDTO.getEnterpriseName());
nameMap.put(infoDTO.getEnterpriseId(), enterpriseDTO.getEnterpriseName() + "_" + enterpriseDTO.getBrandName());
} else {
nameMap.put(infoDTO.getEnterpriseId(), "未知商户");
}
}
//门店店员名称
if (!nameMap.containsKey(infoDTO.getClerkId())) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(infoDTO.getClerkId());
if (null != clerkDTO) {
nameMap.put(infoDTO.getClerkId(), clerkDTO.getClerkName());
nameMap.put(infoDTO.getStoreId(), clerkDTO.getStoreName());
infoDTO.setClerkPhoneNumber(clerkDTO.getPhoneNumber());
} else {
nameMap.put(infoDTO.getClerkId(), "未知店员");
}
} }
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(infoDTO.getClerkId());
//门店店员名称 if (null != clerkDTO) {
if (!nameMap.containsKey(infoDTO.getStoreId())) { infoDTO.setClerkPhoneNumber(clerkDTO.getPhoneNumber());
StoreDTO storeDTO = storeService.getStore(infoDTO.getStoreId()); infoDTO.setClerkName(clerkDTO.getClerkName());
if (null != storeDTO) { infoDTO.setClerkCode(clerkDTO.getClerkCode());
nameMap.put(infoDTO.getStoreId(), storeDTO.getStoreName());
} else {
nameMap.put(infoDTO.getStoreId(), "未知门店");
}
} }
infoDTO.setClerkName(nameMap.get(infoDTO.getClerkId())); StoreDTO storeDTO = storeService.getStore(infoDTO.getStoreId());
infoDTO.setStoreName(nameMap.get(infoDTO.getStoreId())); if (null != storeDTO) {
if ((nameMap.get(infoDTO.getEnterpriseId())) != null) { infoDTO.setStoreName(storeDTO.getStoreName());
String enterpriseAndBrandName = nameMap.get(infoDTO.getEnterpriseId());
String[] split = enterpriseAndBrandName.split("_");
infoDTO.setEnterpriseName(split[0]);
if (split[1] != null) {
infoDTO.setBrandName(split[1]);
}
} }
}); });
return infoDTOS; return infoDTOS;
......
...@@ -24,6 +24,7 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO; ...@@ -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.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; 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.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType; import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
...@@ -162,7 +163,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -162,7 +163,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
int saveResult = hmQrcodeService.insert(hmQrcodeQDTO); int saveResult = hmQrcodeService.insert(hmQrcodeQDTO);
if (saveResult == 1) { if (saveResult == 1) {
// save welcome relation // save welcome relation
this.updateWelcomeRelation(hmQrcodeQDTO); this.updateWelcomeRelation(hmQrcodeQDTO, null);
} }
return ServiceResponse.success(); return ServiceResponse.success();
...@@ -310,11 +311,19 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -310,11 +311,19 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
//操作日志 //操作日志
updateSystemLog(hmQrcodeQDTO, hmId); updateSystemLog(hmQrcodeQDTO, hmId);
String welcomeId = hmQrcodeQDTO.getWelcomeId();
if (StringUtils.isBlank(welcomeId)){
hmQrcodeQDTO.setWelcomeId("");
}
String memberLabelId = hmQrcodeQDTO.getMemberLabelId();
if (StringUtils.isBlank(memberLabelId)){
hmQrcodeQDTO.setMemberLabelId("");
}
int updateResult = hmQrcodeService.update(hmQrcodeQDTO); int updateResult = hmQrcodeService.update(hmQrcodeQDTO);
if (updateResult == 1) { if (updateResult == 1) {
// 更新欢迎语引用次数 // 更新欢迎语引用次数
this.updateWelcomeRelation(hmQrcodeQDTO); hmQrcodeQDTO.setHmCode(hmQrcodeBO.getHmCode());
this.updateWelcomeRelation(hmQrcodeQDTO, null);
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -423,7 +432,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -423,7 +432,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
* *
* @param hmQrcodeQDTO * @param hmQrcodeQDTO
*/ */
private void updateWelcomeRelation(HmQrcodeQDTO hmQrcodeQDTO) { private void updateWelcomeRelation(HmQrcodeQDTO hmQrcodeQDTO, Integer status) {
HmWelcomeRelationBO welcomeRelationBo = new HmWelcomeRelationBO(); HmWelcomeRelationBO welcomeRelationBo = new HmWelcomeRelationBO();
welcomeRelationBo.setEnterpriseId(hmQrcodeQDTO.getEnterpriseId()); welcomeRelationBo.setEnterpriseId(hmQrcodeQDTO.getEnterpriseId());
welcomeRelationBo.setWxEnterpriseId(hmQrcodeQDTO.getWxEnterpriseId()); welcomeRelationBo.setWxEnterpriseId(hmQrcodeQDTO.getWxEnterpriseId());
...@@ -432,6 +441,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -432,6 +441,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
welcomeRelationBo.setReferCode(hmQrcodeQDTO.getHmCode()); welcomeRelationBo.setReferCode(hmQrcodeQDTO.getHmCode());
welcomeRelationBo.setReferName(hmQrcodeQDTO.getName()); welcomeRelationBo.setReferName(hmQrcodeQDTO.getName());
welcomeRelationBo.setType(HmWelcomeReferType.HM.getCode()); welcomeRelationBo.setType(HmWelcomeReferType.HM.getCode());
welcomeRelationBo.setStatus(status);
welcomeRelationService.updateWelcomeRelation(welcomeRelationBo); welcomeRelationService.updateWelcomeRelation(welcomeRelationBo);
} }
...@@ -645,6 +655,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -645,6 +655,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
} }
GicLogRecordEvaluationContext.putAttribute("logContent", logContent); GicLogRecordEvaluationContext.putAttribute("logContent", logContent);
hmQrcodeService.deleteById(hmId); hmQrcodeService.deleteById(hmId);
HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO();
hmQrcodeQDTO.setHmId(hmId);
this.updateWelcomeRelation(hmQrcodeQDTO, WelcomeRelationStatusEnum.DEPRECATED.getCode());
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -7,13 +7,18 @@ import com.gic.haoban.common.utils.PageUtil; ...@@ -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.hm.HmWelcomeRelationDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeRelationQDTO; 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.WelcomeRelationStatusEnum;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmWelcomeRelationApiService; 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.bo.hm.HmWelcomeRelationBO;
import com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO; import com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO;
import com.gic.haoban.manage.service.service.hm.WelcomeRelationService; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
/** /**
* @Author MUSI * @Author MUSI
* @Date 2022/7/4 10:52 AM * @Date 2022/7/4 10:52 AM
...@@ -39,12 +44,22 @@ public class HmWelcomeRelationApiServiceImpl implements HmWelcomeRelationApiServ ...@@ -39,12 +44,22 @@ public class HmWelcomeRelationApiServiceImpl implements HmWelcomeRelationApiServ
} }
WelcomeRelationQO welcomeRelationQo = new WelcomeRelationQO(); WelcomeRelationQO welcomeRelationQo = new WelcomeRelationQO();
welcomeRelationQo.setWelcomeId(queryWelcomeRelationQdto.getWelcomeId()); welcomeRelationQo.setWelcomeId(queryWelcomeRelationQdto.getWelcomeId());
welcomeRelationQo.setStatus(WelcomeRelationStatusEnum.ENABLE.getCode()); welcomeRelationQo.setStatusList(Arrays.asList(WelcomeRelationStatusEnum.ENABLE.getCode(), WelcomeRelationStatusEnum.DEPRECATED.getCode()));
welcomeRelationQo.setSearchContent(queryWelcomeRelationQdto.getSearchContent()); welcomeRelationQo.setSearchContent(queryWelcomeRelationQdto.getSearchContent());
welcomeRelationQo.setPageNum(queryWelcomeRelationQdto.getPageNum()); welcomeRelationQo.setPageNum(queryWelcomeRelationQdto.getPageNum());
welcomeRelationQo.setPageSize(queryWelcomeRelationQdto.getPageSize()); welcomeRelationQo.setPageSize(queryWelcomeRelationQdto.getPageSize());
Page<HmWelcomeRelationBO> welcomeRelationPage = welcomeRelationService.queryWelcomeRelationPage(welcomeRelationQo); Page<HmWelcomeRelationBO> welcomeRelationPage = welcomeRelationService.queryWelcomeRelationPage(welcomeRelationQo);
Page<HmWelcomeRelationDTO> welcomeRelationDTOPage = PageUtil.changeToCurrentPage(welcomeRelationPage, HmWelcomeRelationDTO.class); 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); return ServiceResponse.success(welcomeRelationDTOPage);
} }
} }
...@@ -180,6 +180,12 @@ ...@@ -180,6 +180,12 @@
<if test="searchContent != null and searchContent != ''"> <if test="searchContent != null and searchContent != ''">
and (refer_code = #{searchContent} or refer_name like CONCAT('%', #{searchContent}, '%') ) and (refer_code = #{searchContent} or refer_name like CONCAT('%', #{searchContent}, '%') )
</if> </if>
<if test="statusList != null and statusList.size > 0">
and `status` in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status}
</foreach>
</if>
</where> </where>
</select> </select>
......
...@@ -177,13 +177,13 @@ ...@@ -177,13 +177,13 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime}, update_time = #{updateTime},
</if> </if>
<if test="memberLabelId != null and memberLabelId != ''"> <if test="memberLabelId != null">
member_label_id = #{memberLabelId}, member_label_id = #{memberLabelId},
</if> </if>
<if test="passFlag != null"> <if test="passFlag != null">
pass_flag = #{passFlag}, pass_flag = #{passFlag},
</if> </if>
<if test="welcomeId != null and welcomeId != ''"> <if test="welcomeId != null">
welcome_id = #{welcomeId}, welcome_id = #{welcomeId},
</if> </if>
<if test="statusFlag != null"> <if test="statusFlag != null">
......
...@@ -129,7 +129,7 @@ public class HmPageServiceTest { ...@@ -129,7 +129,7 @@ public class HmPageServiceTest {
@Test @Test
public void welcomeTest(){ public void welcomeTest(){
QueryWelcomeRelationQDTO qdto = new QueryWelcomeRelationQDTO(); QueryWelcomeRelationQDTO qdto = new QueryWelcomeRelationQDTO();
qdto.setWelcomeId("04af9e55515d4352be0b2a3119005ce9"); qdto.setWelcomeId("7f12bdab4fb543e8977f96e30fc8eddb");
//qdto.setSearchContent("测试"); //qdto.setSearchContent("测试");
ServiceResponse<Page<HmWelcomeRelationDTO>> serviceResponse = welcomeRelationApiService.queryWelcomeRelation(qdto); ServiceResponse<Page<HmWelcomeRelationDTO>> serviceResponse = welcomeRelationApiService.queryWelcomeRelation(qdto);
System.out.println(JSON.toJSONString(serviceResponse)); 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