Commit 7c8ef808 by songyinghui

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

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