1;优化浏览器脚本 - 兼容闪购 连锁

2;绑定异常提示
3;文件上传问题处理
4;日报模版页优化
This commit is contained in:
wangshuai 2024-07-26 19:15:22 +08:00
parent 9a89e76486
commit a90353eaa4
7 changed files with 158 additions and 32 deletions

View File

@ -15,6 +15,7 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.mapper.SysDictDataMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
@ -61,6 +62,9 @@ public class BusStoreInfoController extends BaseController {
@Autowired
private IBusTemplateInfoService busTemplateInfoService;
@Autowired
private SysDictDataMapper sysDictDataMapper;
/**
* 查询店铺信息列表
*/
@ -210,8 +214,9 @@ public class BusStoreInfoController extends BaseController {
content = content.replaceAll("#count",busStoreDayInfo1.getLastOrderNum()+"");
content = content.replaceAll("#good",busStoreDayInfo1.getLastPositiveReviewsNum()+"");
content = content.replaceAll("#five",busStoreDayInfo1.getLastFiveStarReviewsNum()+"");
content = content.replaceAll("#score",busStoreDayInfo1.getScore());
content = content.replaceAll("#QRCode","https://youshi.bj.cn/prod-api/profile/upload/2024/07/19/img0_20240719111559A001.jpg");
content = content.replaceAll("#score", busStoreDayInfo1.getScore());
content = content.replaceAll("#QRCode", busTemplateInfo.getCodeUrl());
content = content.replaceAll("#text", busTemplateInfo.getRemark());
int a = busStoreDayInfo1.getLastPositiveReviewsNum();//todo 好评-五星
int b = busStoreDayInfo1.getLastReturnVisitNum();
if (a != 0 && b != 0) {

View File

@ -22,6 +22,10 @@ public class BusTemplateAttrConfig extends BaseEntity
@Excel(name = "模版类型")
private String templateType;
/** 属性值 */
@Excel(name = "属性值")
private String attrValue;
/** 属性名 */
@Excel(name = "属性名")
private String attrName;
@ -52,7 +56,16 @@ public class BusTemplateAttrConfig extends BaseEntity
{
return templateType;
}
public void setAttrName(String attrName)
public String getAttrValue() {
return attrValue;
}
public void setAttrValue(String attrValue) {
this.attrValue = attrValue;
}
public void setAttrName(String attrName)
{
this.attrName = attrName;
}
@ -85,6 +98,7 @@ public class BusTemplateAttrConfig extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("templateType", getTemplateType())
.append("attrValue", getAttrValue())
.append("attrName", getAttrName())
.append("attrStatus", getAttrStatus())
.append("attrSort", getAttrSort())

View File

@ -55,6 +55,27 @@ public class BusTemplateInfo extends BaseEntity
/** 排序 */
@Excel(name = "排序")
private Long sort;
@Excel(name = "地址")
private String codeUrl;
private String remark;
public String getCodeUrl() {
return codeUrl;
}
public void setCodeUrl(String codeUrl) {
this.codeUrl = codeUrl;
}
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
private List<BusTemplateAttrInfo> attrInfoList;

View File

@ -7,19 +7,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BusTemplateAttrConfig" id="BusTemplateAttrConfigResult">
<result property="id" column="id" />
<result property="templateType" column="template_type" />
<result property="attrValue" column="attr_value" />
<result property="attrName" column="attr_name" />
<result property="attrStatus" column="attr_status" />
<result property="attrSort" column="attr_sort" />
</resultMap>
<sql id="selectBusTemplateAttrConfigVo">
select id, template_type, attr_name, attr_status, attr_sort from bus_template_attr_config
select id, template_type, attr_value, attr_name, attr_status, attr_sort from bus_template_attr_config
</sql>
<select id="selectBusTemplateAttrConfigList" parameterType="BusTemplateAttrConfig" resultMap="BusTemplateAttrConfigResult">
<include refid="selectBusTemplateAttrConfigVo"/>
<where>
<if test="templateType != null and templateType != ''"> and template_type = #{templateType}</if>
<if test="attrValue != null and attrValue != ''"> and attr_value = #{attrValue}</if>
<if test="attrName != null and attrName != ''"> and attr_name like concat('%', #{attrName}, '%')</if>
<if test="attrStatus != null and attrStatus != ''"> and attr_status = #{attrStatus}</if>
<if test="attrSort != null "> and attr_sort = #{attrSort}</if>

View File

@ -17,10 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="sort" column="sort" />
<result property="codeUrl" column="code_url" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBusTemplateInfoVo">
select id, template_name, template_type, template_content, template_status, create_id, create_user, create_time, update_id, update_user, update_time, sort from bus_template_info
select id, template_name, template_type, template_content, template_status, create_id, create_user, create_time, update_id, update_user, update_time, sort, code_url, remark from bus_template_info
</sql>
<select id="selectBusTemplateInfoList" parameterType="BusTemplateInfo" resultMap="BusTemplateInfoResult">
@ -57,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateUser != null">update_user,</if>
<if test="updateTime != null">update_time,</if>
<if test="sort != null">sort,</if>
<if test="codeUrl != null">code_url,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="templateName != null">#{templateName},</if>
@ -70,6 +74,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateUser != null">#{updateUser},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="sort != null">#{sort},</if>
<if test="codeUrl != null">#{codeUrl},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
@ -87,6 +93,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateUser != null">update_user = #{updateUser},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="codeUrl != null">code_url = #{codeUrl},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>

View File

@ -97,7 +97,7 @@
<el-form-item label="模版名称" prop="templateName">
<el-input v-model="form.templateName" placeholder="请输入模版名称" />
</el-form-item>
<draggable v-model="attrConfigList" @end="onDragEnd">
<!-- <draggable v-model="attrConfigList" @end="onDragEnd">
<el-form-item
v-for="(item, index) in attrConfigList"
:key="item.id"
@ -105,27 +105,79 @@
>
<el-input v-model="item.attrName"></el-input>
</el-form-item>
</draggable>
</draggable> -->
<el-form-item label="选择内容">
<el-tag v-for="item in attrConfigList"
:key="item.id"
size="small"
closable
@click="clickContent($event,item.attrName)"
@close="handleClose(item.attrName)"
>{{item.attrName}}
</el-tag>
<draggable v-model="attrConfigList" @end="onDragEnd">
<el-row v-for="item in attrConfigList"
:key="item.id"
size="small"
closable
>
<!-- <el-button type="primary">{{item.attrValue}}</el-button> -->
<el-col :span="20"><el-tag class="bg-purple-dark">{{item.attrValue}}</el-tag></el-col>
</el-row>
</draggable>
</el-form-item>
<el-form-item label="内容">
<editor v-model="form.templateContent" :min-height="192" readOnly="true"/>
</el-form-item>
<el-form-item label="排序" prop="sort">
<!-- <el-form-item>
<el-row :gutter="12">
<el-col :span="11">
<el-card shadow="never">
<el-tag v-for="item in attrConfigList"
:key="item.id"
size="small"
closable
@click="clickContent($event,item.attrName)"
@close="handleClose(item.attrName)"
>{{item.attrValue}}
</el-tag>
</el-card>
</el-col>
<el-col :span="11">
<el-card shadow="always">
<draggable v-model="attrList" @end="onDragEnd">
<el-tag v-for="item in attrList"
:key="item.id"
size="small"
closable
>{{item.attrValue}}
</el-tag>
</draggable>
</el-card>
</el-col>
</el-row> -->
<!-- <draggable v-model="attrConfigList" @end="onDragEnd">
<el-tag v-for="item in attrConfigList"
:key="item.id"
size="small"
closable
@click="clickContent($event,item.attrName)"
@close="handleClose(item.attrName)"
>{{item.attrName}}
</el-tag>
</draggable> -->
<!-- <el-form-item label="内容">
<editor v-model="form.templateContent" :min-height="192" readOnly/>
</el-form-item> -->
<el-form-item label="文本内容" prop="remark">
<el-input
type="textarea"
v-model="form.sort"
placeholder="请输入排序"
v-model="form.remark"
placeholder="请输入文本内容"
/>
</el-form-item>
<el-form-item label="收款码">
<el-upload
class="upload-demo"
:action="uploadUrl"
:on-preview="handlePreview"
:on-success="handleSuccess"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="状态" prop="templateStatus">
<!-- <el-input v-model="form.templateStatus" placeholder="请输入状态" /> -->
<el-radio-group v-model="form.templateStatus">
@ -171,6 +223,9 @@ export default {
//
templateList: [],
attrConfigList: [],
attrList: [],
fileList:[],
uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
//
title: "",
//
@ -200,7 +255,8 @@ export default {
this.getList();
this.listTemplateAttr();
},
methods: {onDragEnd(event) {
methods: {
onDragEnd(event) {
// items
const movedItem = this.form.items.splice(event.oldIndex, 1)[0];
this.form.items.splice(event.newIndex, 0, movedItem);
@ -214,6 +270,15 @@ export default {
this.loading = false;
});
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handleSuccess(response, file, fileList){
this.form.codeUrl = response.url;
},
handlePreview(file) {
console.log(file);
},
//
cancel() {
this.open = false;
@ -310,15 +375,15 @@ export default {
},
clickContent(event,content){
// console.log(event,content)
if(!this.containsChinese(this.form.templateContent)){
this.form.templateContent = '<p>'+content+'</p>'
}else{
this.form.templateContent += '<p>'+content+'</p>'
}
// if(!this.containsChinese(this.form.templateContent)){
// this.form.templateContent = '<p>'+content+'</p>'
// }else{
// this.form.templateContent += '<p>'+content+'</p>'
// }
},
handleClose(content){
content = '<p>'+content+'</p>'
this.form.templateContent = this.form.templateContent.replace(content, '');
// content = '<p>'+content+'</p>'
// this.form.templateContent = this.form.templateContent.replace(content, '');
},
listTemplateAttr(){
listTemplateAttr({}).then(response => {
@ -329,7 +394,18 @@ export default {
};
</script>
<style>
.el-tag {
margin: 5px;
.el-row {
/* margin-bottom: 20px; */
&:last-child {
margin-bottom: 0;
}
}
.el-col {
border-radius: 4px;
}
.bg-purple-dark {
width: inherit;
}
</style>

View File

@ -26,7 +26,7 @@ module.exports = {
// 是否开启eslint保存检测有效值ture | false | 'error'
lintOnSave: process.env.NODE_ENV === 'development',
// 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false,
productionSourceMap: true,
// webpack-dev-server 相关配置
devServer: {
host: '0.0.0.0',