|
@@ -688,6 +688,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
ArrayList<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
ArrayList<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
|
HashMap<String, Object> resultMap = new HashMap<>();
|
|
HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
+ StringBuffer strBuilder = new StringBuffer();
|
|
|
|
|
+ String ids="";
|
|
|
try {
|
|
try {
|
|
|
List<InsBxPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsBxPlyIncomeExcelDto.class, 0, 1, 1);
|
|
List<InsBxPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsBxPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
Integer i=0;
|
|
Integer i=0;
|
|
@@ -718,6 +720,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
resultMap.put("agreementId",insPlyIncome.getAgreementId()); //协议id
|
|
resultMap.put("agreementId",insPlyIncome.getAgreementId()); //协议id
|
|
|
}
|
|
}
|
|
|
if(ObjectUtils.isNotEmpty(insPlyIncome)){ // 比配上汇总金额 未匹配则返回到数据当中
|
|
if(ObjectUtils.isNotEmpty(insPlyIncome)){ // 比配上汇总金额 未匹配则返回到数据当中
|
|
|
|
|
+ strBuilder.append(insPlyIncome.getId()).append(",");
|
|
|
if( insPlyIncome.getCommissionFeevalue()!=null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
if( insPlyIncome.getCommissionFeevalue()!=null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
|
totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
|
}
|
|
}
|
|
@@ -736,6 +739,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(strBuilder.length() >0){
|
|
|
|
|
+ ids = strBuilder.deleteCharAt(strBuilder.length() - 1).toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ resultMap.put("ids",ids);
|
|
|
resultMap.put("totalAmount",totalAmount);
|
|
resultMap.put("totalAmount",totalAmount);
|
|
|
resultMap.put("resultList",resultList);
|
|
resultMap.put("resultList",resultList);
|
|
|
return resultMap;
|
|
return resultMap;
|
|
@@ -751,6 +758,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
HashMap<String, Object> resultMap = new HashMap<>();
|
|
HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
ArrayList<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
ArrayList<HashMap<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
+ StringBuffer strBuilder = new StringBuffer();
|
|
|
String ids="";
|
|
String ids="";
|
|
|
try {
|
|
try {
|
|
|
Integer i=0;
|
|
Integer i=0;
|
|
@@ -777,6 +785,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
resultMap.put("agreementId",insPlyIncome.getAgreementId()); //协议id
|
|
resultMap.put("agreementId",insPlyIncome.getAgreementId()); //协议id
|
|
|
}
|
|
}
|
|
|
if(ObjectUtils.isNotEmpty(insPlyIncome)){ // 比配上汇总金额 未匹配则返回到数据当中
|
|
if(ObjectUtils.isNotEmpty(insPlyIncome)){ // 比配上汇总金额 未匹配则返回到数据当中
|
|
|
|
|
+ strBuilder.append(insPlyIncome.getId()).append(",");
|
|
|
if( insPlyIncome.getCommissionFeevalue()!=null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
if( insPlyIncome.getCommissionFeevalue()!=null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
|
totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
|
}
|
|
}
|
|
@@ -791,7 +800,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
resultList.add(noMatching);
|
|
resultList.add(noMatching);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ if(strBuilder.length() >0){
|
|
|
|
|
+ ids = strBuilder.deleteCharAt(strBuilder.length() - 1).toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ resultMap.put("ids",ids);
|
|
|
resultMap.put("totalAmount",totalAmount);
|
|
resultMap.put("totalAmount",totalAmount);
|
|
|
resultMap.put("resultList",resultList);
|
|
resultMap.put("resultList",resultList);
|
|
|
}
|
|
}
|
|
@@ -839,6 +851,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
public HttpResult<List<HashMap<String,Object>>> invicdetail(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<List<HashMap<String,Object>>> invicdetail(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
|
|
|
+ if (StringUtils.isEmpty(insPlyIncomeVo.getIsSettlement())){
|
|
|
|
|
+ params.put("isSettlement","1");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotEmpty(insPlyIncomeVo.getSettlementStatus())){
|
|
|
|
|
+ params.put("settlementStatus",insPlyIncomeVo.getSettlementStatus());
|
|
|
|
|
+ }
|
|
|
List<HashMap<String, Object>> resultList = settlementDocumentaryFeesService.getOtherSettldetail(params);
|
|
List<HashMap<String, Object>> resultList = settlementDocumentaryFeesService.getOtherSettldetail(params);
|
|
|
if (resultList.size() > 0) {
|
|
if (resultList.size() > 0) {
|
|
|
return HttpResult.ok(resultList);
|
|
return HttpResult.ok(resultList);
|
|
@@ -1273,10 +1291,23 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public HttpResult<Object> batchInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<Object> batchInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
|
|
+ // 开票时生成 记录 用来合计已经开票数据
|
|
|
|
|
+ String ids = insPlyIncomeVo.getIds();
|
|
|
|
|
+ if(StringUtils.isNotEmpty(ids)){
|
|
|
|
|
+ String[] split = ids.split(",");
|
|
|
|
|
+ for (String id : split){
|
|
|
|
|
+ InsPlyIncome insPlyIncome = baseMapper.selectById(id);
|
|
|
|
|
+ insPlyIncome.setInvoicTime(LocalDate.now()); //开票时间
|
|
|
|
|
+ insPlyIncome.setInvoicId(insPlyIncomeVo.getInvoicId()); //开票号
|
|
|
|
|
+ insPlyIncome.setHandlingFeesStatus("2"); //2为开票
|
|
|
|
|
+ baseMapper.updateById(insPlyIncome);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
insPlyIncomeVo.setNoInvoicCommissionFeevalue(insPlyIncomeVo.getTotalAmount());
|
|
insPlyIncomeVo.setNoInvoicCommissionFeevalue(insPlyIncomeVo.getTotalAmount());
|
|
|
insPlyIncomeVo.setOtherFeevalue(insPlyIncomeVo.getTotalAmount());
|
|
insPlyIncomeVo.setOtherFeevalue(insPlyIncomeVo.getTotalAmount());
|
|
|
insPlyIncomeVo.setHandlingFeesStatus("0"); // 0手续费 1 跟单费
|
|
insPlyIncomeVo.setHandlingFeesStatus("0"); // 0手续费 1 跟单费
|
|
|
insPlyIncomeVo.setIsNotCar(insPlyIncomeVo.getIsNotCar());
|
|
insPlyIncomeVo.setIsNotCar(insPlyIncomeVo.getIsNotCar());
|
|
|
|
|
+ insPlyIncomeVo.setAgreementId(insPlyIncomeVo.getAgreementId());
|
|
|
insPlyIncomeVo.setSettlementAmount(insPlyIncomeVo.getTotalAmount());
|
|
insPlyIncomeVo.setSettlementAmount(insPlyIncomeVo.getTotalAmount());
|
|
|
insPlyIncomeVo.setContractId(insPlyIncomeVo.getInvoicId());
|
|
insPlyIncomeVo.setContractId(insPlyIncomeVo.getInvoicId());
|
|
|
this.batchInvoic(insPlyIncomeVo);
|
|
this.batchInvoic(insPlyIncomeVo);
|
|
@@ -1296,6 +1327,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> batchBxBalance(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<Object> batchBxBalance(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
|
|
+ if(StringUtils.isNotEmpty(insPlyIncomeVo.getIds())){// 判断 ins_ply_income 是否完全结算完 如果结算完则改为已结算状态
|
|
|
|
|
+ this.changeHandStatus(insPlyIncomeVo.getIds(),insPlyIncomeVo);
|
|
|
|
|
+ }
|
|
|
// 分批结算
|
|
// 分批结算
|
|
|
SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo();
|
|
SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo();
|
|
|
|
|
|
|
@@ -1323,6 +1357,22 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void changeHandStatus(String ids, InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
|
|
+ String[] split = ids.split(",");
|
|
|
|
|
+
|
|
|
|
|
+ SettlementDocumentaryFeesEntity byId = settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
|
|
|
|
|
+ BigDecimal totalAmount = byId.getTotalAmount(); //开票总金额
|
|
|
|
|
+ BigDecimal settlementAmount = insPlyIncomeVo.getSettlementAmount(); //本次结算金额
|
|
|
|
|
+ //多次结算 表中已经结算的金额
|
|
|
|
|
+ SettlementDocumentaryFeesEntity settlementAmountEntity = settlementDocumentaryFeesService.getByParentSettlementAmount(insPlyIncomeVo.getId());
|
|
|
|
|
+ if(ObjectUtils.isNotEmpty(settlementAmountEntity)){
|
|
|
|
|
+ BigDecimal all = settlementAmount.add(settlementAmountEntity.getTotalAmount());
|
|
|
|
|
+ if(all.equals(totalAmount)){
|
|
|
|
|
+ baseMapper.updateByIds(split);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<InsPlyIncome> querySettInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<InsPlyIncome> querySettInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
@@ -1436,6 +1486,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
settlementDocumentaryFeesVo.setHandlingFeesStatus(insPlyIncomeVo.getHandlingFeesStatus());
|
|
settlementDocumentaryFeesVo.setHandlingFeesStatus(insPlyIncomeVo.getHandlingFeesStatus());
|
|
|
settlementDocumentaryFeesVo.setInvoicingMethod(insPlyIncomeVo.getInvoicingMethod()); //开票方式
|
|
settlementDocumentaryFeesVo.setInvoicingMethod(insPlyIncomeVo.getInvoicingMethod()); //开票方式
|
|
|
settlementDocumentaryFeesVo.setTaxPoints(insPlyIncomeVo.getTaxPoints()); //税点
|
|
settlementDocumentaryFeesVo.setTaxPoints(insPlyIncomeVo.getTaxPoints()); //税点
|
|
|
|
|
+ settlementDocumentaryFeesVo.setIds(insPlyIncomeVo.getIds());
|
|
|
// 税点支出
|
|
// 税点支出
|
|
|
if(BigDecimalUtils.nullToZero(insPlyIncomeVo.getTaxPoints()) !=null && BigDecimalUtils.nullToZero(insPlyIncomeVo.getSettlementAmount()) !=null){
|
|
if(BigDecimalUtils.nullToZero(insPlyIncomeVo.getTaxPoints()) !=null && BigDecimalUtils.nullToZero(insPlyIncomeVo.getSettlementAmount()) !=null){
|
|
|
BigDecimal settlementAmount = insPlyIncomeVo.getSettlementAmount();
|
|
BigDecimal settlementAmount = insPlyIncomeVo.getSettlementAmount();
|