Commit 2fdf184d by jianglong

新增INFCRD

parent cb613bc5
......@@ -30,6 +30,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.*;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
......@@ -209,11 +210,54 @@ public class CrToolComponent {
}
public void isFXTrnAllowed(Crdgrp crdgrp, TrncodVo trncodVo) {
public static void isCRTrnAllowed(Crdgrp crdgrp, TrncodVo trncodVo) {
crdgrp.reset();
String trnNam = trncodVo.getInifrm().toUpperCase();
String ErrSelN = "No Clearing selected";
String ErrClsY = "Selected Clearing is closed";
String ErrClsN = "Selected Clearing is not closed";
String ErrOpnN = "Selected Clearing is not yet opened";
String ErrOpnY = "Selected Clearing is already opened";
String ErrCanI = "Selected Clearing is already canceled";
switch (trnNam){
case "CRTCRI":
//# 自动清算
if (!StringUtils.isEmpty(crdgrp.getRec().getInr())){
trncodVo.setDisResult(ErrOpnY);
trncodVo.setIsAllowed("N");
}
break;
case "CRTCRO":
case "CRTFRE":
break;
case "CRTCBK":
case "CRTCTF":
if (StringUtils.isEmpty(crdgrp.getRec().getInr())){
trncodVo.setDisResult(ErrSelN);
trncodVo.setIsAllowed("N");
}
break;
default:
break;
}
if (MdaUtils.isEmpty(trnNam)) {
String msgTxt = "The selected transaction cannot be started under the selected Clearing";
trncodVo.setDisResult(msgTxt);
trncodVo.setIsAllowed("N");
}
if (Strings.isEmpty(trncodVo.getDisResult())) {
trncodVo.setIsAllowed("Y");
}
}
/**
* source:crtmod.0000.script
......@@ -497,4 +541,7 @@ public class CrToolComponent {
return gidgrp;
}
}
package com.brilliance.isc.funds.crtsel.resource;
import com.brilliance.isc.funds.crtsel.service.CrtselService;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.TrnCodeQueryVo;
import com.brilliance.isc.vo.funds.CrtselQueryVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@RequestMapping("/crtsel")
public class CrtselResource {
@Autowired
private CrtselService crtselService;
/*
*
* */
@PostMapping("/list")
public ResponseSet list(@RequestBody CrtselQueryVo crtselQueryVo) {
return ResponseSet.simpleSuccess(crtselService.list(crtselQueryVo));
}
/**
* 处理按钮查看能够进行的交易
*/
@ApiOperation("处理按钮查看能够进行的交易")
@PostMapping("/dealWithByOwnref")
public ResponseSet dealWithByOwnref(@RequestBody TrnCodeQueryVo trnCodeQueryVo) {
return ResponseSet.simpleSuccess(crtselService.dealWithByInr(trnCodeQueryVo));
}
@ApiOperation("处理按钮查看能够进行的交易")
@PostMapping("/dealWithByInr")
public ResponseSet dealWithByInr(@RequestBody TrnCodeQueryVo trnCodeQueryVo) {
return ResponseSet.simpleSuccess(crtselService.dealWithByInr(trnCodeQueryVo));
}
/**
* 详情页面初始化
*/
@PostMapping("/selectXxdByPrimaryKey")
public ResponseSet selectXxdByPrimaryKey(@RequestBody Map<String, String> map) {
return ResponseSet.simpleSuccess(crtselService.selectXxdByPrimaryKey(map));
}
}
package com.brilliance.isc.funds.crtsel.service;
import com.brilliance.isc.vo.TrncodVo;
import com.brilliance.isc.vo.TrnCodeQueryVo;
import com.brilliance.isc.vo.funds.CrtselQueryVo;
import com.github.pagehelper.PageInfo;
import java.util.List;
import java.util.Map;
public interface CrtselService {
PageInfo list(CrtselQueryVo crtselQueryVo);
List<TrncodVo> dealWithByInr(TrnCodeQueryVo trnCodeQueryVo);
Object selectXxdByPrimaryKey(Map<String, String> map);
}
package com.brilliance.isc.funds.crtsel.service.impl;
import com.brilliance.isc.bo.Trn;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.common.sysmod.SysmodService;
import com.brilliance.isc.funds.bo.funds.CrtcriStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtfopStoreBo;
import com.brilliance.isc.funds.common.component.CrToolComponent;
import com.brilliance.isc.funds.crtsel.service.CrtselService;
import com.brilliance.isc.mda.dao.CrdMapper;
import com.brilliance.isc.mda.dao.TrnMapper;
import com.brilliance.isc.vo.TrnCodeQueryVo;
import com.brilliance.isc.vo.TrncodVo;
import com.brilliance.isc.vo.funds.CrdWithPtsCbbResponseVo;
import com.brilliance.isc.vo.funds.CrtselQueryVo;
import com.brilliance.mda.runtime.mda.util.Strings;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
//import com.brilliance.isc.funds.bo.Crdgrp;
@Service
public class CrtselServiceImpl implements CrtselService {
private Logger logger = LoggerFactory.getLogger(CrtselServiceImpl.class);
@Autowired
private CrdMapper crdMapper;
@Resource
private TrnMapper trnMapper;
@Resource
private SysmodService sysmodService;
@Autowired
private CrToolComponent crToolComponent;
//业务查询
@Override
public PageInfo list(CrtselQueryVo crtselQueryVo) {
//FB+FS
PageHelper.startPage(crtselQueryVo.getPageNumber(), crtselQueryVo.getPageSize()).setReasonable(true);
List<CrdWithPtsCbbResponseVo> crdList = crdMapper.queryCrdInfo(crtselQueryVo);
return new PageInfo(crdList);
}
@Override
public List<TrncodVo> dealWithByInr(TrnCodeQueryVo trnCodeQueryVo) {
String type = Strings.toUpper(trnCodeQueryVo.getType());
String inr = trnCodeQueryVo.getInr();
List<TrncodVo> result = Lists.newArrayList();
Crdgrp crdgrp = crToolComponent.getCrdgrpByInr(inr);
if ("I".equals(crdgrp.getRec().getClrtyp())) {
//汇入清算
String[] crTraArray = {"CRTCBK", "CRTCTF"};
String[] crButArray = {"退汇清算", "转汇清算"};
String isAllowed = "";
for (int i = 0; i < crTraArray.length; i++) {
TrncodVo trncodVo = new TrncodVo(crTraArray[i], crButArray[i], isAllowed, "Y", "");
crToolComponent.isCRTrnAllowed(crdgrp, trncodVo);
result.add(trncodVo);
}
} else if ("O".equals(crdgrp.getRec().getClrtyp())) {
//汇出清算
String[] crTraArray = {"CRTCTF"};
String[] crButArray = {"转汇清算"};
String isAllowed = "";
for (int i = 0; i < crTraArray.length; i++) {
TrncodVo trncodVo = new TrncodVo(crTraArray[i], crButArray[i], isAllowed, "Y", "");
crToolComponent.isCRTrnAllowed(crdgrp, trncodVo);
result.add(trncodVo);
}
}
return result;
}
@Override
public Object selectXxdByPrimaryKey(Map<String, String> map) {
String objinr = map.get("objinr");
String objtyp = map.get("objtyp");
String pntinr = map.get("pntinr");
CrtcriStoreBo crtcriStoreBo = new CrtcriStoreBo();
crtcriStoreBo.reset();
if (objinr.length() == 16) {
Trn trnLid = trnMapper.selectByObjinrTrn(objtyp, objinr, "CRTCRI");
if (!Objects.isNull(trnLid)) {
crtcriStoreBo = sysmodService.streamGetNameInSubDir(CrtcriStoreBo.class, trnLid.getInr());
}
}
crtcriStoreBo.setCrdgrp(crToolComponent.getCrdgrpByInr(objinr));
return crtcriStoreBo;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment