1、新增自动归集、根据id认领提交。
This commit is contained in:
parent
b742852031
commit
55c9d339dc
|
@ -2,6 +2,7 @@ package com.hzya.frame.finance.claim.controller;
|
|||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.finance.claim.entity.ClaimVO;
|
||||
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
|
||||
import com.hzya.frame.finance.claim.service.IClaimSKService;
|
||||
import com.hzya.frame.finance.claim.service.IClaimService;
|
||||
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
|
||||
|
@ -80,13 +81,13 @@ public class ClaimSKController extends DefaultController {
|
|||
* 流水生成认领单
|
||||
*/
|
||||
@RequestMapping(value = "/generate", method = RequestMethod.POST)
|
||||
public JsonResultEntity generate(@RequestBody MdmDBQueryVO vo) throws Exception {
|
||||
public JsonResultEntity generate(@RequestBody FeClaimBillHEntity vo) throws Exception {
|
||||
int i=0;
|
||||
int j=0;
|
||||
StringBuffer cgsb = new StringBuffer();
|
||||
StringBuffer sbsb = new StringBuffer();
|
||||
try {
|
||||
String ids = vo.getIds();
|
||||
String ids = vo.getId();
|
||||
String[] split = ids.split(",");
|
||||
for (String s : split) {
|
||||
try {
|
||||
|
@ -114,6 +115,42 @@ public class ClaimSKController extends DefaultController {
|
|||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/generateById", method = RequestMethod.POST)
|
||||
public JsonResultEntity generateById(@RequestBody FeClaimBillHEntity vo) throws Exception {
|
||||
try {
|
||||
claimService.generate(vo);
|
||||
return getSuccessMessageEntity("生成成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询对应客户
|
||||
*/
|
||||
@RequestMapping(value = "/queryCustomer", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryCustomer(@RequestBody MdmDBQueryVO vo) throws Exception {
|
||||
try {
|
||||
return getSuccessMessageEntity("请求成功");
|
||||
}catch (Exception e){
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动带出信息
|
||||
*/
|
||||
@RequestMapping(value = "/autoCollection", method = RequestMethod.POST)
|
||||
public JsonResultEntity autoCollection(@RequestBody MdmDBQueryVO entity){
|
||||
try {
|
||||
FeClaimBillHEntity claimBillHEntity = claimSKService.autoCollection(entity);
|
||||
return getSuccessMessageEntity("请求成功",claimBillHEntity);
|
||||
}catch (Exception e){
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -74,6 +74,8 @@ public class FeClaimBillHEntity extends FeClaimBillBEntity {
|
|||
* 认领人id
|
||||
*/
|
||||
private String claimUserId;
|
||||
private String claimUserCode;
|
||||
private String claimUserName;
|
||||
/**
|
||||
* 银行id
|
||||
*/
|
||||
|
@ -146,6 +148,7 @@ public class FeClaimBillHEntity extends FeClaimBillBEntity {
|
|||
private String pushStatusName;
|
||||
private String sourceId;
|
||||
private String downstreamSystemBillCode;
|
||||
private String ids;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.hzya.frame.finance.claim.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
|
||||
import com.hzya.frame.mdm.entity.MdmViewVo;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
|
||||
|
||||
|
@ -18,4 +19,6 @@ public interface IClaimSKService {
|
|||
PageInfo queryFlowDatePaged(MdmDBQueryVO entity);
|
||||
|
||||
List<Map<String, Object>> queryFlowDateIds(MdmDBQueryVO entity);
|
||||
|
||||
FeClaimBillHEntity autoCollection(MdmDBQueryVO entity);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public interface IClaimService {
|
|||
|
||||
PageInfo queryPaged(ClaimVO vo);
|
||||
|
||||
String generate(MdmDBQueryVO vo);
|
||||
FeClaimBillHEntity generate(FeClaimBillHEntity vo);
|
||||
|
||||
String back(String id);
|
||||
|
||||
|
|
|
@ -1,11 +1,21 @@
|
|||
package com.hzya.frame.finance.claim.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.SaTokenInfo;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
|
||||
import com.hzya.frame.finance.claim.service.IClaimSKService;
|
||||
import com.hzya.frame.finance.flow.dao.IMdmKkBankflowGtsDao;
|
||||
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
|
||||
import com.hzya.frame.mdm.entity.MdmViewVo;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
||||
import com.hzya.frame.sysnew.person.dao.ISysPersonDao;
|
||||
import com.hzya.frame.sysnew.person.entity.SysPersonEntity;
|
||||
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
|
||||
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDbFiledVODAO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
|
||||
|
@ -14,6 +24,8 @@ import com.hzya.frame.voucher.ae.push.service.IAePushVoucherLogService;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -22,6 +34,9 @@ import java.util.Map;
|
|||
*/
|
||||
@Service
|
||||
public class IClaimSKServiceImpl implements IClaimSKService {
|
||||
|
||||
public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Autowired
|
||||
private IMdmModuleDao mdmModuleDao;
|
||||
@Autowired
|
||||
|
@ -34,6 +49,13 @@ public class IClaimSKServiceImpl implements IClaimSKService {
|
|||
|
||||
@Autowired
|
||||
private IAePushVoucherLogService aePushVoucherLogService;
|
||||
@Autowired
|
||||
private IMdmKkBankflowGtsDao kkBankflowGtsDao;
|
||||
@Autowired
|
||||
private ISysUserDao sysUserDao;
|
||||
@Autowired
|
||||
private ISysPersonDao sysPersonDao;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -154,4 +176,123 @@ public class IClaimSKServiceImpl implements IClaimSKService {
|
|||
|
||||
return maps;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动归集
|
||||
* 1、
|
||||
*/
|
||||
@Override
|
||||
public FeClaimBillHEntity autoCollection(MdmDBQueryVO vo) {
|
||||
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
|
||||
try {
|
||||
//查询流水
|
||||
String id = vo.getIds();
|
||||
MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
|
||||
mdmKkBankflowGtsEntity.setId(id);
|
||||
List<MdmKkBankflowGtsEntity> bankflowGtsList = kkBankflowGtsDao.query(mdmKkBankflowGtsEntity);
|
||||
if (bankflowGtsList.size() == 0) {
|
||||
Assert.state(false, "根据流水id:[{}],未查询到流水信息。", id);
|
||||
}
|
||||
MdmKkBankflowGtsEntity kkBankflow = bankflowGtsList.get(0);
|
||||
System.out.println(kkBankflow);
|
||||
|
||||
if ("Y".equals(kkBankflow.getClaimstatus())) {
|
||||
Assert.state(false, "自动归集失败,流水已认领,流水id:{}。", id);
|
||||
}
|
||||
|
||||
//认领日期
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String billDate = now.format(formatter);
|
||||
feClaimBillHEntity.setBillData(billDate);
|
||||
|
||||
//客户
|
||||
String cnteracctname = kkBankflow.getCnteracctname();
|
||||
feClaimBillHEntity.setCustomerName(cnteracctname);
|
||||
|
||||
//认领人
|
||||
// SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
|
||||
// String token = tokenInfo.getTokenValue();
|
||||
// Object loginIdByToken = StpUtil.getLoginIdByToken(token);
|
||||
// System.out.println(loginIdByToken);
|
||||
// SysUserEntity sysUserEntity = new SysUserEntity();
|
||||
// sysUserEntity.setId(String.valueOf(loginIdByToken));
|
||||
// List<SysUserEntity> userEntityList = sysUserDao.query(sysUserEntity);
|
||||
// if(userEntityList.size()==0){
|
||||
// Assert.state(false,"登录过期,请重新登录");
|
||||
// }
|
||||
// String personId = userEntityList.get(0).getPersonId();
|
||||
// SysPersonEntity sysPersonEntity = new SysPersonEntity();
|
||||
// sysPersonEntity.setId(personId);
|
||||
// List<SysPersonEntity> personEntityList = sysPersonDao.query(sysPersonEntity);
|
||||
// System.out.println(personEntityList.get(0).getMobilePhone());
|
||||
// feClaimBillHEntity.setClaimUserId(personId);
|
||||
// feClaimBillHEntity.setClaimUserCode(personEntityList.get(0).getPersonCode());
|
||||
// feClaimBillHEntity.setClaimUserName(personEntityList.get(0).getPersonName());
|
||||
feClaimBillHEntity.setClaimUserId("1");
|
||||
feClaimBillHEntity.setClaimUserCode("admin");
|
||||
feClaimBillHEntity.setClaimUserName("系统管理员");
|
||||
|
||||
|
||||
//收款银行
|
||||
feClaimBillHEntity.setBankName(kkBankflow.getOpnbnkinfo());
|
||||
|
||||
//收款银行账号
|
||||
feClaimBillHEntity.setBankNum(kkBankflow.getCnteracctno());
|
||||
|
||||
//财务组织
|
||||
|
||||
|
||||
//往来对象--
|
||||
feClaimBillHEntity.setWldxName("客商");
|
||||
|
||||
|
||||
|
||||
//认领金额
|
||||
feClaimBillHEntity.setClaimSum(kkBankflow.getTranamt());
|
||||
|
||||
//摘要
|
||||
feClaimBillHEntity.setZy(kkBankflow.getZy());
|
||||
|
||||
|
||||
//款项性质
|
||||
|
||||
//款项类别
|
||||
|
||||
|
||||
//币种
|
||||
feClaimBillHEntity.setCurrencyName(kkBankflow.getCcy());
|
||||
|
||||
//金额
|
||||
feClaimBillHEntity.setMoney(kkBankflow.getTranamt());
|
||||
|
||||
|
||||
//描述说明
|
||||
|
||||
|
||||
//认领类型 SK/FK D-借;C-贷 转入/转出标志
|
||||
String outflag = kkBankflow.getOutflag();
|
||||
if ("D".equals(outflag)) {
|
||||
feClaimBillHEntity.setClaimType("SK");
|
||||
} else if ("C".equals(outflag)) {
|
||||
feClaimBillHEntity.setClaimType("FK");
|
||||
}
|
||||
|
||||
//来源单据号
|
||||
String transeqno1 = kkBankflow.getTranseqno1();
|
||||
feClaimBillHEntity.setSourceFlowBankId(transeqno1);
|
||||
feClaimBillHEntity.setSourceId(kkBankflow.getId());
|
||||
|
||||
//流水交易时间
|
||||
String trandate = kkBankflow.getTrandate();
|
||||
String trantimep = kkBankflow.getTrantimep();
|
||||
feClaimBillHEntity.setDef1(trandate + " " + trantimep);
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Assert.state(false,"自动归集失败,失败原因:{}",e.getMessage());
|
||||
}
|
||||
|
||||
return feClaimBillHEntity;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,67 +125,30 @@ public class IClaimServiceImpl implements IClaimService {
|
|||
* 3、保存认领单
|
||||
*/
|
||||
@Override
|
||||
public String generate(MdmDBQueryVO vo) {
|
||||
public FeClaimBillHEntity generate(FeClaimBillHEntity feClaimBillHEntity) {
|
||||
try {
|
||||
String id = vo.getId();
|
||||
System.out.println(feClaimBillHEntity);
|
||||
// String id = vo.getId();
|
||||
MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
|
||||
mdmKkBankflowGtsEntity.setId(id);
|
||||
mdmKkBankflowGtsEntity.setId(feClaimBillHEntity.getSourceId());
|
||||
List<MdmKkBankflowGtsEntity> bankflowGtsList = kkBankflowGtsDao.query(mdmKkBankflowGtsEntity);
|
||||
if (bankflowGtsList.size() == 0) {
|
||||
Assert.state(false, "根据流水id:[{}],未查询到流水信息。", id);
|
||||
Assert.state(false, "根据流水id:[{}],未查询到流水信息。", feClaimBillHEntity.getSourceId());
|
||||
}
|
||||
MdmKkBankflowGtsEntity kkBankflow = bankflowGtsList.get(0);
|
||||
System.out.println(kkBankflow);
|
||||
|
||||
//
|
||||
if ("Y".equals(kkBankflow.getClaimstatus())) {
|
||||
Assert.state(false, "流水已认领,流水id:{}。", id);
|
||||
}
|
||||
|
||||
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
|
||||
|
||||
//认领类型 SK/FK D-借;C-贷 转入/转出标志
|
||||
String outflag = kkBankflow.getOutflag();
|
||||
if ("D".equals(outflag)) {
|
||||
feClaimBillHEntity.setClaimType("SK");
|
||||
} else if ("C".equals(outflag)) {
|
||||
feClaimBillHEntity.setClaimType("FK");
|
||||
Assert.state(false, "流水已认领,流水id:{}。", feClaimBillHEntity.getSourceId());
|
||||
}
|
||||
|
||||
//获取认领单单号
|
||||
String claimBillCode = claimBillCodeUtil.saveBillCodeByTypeAndSourceCode(feClaimBillHEntity.getClaimType(), kkBankflow.getTranseqno1());
|
||||
String claimBillCode = claimBillCodeUtil.saveBillCodeByTypeAndSourceCode(feClaimBillHEntity.getClaimType(), feClaimBillHEntity.getSourceId());
|
||||
feClaimBillHEntity.setBillCode(claimBillCode);
|
||||
|
||||
//认领时间默认流水交易时间
|
||||
String trandate = kkBankflow.getTrandate();
|
||||
String trantimep = kkBankflow.getTrantimep();
|
||||
feClaimBillHEntity.setBillData(trandate + " " + trantimep);
|
||||
|
||||
|
||||
//对方户名cnterAcctName
|
||||
String cnteracctname = kkBankflow.getCnteracctname();
|
||||
feClaimBillHEntity.setCustomerName(cnteracctname);
|
||||
//收付交易账号
|
||||
String cnteracctno = kkBankflow.getCnteracctno();
|
||||
feClaimBillHEntity.setBankNum(cnteracctno);
|
||||
|
||||
//往来对象
|
||||
feClaimBillHEntity.setWldxName("客商");
|
||||
|
||||
|
||||
feClaimBillHEntity.setIsAutoClaim("N");
|
||||
|
||||
//认领人 当前登陆人
|
||||
// Object loginId = StpUtil.getLoginId();
|
||||
// feClaimBillHEntity.setClaimUserId(loginId.toString());
|
||||
feClaimBillHEntity.setClaimUserId("1");
|
||||
|
||||
//认领金额
|
||||
String tranamt = kkBankflow.getTranamt();
|
||||
feClaimBillHEntity.setClaimSum(tranamt);
|
||||
|
||||
feClaimBillHEntity.setSourceId(id);
|
||||
|
||||
|
||||
//保存认领单
|
||||
claimBillHDao.save(feClaimBillHEntity);
|
||||
//更新流水认领单号以及认领状态
|
||||
|
@ -198,7 +161,7 @@ public class IClaimServiceImpl implements IClaimService {
|
|||
e.printStackTrace();
|
||||
Assert.state(false, "生成认领单失败,失败原因:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
return feClaimBillHEntity;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue