|
|
@ -28,6 +28,9 @@ package com.yxt.anrui.fin.biz.finpaymentapplydetailsbeloweve; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapply.FinPaymentapplyVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -41,6 +44,7 @@ import com.yxt.anrui.fin.api.finpaymentapplydetailsbeloweve.FinPaymentapplyDetai |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplydetailsbeloweve.FinPaymentapplyDetailsBelowEveDto; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplydetailsbeloweve.FinPaymentapplyDetailsBelowEveFeign; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
@ -60,55 +64,120 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class FinPaymentapplyDetailsBelowEveService extends MybatisBaseService<FinPaymentapplyDetailsBelowEveMapper, FinPaymentapplyDetailsBelowEve> { |
|
|
|
private QueryWrapper<FinPaymentapplyDetailsBelowEve> createQueryWrapper(FinPaymentapplyDetailsBelowEveQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
|
QueryWrapper<FinPaymentapplyDetailsBelowEve> qw = new QueryWrapper<>(); |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<FinPaymentapplyDetailsBelowEveVo> listPageVo(PagerQuery<FinPaymentapplyDetailsBelowEveQuery> pq) { |
|
|
|
FinPaymentapplyDetailsBelowEveQuery query = pq.getParams(); |
|
|
|
QueryWrapper<FinPaymentapplyDetailsBelowEve> qw = createQueryWrapper(query); |
|
|
|
IPage<FinPaymentapplyDetailsBelowEve> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinPaymentapplyDetailsBelowEveVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<FinPaymentapplyDetailsBelowEveVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
|
|
|
|
public void saveOrUpdateDto(FinPaymentapplyDetailsBelowEveDto dto){ |
|
|
|
public PagerVo<FinPaymentapplyDetailsBelowEveVo> listPageVo(PagerQuery<FinPaymentapplyDetailsBelowEveQuery> pq) { |
|
|
|
FinPaymentapplyDetailsBelowEveQuery query = pq.getParams(); |
|
|
|
QueryWrapper<FinPaymentapplyDetailsBelowEve> qw = new QueryWrapper<>(); |
|
|
|
//========================================数据授权开始
|
|
|
|
/*if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(query.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = query.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
int i1 = orgSidPath.indexOf("/"); |
|
|
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = defaultIdReltBean.getData(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i1); |
|
|
|
qw.like("fp.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("fp.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("fp.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("fp.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("fp.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<FinPaymentapplyDetailsBelowEveVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<FinPaymentapplyDetailsBelowEveVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
if (StringUtils.isNotBlank(query.getPayCompany())) { |
|
|
|
qw.like("payCompany", query.getPayCompany()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCostTitleValue())) { |
|
|
|
qw.like("costTitleValue", query.getCostTitleValue()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getReceiveCompany())) { |
|
|
|
qw.like("receiveCompany", query.getReceiveCompany()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPeriod())) { |
|
|
|
qw.like("period", query.getPeriod()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getRemarks())) { |
|
|
|
qw.eq("remarks", query.getRemarks()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getPayCompany())) { |
|
|
|
qw.like("fp.payCompany", query.getPayCompany()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getState())) { |
|
|
|
qw.eq("fp.state", query.getState()); |
|
|
|
} |
|
|
|
//融资付款开通日期
|
|
|
|
qw.apply(StringUtils.isNotBlank(query.getOpenStartDate()), "date_format (openDate,'%Y-%m-%d') >= date_format('" + query.getOpenStartDate() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getOpenEndDate()), "date_format (openDate,'%Y-%m-%d') <= date_format('" + query.getOpenEndDate() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//平仓付款日期
|
|
|
|
qw.apply(StringUtils.isNotBlank(query.getExePayStartDate()), "date_format (exePayDate,'%Y-%m-%d') >= date_format('" + query.getExePayStartDate() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getExePayStartDate()), "date_format (exePayDate,'%Y-%m-%d') <= date_format('" + query.getExePayStartDate() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
IPage<FinPaymentapplyDetailsBelowEve> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinPaymentapplyDetailsBelowEveVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<FinPaymentapplyDetailsBelowEveVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public void saveOrUpdateDto(FinPaymentapplyDetailsBelowEveDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
this.insertByDto(dto); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.updateByDto(dto); |
|
|
|
} |
|
|
|
this.updateByDto(dto); |
|
|
|
} |
|
|
|
|
|
|
|
public void insertByDto(FinPaymentapplyDetailsBelowEveDto dto){ |
|
|
|
FinPaymentapplyDetailsBelowEve entity = new FinPaymentapplyDetailsBelowEve(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.insert(entity); |
|
|
|
} |
|
|
|
public void insertByDto(FinPaymentapplyDetailsBelowEveDto dto) { |
|
|
|
FinPaymentapplyDetailsBelowEve entity = new FinPaymentapplyDetailsBelowEve(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateByDto(FinPaymentapplyDetailsBelowEveDto dto){ |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
public void updateByDto(FinPaymentapplyDetailsBelowEveDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
FinPaymentapplyDetailsBelowEve entity = fetchBySid(dtoSid); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.updateById(entity); |
|
|
|
} |
|
|
|
FinPaymentapplyDetailsBelowEve entity = fetchBySid(dtoSid); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|
public FinPaymentapplyDetailsBelowEveDetailsVo fetchDetailsVoBySid(String sid){ |
|
|
|
FinPaymentapplyDetailsBelowEve entity = fetchBySid(sid); |
|
|
|
FinPaymentapplyDetailsBelowEveDetailsVo vo = new FinPaymentapplyDetailsBelowEveDetailsVo(); |
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
public FinPaymentapplyDetailsBelowEveDetailsVo fetchDetailsVoBySid(String sid) { |
|
|
|
FinPaymentapplyDetailsBelowEve entity = fetchBySid(sid); |
|
|
|
FinPaymentapplyDetailsBelowEveDetailsVo vo = new FinPaymentapplyDetailsBelowEveDetailsVo(); |
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
public List<FinPaymentapplyDetailsBelowEveDetailsVo> selByMainSid(String mainSid) { |
|
|
|
return baseMapper.selByMainSid(mainSid); |
|
|
|
} |
|
|
|
public List<FinPaymentapplyDetailsBelowEveDetailsVo> selByMainSid(String mainSid) { |
|
|
|
return baseMapper.selByMainSid(mainSid); |
|
|
|
} |
|
|
|
} |