1、新增认领功能。
This commit is contained in:
parent
f468be5cf2
commit
158b9bee73
|
@ -52,4 +52,7 @@ public class ClaimController extends DefaultController {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
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.service.IClaimSKService;
|
||||
import com.hzya.frame.finance.claim.service.IClaimService;
|
||||
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
|
||||
import com.hzya.frame.mdm.entity.MdmViewVo;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
|
||||
|
@ -26,6 +28,8 @@ public class ClaimSKController extends DefaultController {
|
|||
|
||||
@Autowired
|
||||
private IClaimSKService claimSKService;
|
||||
@Autowired
|
||||
private IClaimService claimService;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -58,7 +62,7 @@ public class ClaimSKController extends DefaultController {
|
|||
|
||||
|
||||
/**
|
||||
* 流水查询数据
|
||||
* 流水查询数据ids
|
||||
*/
|
||||
@RequestMapping(value = "/queryFlowDateIds", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryFlowDateIds(@RequestBody MdmDBQueryVO entity) {
|
||||
|
@ -72,5 +76,44 @@ public class ClaimSKController extends DefaultController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流水生成认领单
|
||||
*/
|
||||
@RequestMapping(value = "/generate", method = RequestMethod.POST)
|
||||
public JsonResultEntity generate(@RequestBody MdmDBQueryVO vo) throws Exception {
|
||||
int i=0;
|
||||
int j=0;
|
||||
StringBuffer cgsb = new StringBuffer();
|
||||
StringBuffer sbsb = new StringBuffer();
|
||||
try {
|
||||
String ids = vo.getIds();
|
||||
String[] split = ids.split(",");
|
||||
for (String s : split) {
|
||||
try {
|
||||
vo.setId(s);
|
||||
claimService.generate(vo);
|
||||
j++;
|
||||
cgsb.append(j).append("、流水号:[");
|
||||
cgsb.append(s).append("];");
|
||||
}catch (Exception e){
|
||||
i++;
|
||||
sbsb.append(i).append("、流水号:[").append(s);
|
||||
sbsb.append("]失败原因:").append(e.getMessage()).append(";");
|
||||
}
|
||||
}
|
||||
if(i==0){
|
||||
return getSuccessMessageEntity("生成成功。"+cgsb);
|
||||
|
||||
}else {
|
||||
return getFailureMessageEntity("生成成功:"+j+"条。:"+cgsb+"\n失败:"+i+"条,失败原因:"+sbsb);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,6 @@ public class ClaimVO extends BaseEntity {
|
|||
private String billDate;
|
||||
private String billCustomer;
|
||||
private String isAutoClaim;//自动认领
|
||||
private String claimUser;//自动认领
|
||||
private String claimStatus;//自动认领
|
||||
private String claimUser;
|
||||
private String claimStatus;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import lombok.Data;
|
|||
* @since 2025-08-26 11:18:08
|
||||
*/
|
||||
@Data
|
||||
public class FeClaimBillHEntity extends BaseEntity {
|
||||
public class FeClaimBillHEntity extends FeClaimBillBEntity {
|
||||
|
||||
// private Long id;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.hzya.frame.finance.claim.service;
|
|||
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.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -13,4 +14,6 @@ public interface IClaimService {
|
|||
List<FeClaimBillHEntity> queryAll(ClaimVO vo);
|
||||
|
||||
PageInfo queryPaged(ClaimVO vo);
|
||||
|
||||
String generate(MdmDBQueryVO vo);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.finance.claim.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
@ -11,6 +12,11 @@ import com.hzya.frame.finance.claim.entity.ClaimVO;
|
|||
import com.hzya.frame.finance.claim.entity.FeClaimBillBEntity;
|
||||
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
|
||||
import com.hzya.frame.finance.claim.service.IClaimService;
|
||||
import com.hzya.frame.finance.conf.billcode.dao.IFeConfBillcodeRuleDao;
|
||||
import com.hzya.frame.finance.flow.dao.IMdmKkBankflowGtsDao;
|
||||
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
|
||||
import com.hzya.frame.finance.utils.ClaimBillCodeUtil;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -31,6 +37,12 @@ public class IClaimServiceImpl implements IClaimService {
|
|||
@Autowired
|
||||
private IFeClaimBillBDao claimBillBDao;
|
||||
|
||||
@Autowired
|
||||
private IMdmKkBankflowGtsDao kkBankflowGtsDao;
|
||||
|
||||
@Autowired
|
||||
private ClaimBillCodeUtil claimBillCodeUtil;
|
||||
|
||||
|
||||
@Override
|
||||
public List<FeClaimBillHEntity> queryAll(ClaimVO vo) {
|
||||
|
@ -77,4 +89,88 @@ public class IClaimServiceImpl implements IClaimService {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 流水生成 - 生成认领单
|
||||
* 1、保存单号 流水单号-认领单号
|
||||
* 2、回写流水数据中的认领单号
|
||||
* 3、保存认领单
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public String generate(MdmDBQueryVO vo) {
|
||||
try {
|
||||
String id = vo.getId();
|
||||
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);
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
//获取认领单单号
|
||||
String claimBillCode = claimBillCodeUtil.saveBillCodeByTypeAndSourceCode(feClaimBillHEntity.getClaimType(), kkBankflow.getTranseqno1());
|
||||
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);
|
||||
|
||||
|
||||
//保存认领单
|
||||
claimBillHDao.save(feClaimBillHEntity);
|
||||
//更新流水认领单号以及认领状态
|
||||
mdmKkBankflowGtsEntity.setClaimbillcode(claimBillCode);
|
||||
mdmKkBankflowGtsEntity.setClaimstatus("Y");
|
||||
kkBankflowGtsDao.update(mdmKkBankflowGtsEntity);
|
||||
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Assert.state(false,"生成认领单失败,失败原因:{}",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.hzya.frame.finance.flow.controller;
|
||||
|
||||
import com.hzya.frame.finance.claim.entity.ClaimVO;
|
||||
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
|
||||
import com.hzya.frame.finance.flow.service.IMdmKkBankflowGtsService;
|
||||
import com.hzya.frame.web.action.DefaultController;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -21,13 +23,27 @@ public class GTSController extends DefaultController {
|
|||
@Autowired
|
||||
private IMdmKkBankflowGtsService bankflowGtsService;
|
||||
|
||||
@RequestMapping(value = "/insert", method = RequestMethod.POST)
|
||||
public void insert(@RequestBody MdmKkBankflowGtsEntity entity) throws Exception {
|
||||
for (int i = 0; i < 4000; i++) {
|
||||
MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
|
||||
mdmKkBankflowGtsEntity.setId(UUID.randomUUID().toString());
|
||||
bankflowGtsService.save(mdmKkBankflowGtsEntity);
|
||||
}
|
||||
}
|
||||
// @RequestMapping(value = "/insert", method = RequestMethod.POST)
|
||||
// public void insert(@RequestBody MdmKkBankflowGtsEntity entity) throws Exception {
|
||||
// for (int i = 0; i < 4000; i++) {
|
||||
// MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
|
||||
// mdmKkBankflowGtsEntity.setId(UUID.randomUUID().toString());
|
||||
// bankflowGtsService.save(mdmKkBankflowGtsEntity);
|
||||
// }
|
||||
// }
|
||||
|
||||
//流水生成认领单
|
||||
// @RequestMapping(value = "/generate", method = RequestMethod.POST)
|
||||
// public JsonResultEntity generate(@RequestBody ClaimVO vo) throws Exception {
|
||||
// try {
|
||||
// return getSuccessMessageEntity(null);
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// return getFailureMessageEntity(e.getMessage());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,9 @@ public class MdmDBQueryVO extends BaseEntity {
|
|||
private String pkentityorg;
|
||||
private String billstatus;
|
||||
private String claimstatus;
|
||||
private String id;
|
||||
private String ids;
|
||||
private String outFlag;
|
||||
private String billDate;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue