Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-03-30 15:10:21 +08:00
commit 14cc5b5c0c
10 changed files with 193 additions and 39 deletions

View File

@ -26,6 +26,14 @@ export function treeselect(params) {
})
}
export function treeselects(params) {
return request({
url: 'backendApi/source/treeselects',
method: 'get',
params: params
})
}
// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId) {
return request({

View File

@ -152,7 +152,7 @@
<script>
import {dutyDelete, dutyEdit, dutyList} from "@/api/duty/duty";
import {addRole, getRole, updateRole} from "@/api/system/role";
import {treeselect} from "@/api/system/menu";
import {treeselects} from "@/api/system/menu";
export default {
data(){
@ -197,10 +197,10 @@ export default {
changeMenu(){
console.log(this.form1.roleType)
if (this.form1.roleType == '4'){
this.getMenuTreeselect(2);
this.getMenuTreeselect();
}
if (this.form1.roleType == '3'){
this.getMenuTreeselect(1);
this.getMenuTreeselect();
}
},
//
@ -217,7 +217,8 @@ export default {
status: "A",
menuIds: [],
menuCheckStrictly: true,
description: ''
description: '',
deptType: '3',
};
this.resetForm("form1");
},
@ -280,13 +281,13 @@ export default {
},
handleAdd1(){
this.reset1();
this.getMenuTreeselect(1);
this.getMenuTreeselect();
this.openDuty = true;
this.title = "添加角色";
},
//
getMenuTreeselect(merchantId) {
return treeselect({merchantId:merchantId}).then(response => {
getMenuTreeselect() {
return treeselects().then(response => {
this.menuOptions = response.data;
return response
});
@ -305,7 +306,7 @@ export default {
let val = null;
if (data.dutyType == '3') val = 1;
if (data.dutyType == '4') val = 2;
const roleMenu = this.getMenuTreeselect(val);
const roleMenu = this.getMenuTreeselect();
const roleId = data.dutyId
getRole(roleId).then(response => {
this.form1.roleName = response.data.roleInfo.name;

View File

@ -117,13 +117,16 @@
@click="binding(scope.row)"
>一键绑定</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="nobinding(scope.row)"
>解绑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="nobinding(scope.row)"
v-if="scope.row.tagStatus == 1"
>解绑</el-button>
<el-button
size="mini"
type="text"
@ -316,29 +319,55 @@
<el-dialog title="码牌列表" :visible.sync="openShow" width="800px" append-to-body>
<div class="wrap-box">
<div class="gang-box">
<div class="rw">
序号
</div>
<div class="rw">
厂商名称
</div>
<div class="rw">
二维码SN号
</div>
<div class="rw">
码牌SN号
</div>
<div class="rw">
操作
</div>
</div>
<div class="gang-box" :class="{'oilid' :oilid == item.id }" v-for="(item,index) in arrList" :key="index">
<el-table-column label="厂商名称" align="center" width="110">
<template slot-scope="item">
<span>{{item.companyName}}</span>
</template>
</el-table-column>
<el-table-column label="二维码SN号" align="center" width="110">
<template slot-scope="item">
<span>{{item.tagCodeSn}}</span>
</template>
</el-table-column>
<el-table-column label="码牌SN号" align="center" width="110">
<template slot-scope="item">
<span>{{item.snCode}}</span>
</template>
</el-table-column>
<!-- <div>
<!-- <el-table-column label="厂商名称" align="center" width="110">-->
<!-- <template slot-scope="item">-->
<!-- <span>{{item.companyName || ''}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="二维码SN号" align="center" width="110">-->
<!-- <template slot-scope="item">-->
<!-- <span>{{item.tagCodeSn|| ''}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="码牌SN号" align="center" width="110">-->
<!-- <template slot-scope="item">-->
<!-- <span>{{item.snCode|| ''}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<div class="rw">
{{index+1}}
</div>
<div class="rw">
{{item.companyName}}
</div>-->
<div style="color: #00afff;cursor: pointer;margin-right: 15px" v-if="oilid != item.id" @click="getoil(item.id)">
</div>
<div class="rw">
{{item.tagCodeSn}}
</div>
<div class="rw">
{{item.snCode}}
</div>
<div style="width: 25%; text-align: center; color: #00afff;cursor: pointer;" v-if="oilid != item.id" @click="getoil(item.id)">
选择
</div>
<div style="color: #adadad;cursor: pointer;margin-right: 15px" v-if="oilid == item.id">
<div style="width: 25%; text-align: center; color: #adadad;cursor: pointer;" v-if="oilid == item.id">
已选择
</div>
</div>
@ -529,7 +558,7 @@ export default {
},
created() {
this.getList();
this.gettagCodeRecord()
//
// this.getDuty();
// this.getStoreList();
},
@ -537,6 +566,7 @@ export default {
binding(row){
this.staffId = row.id
this.openShow = true
this.gettagCodeRecord()
},
nobinding(row){
let data = {
@ -907,5 +937,9 @@ export default {
.oilid{
background: #f6f8f9 !important;
}
.rw{
width: 25%;
text-align: center;
}
</style>

View File

@ -11,6 +11,7 @@ import com.fuint.common.util.TokenUtil;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.service.ISysDeptService;
import com.fuint.system.role.entity.TDuty;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -64,6 +65,7 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
@Override
public Page<TDuty> selectDutyPage(Page page, TDuty duty) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
/*if (ObjectUtil.isNotEmpty(duty.getStoreId())){
SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId()));
duty.setStoreId(Math.toIntExact(sysDept.getDeptId()));
@ -72,7 +74,12 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId());
duty.setStoreId(Math.toIntExact(sysDept.getDeptId()));
}*/
duty.setStoreId(duty.getStoreId());
if (ObjectUtils.isNotEmpty(duty.getStoreId())){
duty.setStoreId(duty.getStoreId());
}else {
duty.setStoreId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
}
return baseMapper.selectDutyPage(page,duty);
}

View File

@ -391,11 +391,14 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
@Override
public LJStaff selectStaffByStoreId(int storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("status","qy");
queryWrapper.eq("if_delete","0");
queryWrapper.eq("role_id","12");
//queryWrapper.eq("role_id","12");
queryWrapper.orderByAsc("create_time");
List<LJStaff> list = baseMapper.selectList(queryWrapper);
LJStaff staff = null;

View File

@ -80,7 +80,7 @@ public class TagCodeRecordController extends BaseController {
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody TagCodeRecordDTO tagCodeRecordDTO) {
public ResponseObject insert(@RequestBody TagCodeRecordDTO tagCodeRecordDTO) throws Exception {
return getSuccessResult(this.tagCodeRecordService.add(tagCodeRecordDTO));
}

View File

@ -18,7 +18,7 @@ import java.util.List;
*/
public interface TagCodeRecordService extends IService<TagCodeRecord> {
boolean add(TagCodeRecordDTO tagCodeRecordDTO);
boolean add(TagCodeRecordDTO tagCodeRecordDTO) throws Exception;
IPage<TagCodeRecordVO> selectTagList(Page page, TagCodeRecord tagCodeRecord);

View File

@ -12,6 +12,7 @@ import com.fuint.business.tag.service.TagCodeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.module.backendApi.controller.BackendFileController;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
@ -43,9 +44,23 @@ public class OilTagServiceImpl extends ServiceImpl<OilTagMapper, OilTag> impleme
oilTag.setTerminalNumber(number+"");
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilTag.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
LambdaQueryWrapper<TagCode> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCode::getTagCodeSn, oilTag.getTagCodeSn());
TagCode tagCode = tagCodeService.getOne(queryWrapper);
LambdaQueryWrapper<OilTag> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(OilTag::getTagCodeSn, oilTag.getTagCodeSn());
OilTag one = getOne(queryWrapper1);
if (ObjectUtils.isNotEmpty(one)){
throw new Exception("该二维码已绑定过码牌");
}
queryWrapper1.eq(OilTag::getSnCode, oilTag.getSnCode());
OilTag ones = getOne(queryWrapper1);
if (ObjectUtils.isNotEmpty(ones)){
throw new Exception("该码牌已绑定过二维码");
}
//TagCode tagCode = tagCodeService.getById(oilTag.getTagCodeId());
oilTag.setTagCodeId(tagCode.getId());
return save(oilTag);

View File

@ -57,7 +57,7 @@ public class TagCodeRecordServiceImpl extends ServiceImpl<TagCodeRecordMapper, T
@Override
@Transactional
public boolean add(TagCodeRecordDTO tagCodeRecordDTO) {
public boolean add(TagCodeRecordDTO tagCodeRecordDTO) throws Exception {
boolean flag = false;
//绑定之前 先去查询
TagCodeRecord tagCodeRecord = new TagCodeRecord();
@ -68,6 +68,20 @@ public class TagCodeRecordServiceImpl extends ServiceImpl<TagCodeRecordMapper, T
OilTag byId = oilTagService.getById(integer);
//二维码id
Integer tagCodeId = byId.getTagCodeId();
//判断该二维码有没有绑定过码牌
/*if (ObjectUtils.isNotEmpty(byId) && ObjectUtils.isNotEmpty(byId.getSnCode())){
throw new Exception("该二维码已经绑定过码牌!");
}*/
if (ObjectUtils.isNotEmpty(byId)){
LambdaQueryWrapper<TagCodeRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCodeRecord::getOilTagId,byId.getId());
TagCodeRecord one = getOne(queryWrapper);
if (ObjectUtils.isNotEmpty(one)){
throw new Exception("该码牌已经绑定过油站!");
}
}
//二维码
TagCode byId1 = tagCodeService.getById(tagCodeId);
String collection = byId1.getCollection();

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.fuint.common.domain.TreeNode;
import com.fuint.common.domain.TreeSelect;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.RoleDto;
import com.fuint.common.dto.SourceDto;
import com.fuint.common.enums.StatusEnum;
import com.fuint.common.service.SourceService;
@ -14,6 +15,8 @@ import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.repository.model.TAccount;
import com.fuint.repository.model.TSource;
import com.fuint.system.role.entity.TDuty;
import com.fuint.system.role.service.DutyService;
import com.fuint.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -22,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -249,6 +254,8 @@ public class BackendSourceController extends BaseController {
return getSuccessResult(true);
}
@Autowired
private DutyService tDutyService;
/**
* 获取菜单下拉树列表
* */
@ -269,5 +276,70 @@ public class BackendSourceController extends BaseController {
List<TreeSelect> data = sourceService.buildMenuTreeSelect(sources);
return getSuccessResult(data);
/*String token = request.getHeader("Access-Token");
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
TDuty htDuty = tDutyService.getRoleById(Long.parseLong(accountInfo.getRoleIds()));
Map<String, Object> result = new HashMap<>();
RoleDto roleInfo = new RoleDto();
roleInfo.setMerchantId(htDuty.getStoreId());
roleInfo.setId(htDuty.getDutyId().longValue());
roleInfo.setName(htDuty.getDutyName());
roleInfo.setType(htDuty.getDutyType());
roleInfo.setStatus(htDuty.getStatus());
roleInfo.setDescription(htDuty.getDescription());
result.put("roleInfo", roleInfo);
return getSuccessResult(result);*/
}
/**
* 获取菜单下拉树列表
* */
@ApiOperation(value = "获取菜单下拉树列表")
@RequestMapping(value = "/treeselects", method = RequestMethod.GET)
public ResponseObject treeselects(HttpServletRequest request) {
String token = request.getHeader("Access-Token");
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
if (accountInfo == null) {
return getFailureResult(1001, "请先登录");
}
List<Long> checkedKeys = tDutyService.getSourceIdsByDutyId(Integer.parseInt(accountInfo.getRoleIds()));
ArrayList<TreeNode> longArrayList = new ArrayList<>();
List<TreeNode> sources = sSourceService.getSourceTree(null);
for (TreeNode source : sources) {
for (Long checkedKey : checkedKeys) {
if (source.getId() == checkedKey) {
longArrayList.add(source);
}
}
}
List<TreeSelect> data = sourceService.buildMenuTreeSelect(longArrayList);
return getSuccessResult(data);
/*String token = request.getHeader("Access-Token");
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
TDuty htDuty = tDutyService.getRoleById(Long.parseLong(accountInfo.getRoleIds()));
Map<String, Object> result = new HashMap<>();
RoleDto roleInfo = new RoleDto();
roleInfo.setMerchantId(htDuty.getStoreId());
roleInfo.setId(htDuty.getDutyId().longValue());
roleInfo.setName(htDuty.getDutyName());
roleInfo.setType(htDuty.getDutyType());
roleInfo.setStatus(htDuty.getStatus());
roleInfo.setDescription(htDuty.getDescription());
result.put("roleInfo", roleInfo);
return getSuccessResult(result);*/
}
}