新中大添加人员与银行绑定,并且修改报销与银行的绑定逻辑,修改建管添加批次需求计划的招标计划查询接口
This commit is contained in:
@ -45,8 +45,7 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
||||||
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
||||||
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
||||||
String projectIdStr = ServletUtils.getRequest().getParameter("projectId");
|
String projectIdStr = ServletUtils.getRequest().getParameter(LoginHelper.PROJECT_KEY);
|
||||||
Long projectId = Long.parseLong(projectIdStr);
|
|
||||||
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
||||||
// token 无效
|
// token 无效
|
||||||
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
||||||
@ -55,7 +54,10 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attributes.put(LOGIN_USER_KEY, loginUser);
|
attributes.put(LOGIN_USER_KEY, loginUser);
|
||||||
|
if (projectIdStr != null && !projectIdStr.isEmpty()) {
|
||||||
|
Long projectId = Long.parseLong(projectIdStr);
|
||||||
attributes.put(PROJECT_ID,projectId);
|
attributes.put(PROJECT_ID,projectId);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (NotLoginException e) {
|
} catch (NotLoginException e) {
|
||||||
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
||||||
|
|||||||
@ -111,6 +111,7 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper,
|
|||||||
lqw.orderByDesc(BusBiddingPlan::getId);
|
lqw.orderByDesc(BusBiddingPlan::getId);
|
||||||
lqw.eq(bo.getProjectId() != null, BusBiddingPlan::getProjectId, bo.getProjectId());
|
lqw.eq(bo.getProjectId() != null, BusBiddingPlan::getProjectId, bo.getProjectId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDictName()), BusBiddingPlan::getDictName, bo.getDictName());
|
lqw.like(StringUtils.isNotBlank(bo.getDictName()), BusBiddingPlan::getDictName, bo.getDictName());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getType()), BusBiddingPlan::getType, bo.getType());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusBiddingPlan::getName, bo.getName());
|
lqw.like(StringUtils.isNotBlank(bo.getName()), BusBiddingPlan::getName, bo.getName());
|
||||||
lqw.eq(bo.getBidStatus() !=null, BusBiddingPlan::getBidStatus, bo.getBidStatus());
|
lqw.eq(bo.getBidStatus() !=null, BusBiddingPlan::getBidStatus, bo.getBidStatus());
|
||||||
lqw.eq(bo.getPlannedBiddingTime() != null, BusBiddingPlan::getPlannedBiddingTime, bo.getPlannedBiddingTime());
|
lqw.eq(bo.getPlannedBiddingTime() != null, BusBiddingPlan::getPlannedBiddingTime, bo.getPlannedBiddingTime());
|
||||||
|
|||||||
@ -4,10 +4,13 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.xzd.bx.bxsq.bxlx.domain.XzdBxBxsqBxlx;
|
import org.dromara.xzd.bx.bxsq.bxlx.domain.XzdBxBxsqBxlx;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,4 +52,18 @@ public class XzdBxBxsqBxlxVo implements Serializable {
|
|||||||
private String lxmc;
|
private String lxmc;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy")
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,10 +24,13 @@ import org.dromara.xzd.bx.bxsq.domain.vo.XzdBxBxsqVo;
|
|||||||
import org.dromara.xzd.bx.bxsq.service.IXzdBxBxsqService;
|
import org.dromara.xzd.bx.bxsq.service.IXzdBxBxsqService;
|
||||||
import org.dromara.xzd.domain.bo.XzdProjectBo;
|
import org.dromara.xzd.domain.bo.XzdProjectBo;
|
||||||
import org.dromara.xzd.domain.bo.XzdSupplierOpenBankBo;
|
import org.dromara.xzd.domain.bo.XzdSupplierOpenBankBo;
|
||||||
|
import org.dromara.xzd.domain.bo.XzdYhxxBo;
|
||||||
import org.dromara.xzd.domain.vo.XzdProjectVo;
|
import org.dromara.xzd.domain.vo.XzdProjectVo;
|
||||||
import org.dromara.xzd.domain.vo.XzdSupplierOpenBankVo;
|
import org.dromara.xzd.domain.vo.XzdSupplierOpenBankVo;
|
||||||
|
import org.dromara.xzd.domain.vo.XzdYhxxVo;
|
||||||
import org.dromara.xzd.service.IXzdProjectService;
|
import org.dromara.xzd.service.IXzdProjectService;
|
||||||
import org.dromara.xzd.service.IXzdSupplierOpenBankService;
|
import org.dromara.xzd.service.IXzdSupplierOpenBankService;
|
||||||
|
import org.dromara.xzd.service.IXzdYhxxService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -58,6 +61,17 @@ public class XzdBxBxsqController extends BaseController {
|
|||||||
return xzdBxBxsqService.queryPageList(bo, pageQuery);
|
return xzdBxBxsqService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final IXzdYhxxService xzdYhxxService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询银行数据关联列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission(value = {"bxsq:bxsq:add","bxsq:bxsq:edit","bxsq:bxsq:list"},mode = SaMode.OR)
|
||||||
|
@GetMapping("/getYhxxList")
|
||||||
|
public TableDataInfo<XzdYhxxVo> getYhxxList(XzdYhxxBo bo, PageQuery pageQuery) {
|
||||||
|
return xzdYhxxService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出报销-报销申请列表
|
* 导出报销-报销申请列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -65,10 +65,10 @@ public class XzdBxBxsq extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long xm;
|
private Long xm;
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * 开户银行
|
* 开户银行
|
||||||
// */
|
*/
|
||||||
// private Long khyh;
|
private Long khyh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开户银行账号
|
* 开户银行账号
|
||||||
|
|||||||
@ -61,7 +61,7 @@ public class XzdBxBxsqBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 开户银行
|
* 开户银行
|
||||||
*/
|
*/
|
||||||
private List <XzdSupplierOpenBank> khyh;
|
private Long khyh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开户银行账号
|
* 开户银行账号
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.xzd.bx.bxsq.domain.XzdBxBxsq;
|
import org.dromara.xzd.bx.bxsq.domain.XzdBxBxsq;
|
||||||
import org.dromara.xzd.bx.bxsq.fymx.domain.vo.XzdBxBxsqFymxVo;
|
import org.dromara.xzd.bx.bxsq.fymx.domain.vo.XzdBxBxsqFymxVo;
|
||||||
import org.dromara.xzd.domain.XzdSupplierOpenBank;
|
import org.dromara.xzd.domain.XzdSupplierOpenBank;
|
||||||
@ -100,11 +102,12 @@ public class XzdBxBxsqVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 开户银行
|
* 开户银行
|
||||||
*/
|
*/
|
||||||
private List<XzdSupplierOpenBank> khyh;
|
private Long khyh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开户银行名称
|
* 开户银行名称
|
||||||
*/
|
*/
|
||||||
|
@Translation(type = TransConstant.XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME, mapper = "khyh")
|
||||||
private String khyhmc;
|
private String khyhmc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -185,18 +185,18 @@ public class XzdBxBxsqServiceImpl extends ServiceImpl<XzdBxBxsqMapper, XzdBxBxsq
|
|||||||
}
|
}
|
||||||
|
|
||||||
//开户银行
|
//开户银行
|
||||||
if(bo.getKhyh() != null && !bo.getKhyh().isEmpty()){
|
// if(bo.getKhyh() != null && !bo.getKhyh().isEmpty()){
|
||||||
for (XzdSupplierOpenBank bank : bo.getKhyh()) {
|
// for (XzdSupplierOpenBank bank : bo.getKhyh()) {
|
||||||
XzdYhxxBo xzdYhxxBo = new XzdYhxxBo();
|
// XzdYhxxBo xzdYhxxBo = new XzdYhxxBo();
|
||||||
xzdYhxxBo.setYhId(bank.getId());
|
// xzdYhxxBo.setYhId(bank.getId());
|
||||||
xzdYhxxBo.setMainId(add.getId());
|
// xzdYhxxBo.setMainId(add.getId());
|
||||||
xzdYhxxBo.setSfmr(bank.getIsDefault());
|
// xzdYhxxBo.setSfmr(bank.getIsDefault());
|
||||||
xzdYhxxBo.setAccount(bank.getAccount());
|
// xzdYhxxBo.setAccount(bank.getAccount());
|
||||||
xzdYhxxBo.setKhhm(bank.getPersonName());
|
// xzdYhxxBo.setKhhm(bank.getPersonName());
|
||||||
xzdYhxxBo.setType("3");
|
// xzdYhxxBo.setType("3");
|
||||||
xzdYhxxService.insertByBo(xzdYhxxBo);
|
// xzdYhxxService.insertByBo(xzdYhxxBo);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
@ -230,40 +230,40 @@ public class XzdBxBxsqServiceImpl extends ServiceImpl<XzdBxBxsqMapper, XzdBxBxsq
|
|||||||
}
|
}
|
||||||
|
|
||||||
//开户银行
|
//开户银行
|
||||||
if(bo.getKhyh() != null && !bo.getKhyh().isEmpty()){
|
// if(bo.getKhyh() != null && !bo.getKhyh().isEmpty()){
|
||||||
|
//
|
||||||
//先获取老数据银行关联表
|
// //先获取老数据银行关联表
|
||||||
LambdaQueryWrapper<XzdYhxx> queryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<XzdYhxx> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(XzdYhxx::getMainId, old.getId());
|
// queryWrapper.eq(XzdYhxx::getMainId, old.getId());
|
||||||
List<XzdYhxx> oldList = xzdYhxxService.list(queryWrapper);
|
// List<XzdYhxx> oldList = xzdYhxxService.list(queryWrapper);
|
||||||
|
//
|
||||||
if (oldList != null && !oldList.isEmpty()){
|
// if (oldList != null && !oldList.isEmpty()){
|
||||||
//先删除老的
|
// //先删除老的
|
||||||
xzdYhxxService.removeByIds(oldList);
|
// xzdYhxxService.removeByIds(oldList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//保存此次的
|
// //保存此次的
|
||||||
for (XzdSupplierOpenBank bank : bo.getKhyh()) {
|
// for (XzdSupplierOpenBank bank : bo.getKhyh()) {
|
||||||
XzdYhxxBo xzdYhxxBo = new XzdYhxxBo();
|
// XzdYhxxBo xzdYhxxBo = new XzdYhxxBo();
|
||||||
xzdYhxxBo.setYhId(bank.getId());
|
// xzdYhxxBo.setYhId(bank.getId());
|
||||||
xzdYhxxBo.setMainId(update.getId());
|
// xzdYhxxBo.setMainId(update.getId());
|
||||||
xzdYhxxBo.setSfmr(bank.getIsDefault());
|
// xzdYhxxBo.setSfmr(bank.getIsDefault());
|
||||||
xzdYhxxBo.setAccount(bank.getAccount());
|
// xzdYhxxBo.setAccount(bank.getAccount());
|
||||||
xzdYhxxBo.setType("3");
|
// xzdYhxxBo.setType("3");
|
||||||
xzdYhxxService.insertByBo(xzdYhxxBo);
|
// xzdYhxxService.insertByBo(xzdYhxxBo);
|
||||||
}
|
// }
|
||||||
}else {
|
// }else {
|
||||||
//先获取老数据银行关联表
|
// //先获取老数据银行关联表
|
||||||
LambdaQueryWrapper<XzdYhxx> queryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<XzdYhxx> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(XzdYhxx::getMainId, old.getId());
|
// queryWrapper.eq(XzdYhxx::getMainId, old.getId());
|
||||||
List<XzdYhxx> oldList = xzdYhxxService.list(queryWrapper);
|
// List<XzdYhxx> oldList = xzdYhxxService.list(queryWrapper);
|
||||||
|
//
|
||||||
//如果不为空则删除
|
// //如果不为空则删除
|
||||||
if (oldList != null && !oldList.isEmpty()){
|
// if (oldList != null && !oldList.isEmpty()){
|
||||||
xzdYhxxService.remove(queryWrapper);
|
// xzdYhxxService.remove(queryWrapper);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
@ -302,38 +302,6 @@ public class XzdBxBxsqServiceImpl extends ServiceImpl<XzdBxBxsqMapper, XzdBxBxsq
|
|||||||
|
|
||||||
public void setValue(List<XzdBxBxsqVo> vos){
|
public void setValue(List<XzdBxBxsqVo> vos){
|
||||||
for (XzdBxBxsqVo vo : vos) {
|
for (XzdBxBxsqVo vo : vos) {
|
||||||
|
|
||||||
//开户银行
|
|
||||||
LambdaQueryWrapper<XzdYhxx> lqw3 = new LambdaQueryWrapper<>();
|
|
||||||
lqw3.eq(XzdYhxx::getMainId, vo.getId());
|
|
||||||
lqw3.eq(XzdYhxx::getSfmr,"1");
|
|
||||||
XzdYhxx one = xzdYhxxService.getOne(lqw3);
|
|
||||||
if (one != null){
|
|
||||||
XzdSupplierOpenBank byId = xzdSupplierOpenBankService.getById(one.getYhId());
|
|
||||||
if (byId != null){
|
|
||||||
vo.setKhyhmc(byId.getOpenBank());
|
|
||||||
vo.setKhyhzh(one.getAccount());
|
|
||||||
vo.setKhhhm(one.getKhhm());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lqw3.clear();
|
|
||||||
lqw3.eq(XzdYhxx::getMainId,vo.getId());
|
|
||||||
List<XzdYhxx> xzdYhxxList = xzdYhxxService.list(lqw3);
|
|
||||||
if (xzdYhxxList!= null && !xzdYhxxList.isEmpty()) {
|
|
||||||
List<XzdSupplierOpenBank> openBanks = new ArrayList<>();
|
|
||||||
for (XzdYhxx yhxx : xzdYhxxList) {
|
|
||||||
XzdSupplierOpenBank byId = xzdSupplierOpenBankService.getById(yhxx.getYhId());
|
|
||||||
if (byId != null){
|
|
||||||
byId.setAccount(yhxx.getAccount());
|
|
||||||
byId.setIsDefault(yhxx.getSfmr());
|
|
||||||
byId.setPersonName(yhxx.getKhhm());
|
|
||||||
openBanks.add(byId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vo.setKhyh(openBanks);
|
|
||||||
}
|
|
||||||
|
|
||||||
//费用明细
|
//费用明细
|
||||||
LambdaQueryWrapper<XzdBxBxsqFymx> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<XzdBxBxsqFymx> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(XzdBxBxsqFymx::getBxId, vo.getId());
|
lqw.eq(XzdBxBxsqFymx::getBxId, vo.getId());
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.xzd.controller;
|
package org.dromara.xzd.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@ -15,8 +16,11 @@ import org.dromara.common.log.enums.BusinessType;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.xzd.domain.bo.XzdSupplierOpenBankBo;
|
||||||
import org.dromara.xzd.domain.bo.XzdYhxxBo;
|
import org.dromara.xzd.domain.bo.XzdYhxxBo;
|
||||||
|
import org.dromara.xzd.domain.vo.XzdSupplierOpenBankVo;
|
||||||
import org.dromara.xzd.domain.vo.XzdYhxxVo;
|
import org.dromara.xzd.domain.vo.XzdYhxxVo;
|
||||||
|
import org.dromara.xzd.service.IXzdSupplierOpenBankService;
|
||||||
import org.dromara.xzd.service.IXzdYhxxService;
|
import org.dromara.xzd.service.IXzdYhxxService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -32,11 +36,22 @@ import java.util.List;
|
|||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/yhzjb/yhxxzjb")
|
@RequestMapping("/xzd/yhzjb/yhxxzjb")
|
||||||
public class XzdYhxxController extends BaseController {
|
public class XzdYhxxController extends BaseController {
|
||||||
|
|
||||||
private final IXzdYhxxService xzdYhxxService;
|
private final IXzdYhxxService xzdYhxxService;
|
||||||
|
|
||||||
|
private final IXzdSupplierOpenBankService xzdSupplierOpenBankService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询供应商信息-开户银行列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission(value = {"yhzjb:yhxxzjb:add","yhzjb:yhxxzjb:edit","yhzjb:yhxxzjb:list"},mode = SaMode.OR)
|
||||||
|
@GetMapping("/getOpenBankList")
|
||||||
|
public TableDataInfo<XzdSupplierOpenBankVo> getOpenBankList(XzdSupplierOpenBankBo bo, PageQuery pageQuery) {
|
||||||
|
return xzdSupplierOpenBankService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询银行数据关联列表
|
* 查询银行数据关联列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -58,4 +58,24 @@ public class XzdYhxx extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行省份
|
||||||
|
*/
|
||||||
|
private String bankSf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行城市
|
||||||
|
*/
|
||||||
|
private String bankCs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行区县
|
||||||
|
*/
|
||||||
|
private String bankQx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,4 +52,24 @@ public class XzdYhxxBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行省份
|
||||||
|
*/
|
||||||
|
private String bankSf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行城市
|
||||||
|
*/
|
||||||
|
private String bankCs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行区县
|
||||||
|
*/
|
||||||
|
private String bankQx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.xzd.domain.XzdYhxx;
|
import org.dromara.xzd.domain.XzdYhxx;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -36,12 +38,15 @@ public class XzdYhxxVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "关联供应商/客户id")
|
@ExcelProperty(value = "关联供应商/客户id")
|
||||||
private Long mainId;
|
private Long mainId;
|
||||||
|
private String mainName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 银行id
|
* 银行id
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "银行id")
|
@ExcelProperty(value = "银行id")
|
||||||
private Long yhId;
|
private Long yhId;
|
||||||
|
@Translation(type = TransConstant.XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME, mapper = "yhId")
|
||||||
|
private String yhName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开户账号
|
* 开户账号
|
||||||
@ -64,4 +69,24 @@ public class XzdYhxxVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行省份
|
||||||
|
*/
|
||||||
|
private String bankSf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行城市
|
||||||
|
*/
|
||||||
|
private String bankCs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行区县
|
||||||
|
*/
|
||||||
|
private String bankQx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,4 +67,6 @@ public interface IXzdCustomerinformationService extends IService<XzdCustomerinfo
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
String queryNameById(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import org.dromara.common.core.utils.StringUtils;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.xzd.domain.XzdCustomerinformation;
|
import org.dromara.xzd.domain.XzdCustomerinformation;
|
||||||
|
import org.dromara.xzd.domain.XzdSupplierInfo;
|
||||||
import org.dromara.xzd.domain.bo.XzdCustomerinformationBo;
|
import org.dromara.xzd.domain.bo.XzdCustomerinformationBo;
|
||||||
import org.dromara.xzd.domain.vo.XzdCustomerinformationVo;
|
import org.dromara.xzd.domain.vo.XzdCustomerinformationVo;
|
||||||
import org.dromara.xzd.mapper.XzdCustomerinformationMapper;
|
import org.dromara.xzd.mapper.XzdCustomerinformationMapper;
|
||||||
@ -183,6 +184,12 @@ public class XzdCustomerinformationServiceImpl extends ServiceImpl<XzdCustomerin
|
|||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String queryNameById(Long id) {
|
||||||
|
XzdCustomerinformation xzdCustomerinformation = baseMapper.selectById(id);
|
||||||
|
return xzdCustomerinformation != null ? xzdCustomerinformation.getUnitName():null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String selectNmaeByIds(String ids) {
|
public String selectNmaeByIds(String ids) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import org.dromara.xzd.service.IXzdCustomerSupplierYybService;
|
|||||||
import org.dromara.xzd.service.IXzdSupplierInfoService;
|
import org.dromara.xzd.service.IXzdSupplierInfoService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -83,6 +84,7 @@ public class XzdSupplierInfoServiceImpl extends ServiceImpl<XzdSupplierInfoMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private XzdSupplierOpenBankServiceImpl xzdSupplierOpenBankService;
|
private XzdSupplierOpenBankServiceImpl xzdSupplierOpenBankService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private XzdYhxxServiceImpl xzdYhxxService;
|
private XzdYhxxServiceImpl xzdYhxxService;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,16 +5,20 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.dromara.xzd.domain.XzdYhxx;
|
import org.dromara.xzd.domain.XzdYhxx;
|
||||||
import org.dromara.xzd.domain.bo.XzdYhxxBo;
|
import org.dromara.xzd.domain.bo.XzdYhxxBo;
|
||||||
import org.dromara.xzd.domain.vo.XzdYhxxVo;
|
import org.dromara.xzd.domain.vo.XzdYhxxVo;
|
||||||
import org.dromara.xzd.mapper.XzdYhxxMapper;
|
import org.dromara.xzd.mapper.XzdYhxxMapper;
|
||||||
import org.dromara.xzd.service.IXzdYhxxService;
|
import org.dromara.xzd.service.*;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -32,6 +36,15 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
|
|
||||||
private final XzdYhxxMapper baseMapper;
|
private final XzdYhxxMapper baseMapper;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
private final IXzdSupplierInfoService supplierInfoService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
private final IXzdCustomerinformationService customerinformationService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
private final ISysUserService sysUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询银行数据关联
|
* 查询银行数据关联
|
||||||
*
|
*
|
||||||
@ -40,7 +53,9 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public XzdYhxxVo queryById(Long id){
|
public XzdYhxxVo queryById(Long id){
|
||||||
return baseMapper.selectVoById(id);
|
XzdYhxxVo vo = baseMapper.selectVoById(id);
|
||||||
|
getName(vo);
|
||||||
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,9 +69,24 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
public TableDataInfo<XzdYhxxVo> queryPageList(XzdYhxxBo bo, PageQuery pageQuery) {
|
public TableDataInfo<XzdYhxxVo> queryPageList(XzdYhxxBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<XzdYhxx> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<XzdYhxx> lqw = buildQueryWrapper(bo);
|
||||||
Page<XzdYhxxVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<XzdYhxxVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
result.getRecords().forEach(this::getName);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getName(XzdYhxxVo xzdYhxx) {
|
||||||
|
String name = null;
|
||||||
|
if ("1".equals(xzdYhxx.getType())){
|
||||||
|
name = supplierInfoService.queryNameById(xzdYhxx.getMainId());
|
||||||
|
}
|
||||||
|
if ("2".equals(xzdYhxx.getType())){
|
||||||
|
name = customerinformationService.queryNameById(xzdYhxx.getMainId());
|
||||||
|
}
|
||||||
|
if ("3".equals(xzdYhxx.getType())){
|
||||||
|
name = sysUserService.queryNameById(xzdYhxx.getMainId());
|
||||||
|
}
|
||||||
|
xzdYhxx.setMainName(name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的银行数据关联列表
|
* 查询符合条件的银行数据关联列表
|
||||||
*
|
*
|
||||||
@ -66,7 +96,9 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
@Override
|
@Override
|
||||||
public List<XzdYhxxVo> queryList(XzdYhxxBo bo) {
|
public List<XzdYhxxVo> queryList(XzdYhxxBo bo) {
|
||||||
LambdaQueryWrapper<XzdYhxx> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<XzdYhxx> lqw = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
List<XzdYhxxVo> vos = baseMapper.selectVoList(lqw);
|
||||||
|
vos.forEach(this::getName);
|
||||||
|
return vos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<XzdYhxx> buildQueryWrapper(XzdYhxxBo bo) {
|
private LambdaQueryWrapper<XzdYhxx> buildQueryWrapper(XzdYhxxBo bo) {
|
||||||
@ -76,6 +108,9 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
lqw.eq(bo.getMainId() != null, XzdYhxx::getMainId, bo.getMainId());
|
lqw.eq(bo.getMainId() != null, XzdYhxx::getMainId, bo.getMainId());
|
||||||
lqw.eq(bo.getYhId() != null, XzdYhxx::getYhId, bo.getYhId());
|
lqw.eq(bo.getYhId() != null, XzdYhxx::getYhId, bo.getYhId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSfmr()), XzdYhxx::getSfmr, bo.getSfmr());
|
lqw.eq(StringUtils.isNotBlank(bo.getSfmr()), XzdYhxx::getSfmr, bo.getSfmr());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getAccount()), XzdYhxx::getAccount, bo.getAccount());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getKhhm()), XzdYhxx::getKhhm, bo.getKhhm());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), XzdYhxx::getType, bo.getType());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,9 +121,20 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean insertByBo(XzdYhxxBo bo) {
|
public Boolean insertByBo(XzdYhxxBo bo) {
|
||||||
XzdYhxx add = MapstructUtils.convert(bo, XzdYhxx.class);
|
XzdYhxx add = MapstructUtils.convert(bo, XzdYhxx.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
|
if ("1".equals(bo.getSfmr())){
|
||||||
|
XzdYhxx xzdYhxx = baseMapper.selectOne(new LambdaQueryWrapper<XzdYhxx>()
|
||||||
|
.eq(XzdYhxx::getType, bo.getType())
|
||||||
|
.eq(XzdYhxx::getMainId, bo.getMainId())
|
||||||
|
.eq(XzdYhxx::getSfmr, bo.getSfmr()));
|
||||||
|
if (xzdYhxx != null) {
|
||||||
|
xzdYhxx.setSfmr("0");
|
||||||
|
baseMapper.updateById(xzdYhxx);
|
||||||
|
}
|
||||||
|
}
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
@ -103,9 +149,21 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateByBo(XzdYhxxBo bo) {
|
public Boolean updateByBo(XzdYhxxBo bo) {
|
||||||
XzdYhxx update = MapstructUtils.convert(bo, XzdYhxx.class);
|
XzdYhxx update = MapstructUtils.convert(bo, XzdYhxx.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
|
if ("1".equals(bo.getSfmr())){
|
||||||
|
XzdYhxx xzdYhxx = baseMapper.selectOne(new LambdaQueryWrapper<XzdYhxx>()
|
||||||
|
.eq(XzdYhxx::getType, bo.getType())
|
||||||
|
.eq(XzdYhxx::getMainId, bo.getMainId())
|
||||||
|
.ne(XzdYhxx::getId, bo.getId())
|
||||||
|
.eq(XzdYhxx::getSfmr, bo.getSfmr()));
|
||||||
|
if (xzdYhxx != null) {
|
||||||
|
xzdYhxx.setSfmr("0");
|
||||||
|
baseMapper.updateById(xzdYhxx);
|
||||||
|
}
|
||||||
|
}
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,6 +172,33 @@ public class XzdYhxxServiceImpl extends ServiceImpl<XzdYhxxMapper, XzdYhxx> impl
|
|||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(XzdYhxx entity){
|
private void validEntityBeforeSave(XzdYhxx entity){
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
if (entity.getId() == null){
|
||||||
|
Long count = baseMapper.selectCount(new LambdaQueryWrapper<XzdYhxx>().eq(XzdYhxx::getAccount, entity.getAccount()).eq(XzdYhxx::getType, entity.getType()));
|
||||||
|
if (count > 0){
|
||||||
|
if ("1".equals(entity.getType())){
|
||||||
|
throw new ServiceException("银行卡号已有其他供应商使用,请确认后提交");
|
||||||
|
}
|
||||||
|
if ("2".equals(entity.getType())){
|
||||||
|
throw new ServiceException("银行卡号已有其他客户使用,请确认后提交");
|
||||||
|
}
|
||||||
|
if ("3".equals(entity.getType())){
|
||||||
|
throw new ServiceException("银行卡号已有其他用户使用,请确认后提交");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Long count = baseMapper.selectCount(new LambdaQueryWrapper<XzdYhxx>().eq(XzdYhxx::getAccount, entity.getAccount()).eq(XzdYhxx::getType, entity.getType()).ne(XzdYhxx::getId, entity.getId()));
|
||||||
|
if (count > 0){
|
||||||
|
if ("1".equals(entity.getType())){
|
||||||
|
throw new ServiceException("修改的银行卡号已有其他供应商使用,请确认后提交");
|
||||||
|
}
|
||||||
|
if ("2".equals(entity.getType())){
|
||||||
|
throw new ServiceException("修改的银行卡号已有其他客户使用,请确认后提交");
|
||||||
|
}
|
||||||
|
if ("3".equals(entity.getType())){
|
||||||
|
throw new ServiceException("修改的银行卡号已有其他用户使用,请确认后提交");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user