
51 changed files with 1091 additions and 274 deletions
@ -0,0 +1,22 @@ |
|||
package com.yxt.anrui.base.api.basemanufacturer; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/7 16:40 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class ManBankVo implements Vo { |
|||
private static final long serialVersionUID = 7602748514129847222L; |
|||
@ApiModelProperty("收款银行名称") |
|||
private String receiveBank; |
|||
@ApiModelProperty("收款银行账号") |
|||
private String receiveBankAccount; |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.anrui.base.api.basemanufacturer; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/7 16:39 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class ManufacturerVo implements Vo { |
|||
private static final long serialVersionUID = 6527095329799323031L; |
|||
@ApiModelProperty("供应商sid") |
|||
private String sid; |
|||
@ApiModelProperty("供应商编码") |
|||
private String payCode; |
|||
@ApiModelProperty("供应商名称") |
|||
private String name; |
|||
|
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 13:29 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysOrgPathList implements Vo { |
|||
private static final long serialVersionUID = 2356384382464107570L; |
|||
|
|||
@ApiModelProperty("组织机构全路径sid") |
|||
private String orgSidPath; |
|||
@ApiModelProperty("组织机构全路径名称") |
|||
private String orgNamePath; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:23 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysUserDefaultOrg extends BaseEntity { |
|||
private static final long serialVersionUID = 3567627566535174850L; |
|||
|
|||
@ApiModelProperty("人员sid") |
|||
private String staffSid; |
|||
@ApiModelProperty("默认的组织机构sid") |
|||
private String orgSidPath; |
|||
@ApiModelProperty("默认的组织机构名称") |
|||
private String orgNamePath; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 14:18 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysUserDefaultOrgDto implements Dto { |
|||
private static final long serialVersionUID = 3069749900524077996L; |
|||
|
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
@ApiModelProperty("设置的默认组织全路径sid") |
|||
private String orgSidPath; |
|||
@ApiModelProperty("设置的默认组织全路径名称") |
|||
private String orgNamePath; |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:24 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "用户默认的组织机构表") |
|||
@FeignClient( |
|||
contextId = "anrui-portal-SysUserDefaultOrg", |
|||
name = "anrui-portal", |
|||
path = "v1/sysuserdefaultorg", |
|||
fallback = SysUserDefaultOrgFeignFallback.class) |
|||
public interface SysUserDefaultOrgFeign { |
|||
|
|||
@ApiOperation("获取用户的默认机构") |
|||
@GetMapping("/getList") |
|||
@ResponseBody |
|||
ResultBean<SysUserDefaultOrgVo> getList(@RequestParam("userSid") String userSid); |
|||
|
|||
@ApiOperation("设置默认组织机构") |
|||
@PostMapping("/saveOrUpdate") |
|||
@ResponseBody |
|||
ResultBean saveOrUpdate(@RequestBody SysUserDefaultOrgDto dto); |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:26 |
|||
* @Description |
|||
*/ |
|||
@Component |
|||
public class SysUserDefaultOrgFeignFallback implements SysUserDefaultOrgFeign{ |
|||
@Override |
|||
public ResultBean<SysUserDefaultOrgVo> getList(String userSid) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean saveOrUpdate(SysUserDefaultOrgDto dto) { |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:52 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysUserDefaultOrgQuery implements Query { |
|||
private static final long serialVersionUID = 549888513841147615L; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.anrui.portal.api.sysuserdefaultorg; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:52 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysUserDefaultOrgVo implements Vo { |
|||
private static final long serialVersionUID = -4852902800844447195L; |
|||
|
|||
@ApiModelProperty("设置的默认的组织机构名称") |
|||
private String orgNamePath; |
|||
@ApiModelProperty("设置的默认的组织机构sid") |
|||
private String orgSidPath; |
|||
@ApiModelProperty("当前用户所有的组织机构list") |
|||
private List<SysOrgPathList> list; |
|||
|
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.yxt.anrui.portal.biz.sysuserdefaultorg; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.anrui.portal.api.sysuserdefaultorg.SysUserDefaultOrg; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:27 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface SysUserDefaultOrgMapper extends BaseMapper<SysUserDefaultOrg> { |
|||
SysUserDefaultOrg selectByUserSid(String userSid); |
|||
|
|||
int deleteByUserSid(String userSid); |
|||
} |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|||
<mapper namespace="com.yxt.anrui.portal.biz.sysuserdefaultorg.SysUserDefaultOrgMapper"> |
|||
<select id="selectByUserSid" resultType="com.yxt.anrui.portal.api.sysuserdefaultorg.SysUserDefaultOrg"> |
|||
select * |
|||
from sys_user_default_org |
|||
where createBySid = #{userSid} |
|||
order by id desc |
|||
limit 1 |
|||
</select> |
|||
|
|||
<delete id="deleteByUserSid"> |
|||
delete |
|||
from sys_user_default_org |
|||
where createBySid = #{userSid} |
|||
</delete> |
|||
</mapper> |
@ -0,0 +1,34 @@ |
|||
package com.yxt.anrui.portal.biz.sysuserdefaultorg; |
|||
|
|||
import com.yxt.anrui.portal.api.sysuserdefaultorg.SysUserDefaultOrgDto; |
|||
import com.yxt.anrui.portal.api.sysuserdefaultorg.SysUserDefaultOrgFeign; |
|||
import com.yxt.anrui.portal.api.sysuserdefaultorg.SysUserDefaultOrgVo; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:26 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "用户默认的组织机构") |
|||
@RestController |
|||
@RequestMapping("v1/sysuserdefaultorg") |
|||
public class SysUserDefaultOrgRest implements SysUserDefaultOrgFeign { |
|||
|
|||
@Autowired |
|||
private SysUserDefaultOrgService sysUserDefaultOrgService; |
|||
|
|||
@Override |
|||
public ResultBean<SysUserDefaultOrgVo> getList(String userSid) { |
|||
return sysUserDefaultOrgService.getList(userSid); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean saveOrUpdate(SysUserDefaultOrgDto dto) { |
|||
return sysUserDefaultOrgService.saveDefaultOrg(dto); |
|||
} |
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.yxt.anrui.portal.biz.sysuserdefaultorg; |
|||
|
|||
import com.yxt.anrui.portal.api.sysuser.SysUser; |
|||
import com.yxt.anrui.portal.api.sysuserdefaultorg.*; |
|||
import com.yxt.anrui.portal.biz.sysstafforg.SysStaffOrgService; |
|||
import com.yxt.anrui.portal.biz.sysuser.SysUserService; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/11 11:27 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class SysUserDefaultOrgService extends MybatisBaseService<SysUserDefaultOrgMapper, SysUserDefaultOrg> { |
|||
|
|||
@Autowired |
|||
private SysStaffOrgService sysStaffOrgService; |
|||
@Autowired |
|||
private SysUserService sysUserService; |
|||
|
|||
public ResultBean<SysUserDefaultOrgVo> getList(String userSid) { |
|||
ResultBean<SysUserDefaultOrgVo> rb = ResultBean.fireFail(); |
|||
SysUserDefaultOrgVo sysUserDefaultOrgVo = new SysUserDefaultOrgVo(); |
|||
//根据用户sid查询staffSid
|
|||
SysUser sysUser = sysUserService.fetchBySid(userSid); |
|||
List<SysOrgPathList> list = sysStaffOrgService.getList(sysUser.getStaffSid()); |
|||
list.removeAll(Collections.singleton(null)); |
|||
sysUserDefaultOrgVo.setList(list); |
|||
//根据该用户名称查询是否设置了默认组织机构
|
|||
SysUserDefaultOrg sysUserDefaultOrg = baseMapper.selectByUserSid(userSid); |
|||
if (sysUserDefaultOrg != null) { |
|||
sysUserDefaultOrgVo.setOrgSidPath(sysUserDefaultOrg.getOrgSidPath()); |
|||
sysUserDefaultOrgVo.setOrgNamePath(sysUserDefaultOrg.getOrgNamePath()); |
|||
} |
|||
return rb.success().setData(sysUserDefaultOrgVo); |
|||
} |
|||
|
|||
public SysUserDefaultOrg selectByUserSid(String userSid) { |
|||
return baseMapper.selectByUserSid(userSid); |
|||
} |
|||
|
|||
public ResultBean saveDefaultOrg(SysUserDefaultOrgDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String userSid = dto.getUserSid(); |
|||
if (StringUtils.isBlank(userSid)) { |
|||
return rb.setMsg("参数错误:userSid是必传项"); |
|||
} |
|||
String orgSidPath = dto.getOrgSidPath(); |
|||
if (StringUtils.isNotBlank(orgSidPath)) { |
|||
//删除设置的默认组织机构
|
|||
baseMapper.deleteByUserSid(userSid); |
|||
SysUserDefaultOrg sysUserDefaultOrg = new SysUserDefaultOrg(); |
|||
String orgNamePath = dto.getOrgNamePath(); |
|||
if (StringUtils.isBlank(orgNamePath)) { |
|||
return rb.setMsg("参数错误:orgNamePath是必传项"); |
|||
} |
|||
SysUser sysUser = sysUserService.fetchBySid(userSid); |
|||
sysUserDefaultOrg.setOrgSidPath(orgSidPath); |
|||
sysUserDefaultOrg.setOrgNamePath(orgNamePath); |
|||
sysUserDefaultOrg.setCreateBySid(userSid); |
|||
sysUserDefaultOrg.setStaffSid(sysUser.getStaffSid()); |
|||
baseMapper.insert(sysUserDefaultOrg); |
|||
} else { |
|||
//删除设置的默认组织机构
|
|||
baseMapper.deleteByUserSid(userSid); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public int deleteByUserSid(String sid) { |
|||
return baseMapper.deleteByUserSid(sid); |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 获取菜单 分页列表
|
|||
export function getList(data) { |
|||
return request({ |
|||
url: '/portal/v1/sysuserdefaultorg/getList', |
|||
method: 'get', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 新增插件
|
|||
export function saveOrUpdate(data) { |
|||
return request({ |
|||
url: '/portal/v1/sysuserdefaultorg/saveOrUpdate', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
} |
@ -0,0 +1,117 @@ |
|||
<template> |
|||
<div class="content"> |
|||
<div class="right_cont"> |
|||
<table class="tishi" cellspacing="0" style="margin:0 auto 30px"> |
|||
<tr> |
|||
<td style="border-right: none;">设置默认组织机构</td> |
|||
<td> |
|||
<el-select v-model="formobj.orgNamePath" filterable placeholder="请选择" @change="changeoOrgNamePath" clearable> |
|||
<el-option v-for="item in orgNamePath_list" :key="item.orgSidPath" :label="item.orgNamePath" :value="item.orgNamePath"/> |
|||
</el-select> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<span slot="footer" class="dialog-footer" style="margin-left:40%;"> |
|||
<el-button style=" margin-left: 8%; width: 100px;height: 40px;" type="primary" @click="handleConfirm()">确认</el-button> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getList, saveOrUpdate } from '@/api/system/personalization/personalization' |
|||
|
|||
export default { |
|||
name: 'personalization', |
|||
data() { |
|||
return { |
|||
orgNamePath_list: [], |
|||
formobj: { |
|||
orgSidPath: '', |
|||
orgNamePath: '', |
|||
userSid: '' |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.init() |
|||
}, |
|||
methods: { |
|||
init() { |
|||
getList({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => { |
|||
if (res.success) { |
|||
this.formobj.orgNamePath = res.data.orgNamePath |
|||
this.formobj.orgSidPath = res.data.orgSidPath |
|||
this.orgNamePath_list = res.data.list |
|||
} |
|||
}) |
|||
}, |
|||
changeoOrgNamePath(value) { |
|||
const choose = this.orgNamePath_list.filter((item) => item.orgNamePath === value) |
|||
this.formobj.orgSidPath = choose[0].orgSidPath |
|||
}, |
|||
handleConfirm() { |
|||
if (this.formobj.orgNamePath === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '默认组织机构不能为空' }) |
|||
return |
|||
} |
|||
this.formobj.userSid = window.sessionStorage.getItem('userSid') |
|||
saveOrUpdate(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped="scoped" lang="scss"> |
|||
|
|||
.content { |
|||
width: 100%; |
|||
padding-top: 10px; |
|||
font-size: 16px; |
|||
color: #fff; |
|||
box-sizing: border-box; |
|||
} |
|||
.right_cont { |
|||
width: 100%; |
|||
height: 645px; |
|||
background-color: #fff; |
|||
margin: 0; |
|||
padding: 15px; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
.tishi { |
|||
width: 560px; |
|||
color: #000; |
|||
padding-left: 1.5%; |
|||
margin-bottom: 50px; |
|||
|
|||
tr { |
|||
height: 70px; |
|||
} |
|||
|
|||
td { |
|||
border: 1px solid #e6e9f0; |
|||
text-align: center; |
|||
} |
|||
|
|||
td:first-child { |
|||
background-color: #f7f9fc; |
|||
} |
|||
|
|||
.el-input, |
|||
input { |
|||
width: 80%; |
|||
} |
|||
|
|||
span { |
|||
font-size: 26px; |
|||
color: red; |
|||
margin-left: 10px; |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue