店铺操作

This commit is contained in:
wangshuai 2024-07-04 23:16:28 +08:00
parent 88884604b0
commit 2f4eca1158
4 changed files with 142 additions and 42 deletions

View File

@ -4,8 +4,11 @@ import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.business.domain.BusStoreConfigInfo;
import com.ruoyi.business.req.ReqBusStoreInfo;
import com.ruoyi.business.resp.RespBusStoreInfo;
import com.ruoyi.business.service.IBusStoreConfigInfoService;
import com.ruoyi.common.exception.ServiceException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
@ -42,6 +45,8 @@ public class BusStoreInfoController extends BaseController
@Autowired
private IBusStoreInfoService busStoreInfoService;
@Autowired
private IBusStoreConfigInfoService iBusStoreConfigInfoService;
/**
* 查询店铺信息列表
*/
@ -83,12 +88,43 @@ public class BusStoreInfoController extends BaseController
}
@PreAuthorize("@ss.hasPermi('business:store:edit')")
@Log(title = "店铺信息", businessType = BusinessType.UPDATE)
@Log(title = "修改营销状态", businessType = BusinessType.UPDATE)
@PutMapping("changeReturnVisitStatus")
public AjaxResult changeReturnVisitStatus(@RequestBody BusStoreInfo busStoreInfo)
public AjaxResult changeReturnVisitStatus(@RequestBody BusStoreInfo busStoreInfo1)
{
BusStoreInfo busStoreInfo = new BusStoreInfo();
busStoreInfo.setId(busStoreInfo1.getId());
busStoreInfo.setReturnVisitStatus(busStoreInfo1.getReturnVisitStatus());
return toAjax(busStoreInfoService.updateBusStoreInfo(busStoreInfo));
}
@PreAuthorize("@ss.hasPermi('business:store:edit')")
@Log(title = "自配送、删除状态", businessType = BusinessType.UPDATE)
@PutMapping("changeSelfDeliveryStatus")
public AjaxResult changeSelfDeliveryStatus(@RequestBody BusStoreInfo busStoreInfo1)
{
BusStoreInfo busStoreInfo = new BusStoreInfo();
busStoreInfo.setId(busStoreInfo1.getId());
busStoreInfo.setSelfDeliveryStatus(busStoreInfo1.getSelfDeliveryStatus());
return toAjax(busStoreInfoService.updateBusStoreInfo(busStoreInfo));
}
@PreAuthorize("@ss.hasPermi('business:store:query')")
@GetMapping(value = "/config/{storeCode}")
public AjaxResult getStoreConfig(@PathVariable("storeCode") String storeCode)
{
BusStoreConfigInfo busStoreConfigInfo = new BusStoreConfigInfo();
busStoreConfigInfo.setStoreCode(storeCode);
List<BusStoreConfigInfo> list = iBusStoreConfigInfoService.selectBusStoreConfigInfoList(busStoreConfigInfo);
if(list.size()==0){
return success();
}else if(list.size()==1){
return success(list.get(0));
}else{
throw new ServiceException("数据重复!");
}
}
/**
* 导出店铺信息列表
*/

View File

@ -39,4 +39,7 @@ public class ReqBusStoreInfo {
@ApiModelProperty(name = "回访状态")
private String returnVisitStatus;
/** 店铺状态 */
@ApiModelProperty(name = "店铺状态1正常2自配送3删除")
private String selfDeliveryStatus;
}

View File

@ -46,11 +46,11 @@ public class BusStoreConfigInfo extends BaseEntity
/** 下单次数区间min */
@Excel(name = "下单次数区间min")
private Long minOrderNum;
private int minOrderNum;
/** max */
@Excel(name = "max")
private Long maxOrderNum;
private int maxOrderNum;
/** 回访时段start */
@JsonFormat(pattern = "yyyy-MM-dd")
@ -68,11 +68,11 @@ public class BusStoreConfigInfo extends BaseEntity
/** 自配送营销时长 */
@Excel(name = "自配送营销时长")
private Long selfDeliveryDuration;
private int selfDeliveryDuration;
/** 营销限额 */
@Excel(name = "营销限额")
private Long quota;
private int quota;
public void setId(Long id)
{
@ -137,21 +137,21 @@ public class BusStoreConfigInfo extends BaseEntity
{
return content4;
}
public void setMinOrderNum(Long minOrderNum)
public void setMinOrderNum(int minOrderNum)
{
this.minOrderNum = minOrderNum;
}
public Long getMinOrderNum()
public int getMinOrderNum()
{
return minOrderNum;
}
public void setMaxOrderNum(Long maxOrderNum)
public void setMaxOrderNum(int maxOrderNum)
{
this.maxOrderNum = maxOrderNum;
}
public Long getMaxOrderNum()
public int getMaxOrderNum()
{
return maxOrderNum;
}
@ -182,21 +182,21 @@ public class BusStoreConfigInfo extends BaseEntity
{
return isSpliceOrder;
}
public void setSelfDeliveryDuration(Long selfDeliveryDuration)
public void setSelfDeliveryDuration(int selfDeliveryDuration)
{
this.selfDeliveryDuration = selfDeliveryDuration;
}
public Long getSelfDeliveryDuration()
public int getSelfDeliveryDuration()
{
return selfDeliveryDuration;
}
public void setQuota(Long quota)
public void setQuota(int quota)
{
this.quota = quota;
}
public Long getQuota()
public int getQuota()
{
return quota;
}

View File

@ -185,18 +185,18 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width =120>
<template slot-scope="scope">
<el-button
<el-button v-if="scope.row.returnVisitStatus !== 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']"
>配置</el-button>
<el-button v-if="scope.row.selfDeliveryStatus == 1"
<el-button v-if="scope.row.selfDeliveryStatus == 1 && scope.row.returnVisitStatus !== 1"
size="mini"
type="text"
icon="el-icon-bicycle"
@click="handleDelete(scope.row)"
@click="handleSelfDelivery(scope.row)"
v-hasPermi="['system:role:edit']"
>自配送</el-button>
<el-button v-if="scope.row.returnVisitStatus !== 1"
@ -223,19 +223,77 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="早高峰时段-方案" prop="content1">
<el-input v-model="form.content1" placeholder="请输入角色名称" />
</el-form-item>
<el-form-item label="午高峰时段-方案" prop="content2">
<el-input v-model="form.content2" placeholder="请输入角色名称" />
</el-form-item>
<el-form-item label="晚高峰时段-方案" prop="content3">
<el-input v-model="form.content3" placeholder="请输入角色名称" />
</el-form-item>
<el-form-item label="默认时间段-方案" prop="content4">
<el-input v-model="form.content4" placeholder="请输入角色名称"/>
</el-form-item>
<el-form-item label="营销用户-下单次数 >=" prop="min_order_num">
<el-input-number v-model="form.minOrderNum" placeholder="请输入角色名称" :min="0"/>
</el-form-item>
<el-form-item label="营销用户-下单次数 <=" prop="max_order_num">
<el-input-number v-model="form.maxOrderNum" placeholder="请输入角色名称" :min="0"/>
</el-form-item>
<el-form-item label="营销时段" prop="start_time">
<el-date-picker
v-model="value2"
type="datetimerange"
range-separator="至"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right">
</el-date-picker>
</el-form-item>
<el-form-item label="营销时长" prop="selfDeliveryDuration">
<el-input-number v-model="form.selfDeliveryDuration" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="营销限额" prop="quota">
<el-input-number v-model="form.quota" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="是否拼好饭">
<el-radio-group v-model="form.isSpliceOrder">
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="店铺归属" prop="saleBindName">
<el-input v-model="form.roleSort" controls-position="right"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
// import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
// import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { listStore, changeReturnVisitStatus, listSale, getMtUrl} from "@/api/business/store";
import { listStore, changeReturnVisitStatus, listSale, getMtUrl, changeSelfDeliveryStatus, getStoreConfig} from "@/api/business/store";
import user from "@/store";
export default {
name: "Role",
dicts: ['sys_normal_disable','sys_grant_status','sys_platform_type','sys_return_visit_status'],
dicts: ['sys_yes_no','sys_grant_status','sys_platform_type','sys_return_visit_status'],
data() {
return {
meituanUrl: "https://e.waimai.meituan.com?ABC="+this.$store.state.user.name+":1",
@ -269,7 +327,8 @@ export default {
storeName: undefined,
saleBindId: undefined,
grantStatus: undefined,
returnVisitStatus: undefined
returnVisitStatus: undefined,
selfDeliveryStatus: 1
},
saleList: [],
//
@ -377,8 +436,6 @@ export default {
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
@ -414,22 +471,12 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId);
getRole(roleId).then(response => {
this.form = response.data;
getStoreConfig(row.storeCode).then(response => {
this.open = true;
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
});
});
this.title = "修改角色";
if(response.data != null){
this.form = response.data;
}
this.title = "编辑配置";
});
},
/** 提交按钮 */
@ -467,13 +514,27 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
this.$modal.confirm('是否确认删除解绑编号为"' + row.storeCode + '"的店铺?').then(function() {
console.log(row.id+"====")
return changeSelfDeliveryStatus(row.id, 3);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(function() {
});
},
/** 自配送按钮操作 */
handleSelfDelivery(row) {
this.$modal.confirm('是否确认将营销源 "' + row.storeCode + '" 转为自配送?确认后该营销源会变为自配送营销。').then(function() {
console.log(row.id+"====")
return changeSelfDeliveryStatus(row.id, 2);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(function() {
});
},
/** 导出按钮操作 */
handleExport() {