店铺操作

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 java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.business.domain.BusStoreConfigInfo;
import com.ruoyi.business.req.ReqBusStoreInfo; import com.ruoyi.business.req.ReqBusStoreInfo;
import com.ruoyi.business.resp.RespBusStoreInfo; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -42,6 +45,8 @@ public class BusStoreInfoController extends BaseController
@Autowired @Autowired
private IBusStoreInfoService busStoreInfoService; private IBusStoreInfoService busStoreInfoService;
@Autowired
private IBusStoreConfigInfoService iBusStoreConfigInfoService;
/** /**
* 查询店铺信息列表 * 查询店铺信息列表
*/ */
@ -83,12 +88,43 @@ public class BusStoreInfoController extends BaseController
} }
@PreAuthorize("@ss.hasPermi('business:store:edit')") @PreAuthorize("@ss.hasPermi('business:store:edit')")
@Log(title = "店铺信息", businessType = BusinessType.UPDATE) @Log(title = "修改营销状态", businessType = BusinessType.UPDATE)
@PutMapping("changeReturnVisitStatus") @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)); 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 = "回访状态") @ApiModelProperty(name = "回访状态")
private String returnVisitStatus; private String returnVisitStatus;
/** 店铺状态 */
@ApiModelProperty(name = "店铺状态1正常2自配送3删除")
private String selfDeliveryStatus;
} }

View File

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

View File

@ -185,18 +185,18 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width =120> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width =120>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-if="scope.row.returnVisitStatus !== 1"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']" v-hasPermi="['system:role:edit']"
>配置</el-button> >配置</el-button>
<el-button v-if="scope.row.selfDeliveryStatus == 1" <el-button v-if="scope.row.selfDeliveryStatus == 1 && scope.row.returnVisitStatus !== 1"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-bicycle" icon="el-icon-bicycle"
@click="handleDelete(scope.row)" @click="handleSelfDelivery(scope.row)"
v-hasPermi="['system:role:edit']" v-hasPermi="['system:role:edit']"
>自配送</el-button> >自配送</el-button>
<el-button v-if="scope.row.returnVisitStatus !== 1" <el-button v-if="scope.row.returnVisitStatus !== 1"
@ -223,19 +223,77 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @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> </div>
</template> </template>
<script> <script>
// import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; // import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
// import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; // 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"; import user from "@/store";
export default { export default {
name: "Role", 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() { data() {
return { return {
meituanUrl: "https://e.waimai.meituan.com?ABC="+this.$store.state.user.name+":1", meituanUrl: "https://e.waimai.meituan.com?ABC="+this.$store.state.user.name+":1",
@ -269,7 +327,8 @@ export default {
storeName: undefined, storeName: undefined,
saleBindId: undefined, saleBindId: undefined,
grantStatus: undefined, grantStatus: undefined,
returnVisitStatus: undefined returnVisitStatus: undefined,
selfDeliveryStatus: 1
}, },
saleList: [], saleList: [],
// //
@ -377,8 +436,6 @@ export default {
roleKey: undefined, roleKey: undefined,
roleSort: 0, roleSort: 0,
status: "0", status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true, menuCheckStrictly: true,
deptCheckStrictly: true, deptCheckStrictly: true,
remark: undefined remark: undefined
@ -414,22 +471,12 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const roleId = row.roleId || this.ids getStoreConfig(row.storeCode).then(response => {
const roleMenu = this.getRoleMenuTreeselect(roleId);
getRole(roleId).then(response => {
this.form = response.data;
this.open = true; this.open = true;
this.$nextTick(() => { if(response.data != null){
roleMenu.then(res => { this.form = response.data;
let checkedKeys = res.checkedKeys }
checkedKeys.forEach((v) => { this.title = "编辑配置";
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
});
});
this.title = "修改角色";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -467,13 +514,27 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const roleIds = row.roleId || this.ids; this.$modal.confirm('是否确认删除解绑编号为"' + row.storeCode + '"的店铺?').then(function() {
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() { console.log(row.id+"====")
return delRole(roleIds); return changeSelfDeliveryStatus(row.id, 3);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); 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() { handleExport() {