This commit is contained in:
cun-nan 2024-10-22 16:01:59 +08:00
parent ae9ee648c6
commit 219dfa5cb4
11 changed files with 95 additions and 48 deletions

View File

@ -213,7 +213,7 @@
</template> </template>
<script> <script>
import echarts from "echarts"; import * as echarts from 'echarts';
import { import {
getAmount, getByMonth, getByYear, getAmount, getByMonth, getByYear,
getConsumePoints, getConsumePoints,

View File

@ -75,8 +75,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="machineCode" label="备注"></el-table-column> <el-table-column align="center" prop="remark" label="备注"></el-table-column>
<el-table-column align="center" prop="machineCode" label="创建时间"></el-table-column> <el-table-column align="center" prop="createTime" label="创建时间"></el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -145,19 +145,20 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属机构" prop="deptName"> <el-form-item label="所属机构" prop="deptId">
<el-select <el-select
v-model="deptName" v-model="deviceInfo.deptId"
clearable clearable
placeholder="" placeholder=""
style="width: 300px" style="width: 300px"
multiple
collapse-tags collapse-tags
> >
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id+''"> <el-option
<span style="float: left">{{ item.realName }}</span> v-for="item in deptListSelect"
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span> :key="item.deptId"
</el-option> :label="item.deptName"
:value="item.deptId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="启用状态" prop="isAcquiesce"> <el-form-item label="启用状态" prop="isAcquiesce">
@ -168,8 +169,8 @@
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="appPublicKey"> <el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="deviceInfo.appPublicKey" style="width: 300px"></el-input> <el-input type="textarea" v-model="deviceInfo.remark" style="width: 300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="" @click="handleCancel">取消</el-button> <el-button type="" @click="handleCancel">取消</el-button>
@ -186,6 +187,7 @@
import {addPrintDeviceApi, delPrintDeviceApi, editPrintDeviceApi, getListByPageApi} from "@/api/print"; import {addPrintDeviceApi, delPrintDeviceApi, editPrintDeviceApi, getListByPageApi} from "@/api/print";
import {queryStaffs} from "@/api/order/staff"; import {queryStaffs} from "@/api/order/staff";
import {selectChildByDeptId} from "@/api/system/role";
export default { export default {
name: "printIndex", name: "printIndex",
@ -195,7 +197,7 @@ export default {
tableData: [], tableData: [],
staffIds: '', staffIds: '',
staffList: [], staffList: [],
deptListSelect:[],
deviceInfo: { deviceInfo: {
id: null, // id id: null, // id
machineCode: '', // machineCode: '', //
@ -217,7 +219,7 @@ export default {
deviceName: [ deviceName: [
{required: true, message: '设备名称不能为空', trigger: 'blur'} {required: true, message: '设备名称不能为空', trigger: 'blur'}
], ],
deptName: [ deptId: [
{required: true, message: '机构不能为空', trigger: 'blur'} {required: true, message: '机构不能为空', trigger: 'blur'}
], ],
deviceSi: [ deviceSi: [
@ -249,8 +251,15 @@ export default {
created() { created() {
this.getList() this.getList()
this.getStaffList() this.getStaffList()
this.selectChildByDeptIdApi()
}, },
methods: { methods: {
//
selectChildByDeptIdApi() {
selectChildByDeptId().then(res => {
this.deptListSelect = res.data
})
},
getList() { getList() {
getListByPageApi(this.queryParams).then(res => { getListByPageApi(this.queryParams).then(res => {
this.tableData = res.data.records; this.tableData = res.data.records;

View File

@ -56,7 +56,7 @@ public class CommissionRecordController extends BaseController {
* @return 查询结果 * @return 查询结果
*/ */
@GetMapping("queryList") @GetMapping("queryList")
public ResponseObject queryStaffCommission(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, public ResponseObject queryStaffCommission(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
CommissionRecord commissionRecord) { CommissionRecord commissionRecord) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);

View File

@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Objects;
import java.util.Random; import java.util.Random;
/** /**
@ -143,6 +144,9 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>() MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>()
.eq(MtUser::getMobile, fleetMember.getMobile()) .eq(MtUser::getMobile, fleetMember.getMobile())
.last("limit 1")); .last("limit 1"));
if (ObjectUtil.isEmpty(mtUser)){
throw new RuntimeException("该手机号在会员列表中不存在");
}
if (ObjectUtil.isEmpty(mtUser)) { if (ObjectUtil.isEmpty(mtUser)) {
//注册用户 //注册用户
mtUser = new MtUser(); mtUser = new MtUser();
@ -242,9 +246,16 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
public int update(FleetMember fleetMember) { public int update(FleetMember fleetMember) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
FleetMember fleetMember1 = queryByMobile(fleetMember); FleetMember fleetMember1 = queryByMobile(fleetMember);
if (ObjectUtil.isNotEmpty(fleetMember1) && fleetMember1.getId() != fleetMember.getId()) { if (ObjectUtil.isNotEmpty(fleetMember1) && !Objects.equals(fleetMember1.getId(), fleetMember.getId())) {
return 0; return 0;
} }
//判断当前车队成员否存在账号
MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>()
.eq(MtUser::getMobile, fleetMember.getMobile())
.last("limit 1"));
if (ObjectUtil.isEmpty(mtUser)){
throw new RuntimeException("该手机号在会员列表中不存在");
}
// 如果不限额的话将成员的余额信息改为车队的余额信息 // 如果不限额的话将成员的余额信息改为车队的余额信息
FleetInfo fleetInfo = fleetInfoService.queryById(fleetMember.getFleetId()); FleetInfo fleetInfo = fleetInfoService.queryById(fleetMember.getFleetId());
if (fleetMember.getSecondaryCardType()==1){ if (fleetMember.getSecondaryCardType()==1){

View File

@ -40,7 +40,7 @@ public class PrintDeviceInfoController extends BaseController {
* @return 查询结果 * @return 查询结果
*/ */
@GetMapping("queryByPage") @GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, public ResponseObject queryByPage(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("printDeviceInfo") PrintDeviceInfo printDeviceInfo) { @Param("printDeviceInfo") PrintDeviceInfo printDeviceInfo) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);

View File

@ -68,8 +68,13 @@ public class PrintDeviceInfo extends BaseEntity {
* 店铺id * 店铺id
*/ */
private Integer storeId; private Integer storeId;
@TableField(exist = false) /**
* 机构id
*/
private Integer deptId; private Integer deptId;
/**
* 机构名称
*/
@TableField(exist = false) @TableField(exist = false)
private String deptName; private String deptName;
@ -77,24 +82,14 @@ public class PrintDeviceInfo extends BaseEntity {
private String staffIds; // 员工 private String staffIds; // 员工
private String deviceAb; // 设备功能 private String deviceAb; // 设备功能
private String staffName; // 设备员工名字 private String staffName; // 设备员工名字
/**
* 设备状态 0启用 1 禁用
*/
private String status;
/**
* 备注
*/
private String remark;
} }

View File

@ -39,11 +39,14 @@
id,machine_code,msign,device_name,user_id, id,machine_code,msign,device_name,user_id,
app_key,app_secret,app_public_key,platform_public_key, app_key,app_secret,app_public_key,platform_public_key,
access_token,payment,create_time,update_time,create_by, access_token,payment,create_time,update_time,create_by,
update_by,store_id,acquiesce, update_by,store_id,dept_id,acquiesce,
device_si, device_si,
staff_ids, staff_ids,
device_ab, device_ab,
staff_name staff_name,
create_time,
status,
remark
from print_device_info from print_device_info
<where> <where>
<if test="printDeviceInfo.id != null"> <if test="printDeviceInfo.id != null">
@ -136,16 +139,17 @@
machine_code,msign,device_name,user_id,app_key, machine_code,msign,device_name,user_id,app_key,
app_secret,app_public_key,platform_public_key, app_secret,app_public_key,platform_public_key,
access_token,payment,create_time,update_time, access_token,payment,create_time,update_time,
create_by,update_by,store_id, create_by,update_by,store_id,dept_id,
device_si,staff_ids,device_ab,staff_name device_si,staff_ids,device_ab,staff_name,remark
) )
values (#{acquiesce},#{machineCode},#{msign},#{deviceName},#{userId}, values (#{acquiesce},#{machineCode},#{msign},#{deviceName},#{userId},
#{appKey},#{appSecret},#{appPublicKey},#{platformPublicKey},#{accessToken},#{payment}, #{appKey},#{appSecret},#{appPublicKey},#{platformPublicKey},#{accessToken},#{payment},
#{createTime},#{updateTime},#{createBy},#{updateBy},#{storeId}, #{createTime},#{updateTime},#{createBy},#{updateBy},#{storeId},#{deptId},
#{deviceSi}, #{deviceSi},
#{staffIds}, #{staffIds},
#{deviceAb}, #{deviceAb},
#{staffName} #{staffName},
#{remark}
) )
</insert> </insert>
@ -218,6 +222,9 @@ machine_code = values(machine_code)msign = values(msign)device_name = values(dev
<if test="storeId != null"> <if test="storeId != null">
store_id = #{storeId}, store_id = #{storeId},
</if> </if>
<if test="deptId != null">
dept_id = #{deptId},
</if>
<if test="acquiesce != null"> <if test="acquiesce != null">
acquiesce = #{acquiesce}, acquiesce = #{acquiesce},
</if> </if>
@ -233,6 +240,9 @@ machine_code = values(machine_code)msign = values(msign)device_name = values(dev
<if test="staffName != null"> <if test="staffName != null">
staff_name = #{staffName}, staff_name = #{staffName},
</if> </if>
<if test="remark != null">
remark = #{remark},
</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -1,5 +1,6 @@
package com.fuint.business.printer.service.impl; package com.fuint.business.printer.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -7,6 +8,9 @@ import com.fuint.business.printer.entity.PrintDeviceInfo;
import com.fuint.business.printer.mapper.PrintDeviceInfoMapper; import com.fuint.business.printer.mapper.PrintDeviceInfoMapper;
import com.fuint.business.printer.service.PrintDeviceInfoService; import com.fuint.business.printer.service.PrintDeviceInfoService;
import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import io.lettuce.core.dynamic.annotation.Param; import io.lettuce.core.dynamic.annotation.Param;
@ -25,6 +29,8 @@ import javax.annotation.Resource;
public class PrintDeviceInfoServiceImpl implements PrintDeviceInfoService { public class PrintDeviceInfoServiceImpl implements PrintDeviceInfoService {
@Resource @Resource
private PrintDeviceInfoMapper printDeviceInfoMapper; private PrintDeviceInfoMapper printDeviceInfoMapper;
@Autowired
private ISysDeptService deptService;
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
@ -48,7 +54,14 @@ public class PrintDeviceInfoServiceImpl implements PrintDeviceInfoService {
public IPage<PrintDeviceInfo> queryByPage(@Param("page") Page page, PrintDeviceInfo printDeviceInfo) { public IPage<PrintDeviceInfo> queryByPage(@Param("page") Page page, PrintDeviceInfo printDeviceInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
printDeviceInfo.setStoreId(nowAccountInfo.getStoreId()); printDeviceInfo.setStoreId(nowAccountInfo.getStoreId());
return this.printDeviceInfoMapper.queryAllByLimit(page, printDeviceInfo); IPage<PrintDeviceInfo> printDeviceInfoIPage = this.printDeviceInfoMapper.queryAllByLimit(page, printDeviceInfo);
for (PrintDeviceInfo record : printDeviceInfoIPage.getRecords()) {
if (ObjectUtil.isNotEmpty(record.getDeptId())){
SysDept sysDept = deptService.selectDeptById(Long.valueOf(record.getDeptId()));
record.setDeptName(sysDept.getDeptName());
}
}
return printDeviceInfoIPage;
} }
/** /**

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.fleet.entity.FleetMember; import com.fuint.business.fleet.entity.FleetMember;
import com.fuint.business.fleet.mapper.FleetMemberMapper; import com.fuint.business.fleet.mapper.FleetMemberMapper;
import com.fuint.business.fleet.service.FleetInfoService; import com.fuint.business.fleet.service.FleetInfoService;
import com.fuint.business.fleet.service.FleetMemberService;
import com.fuint.business.fleet.vo.FleetInfoUniVo; import com.fuint.business.fleet.vo.FleetInfoUniVo;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService; import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
@ -73,7 +74,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
@Autowired @Autowired
private FleetInfoService fleetInfoService; private FleetInfoService fleetInfoService;
@Autowired @Autowired
private FleetMemberMapper fleetMemberMapper; @Lazy
private FleetMemberService fleetMemberService;
/** /**
* 根据条件分页查询会员信息 * 根据条件分页查询会员信息
@ -386,6 +388,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
if (CollUtil.isNotEmpty(fleetInfoUniVos)) { if (CollUtil.isNotEmpty(fleetInfoUniVos)) {
it.setFleetInfoUniVos(fleetInfoUniVos); it.setFleetInfoUniVos(fleetInfoUniVos);
} }
FleetMember fleetMember = fleetMemberService.selectByUserId(it.getId());
it.setFleetMember(fleetMember);
}); });
return ljUserVos; return ljUserVos;
} }

View File

@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.fleet.entity.FleetMember;
import com.fuint.business.fleet.vo.FleetInfoUniVo; import com.fuint.business.fleet.vo.FleetInfoUniVo;
import com.fuint.business.userManager.entity.MtUserFuel; import com.fuint.business.userManager.entity.MtUserFuel;
import com.fuint.business.userManager.util.GenderConverter; import com.fuint.business.userManager.util.GenderConverter;
@ -171,4 +172,8 @@ public class LJUserVo extends BaseEntity {
* 车队信息 * 车队信息
*/ */
List<FleetInfoUniVo> fleetInfoUniVos; List<FleetInfoUniVo> fleetInfoUniVos;
/**
* 车队成员信息
*/
FleetMember fleetMember;
} }

View File

@ -20,9 +20,9 @@
囤油卡{{item.fuelAmount}} 囤油卡{{item.fuelAmount}}
</div> </div>
</div> </div>
<div v-if="chooseVipUser.fleetInfoUniVos"> <div v-if="chooseVipUser.fleetMember">
<div v-for="(item,index) in chooseVipUser.fleetInfoUniVos" :key="index"> <div>
车队卡{{ item.totalBalance }} 车队卡{{ chooseVipUser.fleetMember.secondaryCardLimit }}
</div> </div>
</div> </div>
<img slot="reference" src="./imgs/kbao.png" style="width: 24px;height: 24px;margin-right: 10px"> <img slot="reference" src="./imgs/kbao.png" style="width: 24px;height: 24px;margin-right: 10px">
@ -419,7 +419,7 @@
width="542px" width="542px"
center center
> >
<accountPending :amount="oilGunClearing.amount" @changeAmount="changeAmount"></accountPending> <accountPending v-if="oilGunClearing.amount>0" :amount="oilGunClearing.amount" @changeAmount="changeAmount"></accountPending>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="accountPending = false"> </el-button> <el-button @click="accountPending = false"> </el-button>
<el-button type="primary" @click="addHangbill"> </el-button> <el-button type="primary" @click="addHangbill"> </el-button>