|
|
|
@ -12,7 +12,7 @@ import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
|
|
|
|
|
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
|
|
|
|
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
|
|
|
|
|
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.bd.controller.BdController;
|
|
|
|
|
import com.hzya.frame.voucher.utils.PushU8CUtil;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdAccsubjDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdOrgBookVODao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
|
|
|
|
@ -26,7 +26,6 @@ import com.hzya.frame.voucher.ae.comf.bd.entity.vo.OrgBookVO;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.factor.dao.IAeConfInfluenceFactorCorrelationDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.factor.dao.IAeConfInfluenceFactorDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorCorrelationEntity;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorEntity;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.module.service.IMdmService;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.subject.dao.IAeConfSubjectClassificationDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.subject.dao.IAeConfSubjectContrastBDao;
|
|
|
|
@ -42,15 +41,13 @@ import com.hzya.frame.voucher.ae.comf.template.entity.AeConfVoucherTemplateTypeE
|
|
|
|
|
import com.hzya.frame.voucher.ae.comf.template.service.IAeConfVoucherTemplateService;
|
|
|
|
|
import com.hzya.frame.voucher.ae.generate.core.dao.ICoreDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.generate.core.service.ICoreService;
|
|
|
|
|
import com.hzya.frame.voucher.ae.generate.core.vo.AccsubjVO;
|
|
|
|
|
import com.hzya.frame.voucher.ae.generate.core.vo.CreateVoucherVO;
|
|
|
|
|
import com.hzya.frame.voucher.ae.generate.core.vo.VoucherData;
|
|
|
|
|
import com.hzya.frame.voucher.ae.push.dao.IAePushVoucherLogDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.push.dao.IAePushVoucherLogDetailsDao;
|
|
|
|
|
import com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogDetailsEntity;
|
|
|
|
|
import com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogEntity;
|
|
|
|
|
import com.hzya.frame.voucher.ae.push.service.IAePushVoucherLogService;
|
|
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
|
|
import com.hzya.frame.voucher.utils.ZTResult;
|
|
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -115,6 +112,9 @@ public class ICoreServiceImpl implements ICoreService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IAePushVoucherLogDao aePushVoucherLogDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private PushU8CUtil pushU8CUtil;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> queryDataByMdmId(CreateVoucherVO createVoucherVO) {
|
|
|
|
@ -601,268 +601,284 @@ public class ICoreServiceImpl implements ICoreService {
|
|
|
|
|
vouche.setDetails(details);
|
|
|
|
|
voucher.add(vouche);
|
|
|
|
|
|
|
|
|
|
String data="{\"voucher\":";
|
|
|
|
|
data+=JSONUtil.toJsonStr(voucher)+"}";
|
|
|
|
|
|
|
|
|
|
//8000630001:凭证新增
|
|
|
|
|
//8000630002:凭证删除
|
|
|
|
|
//推送U8C-新增凭证
|
|
|
|
|
ZTResult ztResult = null;
|
|
|
|
|
try {
|
|
|
|
|
ztResult = pushU8CUtil.pushByCode("8000630001", data);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
Assert.state(false,"推送U8C失败,失败原因:{}",e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
System.out.println(ztResult);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//记录日志
|
|
|
|
|
saveLog("Y",createVoucherVO.getBill_code(),null,createVoucherVO.getMdmId(),voucher);
|
|
|
|
|
|
|
|
|
|
updateBillStatusYByBillCodeMdmId(mdmModuleDb.getDbName(),createVoucherVO.getBill_code());
|
|
|
|
|
} else {//按类型生成不同的凭证
|
|
|
|
|
//根据凭证类型分组 账簿主键+凭证类别+模板id
|
|
|
|
|
Map<String, List<AeConfVoucherTemplateEntity>> collectTempType =
|
|
|
|
|
templateList.stream().collect(Collectors.groupingBy(index -> index.getPkGlorgbook() + "," + index.getVoucherTypeId() + "," + index.getTemplateTypeId()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<AeConfVoucherTemplateEntity>> entry : collectTempType.entrySet()) {
|
|
|
|
|
List<VoucherData.Voucher> voucher = new ArrayList<>();
|
|
|
|
|
List<VoucherData.Voucher.Detail> details = new ArrayList<>();
|
|
|
|
|
String key = entry.getKey();
|
|
|
|
|
List<AeConfVoucherTemplateEntity> value = entry.getValue();
|
|
|
|
|
AeConfVoucherTemplateEntity aeConfVoucherTemplateEntity1 = value.get(0);
|
|
|
|
|
String[] split = key.split(",");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//凭证组装头
|
|
|
|
|
VoucherData.Voucher vouche = new VoucherData.Voucher();
|
|
|
|
|
//pk_corp;//公司
|
|
|
|
|
OrgBookVO orgBookVO = queryPkCorpByPkGlOrgBook(aeConfVoucherTemplateEntity1.getPkGlorgbook());
|
|
|
|
|
vouche.setPk_corp(orgBookVO.getPkentityorg());
|
|
|
|
|
vouche.setCorp_code(orgBookVO.getGlorgcode());
|
|
|
|
|
vouche.setCorp_name(orgBookVO.getGlorgname());
|
|
|
|
|
//pk_glorgbook;//账簿
|
|
|
|
|
vouche.setPk_glorgbook(orgBookVO.getPkglorgbook());
|
|
|
|
|
vouche.setAccbookCode(orgBookVO.getGlorgbookcode());
|
|
|
|
|
vouche.setAccbookName(orgBookVO.getGlorgbookname());
|
|
|
|
|
//pk_prepared;//制单人编码
|
|
|
|
|
vouche.setPk_prepared("tbadmin");
|
|
|
|
|
vouche.setPrepared("tbadmin");
|
|
|
|
|
//pk_vouchertype;//凭证类别简称
|
|
|
|
|
BdVoucherTypeVO voucherTypeVO = queryGlOrgBookShortNameByVoucherTypeId(aeConfVoucherTemplateEntity1.getVoucherTypeId());
|
|
|
|
|
System.out.println(voucherTypeVO);
|
|
|
|
|
vouche.setPk_vouchertype(voucherTypeVO.getPkVouchertype());
|
|
|
|
|
vouche.setVouchertype_code(voucherTypeVO.getCode());
|
|
|
|
|
vouche.setVouchertype_name(voucherTypeVO.getName());
|
|
|
|
|
vouche.setVouchertype_shortname(voucherTypeVO.getShortname());
|
|
|
|
|
//prepareddate;//制单日期(格式示例:2021-04-27)) 根据sys_date找到单据日期字段
|
|
|
|
|
vouche.setPrepareddate(date);
|
|
|
|
|
vouche.setYear(date.substring(0, 4));
|
|
|
|
|
vouche.setPeriod(date.substring(5, 7));
|
|
|
|
|
//生成分录
|
|
|
|
|
System.out.println(groupedResult);
|
|
|
|
|
for (Map.Entry<List<Object>, List<Map<String, Object>>> dataEntry : groupedResult.entrySet()) {
|
|
|
|
|
try {
|
|
|
|
|
List<Object> dateKey = dataEntry.getKey();
|
|
|
|
|
List<Map<String, Object>> dataValue = dataEntry.getValue();
|
|
|
|
|
for (AeConfVoucherTemplateEntity template : templateList) {
|
|
|
|
|
VoucherData.Voucher.Detail detail = new VoucherData.Voucher.Detail();
|
|
|
|
|
//汇率:excrate2、locRate、groupRate、globalRate
|
|
|
|
|
String exchangeRate = template.getExchangeRate();
|
|
|
|
|
detail.setExcrate2(exchangeRate);
|
|
|
|
|
detail.setLocRate(exchangeRate);
|
|
|
|
|
detail.setGroupRate(exchangeRate);
|
|
|
|
|
detail.setGlobalRate(exchangeRate);
|
|
|
|
|
|
|
|
|
|
//单价:price
|
|
|
|
|
|
|
|
|
|
//摘要:explanation
|
|
|
|
|
boolean b = templateService.checkAbstract(template);
|
|
|
|
|
if (!b) {
|
|
|
|
|
Assert.state(false, "根据Id:{},校验摘要失败!", template.getId());
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
transSbstractRes(createVoucherVO.getMdmId(), template, dataValue);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
Assert.state(false, "根据Id:{},转换摘要失败!失败原因:{}", template.getId(), e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
detail.setExplanation(template.getAbstractStr());
|
|
|
|
|
|
|
|
|
|
//科目:pk_accsubj、accountCode、accountName
|
|
|
|
|
//分类定义 查 影响因素,再根据影响因素 查 影响因素关联的字段。
|
|
|
|
|
//分类定义 查 对照表
|
|
|
|
|
//影响因素关联的字段,对应对照表的 会计计科目,如果没有对照表 去默认科目 都没有则跳过该条分录
|
|
|
|
|
Long ClassificationId = template.getSubjectClassificationId();
|
|
|
|
|
String ClassificationCode = template.getSubjectClassificationCode();
|
|
|
|
|
String ClassificationName = template.getSubjectClassificationName();
|
|
|
|
|
AeConfSubjectClassificationEntity aeConfSubjectClassificationEntity = new AeConfSubjectClassificationEntity();
|
|
|
|
|
aeConfSubjectClassificationEntity.setId(String.valueOf(ClassificationId));
|
|
|
|
|
List<AeConfSubjectClassificationEntity> classificationList = subjectClassificationDao.query(aeConfSubjectClassificationEntity);
|
|
|
|
|
if (classificationList.size() == 0 || classificationList.size() > 1) {
|
|
|
|
|
Assert.state(false, "根据影响因素id:{}。未查询到分类定义或存在多个!{},{}", ClassificationId, ClassificationCode, ClassificationName);
|
|
|
|
|
}
|
|
|
|
|
AeConfSubjectClassificationEntity subjectClassification = classificationList.get(0);
|
|
|
|
|
String factorIds = subjectClassification.getFactorids();//影响因素定义
|
|
|
|
|
String[] factorIdSplit = factorIds.split(",");
|
|
|
|
|
Map<String, String> factorCorrelationMap = new LinkedHashMap<>();//影响因素关联map:影响因素id,单据选项 name中有公式,整个字段或者字段截取
|
|
|
|
|
for (String factorId : factorIdSplit) {
|
|
|
|
|
AeConfInfluenceFactorCorrelationEntity factorCorrelationEntity = new AeConfInfluenceFactorCorrelationEntity();
|
|
|
|
|
factorCorrelationEntity.setFactorId(Long.valueOf(factorId));
|
|
|
|
|
List<AeConfInfluenceFactorCorrelationEntity> factorCorrelationEntityList = factorCorrelationDao.query(factorCorrelationEntity);
|
|
|
|
|
if (factorCorrelationEntityList.size() == 0 || factorCorrelationEntityList.size() > 1) {
|
|
|
|
|
Assert.state(false, "根据影响因素id:{}。未查询到或查询到多条影响因素关联。", factorId);
|
|
|
|
|
}
|
|
|
|
|
String mdmId = factorCorrelationEntityList.get(0).getMdmId();
|
|
|
|
|
String mappingFieldName = factorCorrelationEntityList.get(0).getMappingFieldName();
|
|
|
|
|
//如果存在substr公式,则切割,否则返回单据值
|
|
|
|
|
String strValue = formulaTransFactorCorrelation(mdmId, mappingFieldName, dataValue);
|
|
|
|
|
|
|
|
|
|
factorCorrelationMap.put(factorId, strValue);
|
|
|
|
|
}
|
|
|
|
|
String contrastId = subjectClassification.getContrastId();//该分类定义下的对照表
|
|
|
|
|
AeConfSubjectContrastBEntity aeConfSubjectContrastBEntity = new AeConfSubjectContrastBEntity();
|
|
|
|
|
aeConfSubjectContrastBEntity.setContrastId(Long.valueOf(contrastId));
|
|
|
|
|
List<AeConfSubjectContrastBEntity> subjectContrastBEntityList = subjectContrastBDao.query(aeConfSubjectContrastBEntity);
|
|
|
|
|
AeConfBdAccsubjEntity confBdAccsubj = matchSubj(factorCorrelationMap, subjectContrastBEntityList);
|
|
|
|
|
if (confBdAccsubj == null) {//没有匹配到对照表,查询分类定义是否有默认科目
|
|
|
|
|
//分类的定义的默认科目
|
|
|
|
|
String desdocvalueDefaultId = subjectClassification.getDesdocvalueDefaultId();
|
|
|
|
|
String desdocvalueDefaultName = subjectClassification.getDesdocvalueDefaultName();
|
|
|
|
|
if (desdocvalueDefaultId != null && !"".equals(desdocvalueDefaultId) && desdocvalueDefaultName != null && !"".equals(desdocvalueDefaultName)) {
|
|
|
|
|
|
|
|
|
|
//查询科目
|
|
|
|
|
AeConfBdAccsubjEntity accsubj = new AeConfBdAccsubjEntity();
|
|
|
|
|
accsubj.setPkAccsubj(desdocvalueDefaultId);
|
|
|
|
|
List<AeConfBdAccsubjEntity> accsubjList = aeConfBdAccsubjDao.query(accsubj);
|
|
|
|
|
if (accsubjList.size() > 1 || accsubjList.size() == 0) {
|
|
|
|
|
Assert.state(false, "根据默认科目主键:{},默认科目名称:{},未查询到或存在多条科目,请检查", desdocvalueDefaultId, desdocvalueDefaultName);
|
|
|
|
|
}
|
|
|
|
|
detail.setPk_accsubj(accsubjList.get(0).getSubjcode());//u8c需要编码
|
|
|
|
|
detail.setAccountId(desdocvalueDefaultId);
|
|
|
|
|
detail.setAccountCode(accsubjList.get(0).getSubjcode());
|
|
|
|
|
detail.setAccountName(accsubjList.get(0).getSubjname());
|
|
|
|
|
} else {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
detail.setPk_accsubj(confBdAccsubj.getSubjcode());//u8c需要编码
|
|
|
|
|
detail.setAccountId(confBdAccsubj.getPkAccsubj());
|
|
|
|
|
detail.setAccountCode(confBdAccsubj.getSubjcode());
|
|
|
|
|
detail.setAccountName(confBdAccsubj.getSubjname());
|
|
|
|
|
}
|
|
|
|
|
//币种编码:pk_currtype、currtypeCode、currtypeName
|
|
|
|
|
String currencyFieldName = template.getCurrencyFieldName();
|
|
|
|
|
BdCurrtypeVO bdCurrtypeVO = formulaTransCurrency(currencyFieldName);
|
|
|
|
|
if (bdCurrtypeVO == null) {
|
|
|
|
|
Assert.state(false, "根据币种字段:{},转换失败");
|
|
|
|
|
}
|
|
|
|
|
detail.setPk_currtype(bdCurrtypeVO.getCode());
|
|
|
|
|
detail.setCurrtypeId(bdCurrtypeVO.getPkCurrtype());
|
|
|
|
|
detail.setCurrtypeCode(bdCurrtypeVO.getCode());
|
|
|
|
|
detail.setCurrtypeName(bdCurrtypeVO.getName());
|
|
|
|
|
//借方数量:debitquantity
|
|
|
|
|
BigDecimal jNumField = sumAmountAndNum(template.getjNumFieldName(), dataValue);
|
|
|
|
|
detail.setDebitquantity(jNumField.toString());
|
|
|
|
|
//原币借方金额:debitamount
|
|
|
|
|
BigDecimal jYbSumField = sumAmountAndNum(template.getjYbSumFieldName(), dataValue);
|
|
|
|
|
detail.setDebitamount(jYbSumField.toString());
|
|
|
|
|
//本币借方金额:localdebitamount//本币为null,但是汇率右值,原币*汇率=本币
|
|
|
|
|
if (template.getjBbSumFieldName() == null || "".equals(template.getjBbSumFieldName()) && exchangeRate != null) {
|
|
|
|
|
BigDecimal jbb = jYbSumField.divide(new BigDecimal(exchangeRate));
|
|
|
|
|
detail.setLocaldebitamount(jbb.toString());
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal jBbSumField = sumAmountAndNum(template.getjBbSumFieldName(), dataValue);
|
|
|
|
|
detail.setLocaldebitamount(jBbSumField.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//贷方数量:creditquantity
|
|
|
|
|
BigDecimal dNumField = sumAmountAndNum(template.getdNumFieldName(), dataValue);
|
|
|
|
|
detail.setCreditquantity(dNumField.toString());
|
|
|
|
|
//原币贷方金额:creditamount
|
|
|
|
|
BigDecimal dYbSumField = sumAmountAndNum(template.getdYbSumFieldName(), dataValue);
|
|
|
|
|
detail.setCreditamount(dYbSumField.toString());
|
|
|
|
|
//本币贷方金额:localcreditamount
|
|
|
|
|
if (template.getdBbSumFieldName() == null || "".equals(template.getdBbSumFieldName()) && exchangeRate != null) {
|
|
|
|
|
BigDecimal dbb = dYbSumField.divide(new BigDecimal(exchangeRate));
|
|
|
|
|
detail.setLocalcreditamount(dbb.toString());
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal dBbSumField = sumAmountAndNum(template.getdBbSumFieldName(), dataValue);
|
|
|
|
|
detail.setLocalcreditamount(dBbSumField.toString());
|
|
|
|
|
}
|
|
|
|
|
//如果借贷都为0,则不生成该条分录
|
|
|
|
|
String detail_jYb = detail.getDebitamount();
|
|
|
|
|
String detail_jBb = detail.getLocaldebitamount();
|
|
|
|
|
String detail_dYb = detail.getCreditamount();
|
|
|
|
|
String detail_dBb = detail.getLocalcreditamount();
|
|
|
|
|
if("0".equals(detail_jYb)&&"0".equals(detail_jBb)&&"0".equals(detail_dYb)&&"0".equals(detail_dBb)){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
//业务日期:busidate
|
|
|
|
|
detail.setBusidate(date);
|
|
|
|
|
//辅助核算
|
|
|
|
|
//查询该科目下的辅助核算
|
|
|
|
|
String templateId = template.getId();
|
|
|
|
|
String pkGlorgbook = template.getPkGlorgbook();
|
|
|
|
|
AeConfBdAccsubjEntity confBdAccsubj1 = new AeConfBdAccsubjEntity();
|
|
|
|
|
confBdAccsubj1.setPkAccsubj(detail.getAccountId());
|
|
|
|
|
confBdAccsubj1.setPkGlorgbook(pkGlorgbook);
|
|
|
|
|
List<AeConfBdAccsubjEntity> aeConfBdAccsubjEntities = aeConfBdAccsubjDao.queryAssist(confBdAccsubj1);//科目必要的辅助核算
|
|
|
|
|
System.out.println(aeConfBdAccsubjEntities);
|
|
|
|
|
Map<String, String> assCodeNameMap = transferSubjAss(aeConfBdAccsubjEntities);
|
|
|
|
|
// Map<String, Map<String, Object>> assCodePkBdinfoMap = querySubjAssCodePkBdinfo(aeConfBdAccsubjEntities);
|
|
|
|
|
if (assCodeNameMap != null) {//不等于空,需要辅助核算
|
|
|
|
|
|
|
|
|
|
//查询科目下的辅助核算对应关系
|
|
|
|
|
Map<String, String> AssByBdCodeMap = queryAssByBdCode(aeConfBdAccsubjEntities);
|
|
|
|
|
System.out.println(AssByBdCodeMap);
|
|
|
|
|
|
|
|
|
|
//查询该分录下配置的辅助核算,模板上的辅助核算
|
|
|
|
|
AeConfVoucherTemplateAssistEntity assistEntity = new AeConfVoucherTemplateAssistEntity();
|
|
|
|
|
assistEntity.setVoucherTemplateId(Long.valueOf(templateId));
|
|
|
|
|
List<AeConfVoucherTemplateAssistEntity> templateAssist = templateAssDao.query(assistEntity);
|
|
|
|
|
System.out.println(templateAssist);//分录配置的辅助核算
|
|
|
|
|
Map<String, AeConfVoucherTemplateAssistEntity> AssByMdmId = queryAssByMdmId(templateAssist);
|
|
|
|
|
System.out.println(AssByMdmId);
|
|
|
|
|
|
|
|
|
|
List<VoucherData.Voucher.Detail.Ass> assList = new ArrayList<>();
|
|
|
|
|
//根据科目的辅助核算匹配模板的配置
|
|
|
|
|
for (Map.Entry<String, String> assByBdCodeEntry : AssByBdCodeMap.entrySet()) {
|
|
|
|
|
|
|
|
|
|
String keyy = assByBdCodeEntry.getKey();
|
|
|
|
|
String valuee = assByBdCodeEntry.getValue();
|
|
|
|
|
AeConfVoucherTemplateAssistEntity templateAssistEntity = AssByMdmId.get(keyy);//去单据辅助核算
|
|
|
|
|
|
|
|
|
|
//辅助核算取值
|
|
|
|
|
Map<String, String> assValue = getAssValue(templateAssistEntity, dataValue, orgBookVO);
|
|
|
|
|
System.out.println(assValue);
|
|
|
|
|
if(assValue.size()!=0){
|
|
|
|
|
VoucherData.Voucher.Detail.Ass assEntity = new VoucherData.Voucher.Detail.Ass();
|
|
|
|
|
assEntity.setChecktypecode(valuee);
|
|
|
|
|
assEntity.setCheckvalueid(assValue.get("pk"));
|
|
|
|
|
assEntity.setCheckvaluecode(assValue.get("code"));
|
|
|
|
|
assEntity.setCheckvaluename(assValue.get("name"));
|
|
|
|
|
//类型
|
|
|
|
|
for (AeConfBdAccsubjEntity aeConfBdAccsubjEntity : aeConfBdAccsubjEntities) {
|
|
|
|
|
if(valuee.equals(aeConfBdAccsubjEntity.getBdcode())){
|
|
|
|
|
assEntity.setChecktypename(aeConfBdAccsubjEntity.getBdname());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
assList.add(assEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (assList.size() != 0) {
|
|
|
|
|
detail.setAss(assList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
details.add(detail);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
//分录生成失败
|
|
|
|
|
Assert.state(false, "分录生成失败,失败原因:{}", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(details.size()==0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vouche.setDetails(details);
|
|
|
|
|
voucher.add(vouche);
|
|
|
|
|
//记录日志
|
|
|
|
|
saveLog("Y",createVoucherVO.getBill_code(),null,createVoucherVO.getMdmId(),voucher);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// saveLog("Y",createVoucherVO.getBill_code(),null,createVoucherVO.getMdmId(),voucher);
|
|
|
|
|
//
|
|
|
|
|
// updateBillStatusYByBillCodeMdmId(mdmModuleDb.getDbName(),createVoucherVO.getBill_code());
|
|
|
|
|
}
|
|
|
|
|
// else {//按类型生成不同的凭证
|
|
|
|
|
// //根据凭证类型分组 账簿主键+凭证类别+模板id
|
|
|
|
|
// Map<String, List<AeConfVoucherTemplateEntity>> collectTempType =
|
|
|
|
|
// templateList.stream().collect(Collectors.groupingBy(index -> index.getPkGlorgbook() + "," + index.getVoucherTypeId() + "," + index.getTemplateTypeId()));
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// for (Map.Entry<String, List<AeConfVoucherTemplateEntity>> entry : collectTempType.entrySet()) {
|
|
|
|
|
// List<VoucherData.Voucher> voucher = new ArrayList<>();
|
|
|
|
|
// List<VoucherData.Voucher.Detail> details = new ArrayList<>();
|
|
|
|
|
// String key = entry.getKey();
|
|
|
|
|
// List<AeConfVoucherTemplateEntity> value = entry.getValue();
|
|
|
|
|
// AeConfVoucherTemplateEntity aeConfVoucherTemplateEntity1 = value.get(0);
|
|
|
|
|
// String[] split = key.split(",");
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //凭证组装头
|
|
|
|
|
// VoucherData.Voucher vouche = new VoucherData.Voucher();
|
|
|
|
|
// //pk_corp;//公司
|
|
|
|
|
// OrgBookVO orgBookVO = queryPkCorpByPkGlOrgBook(aeConfVoucherTemplateEntity1.getPkGlorgbook());
|
|
|
|
|
// vouche.setPk_corp(orgBookVO.getPkentityorg());
|
|
|
|
|
// vouche.setCorp_code(orgBookVO.getGlorgcode());
|
|
|
|
|
// vouche.setCorp_name(orgBookVO.getGlorgname());
|
|
|
|
|
// //pk_glorgbook;//账簿
|
|
|
|
|
// vouche.setPk_glorgbook(orgBookVO.getPkglorgbook());
|
|
|
|
|
// vouche.setAccbookCode(orgBookVO.getGlorgbookcode());
|
|
|
|
|
// vouche.setAccbookName(orgBookVO.getGlorgbookname());
|
|
|
|
|
// //pk_prepared;//制单人编码
|
|
|
|
|
// vouche.setPk_prepared("tbadmin");
|
|
|
|
|
// vouche.setPrepared("tbadmin");
|
|
|
|
|
// //pk_vouchertype;//凭证类别简称
|
|
|
|
|
// BdVoucherTypeVO voucherTypeVO = queryGlOrgBookShortNameByVoucherTypeId(aeConfVoucherTemplateEntity1.getVoucherTypeId());
|
|
|
|
|
// System.out.println(voucherTypeVO);
|
|
|
|
|
// vouche.setPk_vouchertype(voucherTypeVO.getPkVouchertype());
|
|
|
|
|
// vouche.setVouchertype_code(voucherTypeVO.getCode());
|
|
|
|
|
// vouche.setVouchertype_name(voucherTypeVO.getName());
|
|
|
|
|
// vouche.setVouchertype_shortname(voucherTypeVO.getShortname());
|
|
|
|
|
// //prepareddate;//制单日期(格式示例:2021-04-27)) 根据sys_date找到单据日期字段
|
|
|
|
|
// vouche.setPrepareddate(date);
|
|
|
|
|
// vouche.setYear(date.substring(0, 4));
|
|
|
|
|
// vouche.setPeriod(date.substring(5, 7));
|
|
|
|
|
// //生成分录
|
|
|
|
|
// System.out.println(groupedResult);
|
|
|
|
|
// for (Map.Entry<List<Object>, List<Map<String, Object>>> dataEntry : groupedResult.entrySet()) {
|
|
|
|
|
// try {
|
|
|
|
|
// List<Object> dateKey = dataEntry.getKey();
|
|
|
|
|
// List<Map<String, Object>> dataValue = dataEntry.getValue();
|
|
|
|
|
// for (AeConfVoucherTemplateEntity template : templateList) {
|
|
|
|
|
// VoucherData.Voucher.Detail detail = new VoucherData.Voucher.Detail();
|
|
|
|
|
// //汇率:excrate2、locRate、groupRate、globalRate
|
|
|
|
|
// String exchangeRate = template.getExchangeRate();
|
|
|
|
|
// detail.setExcrate2(exchangeRate);
|
|
|
|
|
// detail.setLocRate(exchangeRate);
|
|
|
|
|
// detail.setGroupRate(exchangeRate);
|
|
|
|
|
// detail.setGlobalRate(exchangeRate);
|
|
|
|
|
//
|
|
|
|
|
// //单价:price
|
|
|
|
|
//
|
|
|
|
|
// //摘要:explanation
|
|
|
|
|
// boolean b = templateService.checkAbstract(template);
|
|
|
|
|
// if (!b) {
|
|
|
|
|
// Assert.state(false, "根据Id:{},校验摘要失败!", template.getId());
|
|
|
|
|
// }
|
|
|
|
|
// try {
|
|
|
|
|
// transSbstractRes(createVoucherVO.getMdmId(), template, dataValue);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// Assert.state(false, "根据Id:{},转换摘要失败!失败原因:{}", template.getId(), e.getMessage());
|
|
|
|
|
// }
|
|
|
|
|
// detail.setExplanation(template.getAbstractStr());
|
|
|
|
|
//
|
|
|
|
|
// //科目:pk_accsubj、accountCode、accountName
|
|
|
|
|
// //分类定义 查 影响因素,再根据影响因素 查 影响因素关联的字段。
|
|
|
|
|
// //分类定义 查 对照表
|
|
|
|
|
// //影响因素关联的字段,对应对照表的 会计计科目,如果没有对照表 去默认科目 都没有则跳过该条分录
|
|
|
|
|
// Long ClassificationId = template.getSubjectClassificationId();
|
|
|
|
|
// String ClassificationCode = template.getSubjectClassificationCode();
|
|
|
|
|
// String ClassificationName = template.getSubjectClassificationName();
|
|
|
|
|
// AeConfSubjectClassificationEntity aeConfSubjectClassificationEntity = new AeConfSubjectClassificationEntity();
|
|
|
|
|
// aeConfSubjectClassificationEntity.setId(String.valueOf(ClassificationId));
|
|
|
|
|
// List<AeConfSubjectClassificationEntity> classificationList = subjectClassificationDao.query(aeConfSubjectClassificationEntity);
|
|
|
|
|
// if (classificationList.size() == 0 || classificationList.size() > 1) {
|
|
|
|
|
// Assert.state(false, "根据影响因素id:{}。未查询到分类定义或存在多个!{},{}", ClassificationId, ClassificationCode, ClassificationName);
|
|
|
|
|
// }
|
|
|
|
|
// AeConfSubjectClassificationEntity subjectClassification = classificationList.get(0);
|
|
|
|
|
// String factorIds = subjectClassification.getFactorids();//影响因素定义
|
|
|
|
|
// String[] factorIdSplit = factorIds.split(",");
|
|
|
|
|
// Map<String, String> factorCorrelationMap = new LinkedHashMap<>();//影响因素关联map:影响因素id,单据选项 name中有公式,整个字段或者字段截取
|
|
|
|
|
// for (String factorId : factorIdSplit) {
|
|
|
|
|
// AeConfInfluenceFactorCorrelationEntity factorCorrelationEntity = new AeConfInfluenceFactorCorrelationEntity();
|
|
|
|
|
// factorCorrelationEntity.setFactorId(Long.valueOf(factorId));
|
|
|
|
|
// List<AeConfInfluenceFactorCorrelationEntity> factorCorrelationEntityList = factorCorrelationDao.query(factorCorrelationEntity);
|
|
|
|
|
// if (factorCorrelationEntityList.size() == 0 || factorCorrelationEntityList.size() > 1) {
|
|
|
|
|
// Assert.state(false, "根据影响因素id:{}。未查询到或查询到多条影响因素关联。", factorId);
|
|
|
|
|
// }
|
|
|
|
|
// String mdmId = factorCorrelationEntityList.get(0).getMdmId();
|
|
|
|
|
// String mappingFieldName = factorCorrelationEntityList.get(0).getMappingFieldName();
|
|
|
|
|
// //如果存在substr公式,则切割,否则返回单据值
|
|
|
|
|
// String strValue = formulaTransFactorCorrelation(mdmId, mappingFieldName, dataValue);
|
|
|
|
|
//
|
|
|
|
|
// factorCorrelationMap.put(factorId, strValue);
|
|
|
|
|
// }
|
|
|
|
|
// String contrastId = subjectClassification.getContrastId();//该分类定义下的对照表
|
|
|
|
|
// AeConfSubjectContrastBEntity aeConfSubjectContrastBEntity = new AeConfSubjectContrastBEntity();
|
|
|
|
|
// aeConfSubjectContrastBEntity.setContrastId(Long.valueOf(contrastId));
|
|
|
|
|
// List<AeConfSubjectContrastBEntity> subjectContrastBEntityList = subjectContrastBDao.query(aeConfSubjectContrastBEntity);
|
|
|
|
|
// AeConfBdAccsubjEntity confBdAccsubj = matchSubj(factorCorrelationMap, subjectContrastBEntityList);
|
|
|
|
|
// if (confBdAccsubj == null) {//没有匹配到对照表,查询分类定义是否有默认科目
|
|
|
|
|
// //分类的定义的默认科目
|
|
|
|
|
// String desdocvalueDefaultId = subjectClassification.getDesdocvalueDefaultId();
|
|
|
|
|
// String desdocvalueDefaultName = subjectClassification.getDesdocvalueDefaultName();
|
|
|
|
|
// if (desdocvalueDefaultId != null && !"".equals(desdocvalueDefaultId) && desdocvalueDefaultName != null && !"".equals(desdocvalueDefaultName)) {
|
|
|
|
|
//
|
|
|
|
|
// //查询科目
|
|
|
|
|
// AeConfBdAccsubjEntity accsubj = new AeConfBdAccsubjEntity();
|
|
|
|
|
// accsubj.setPkAccsubj(desdocvalueDefaultId);
|
|
|
|
|
// List<AeConfBdAccsubjEntity> accsubjList = aeConfBdAccsubjDao.query(accsubj);
|
|
|
|
|
// if (accsubjList.size() > 1 || accsubjList.size() == 0) {
|
|
|
|
|
// Assert.state(false, "根据默认科目主键:{},默认科目名称:{},未查询到或存在多条科目,请检查", desdocvalueDefaultId, desdocvalueDefaultName);
|
|
|
|
|
// }
|
|
|
|
|
// detail.setPk_accsubj(accsubjList.get(0).getSubjcode());//u8c需要编码
|
|
|
|
|
// detail.setAccountId(desdocvalueDefaultId);
|
|
|
|
|
// detail.setAccountCode(accsubjList.get(0).getSubjcode());
|
|
|
|
|
// detail.setAccountName(accsubjList.get(0).getSubjname());
|
|
|
|
|
// } else {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// detail.setPk_accsubj(confBdAccsubj.getSubjcode());//u8c需要编码
|
|
|
|
|
// detail.setAccountId(confBdAccsubj.getPkAccsubj());
|
|
|
|
|
// detail.setAccountCode(confBdAccsubj.getSubjcode());
|
|
|
|
|
// detail.setAccountName(confBdAccsubj.getSubjname());
|
|
|
|
|
// }
|
|
|
|
|
// //币种编码:pk_currtype、currtypeCode、currtypeName
|
|
|
|
|
// String currencyFieldName = template.getCurrencyFieldName();
|
|
|
|
|
// BdCurrtypeVO bdCurrtypeVO = formulaTransCurrency(currencyFieldName);
|
|
|
|
|
// if (bdCurrtypeVO == null) {
|
|
|
|
|
// Assert.state(false, "根据币种字段:{},转换失败");
|
|
|
|
|
// }
|
|
|
|
|
// detail.setPk_currtype(bdCurrtypeVO.getCode());
|
|
|
|
|
// detail.setCurrtypeId(bdCurrtypeVO.getPkCurrtype());
|
|
|
|
|
// detail.setCurrtypeCode(bdCurrtypeVO.getCode());
|
|
|
|
|
// detail.setCurrtypeName(bdCurrtypeVO.getName());
|
|
|
|
|
// //借方数量:debitquantity
|
|
|
|
|
// BigDecimal jNumField = sumAmountAndNum(template.getjNumFieldName(), dataValue);
|
|
|
|
|
// detail.setDebitquantity(jNumField.toString());
|
|
|
|
|
// //原币借方金额:debitamount
|
|
|
|
|
// BigDecimal jYbSumField = sumAmountAndNum(template.getjYbSumFieldName(), dataValue);
|
|
|
|
|
// detail.setDebitamount(jYbSumField.toString());
|
|
|
|
|
// //本币借方金额:localdebitamount//本币为null,但是汇率右值,原币*汇率=本币
|
|
|
|
|
// if (template.getjBbSumFieldName() == null || "".equals(template.getjBbSumFieldName()) && exchangeRate != null) {
|
|
|
|
|
// BigDecimal jbb = jYbSumField.divide(new BigDecimal(exchangeRate));
|
|
|
|
|
// detail.setLocaldebitamount(jbb.toString());
|
|
|
|
|
// } else {
|
|
|
|
|
// BigDecimal jBbSumField = sumAmountAndNum(template.getjBbSumFieldName(), dataValue);
|
|
|
|
|
// detail.setLocaldebitamount(jBbSumField.toString());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// //贷方数量:creditquantity
|
|
|
|
|
// BigDecimal dNumField = sumAmountAndNum(template.getdNumFieldName(), dataValue);
|
|
|
|
|
// detail.setCreditquantity(dNumField.toString());
|
|
|
|
|
// //原币贷方金额:creditamount
|
|
|
|
|
// BigDecimal dYbSumField = sumAmountAndNum(template.getdYbSumFieldName(), dataValue);
|
|
|
|
|
// detail.setCreditamount(dYbSumField.toString());
|
|
|
|
|
// //本币贷方金额:localcreditamount
|
|
|
|
|
// if (template.getdBbSumFieldName() == null || "".equals(template.getdBbSumFieldName()) && exchangeRate != null) {
|
|
|
|
|
// BigDecimal dbb = dYbSumField.divide(new BigDecimal(exchangeRate));
|
|
|
|
|
// detail.setLocalcreditamount(dbb.toString());
|
|
|
|
|
// } else {
|
|
|
|
|
// BigDecimal dBbSumField = sumAmountAndNum(template.getdBbSumFieldName(), dataValue);
|
|
|
|
|
// detail.setLocalcreditamount(dBbSumField.toString());
|
|
|
|
|
// }
|
|
|
|
|
// //如果借贷都为0,则不生成该条分录
|
|
|
|
|
// String detail_jYb = detail.getDebitamount();
|
|
|
|
|
// String detail_jBb = detail.getLocaldebitamount();
|
|
|
|
|
// String detail_dYb = detail.getCreditamount();
|
|
|
|
|
// String detail_dBb = detail.getLocalcreditamount();
|
|
|
|
|
// if("0".equals(detail_jYb)&&"0".equals(detail_jBb)&&"0".equals(detail_dYb)&&"0".equals(detail_dBb)){
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// //业务日期:busidate
|
|
|
|
|
// detail.setBusidate(date);
|
|
|
|
|
// //辅助核算
|
|
|
|
|
// //查询该科目下的辅助核算
|
|
|
|
|
// String templateId = template.getId();
|
|
|
|
|
// String pkGlorgbook = template.getPkGlorgbook();
|
|
|
|
|
// AeConfBdAccsubjEntity confBdAccsubj1 = new AeConfBdAccsubjEntity();
|
|
|
|
|
// confBdAccsubj1.setPkAccsubj(detail.getAccountId());
|
|
|
|
|
// confBdAccsubj1.setPkGlorgbook(pkGlorgbook);
|
|
|
|
|
// List<AeConfBdAccsubjEntity> aeConfBdAccsubjEntities = aeConfBdAccsubjDao.queryAssist(confBdAccsubj1);//科目必要的辅助核算
|
|
|
|
|
// System.out.println(aeConfBdAccsubjEntities);
|
|
|
|
|
// Map<String, String> assCodeNameMap = transferSubjAss(aeConfBdAccsubjEntities);
|
|
|
|
|
//// Map<String, Map<String, Object>> assCodePkBdinfoMap = querySubjAssCodePkBdinfo(aeConfBdAccsubjEntities);
|
|
|
|
|
// if (assCodeNameMap != null) {//不等于空,需要辅助核算
|
|
|
|
|
//
|
|
|
|
|
// //查询科目下的辅助核算对应关系
|
|
|
|
|
// Map<String, String> AssByBdCodeMap = queryAssByBdCode(aeConfBdAccsubjEntities);
|
|
|
|
|
// System.out.println(AssByBdCodeMap);
|
|
|
|
|
//
|
|
|
|
|
// //查询该分录下配置的辅助核算,模板上的辅助核算
|
|
|
|
|
// AeConfVoucherTemplateAssistEntity assistEntity = new AeConfVoucherTemplateAssistEntity();
|
|
|
|
|
// assistEntity.setVoucherTemplateId(Long.valueOf(templateId));
|
|
|
|
|
// List<AeConfVoucherTemplateAssistEntity> templateAssist = templateAssDao.query(assistEntity);
|
|
|
|
|
// System.out.println(templateAssist);//分录配置的辅助核算
|
|
|
|
|
// Map<String, AeConfVoucherTemplateAssistEntity> AssByMdmId = queryAssByMdmId(templateAssist);
|
|
|
|
|
// System.out.println(AssByMdmId);
|
|
|
|
|
//
|
|
|
|
|
// List<VoucherData.Voucher.Detail.Ass> assList = new ArrayList<>();
|
|
|
|
|
// //根据科目的辅助核算匹配模板的配置
|
|
|
|
|
// for (Map.Entry<String, String> assByBdCodeEntry : AssByBdCodeMap.entrySet()) {
|
|
|
|
|
//
|
|
|
|
|
// String keyy = assByBdCodeEntry.getKey();
|
|
|
|
|
// String valuee = assByBdCodeEntry.getValue();
|
|
|
|
|
// AeConfVoucherTemplateAssistEntity templateAssistEntity = AssByMdmId.get(keyy);//去单据辅助核算
|
|
|
|
|
//
|
|
|
|
|
// //辅助核算取值
|
|
|
|
|
// Map<String, String> assValue = getAssValue(templateAssistEntity, dataValue, orgBookVO);
|
|
|
|
|
// System.out.println(assValue);
|
|
|
|
|
// if(assValue.size()!=0){
|
|
|
|
|
// VoucherData.Voucher.Detail.Ass assEntity = new VoucherData.Voucher.Detail.Ass();
|
|
|
|
|
// assEntity.setChecktypecode(valuee);
|
|
|
|
|
// assEntity.setCheckvalueid(assValue.get("pk"));
|
|
|
|
|
// assEntity.setCheckvaluecode(assValue.get("code"));
|
|
|
|
|
// assEntity.setCheckvaluename(assValue.get("name"));
|
|
|
|
|
// //类型
|
|
|
|
|
// for (AeConfBdAccsubjEntity aeConfBdAccsubjEntity : aeConfBdAccsubjEntities) {
|
|
|
|
|
// if(valuee.equals(aeConfBdAccsubjEntity.getBdcode())){
|
|
|
|
|
// assEntity.setChecktypename(aeConfBdAccsubjEntity.getBdname());
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// assList.add(assEntity);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (assList.size() != 0) {
|
|
|
|
|
// detail.setAss(assList);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// details.add(detail);
|
|
|
|
|
// }
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// //分录生成失败
|
|
|
|
|
// Assert.state(false, "分录生成失败,失败原因:{}", e.getMessage());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if(details.size()==0){
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// vouche.setDetails(details);
|
|
|
|
|
// voucher.add(vouche);
|
|
|
|
|
// //记录日志
|
|
|
|
|
// saveLog("Y",createVoucherVO.getBill_code(),null,createVoucherVO.getMdmId(),voucher);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//抽取业务单据报错
|
|
|
|
@ -1256,169 +1272,6 @@ public class ICoreServiceImpl implements ICoreService {
|
|
|
|
|
//科目map
|
|
|
|
|
Map<String, String> subjectMap = new LinkedHashMap<>();
|
|
|
|
|
|
|
|
|
|
// for (AeConfSubjectContrastBEntity aeConfSubjectContrastBEntity : subjectContrastBEntityList) {
|
|
|
|
|
// Map<String, String> contrastMap = transContrastBMap(aeConfSubjectContrastBEntity);
|
|
|
|
|
// System.out.println(contrastMap);
|
|
|
|
|
//
|
|
|
|
|
// // 匹配科目
|
|
|
|
|
// switch (size) {
|
|
|
|
|
// case 1: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// if (v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 2: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 3: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 4: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// String v4 = fieldValuesList.get(3);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))
|
|
|
|
|
// && (v4.equals(contrastMap.get(b + 4)) || v4.equals(contrastMap.get(c + 4)) || v4.equals(contrastMap.get(d + 4)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 5: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// String v4 = fieldValuesList.get(3);
|
|
|
|
|
// String v5 = fieldValuesList.get(4);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))
|
|
|
|
|
// && (v4.equals(contrastMap.get(b + 4)) || v4.equals(contrastMap.get(c + 4)) || v4.equals(contrastMap.get(d + 4)))
|
|
|
|
|
// && (v5.equals(contrastMap.get(b + 5)) || v5.equals(contrastMap.get(c + 5)) || v5.equals(contrastMap.get(d + 5)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 6: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// String v4 = fieldValuesList.get(3);
|
|
|
|
|
// String v5 = fieldValuesList.get(4);
|
|
|
|
|
// String v6 = fieldValuesList.get(5);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))
|
|
|
|
|
// && (v4.equals(contrastMap.get(b + 4)) || v4.equals(contrastMap.get(c + 4)) || v4.equals(contrastMap.get(d + 4)))
|
|
|
|
|
// && (v5.equals(contrastMap.get(b + 5)) || v5.equals(contrastMap.get(c + 5)) || v5.equals(contrastMap.get(d + 5)))
|
|
|
|
|
// && (v6.equals(contrastMap.get(b + 6)) || v6.equals(contrastMap.get(c + 6)) || v6.equals(contrastMap.get(d + 6)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 7: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// String v4 = fieldValuesList.get(3);
|
|
|
|
|
// String v5 = fieldValuesList.get(4);
|
|
|
|
|
// String v6 = fieldValuesList.get(5);
|
|
|
|
|
// String v7 = fieldValuesList.get(6);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))
|
|
|
|
|
// && (v4.equals(contrastMap.get(b + 4)) || v4.equals(contrastMap.get(c + 4)) || v4.equals(contrastMap.get(d + 4)))
|
|
|
|
|
// && (v5.equals(contrastMap.get(b + 5)) || v5.equals(contrastMap.get(c + 5)) || v5.equals(contrastMap.get(d + 5)))
|
|
|
|
|
// && (v6.equals(contrastMap.get(b + 6)) || v6.equals(contrastMap.get(c + 6)) || v6.equals(contrastMap.get(d + 6)))
|
|
|
|
|
// && (v7.equals(contrastMap.get(b + 7)) || v7.equals(contrastMap.get(c + 7)) || v7.equals(contrastMap.get(d + 7)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 8: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// String v4 = fieldValuesList.get(3);
|
|
|
|
|
// String v5 = fieldValuesList.get(4);
|
|
|
|
|
// String v6 = fieldValuesList.get(5);
|
|
|
|
|
// String v7 = fieldValuesList.get(6);
|
|
|
|
|
// String v8 = fieldValuesList.get(7);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))
|
|
|
|
|
// && (v4.equals(contrastMap.get(b + 4)) || v4.equals(contrastMap.get(c + 4)) || v4.equals(contrastMap.get(d + 4)))
|
|
|
|
|
// && (v5.equals(contrastMap.get(b + 5)) || v5.equals(contrastMap.get(c + 5)) || v5.equals(contrastMap.get(d + 5)))
|
|
|
|
|
// && (v6.equals(contrastMap.get(b + 6)) || v6.equals(contrastMap.get(c + 6)) || v6.equals(contrastMap.get(d + 6)))
|
|
|
|
|
// && (v7.equals(contrastMap.get(b + 7)) || v7.equals(contrastMap.get(c + 7)) || v7.equals(contrastMap.get(d + 7)))
|
|
|
|
|
// && (v8.equals(contrastMap.get(b + 8)) || v8.equals(contrastMap.get(c + 8)) || v8.equals(contrastMap.get(d + 8)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case 9: {
|
|
|
|
|
// String v1 = fieldValuesList.get(0);
|
|
|
|
|
// String v2 = fieldValuesList.get(1);
|
|
|
|
|
// String v3 = fieldValuesList.get(2);
|
|
|
|
|
// String v4 = fieldValuesList.get(3);
|
|
|
|
|
// String v5 = fieldValuesList.get(4);
|
|
|
|
|
// String v6 = fieldValuesList.get(5);
|
|
|
|
|
// String v7 = fieldValuesList.get(6);
|
|
|
|
|
// String v8 = fieldValuesList.get(7);
|
|
|
|
|
// String v9 = fieldValuesList.get(8);
|
|
|
|
|
// if ((v1.equals(contrastMap.get(b + 1)) || v1.equals(contrastMap.get(c + 1)) || v1.equals(contrastMap.get(d + 1)))
|
|
|
|
|
// && (v2.equals(contrastMap.get(b + 2)) || v2.equals(contrastMap.get(c + 2)) || v2.equals(contrastMap.get(d + 2)))
|
|
|
|
|
// && (v3.equals(contrastMap.get(b + 3)) || v3.equals(contrastMap.get(c + 3)) || v3.equals(contrastMap.get(d + 3)))
|
|
|
|
|
// && (v4.equals(contrastMap.get(b + 4)) || v4.equals(contrastMap.get(c + 4)) || v4.equals(contrastMap.get(d + 4)))
|
|
|
|
|
// && (v5.equals(contrastMap.get(b + 5)) || v5.equals(contrastMap.get(c + 5)) || v5.equals(contrastMap.get(d + 5)))
|
|
|
|
|
// && (v6.equals(contrastMap.get(b + 6)) || v6.equals(contrastMap.get(c + 6)) || v6.equals(contrastMap.get(d + 6)))
|
|
|
|
|
// && (v7.equals(contrastMap.get(b + 7)) || v7.equals(contrastMap.get(c + 7)) || v7.equals(contrastMap.get(d + 7)))
|
|
|
|
|
// && (v8.equals(contrastMap.get(b + 8)) || v8.equals(contrastMap.get(c + 8)) || v8.equals(contrastMap.get(d + 8)))
|
|
|
|
|
// && (v9.equals(contrastMap.get(b + 9)) || v9.equals(contrastMap.get(c + 9)) || v9.equals(contrastMap.get(d + 9)))) {
|
|
|
|
|
// subjectMap.put("glorgname", aeConfSubjectContrastBEntity.getGlorgname());
|
|
|
|
|
// subjectMap.put("pkAccsubj", aeConfSubjectContrastBEntity.getPkAccsubj());
|
|
|
|
|
// subjectMap.put("desdocvalue", aeConfSubjectContrastBEntity.getDesdocvalue());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (AeConfSubjectContrastBEntity entity : subjectContrastBEntityList) {
|
|
|
|
|
Map<String, String> contrastMap = transContrastBMap(entity);
|
|
|
|
|
System.out.println(contrastMap);
|
|
|
|
|