This commit is contained in:
wangshuai 2024-07-17 10:29:19 +08:00
parent 1434a536ef
commit c305d7f9b4
10 changed files with 83 additions and 16 deletions

View File

@ -95,6 +95,7 @@ public class BusAgentInfoController extends BaseController {
} }
SysLogininfor sysLogininfor = new SysLogininfor(); SysLogininfor sysLogininfor = new SysLogininfor();
sysLogininfor.setUserName(bean.getAgentAccount()); sysLogininfor.setUserName(bean.getAgentAccount());
sysLogininfor.setStatus("0");
sysLogininfor.setMsg("登录成功"); sysLogininfor.setMsg("登录成功");
List<SysLogininfor> llll = iSysLogininforService.selectLogininforList(sysLogininfor); List<SysLogininfor> llll = iSysLogininforService.selectLogininforList(sysLogininfor);
bean.setLoginNum(llll.size()); bean.setLoginNum(llll.size());

View File

@ -56,6 +56,9 @@ public class BusSaleInfoController extends BaseController
public TableDataInfo list(BusSaleInfo busSaleInfo) public TableDataInfo list(BusSaleInfo busSaleInfo)
{ {
startPage(); startPage();
if(!"admin".equals(SecurityUtils.getUsername())){
busSaleInfo.setCreateId(SecurityUtils.getUserId());
}
List<BusSaleInfo> list = busSaleInfoService.selectBusSaleInfoList(busSaleInfo); List<BusSaleInfo> list = busSaleInfoService.selectBusSaleInfoList(busSaleInfo);
List<BusSaleInfo> tableList = list.stream() List<BusSaleInfo> tableList = list.stream()
.map(info -> { .map(info -> {

View File

@ -109,7 +109,7 @@ public class BusStoreInfoController extends BaseController {
BusStoreInfo busStoreInfo = new BusStoreInfo(); BusStoreInfo busStoreInfo = new BusStoreInfo();
BeanUtils.copyProperties(reqBusStoreInfo, busStoreInfo); BeanUtils.copyProperties(reqBusStoreInfo, busStoreInfo);
LoginUser user = SecurityUtils.getLoginUser(); LoginUser user = SecurityUtils.getLoginUser();
if (!"OK777".equals(user.getUsername())) { if (!"admin".equals(user.getUsername())) {
busStoreInfo.setBindUser(user.getUsername()); busStoreInfo.setBindUser(user.getUsername());
} }
List<BusStoreInfo> list = busStoreInfoService.selectBusStoreInfoList(busStoreInfo); List<BusStoreInfo> list = busStoreInfoService.selectBusStoreInfoList(busStoreInfo);

View File

@ -2,6 +2,9 @@ package com.ruoyi.business.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -27,6 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author ruoyi * @author ruoyi
* @date 2024-07-16 * @date 2024-07-16
*/ */
@Api(tags = "模版")
@RestController @RestController
@RequestMapping("/business/template") @RequestMapping("/business/template")
public class BusTemplateInfoController extends BaseController public class BusTemplateInfoController extends BaseController
@ -37,7 +41,7 @@ public class BusTemplateInfoController extends BaseController
/** /**
* 查询模版列表 * 查询模版列表
*/ */
@PreAuthorize("@ss.hasPermi('business:template:list')") // @PreAuthorize("@ss.hasPermi('business:template:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BusTemplateInfo busTemplateInfo) public TableDataInfo list(BusTemplateInfo busTemplateInfo)
{ {
@ -62,17 +66,24 @@ public class BusTemplateInfoController extends BaseController
/** /**
* 获取模版详细信息 * 获取模版详细信息
*/ */
@PreAuthorize("@ss.hasPermi('business:template:query')") // @PreAuthorize("@ss.hasPermi('business:template:query')")
@ApiOperation("根据模版id获取模版详情")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return success(busTemplateInfoService.selectBusTemplateInfoById(id)); return success(busTemplateInfoService.selectBusTemplateInfoById(id));
} }
@ApiOperation("根据单前登录人获取模版详情")
@GetMapping(value = "/getTemplateInfo")
public AjaxResult getTemplateInfo()
{
return success(busTemplateInfoService.getTemplateInfo());
}
/** /**
* 新增模版 * 新增模版
*/ */
@PreAuthorize("@ss.hasPermi('business:template:add')") // @PreAuthorize("@ss.hasPermi('business:template:add')")
@Log(title = "模版", businessType = BusinessType.INSERT) @Log(title = "模版", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BusTemplateInfo busTemplateInfo) public AjaxResult add(@RequestBody BusTemplateInfo busTemplateInfo)
@ -83,7 +94,7 @@ public class BusTemplateInfoController extends BaseController
/** /**
* 修改模版 * 修改模版
*/ */
@PreAuthorize("@ss.hasPermi('business:template:edit')") // @PreAuthorize("@ss.hasPermi('business:template:edit')")
@Log(title = "模版", businessType = BusinessType.UPDATE) @Log(title = "模版", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BusTemplateInfo busTemplateInfo) public AjaxResult edit(@RequestBody BusTemplateInfo busTemplateInfo)

View File

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* 模版对象 bus_template_info * 模版对象 bus_template_info
* *
@ -54,6 +56,16 @@ public class BusTemplateInfo extends BaseEntity
@Excel(name = "排序") @Excel(name = "排序")
private Long sort; private Long sort;
private List<BusTemplateAttrInfo> attrInfoList;
public List<BusTemplateAttrInfo> getAttrInfoList() {
return attrInfoList;
}
public void setAttrInfoList(List<BusTemplateAttrInfo> attrInfoList) {
this.attrInfoList = attrInfoList;
}
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;

View File

@ -58,4 +58,6 @@ public interface IBusTemplateInfoService
* @return 结果 * @return 结果
*/ */
public int deleteBusTemplateInfoById(Long id); public int deleteBusTemplateInfoById(Long id);
public BusTemplateInfo getTemplateInfo();
} }

View File

@ -1,7 +1,13 @@
package com.ruoyi.business.service.impl; package com.ruoyi.business.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.business.domain.BusTemplateAttrInfo;
import com.ruoyi.business.mapper.BusTemplateAttrInfoMapper;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusTemplateInfoMapper; import com.ruoyi.business.mapper.BusTemplateInfoMapper;
@ -20,6 +26,9 @@ public class BusTemplateInfoServiceImpl implements IBusTemplateInfoService
@Autowired @Autowired
private BusTemplateInfoMapper busTemplateInfoMapper; private BusTemplateInfoMapper busTemplateInfoMapper;
@Autowired
private BusTemplateAttrInfoMapper busTemplateAttrInfoMapper;
/** /**
* 查询模版 * 查询模版
* *
@ -29,7 +38,12 @@ public class BusTemplateInfoServiceImpl implements IBusTemplateInfoService
@Override @Override
public BusTemplateInfo selectBusTemplateInfoById(Long id) public BusTemplateInfo selectBusTemplateInfoById(Long id)
{ {
return busTemplateInfoMapper.selectBusTemplateInfoById(id); BusTemplateInfo busTemplateInfo = busTemplateInfoMapper.selectBusTemplateInfoById(id);
BusTemplateAttrInfo busTemplateAttrInfo = new BusTemplateAttrInfo();
busTemplateAttrInfo.setTemplateId(id);
List<BusTemplateAttrInfo> list1 = busTemplateAttrInfoMapper.selectBusTemplateAttrInfoList(busTemplateAttrInfo);
busTemplateInfo.setAttrInfoList(list1);
return busTemplateInfo;
} }
/** /**
@ -93,4 +107,22 @@ public class BusTemplateInfoServiceImpl implements IBusTemplateInfoService
{ {
return busTemplateInfoMapper.deleteBusTemplateInfoById(id); return busTemplateInfoMapper.deleteBusTemplateInfoById(id);
} }
@Override
public BusTemplateInfo getTemplateInfo() {
LoginUser user = SecurityUtils.getLoginUser();
BusTemplateInfo busTemplateInfo = new BusTemplateInfo();
busTemplateInfo.setCreateId(user.getUserId());
busTemplateInfo.setTemplateStatus("1");
List<BusTemplateInfo> list = busTemplateInfoMapper.selectBusTemplateInfoList(busTemplateInfo);
if(list.size() == 1){
BusTemplateInfo busTemplateInfo1 = list.get(0);
BusTemplateAttrInfo busTemplateAttrInfo = new BusTemplateAttrInfo();
busTemplateAttrInfo.setTemplateId(busTemplateInfo1.getId());
List<BusTemplateAttrInfo> list1 = busTemplateAttrInfoMapper.selectBusTemplateAttrInfoList(busTemplateAttrInfo);
busTemplateInfo1.setAttrInfoList(list1);
return busTemplateInfo1;
}
throw new ServiceException("模版信息异常!");
}
} }

View File

@ -33,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND user_name like concat('%', #{userName}, '%') AND user_name like concat('%', #{userName}, '%')
</if> </if>
<if test="msg != null and msg != ''">
AND msg like concat('%', #{msg}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND login_time &gt;= #{params.beginTime} AND login_time &gt;= #{params.beginTime}
</if> </if>

View File

@ -186,13 +186,13 @@
<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 v-if="userAccount !='OK777' && scope.row.returnVisitStatus !== '1'" <el-button v-if="userAccount !='admin' && 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)"
>配置</el-button> >配置</el-button>
<el-button v-if="userAccount !='OK777' && scope.row.returnVisitStatus !== '1'" <el-button v-if="userAccount !='admin' && scope.row.returnVisitStatus !== '1'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@ -453,7 +453,7 @@ export default {
}, },
created() { created() {
this.userAccount = this.$store.state.user.name; this.userAccount = this.$store.state.user.name;
if(this.$store.state.user.name == 'OK777'){ if(this.$store.state.user.name == 'admin'){
this.isDisabled = true; this.isDisabled = true;
} }
this.getListSale(); this.getListSale();

View File

@ -106,9 +106,12 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="2">
<el-form-item label="开启数量:"><span>{{map.openCount}}</span></el-form-item> <el-form-item label="开启数量:"><span>{{map.openCount}}</span></el-form-item>
</el-col> </el-col>
<el-col :span="2">
<el-form-item label="当前账分:"><span>{{nowIntegral}}</span></el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -147,7 +150,7 @@
@click="handleExport" @click="handleExport"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5" class="top-right-btn"><el-button size="mini" type="error">当前账分{{nowIntegral}}</el-button></el-col> <!-- <el-col :span="1.5" class="top-right-btn"><el-button size="mini" type="error">当前账分{{nowIntegral}}</el-button></el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -194,19 +197,19 @@
<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 v-if="userAccount !='OK777' " <el-button v-if="userAccount !='admin' "
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>配置</el-button> >配置</el-button>
<el-button v-if="userAccount !='OK777' && scope.row.selfDeliveryStatus == '1' " <el-button v-if="userAccount !='admin' && scope.row.selfDeliveryStatus == '1' "
size="mini" size="mini"
type="text" type="text"
icon="el-icon-bicycle" icon="el-icon-bicycle"
@click="handleSelfDelivery(scope.row)" @click="handleSelfDelivery(scope.row)"
>自配送</el-button> >自配送</el-button>
<el-button v-if="userAccount !='OK777' " <el-button v-if="userAccount !='admin' "
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@ -466,7 +469,7 @@ export default {
}, },
created() { created() {
this.userAccount = this.$store.state.user.name; this.userAccount = this.$store.state.user.name;
if(this.$store.state.user.name == 'OK777'){ if(this.$store.state.user.name == 'admin'){
this.isDisabled = true; this.isDisabled = true;
} }
this.getListSale(); this.getListSale();