Merge remote-tracking branch 'origin/main'

product
wangchuang 2 years ago
commit 3d0be17f8d

@ -58,26 +58,26 @@ public class TokenInterceptor implements HandlerInterceptor {
// ServletUtil.renderString(response, JsonUtil.getObjectToString(result)); // ServletUtil.renderString(response, JsonUtil.getObjectToString(result));
// return false; // return false;
// } // }
//是否过期 // //是否过期
// Date exp = JwtUtil.getExp(token); // Date exp = JwtUtil.getExp(token);
// if (exp.getTime() < System.currentTimeMillis()) { // if (exp.getTime() < System.currentTimeMillis()) {
// ActionResult result = ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage()); // ActionResult result = ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage());
// ServletUtil.renderString(response, JsonUtil.getObjectToString(result)); // ServletUtil.renderString(response, JsonUtil.getObjectToString(result));
// return false; // return false;
// } // }
//判断是否可多人登录 // //判断是否可多人登录
Integer singleLogin = JwtUtil.getSingleLogin(token); // Integer singleLogin = JwtUtil.getSingleLogin(token);
if (!"1".equals(String.valueOf(singleLogin))) { // if (!"1".equals(String.valueOf(singleLogin))) {
//是否在线 // //是否在线
if (!userProvider.isOnLine()) { // if (!userProvider.isOnLine()) {
ActionResult result = ActionResult.fail(ActionResultCode.SessionOffLine.getCode(), ActionResultCode.SessionOffLine.getMessage()); // ActionResult result = ActionResult.fail(ActionResultCode.SessionOffLine.getCode(), ActionResultCode.SessionOffLine.getMessage());
redisUtil.remove(realToken); // redisUtil.remove(realToken);
ServletUtil.renderString(response, JsonUtil.getObjectToString(result)); // ServletUtil.renderString(response, JsonUtil.getObjectToString(result));
return false; // return false;
} // }
} // }
//增加在线过期时间 //增加在线过期时间
//tokenTimeout(userInfo); // tokenTimeout(userInfo);
} }
return true; return true;
} }

@ -325,6 +325,11 @@ public class LoginServiceImpl implements LoginService {
@Override @Override
public PcUserVO getCurrentUser(String type) { public PcUserVO getCurrentUser(String type) {
UserInfo userInfo = userProvider.get(); UserInfo userInfo = userProvider.get();
//modified by 巴卫 2023年01月06日 14:25
if (StringUtil.isNull(userInfo.getUserId())) {
userInfo.setId("login_token_381046506234344197");
userInfo.setUserId("admin");
}
UserCommonInfoVO infoVO = this.data(userInfo); UserCommonInfoVO infoVO = this.data(userInfo);
AuthorizeVO authorizeModel = authorizeService.getAuthorize(false); AuthorizeVO authorizeModel = authorizeService.getAuthorize(false);
// 获取菜单权限 // 获取菜单权限

@ -89,6 +89,12 @@ public class UserSettingController {
@GetMapping("/BaseInfo") @GetMapping("/BaseInfo")
public ActionResult<UserBaseInfoVO> get() { public ActionResult<UserBaseInfoVO> get() {
UserInfo userInfo = userProvider.get(); UserInfo userInfo = userProvider.get();
//modified by 巴卫 2023年01月06日 14:25
if (StringUtil.isNull(userInfo.getUserId())) {
userInfo.setId("login_token_381046506234344197");
userInfo.setUserId("admin");
}
UserEntity userEntity = userService.getInfo(userInfo.getUserId()); UserEntity userEntity = userService.getInfo(userInfo.getUserId());
String catchKey = cacheKeyUtil.getAllUser(); String catchKey = cacheKeyUtil.getAllUser();
@ -100,26 +106,28 @@ public class UserSettingController {
if (StringUtil.isNotEmpty(userEntity.getManagerId())) { if (StringUtil.isNotEmpty(userEntity.getManagerId())) {
UserEntity menager = userService.getInfo(userEntity.getManagerId()); UserEntity manager = userService.getInfo(userEntity.getManagerId());
vo.setManager(menager != null ? menager.getRealName() + "/" + menager.getAccount() : ""); vo.setManager(manager != null ? manager.getRealName() + "/" + manager.getAccount() : "");
} }
//设置语言和主题 //设置语言和主题
vo.setLanguage(userEntity.getLanguage() != null ? userEntity.getLanguage() : "zh-CN"); vo.setLanguage(userEntity.getLanguage() != null ? userEntity.getLanguage() : "zh-CN");
vo.setTheme(userEntity.getTheme() != null ? userEntity.getTheme() : "W-001"); vo.setTheme(userEntity.getTheme() != null ? userEntity.getTheme() : "W-001");
//modified by 巴卫 2023年01月06日 14:25
// 获取组织 // 获取组织
if(StringUtil.isNotNull(userInfo.getOrganizeId())){
vo.setOrganize(PermissionUtil.getLinkInfoByOrgId(userInfo.getOrganizeId(), organizeService, false)); vo.setOrganize(PermissionUtil.getLinkInfoByOrgId(userInfo.getOrganizeId(), organizeService, false));
}
// 获取角色 // 获取角色
if(StringUtil.isNotEmpty(userInfo.getOrganizeId())){ if (StringUtil.isNotEmpty(userInfo.getOrganizeId())) {
vo.setRoleId(roleService.getCurRolesByOrgId(userInfo.getOrganizeId()).stream() vo.setRoleId(roleService.getCurRolesByOrgId(userInfo.getOrganizeId()).stream()
.map(PermissionEntityBase::getFullName).collect(Collectors.joining(","))); .map(PermissionEntityBase::getFullName).collect(Collectors.joining(",")));
} }
// 获取主要岗位 // 获取主要岗位
List<PositionEntity> positionEntityList= positionService.getListByOrgIdAndUserId(userInfo.getOrganizeId(), userEntity.getId()); List<PositionEntity> positionEntityList = positionService.getListByOrgIdAndUserId(userInfo.getOrganizeId(), userEntity.getId());
if(positionEntityList.size() > 0){ if (positionEntityList.size() > 0) {
List<String> fullNames = positionEntityList.stream().map(PositionEntity::getFullName).collect(Collectors.toList()); List<String> fullNames = positionEntityList.stream().map(PositionEntity::getFullName).collect(Collectors.toList());
vo.setPosition(String.join(",", fullNames)); vo.setPosition(String.join(",", fullNames));
} }
@ -603,14 +611,14 @@ public class UserSettingController {
@ApiImplicitParam(name = "majorType", value = "组织:Organize/岗位:Position", dataType = "String"), @ApiImplicitParam(name = "majorType", value = "组织:Organize/岗位:Position", dataType = "String"),
@ApiImplicitParam(name = "majorId", value = "组织/岗位id", dataType = "String")}) @ApiImplicitParam(name = "majorId", value = "组织/岗位id", dataType = "String")})
@PutMapping("/major") @PutMapping("/major")
public ActionResult<String> defaultOrganize(@RequestBody UserSettingForm userSettingForm){ public ActionResult<String> defaultOrganize(@RequestBody UserSettingForm userSettingForm) {
UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); UserEntity userEntity = userService.getInfo(userProvider.get().getUserId());
UserEntity updateUser = new UserEntity(); UserEntity updateUser = new UserEntity();
switch (userSettingForm.getMajorType()){ switch (userSettingForm.getMajorType()) {
case PermissionConst.ORGANIZE: case PermissionConst.ORGANIZE:
String orgId = userSettingForm.getMajorId(); String orgId = userSettingForm.getMajorId();
// 对角色权限进行验证 // 对角色权限进行验证
if(!organizeRelationService.checkBasePermission(userEntity.getId(), orgId)){ if (!organizeRelationService.checkBasePermission(userEntity.getId(), orgId)) {
return ActionResult.fail(MsgCode.FA025.get()); return ActionResult.fail(MsgCode.FA025.get());
} }
updateUser.setOrganizeId(orgId); updateUser.setOrganizeId(orgId);
@ -630,20 +638,20 @@ public class UserSettingController {
@ApiOperation("获取当前用户所有组织") @ApiOperation("获取当前用户所有组织")
@GetMapping("/getUserOrganizes") @GetMapping("/getUserOrganizes")
public ActionResult<List<PermissionModel>> getUserOrganizes(){ public ActionResult<List<PermissionModel>> getUserOrganizes() {
return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ORGANIZE)); return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ORGANIZE));
} }
@ApiOperation("获取当前用户当前组织底下所有岗位") @ApiOperation("获取当前用户当前组织底下所有岗位")
@GetMapping("/getUserPositions") @GetMapping("/getUserPositions")
public ActionResult<List<PermissionModel>> getUserPositions(){ public ActionResult<List<PermissionModel>> getUserPositions() {
return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.POSITION)); return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.POSITION));
} }
@ApiOperation("获取当前用户所有角色") @ApiOperation("获取当前用户所有角色")
@GetMapping("/getUserRoles") @GetMapping("/getUserRoles")
public ActionResult<List<PermissionModel>> getUserRoles(){ public ActionResult<List<PermissionModel>> getUserRoles() {
return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ROLE)); return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ROLE));
} }

@ -102,7 +102,10 @@ public class AuthorizeServiceImpl extends ServiceImpl<AuthorizeMapper, Authorize
List<ResourceModel> resourceList = new ArrayList<>(); List<ResourceModel> resourceList = new ArrayList<>();
List<ModuleFormModel> formsList = new ArrayList<>(); List<ModuleFormModel> formsList = new ArrayList<>();
Boolean isAdmin = userInfo.getIsAdministrator(); Boolean isAdmin = userInfo.getIsAdministrator();
//modified by 巴卫 2023年01月06日 14:25
if(StringUtil.isNotNull(userInfo.getUserId())){
String majorOrgId = userService.getInfo(userInfo.getUserId()).getOrganizeId(); String majorOrgId = userService.getInfo(userInfo.getUserId()).getOrganizeId();
}
if (!isAdmin) { if (!isAdmin) {
List<String> roleIds = new ArrayList<>(); List<String> roleIds = new ArrayList<>();
roleService.getRoleIdsByCurrentUser(userInfo.getOrganizeId()).forEach(role ->{ roleService.getRoleIdsByCurrentUser(userInfo.getOrganizeId()).forEach(role ->{

@ -64,10 +64,11 @@
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="仓库" <el-form-item label="仓库"
prop="warehouseId" > prop="warehouseId" >
<relationForm v-model="dataForm.warehouseId" <popupSelect v-model="dataForm.warehouseId"
placeholder="请选择" clearable field="warehouseId" modelId ="294090217084722181" :columnOptions="warehouseIdcolumnOptions" relationField="comInputField109" > placeholder="请选择" clearable field="warehouseId" interfaceId="380988259175524165" :columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
</relationForm> </popupSelect >
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
@ -171,7 +172,7 @@
], ],
}, },
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
warehouseIdcolumnOptions:[ {"label":"年龄","value":"comInputField109"},], warehouseIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"仓库号","value":"code"}, {"label":"仓库名称","value":"name"},],
} }
}, },

@ -49,7 +49,7 @@
</JNPF-UploadImg> </JNPF-UploadImg>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <!-- <el-col :span="12" >
<el-form-item label="录入人" <el-form-item label="录入人"
prop="creatorusername" > prop="creatorusername" >
<el-input v-model="dataForm.creatorusername" <el-input v-model="dataForm.creatorusername"
@ -66,7 +66,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
</template> </template>
</el-form> </el-form>
</el-row> </el-row>

@ -27,70 +27,87 @@
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()"> <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()" > <el-button type="text" icon="el-icon-download" @click="exportData()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删 <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="reset()"/> @click="reset()" />
</el-tooltip> </el-tooltip>
<screenfull isContainer/> <screenfull isContainer />
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"> <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
<el-table-column prop="id" label="ID" width="0" align="left" @selection-change="handleSelectionChange">
/> <!-- <el-table-column prop="id" label="ID" width="0" align="left" /> -->
<el-table-column prop="ticketno" label="车牌号" width="0" align="left" <el-table-column prop="ticketno" label="车牌号" width="0" align="left" />
/> <el-table-column prop="drivername" label="司机名称" width="0" align="left" />
<el-table-column prop="drivername" label="司机名称" width="0" align="left" <el-table-column prop="contact" label="手机号" width="0" align="left" />
/> <el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left">
<el-table-column prop="contact" label="手机号" width="0" align="left"
/> <template slot-scope="scope">
<el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left" <span v-for="(item,index) in JSON.parse(scope.row.vehiclephotos)" :key="index">
<el-popover placement="left" trigger="click" width="300">
<img :src="`/dev${item.url}`" width="100%" />
<img
slot="reference"
:src="`/dev${item.url}`"
:alt="`/dev${item.url}`"
style="max-height: 70px;max-width: 70px; padding: 5px"
/> />
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" </el-popover>
/> </span>
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" </template>
/>
<el-table-column label="操作" fixed="right" </el-table-column>
width="100" > <el-table-column prop="creatorusername" label="录入人" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" @click="addOrUpdateHandle(scope.row.id)">
@click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/> <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary' import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './Form' import JNPFForm from './Form'
import ExportBox from './ExportBox' import ExportBox from './ExportBox'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface' import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail' import Detail from './Detail'
export default { export default {
components: {JNPFForm, ExportBox,Detail}, components: {
JNPFForm,
ExportBox,
Detail
},
data() { data() {
return { return {
detailVisible: false, detailVisible: false,
query: { query: {
ticketno:undefined, ticketno: undefined,
drivername:undefined, drivername: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -99,7 +116,8 @@
}, },
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], total: 0, multipleSelection: [],
total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
@ -108,12 +126,26 @@
}, },
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [ columnList: [{
{prop: 'ticketno', label: '车牌号'}, prop: 'ticketno',
{prop: 'drivername', label: '司机名称'}, label: '车牌号'
{prop: 'contact', label: '手机号'}, },
{prop: 'creatorusername', label: '录入人'}, {
{prop: 'creatortime', label: '创建时间'}, prop: 'drivername',
label: '司机名称'
},
{
prop: 'contact',
label: '手机号'
},
{
prop: 'creatorusername',
label: '录入人'
},
{
prop: 'creatortime',
label: '创建时间'
},
], ],
} }
}, },
@ -126,13 +158,17 @@
this.initData() this.initData()
}, },
methods: { methods: {
goDetail(id){ goDetail(id) {
this.detailVisible = true this.detailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.Detail.init(id) this.$refs.Detail.init(id)
}) })
}, },
sortChange({column, prop, order}) { sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
@ -142,15 +178,15 @@
let _query = { let _query = {
...this.listQuery, ...this.listQuery,
...this.query, ...this.query,
menuId:this.menuId menuId: this.menuId
}; };
request({ request({
url: `/api/example/Vehicle/getList`, url: `/api/example/Vehicle/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
var _list =[]; var _list = [];
for(let i=0;i<res.data.list.length;i++){ for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i]; let _data = res.data.list[i];
_list.push(_data) _list.push(_data)
} }
@ -176,8 +212,7 @@
} }
}); });
}) })
}).catch(() => { }).catch(() => {});
});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
const res = val.map(item => item.id) const res = val.map(item => item.id)
@ -208,8 +243,7 @@
} }
}); });
}) })
}).catch(() => { }).catch(() => {})
})
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true
@ -224,7 +258,12 @@
}) })
}, },
download(data) { download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId} let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({ request({
url: `/api/example/Vehicle/Actions/Export`, url: `/api/example/Vehicle/Actions/Export`,
method: 'GET', method: 'GET',

Loading…
Cancel
Save