parent
661c503aee
commit
693b8feaea
|
@ -2,6 +2,9 @@ package com.ruoyi.business.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -42,7 +45,11 @@ public class BusMarketOperationInfoController extends BaseController
|
|||
public TableDataInfo list(BusMarketOperationInfo busMarketOperationInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BusMarketOperationInfo> list = busMarketOperationInfoService.selectBusMarketOperationInfoList(busMarketOperationInfo);
|
||||
LoginUser user = SecurityUtils.getLoginUser();
|
||||
if(!"admin".equals(user.getUsername())){
|
||||
busMarketOperationInfo.setUpdateId(user.getUserId());
|
||||
}
|
||||
List<BusMarketOperationInfo> list = busMarketOperationInfoService.selectBusMarketOperationInfoListByPid(busMarketOperationInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -122,4 +122,5 @@ public class BusTemplateInfoController extends BaseController
|
|||
{
|
||||
return toAjax(busTemplateInfoService.deleteBusTemplateInfoByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,11 +7,12 @@ ruoyi:
|
|||
# 版权年份
|
||||
copyrightYear: 2024
|
||||
# 文件路径 示例( Windows配置 F:/home/youshi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: /home/ruoyi/uploadPath
|
||||
profile: F:/home/youshi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
captchaType: math
|
||||
baseUrl: http://localhost/dev-api
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
|
@ -124,7 +125,7 @@ xss:
|
|||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
excludes: /system/notice,/business/template
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*,/business/*
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ public class RuoYiConfig
|
|||
/** 验证码类型 */
|
||||
private static String captchaType;
|
||||
|
||||
private static String baseUrl;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
|
@ -119,4 +121,12 @@ public class RuoYiConfig
|
|||
{
|
||||
return getProfile() + "/upload";
|
||||
}
|
||||
|
||||
public static String getBaseUrl() {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
public static void setBaseUrl(String baseUrl) {
|
||||
RuoYiConfig.baseUrl = baseUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface BusMarketOperationInfoMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteBusMarketOperationInfoByIds(Long[] ids);
|
||||
|
||||
List<BusMarketOperationInfo> selectBusMarketOperationInfoListByPid(BusMarketOperationInfo busMarketOperationInfo);
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface IBusMarketOperationInfoService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteBusMarketOperationInfoById(Long id);
|
||||
|
||||
List<BusMarketOperationInfo> selectBusMarketOperationInfoListByPid(BusMarketOperationInfo busMarketOperationInfo);
|
||||
}
|
||||
|
|
|
@ -92,4 +92,9 @@ public class BusMarketOperationInfoServiceImpl implements IBusMarketOperationInf
|
|||
{
|
||||
return busMarketOperationInfoMapper.deleteBusMarketOperationInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusMarketOperationInfo> selectBusMarketOperationInfoListByPid(BusMarketOperationInfo busMarketOperationInfo) {
|
||||
return busMarketOperationInfoMapper.selectBusMarketOperationInfoListByPid(busMarketOperationInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.ruoyi.business.domain.BusTemplateAttrInfo;
|
||||
import com.ruoyi.business.mapper.BusTemplateAttrInfoMapper;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
@ -117,6 +118,18 @@ public class BusTemplateInfoServiceImpl implements IBusTemplateInfoService
|
|||
List<BusTemplateInfo> list = busTemplateInfoMapper.selectBusTemplateInfoList(busTemplateInfo);
|
||||
if(list.size() == 1){
|
||||
BusTemplateInfo busTemplateInfo1 = list.get(0);
|
||||
String content = busTemplateInfo1.getTemplateContent();
|
||||
String http = RuoYiConfig.getBaseUrl()==null?"http://localhost/dev-api":"";
|
||||
if(content.contains("img src")){
|
||||
int img = content.indexOf("<img");
|
||||
String[] array = content.split("/dev-api");
|
||||
|
||||
// int start = array[1].indexOf("http");
|
||||
int end = array[1].indexOf("\">");
|
||||
String addr = http + array[1].substring(0,end);
|
||||
content = busTemplateInfo1.getTemplateContent().substring(0,img)+addr;
|
||||
busTemplateInfo1.setTemplateContent(content);
|
||||
}
|
||||
BusTemplateAttrInfo busTemplateAttrInfo = new BusTemplateAttrInfo();
|
||||
busTemplateAttrInfo.setTemplateId(busTemplateInfo1.getId());
|
||||
List<BusTemplateAttrInfo> list1 = busTemplateAttrInfoMapper.selectBusTemplateAttrInfoList(busTemplateAttrInfo);
|
||||
|
|
|
@ -107,7 +107,6 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
storeInfo.setStoreCookie(cookie.getCookie());
|
||||
storeInfo.setPlatformType(String.valueOf(cookie.getBingType()));
|
||||
storeInfo.setBindTime(date);
|
||||
storeInfo.setUpdateTime(date);
|
||||
storeInfo.setGrantStatus("1");//授权登录状态
|
||||
storeInfo.setReturnVisitStatus("2");// 营销状态
|
||||
storeInfo.setSelfDeliveryStatus("1");// 1 正常, 2 自配送, 3 删除
|
||||
|
@ -131,10 +130,13 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
|
||||
return R.ok();
|
||||
} else if (list.size() == 1) {
|
||||
// 不同代理人绑定
|
||||
if (!cookie.getUserName().equals(list.get(0).getBindUser())) {
|
||||
// 如果未删除 不可以继续绑定
|
||||
if(!"3".equals(list.get(0).getSelfDeliveryStatus())){
|
||||
throw new ServiceException("授权失败,已绑定其他代理账号!");
|
||||
}
|
||||
// 如果已删除 可以继续绑定
|
||||
storeInfo.setId(list.get(0).getId());
|
||||
storeInfo.setBindId(list1.get(0).getId());
|
||||
storeInfo.setBindUser(cookie.getUserName());
|
||||
|
@ -177,6 +179,8 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public String getComments() {
|
||||
BusStoreInfo busStoreInfo = new BusStoreInfo();
|
||||
busStoreInfo.setReturnVisitStatus("1");
|
||||
busStoreInfo.setBindUser(SecurityUtils.getUsername());
|
||||
List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo);
|
||||
for (BusStoreInfo store : busStoreInfoList) {
|
||||
Boolean flag = getCommentsOne(store);
|
||||
|
@ -191,6 +195,8 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public String getYestodayCount() {
|
||||
BusStoreInfo busStoreInfo = new BusStoreInfo();
|
||||
busStoreInfo.setReturnVisitStatus("1");
|
||||
busStoreInfo.setBindUser(SecurityUtils.getUsername());
|
||||
List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo);
|
||||
for (BusStoreInfo store : busStoreInfoList) {
|
||||
Boolean flag = yesterdayCountOne(store);
|
||||
|
@ -210,6 +216,8 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public String getScore() {
|
||||
BusStoreInfo busStoreInfo = new BusStoreInfo();
|
||||
busStoreInfo.setReturnVisitStatus("1");
|
||||
busStoreInfo.setBindUser(SecurityUtils.getUsername());
|
||||
List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo);
|
||||
for (BusStoreInfo store : busStoreInfoList) {
|
||||
Boolean flag = getScoreOne(store);
|
||||
|
@ -230,7 +238,7 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
public String orderInfoList() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
BusStoreInfo busStoreInfo = new BusStoreInfo();
|
||||
// busStoreInfo.setGrantStatus("1");
|
||||
busStoreInfo.setReturnVisitStatus("1");
|
||||
List<BusStoreInfo> busStoreInfoList = busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo);
|
||||
for (BusStoreInfo store : busStoreInfoList) {
|
||||
R flag = orderInfo(store.getStoreCode(),now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),store.getStoreCookie());
|
||||
|
@ -655,7 +663,8 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
try {
|
||||
result = EntityUtils.toString(httpClient.execute(request).getEntity());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
if (result != null) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
|
@ -678,6 +687,10 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
busStoreDayInfoService.insertBusStoreDayInfo(dayInfo);
|
||||
}
|
||||
}
|
||||
}else if ("1001".equals(jsonObject.getString("code"))) {
|
||||
store.setGrantStatus("2");
|
||||
busStoreInfoService.updateBusStoreInfo(store);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// System.out.println(result);
|
||||
|
@ -722,6 +735,8 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
int code = jsonObject.getInteger(("code"));
|
||||
if (code != 0) {
|
||||
System.out.println(result);
|
||||
store.setGrantStatus("2");
|
||||
busStoreInfoService.updateBusStoreInfo(store);
|
||||
return false;
|
||||
}
|
||||
JSONArray array = jsonObject.getJSONObject("data").getJSONArray("list");
|
||||
|
|
|
@ -35,6 +35,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectBusMarketOperationInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectBusMarketOperationInfoListByPid" parameterType="BusMarketOperationInfo" resultMap="BusMarketOperationInfoResult">
|
||||
<include refid="selectBusMarketOperationInfoVo"/>
|
||||
<where>
|
||||
<if test="storeId != null "> and store_id = #{storeId}</if>
|
||||
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode}</if>
|
||||
<if test="storeName != null and storeName != ''"> and store_name like concat('%', #{storeName}, '%')</if>
|
||||
<if test="updateId != null "> and (update_id = #{updateId} or update_id in (select id from bus_agent_info where superior_agent_code = #{updateId}))</if>
|
||||
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
||||
<if test="operationStatus != null and operationStatus != ''"> and operation_status = #{operationStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertBusMarketOperationInfo" parameterType="BusMarketOperationInfo">
|
||||
insert into bus_market_operation_info
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -72,7 +72,12 @@
|
|||
<el-table-column label="模版名称" align="center" prop="templateName" />
|
||||
<el-table-column label="模版类型 word excel" align="center" prop="templateType" />
|
||||
<!-- <el-table-column label="内容" align="center" prop="templateContent" /> -->
|
||||
<el-table-column label="状态 1启用 2弃用" align="center" prop="templateStatus" />
|
||||
<el-table-column label="状态 1启用 2停用" align="center" prop="templateStatus" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.templateStatus ==='1' " type="success">启用</el-tag>
|
||||
<el-tag v-if="scope.row.templateStatus ==='2' " type="danger">停用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="createUser" />
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
|
@ -92,7 +97,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
|
@ -113,6 +118,16 @@
|
|||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="templateStatus">
|
||||
<!-- <el-input v-model="form.templateStatus" placeholder="请输入状态" /> -->
|
||||
<el-radio-group v-model="form.templateStatus">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.bus_template_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -127,6 +142,7 @@ import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate } f
|
|||
|
||||
export default {
|
||||
name: "Template",
|
||||
dicts: ['bus_template_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
|
@ -32,9 +32,14 @@
|
|||
<el-table-column label="店铺名称" align="center" prop="storeName" />
|
||||
<el-table-column label="店铺标识" align="center" prop="storeCode" />
|
||||
<el-table-column label="操作账户" align="center" prop="updateUser" />
|
||||
<el-table-column label="操作状态" align="center" prop="operationStatus" />
|
||||
<el-table-column label="操作状态" align="center" prop="operationStatus" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.operationStatus ==='1' " type="success">启用</el-tag>
|
||||
<el-tag v-if="scope.row.operationStatus ==='2' " type="danger">停用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时间" align="center" prop="updateTime" />
|
||||
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
|
|
@ -346,6 +346,7 @@
|
|||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
<!-- <img class="btn" :src="imageUrl" alt="your-image-description" > -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -387,6 +388,9 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<!-- <el-upload src="{{ imageUrl }}"></el-upload> -->
|
||||
<!-- <img src="imageUrl" title="点击上传头像" class="img-circle img-lg"></img> -->
|
||||
<!-- <el-image src="{{imageUrl}}" /> -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -429,6 +433,7 @@ export default {
|
|||
open2: false,
|
||||
// 是否显示弹出层(数据权限)
|
||||
openDataScope: false,
|
||||
imageUrl: '',
|
||||
map: {
|
||||
storeCount: 0,
|
||||
openCount: 0,
|
||||
|
@ -708,9 +713,20 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleCopy(row) {
|
||||
generateWord(row).then(response => {
|
||||
const query = {id:row.id}
|
||||
generateWord(query).then(response => {
|
||||
const copyText = response.msg
|
||||
this.imageUrl = "http://localhost/dev-api/profile/upload/2024/07/18/img0_20240718113153A001.jpg";
|
||||
try {
|
||||
// 创建一个ClipboardItem
|
||||
// const blob = this.fetchImageAsBlob(this.imageUrl);
|
||||
// const item = new ClipboardItem({ [blob.type]: blob });
|
||||
|
||||
// // 将ClipboardItem放入剪贴板
|
||||
// navigator.clipboard.write([item]).then(function() {
|
||||
// console.log('图片已复制到剪贴板');
|
||||
// })
|
||||
// this.copyQrCode()
|
||||
navigator.clipboard.writeText(copyText);
|
||||
this.$modal.msgSuccess("复制成功");
|
||||
} catch (err) {
|
||||
|
@ -726,6 +742,38 @@ export default {
|
|||
|
||||
// });
|
||||
},
|
||||
copyQrCode() {
|
||||
const clipboard = new Clipboard('.copy-btn', {
|
||||
text: () => this.imageUrl
|
||||
});
|
||||
|
||||
clipboard.on('success', () => {
|
||||
console.log('二维码图片链接已复制到剪贴板');
|
||||
// 可以添加用户提示复制成功
|
||||
clipboard.destroy(); // 销毁Clipboard实例
|
||||
});
|
||||
|
||||
clipboard.on('error', () => {
|
||||
console.log('复制失败');
|
||||
// 可以添加用户提示复制失败
|
||||
clipboard.destroy(); // 销毁Clipboard实例
|
||||
});
|
||||
},
|
||||
fetchImageAsBlob(imageUrl) {
|
||||
return fetch(imageUrl)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok ' + response.statusText);
|
||||
}
|
||||
return response.blob();
|
||||
})
|
||||
.then(blob => {
|
||||
return blob;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('There has been a problem with your fetch operation:', error);
|
||||
});
|
||||
},
|
||||
/** 自配送按钮操作 */
|
||||
handleSelfDelivery(row) {
|
||||
this.$modal.confirm('是否确认将营销源 "' + row.storeCode + '" 转为自配送?确认后该营销源会变为自配送营销。').then(function() {
|
||||
|
|
Loading…
Reference in New Issue