站点管理bug修复

master
382696293@qq.com 2 years ago
parent 48409d9da6
commit fb8ae2a1b1

@ -51,6 +51,8 @@ public interface SiteLogMapper {
*/ */
public int deleteSiteLogById(Long id); public int deleteSiteLogById(Long id);
public int deleteBySiteId(Long siteId);
/** /**
* *
* *

@ -62,6 +62,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from site_log where id = #{id} delete from site_log where id = #{id}
</delete> </delete>
<delete id="deleteBySiteId" parameterType="Long">
delete from site_log where site_id = #{siteId}
</delete>
<delete id="deleteSiteLogByIds" parameterType="String"> <delete id="deleteSiteLogByIds" parameterType="String">
delete from site_log where id in delete from site_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">

@ -7,6 +7,7 @@ import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.entity.*;
import com.flossom.common.core.enums.SitePushTypeEnum;
import com.flossom.common.core.mapper.*; import com.flossom.common.core.mapper.*;
import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.utils.StringUtils;
@ -40,6 +41,9 @@ public class SiteInfoServiceImpl implements ISiteInfoService
private WxInstrumentMapper wxInstrumentMapper; private WxInstrumentMapper wxInstrumentMapper;
@Autowired @Autowired
private SiteInfoInstrumentMapper siteInfoInstrumentMapper; private SiteInfoInstrumentMapper siteInfoInstrumentMapper;
@Autowired
private SiteLogMapper siteLogMapper;
/** /**
* *
* *
@ -447,6 +451,40 @@ public class SiteInfoServiceImpl implements ISiteInfoService
List<SysTag> handlerWechatTagNew = Lists.newArrayList(); List<SysTag> handlerWechatTagNew = Lists.newArrayList();
List<SysTag> handlerCompanyTagNew = Lists.newArrayList(); List<SysTag> handlerCompanyTagNew = Lists.newArrayList();
List<WxInstrument> wxInstrumentList = Lists.newArrayList(); List<WxInstrument> wxInstrumentList = Lists.newArrayList();
SiteInfo oldSiteInfo = siteInfoMapper.selectSiteInfoById(siteInfo.getId());
// 修改 开启时间,清理弹窗推送记录
if (oldSiteInfo.getSiteStartTime() != siteInfo.getSiteStartTime()
|| oldSiteInfo.getSiteEndTime() != siteInfo.getSiteEndTime() ) {
siteLogMapper.deleteBySiteId(siteInfo.getId());
}
// 修改 推送频率,清理弹窗推送记录
if(oldSiteInfo.getPushType() != siteInfo.getPushType()) {
siteLogMapper.deleteBySiteId(siteInfo.getId());
} else {
// 推送频率未改动,但是在自定义推送时,还需判断推送次数和推送日期是否修改
if(SitePushTypeEnum.CUSTOM.getCode() == siteInfo.getPushType()) {
if(oldSiteInfo.getPushNumber() != siteInfo.getPushNumber()) {
siteLogMapper.deleteBySiteId(siteInfo.getId());
}
if(StringUtils.isNotBlank(oldSiteInfo.getPushTimer())) {
List<Integer> oldPushTimer = Arrays.stream(oldSiteInfo.getPushTimer().split(","))
.map(Integer::valueOf)
.sorted()
.collect(Collectors.toList());
List<Integer> newPushTimer = Arrays.stream(siteInfo.getPushTimer().split(","))
.map(Integer::valueOf)
.sorted()
.collect(Collectors.toList());
if(!oldPushTimer.containsAll(newPushTimer) || !newPushTimer.containsAll(oldPushTimer)) {
siteLogMapper.deleteBySiteId(siteInfo.getId());
}
} else {
siteLogMapper.deleteBySiteId(siteInfo.getId());
}
}
}
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentList); this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentList);
// 删除关联关系 // 删除关联关系
siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId()); siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId());

@ -283,6 +283,7 @@
:headers="upload.headers" :headers="upload.headers"
:action="upload.url" :action="upload.url"
:disabled="upload.isUploading" :disabled="upload.isUploading"
:before-upload="handleBeforeUpload"
:on-progress="handleFileUploadProgress" :on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
drag drag
@ -340,7 +341,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="推送次数" prop="pushType"> <el-form-item label="推送次数" prop="pushType">
<el-radio-group v-model="form.pushType"> <el-radio-group v-model="form.pushType" @input="pushTypeChange">
<el-radio :label="1">永久一次</el-radio> <el-radio :label="1">永久一次</el-radio>
<el-radio :label="2">每次进入</el-radio> <el-radio :label="2">每次进入</el-radio>
<el-radio :label="3">自定义频次</el-radio> <el-radio :label="3">自定义频次</el-radio>
@ -623,6 +624,11 @@ export default {
chatTagOptions: [], chatTagOptions: [],
// //
open: false, open: false,
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["jpg", "png"],
},
// //
upload: { upload: {
// //
@ -930,6 +936,20 @@ export default {
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
console.log('上传处理中==>file', JSON.stringify(file)) console.log('上传处理中==>file', JSON.stringify(file))
}, },
//
handleBeforeUpload(file) {
//
if (this.fileType) {
const fileName = file.name.split('.');
const fileExt = fileName[fileName.length - 1];
const isTypeOk = this.fileType.default().indexOf(fileExt) >= 0;
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确`);
return false;
}
}
return true;
},
// //
handleFileSuccess(response, file, fileList, item) { handleFileSuccess(response, file, fileList, item) {
console.log('上传后的结果==>', JSON.stringify(response)) console.log('上传后的结果==>', JSON.stringify(response))
@ -970,6 +990,11 @@ export default {
`info_${new Date().getTime()}.xlsx` `info_${new Date().getTime()}.xlsx`
) )
}, },
pushTypeChange() {
this.form.pushTimerArray = null;
this.form.pushTimer = null;
this.form.pushNumber = 1;
}
}, },
} }
</script> </script>

Loading…
Cancel
Save