Commit 7c8ef808 by songyinghui

feat: 活码作废 关联详情状态改为作废不删除

parent 367c9a45
...@@ -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(hmWelcomeRelationBO.getStatus());
if (welcomeTemplateRelation.getStatus() == null){
welcomeTemplateRelation.setStatus(WelcomeRelationStatusEnum.DISABLE.getCode()); welcomeTemplateRelation.setStatus(WelcomeRelationStatusEnum.DISABLE.getCode());
}
welcomeTemplateRelationMapper.updateByPrimaryKeySelective(welcomeTemplateRelation); welcomeTemplateRelationMapper.updateByPrimaryKeySelective(welcomeTemplateRelation);
// 定义 // 定义
......
...@@ -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();
...@@ -315,7 +316,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -315,7 +316,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if (updateResult == 1) { if (updateResult == 1) {
// 更新欢迎语引用次数 // 更新欢迎语引用次数
hmQrcodeQDTO.setHmCode(hmQrcodeBO.getHmCode()); hmQrcodeQDTO.setHmCode(hmQrcodeBO.getHmCode());
this.updateWelcomeRelation(hmQrcodeQDTO); this.updateWelcomeRelation(hmQrcodeQDTO, null);
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -424,7 +425,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -424,7 +425,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());
...@@ -433,6 +434,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -433,6 +434,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);
} }
...@@ -648,7 +650,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -648,7 +650,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmQrcodeService.deleteById(hmId); hmQrcodeService.deleteById(hmId);
HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO(); HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO();
hmQrcodeQDTO.setHmId(hmId); hmQrcodeQDTO.setHmId(hmId);
this.updateWelcomeRelation(hmQrcodeQDTO); this.updateWelcomeRelation(hmQrcodeQDTO, WelcomeRelationStatusEnum.DEPRECATED.getCode());
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
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