|
@@ -28,6 +28,7 @@ import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
|
|
|
import com.ydtech.modules.ins.model.vo.res.*;
|
|
import com.ydtech.modules.ins.model.vo.res.*;
|
|
|
import com.ydtech.modules.inv.model.dto.*;
|
|
import com.ydtech.modules.inv.model.dto.*;
|
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
|
|
+import com.ydtech.modules.inv.utils.LocalDateTimeUtils;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
import com.ydtech.modules.order.entity.api.dajia.response.NVHLODR1001Response;
|
|
import com.ydtech.modules.order.entity.api.dajia.response.NVHLODR1001Response;
|
|
@@ -69,7 +70,9 @@ import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
import java.nio.file.Paths;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.LocalTime;
|
|
|
import java.time.YearMonth;
|
|
import java.time.YearMonth;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -106,6 +109,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
private ImportAsyncService importAsyncService;
|
|
private ImportAsyncService importAsyncService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IncomeTaskRelationshipService incomeTaskRelationshipService;
|
|
private IncomeTaskRelationshipService incomeTaskRelationshipService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SettlementDocumentaryFeesSumService settlementDocumentaryFeesSumService;
|
|
|
|
|
|
|
|
@Value("${upload.file.path}")
|
|
@Value("${upload.file.path}")
|
|
|
private String uploadPath;
|
|
private String uploadPath;
|
|
@@ -1254,7 +1259,7 @@ handlingProportion,
|
|
|
BigDecimal noNoTaxPremium = insPlyIncomeVo.getNoPremium();// 非车手续费 按照思路 非车不含税保费* 非车手续费比例 =非车手续费
|
|
BigDecimal noNoTaxPremium = insPlyIncomeVo.getNoPremium();// 非车手续费 按照思路 非车不含税保费* 非车手续费比例 =非车手续费
|
|
|
if (jqNoTaxPremium != null && insPlyIncomeVo.getJqSuperviseCostsProportion() != null && insPlyIncomeVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
if (jqNoTaxPremium != null && insPlyIncomeVo.getJqSuperviseCostsProportion() != null && insPlyIncomeVo.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
|
|
|
- insPlyIncome.setJqSuperviseCostsPremiums(getBigDecimal(syNoTaxPremium, insPlyIncomeVo.getJqSuperviseCostsProportion()));
|
|
|
|
|
|
|
+ insPlyIncome.setJqSuperviseCostsPremiums(getBigDecimal(jqNoTaxPremium, insPlyIncomeVo.getJqSuperviseCostsProportion()));
|
|
|
insPlyIncome.setJqSuperviseCostsProportion(insPlyIncomeVo.getJqSuperviseCostsProportion());
|
|
insPlyIncome.setJqSuperviseCostsProportion(insPlyIncomeVo.getJqSuperviseCostsProportion());
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1354,16 +1359,49 @@ handlingProportion,
|
|
|
Long id = new SnowFlakeUtil().nextId();
|
|
Long id = new SnowFlakeUtil().nextId();
|
|
|
InsPlyIncome insPlyIncome = new InsPlyIncome();
|
|
InsPlyIncome insPlyIncome = new InsPlyIncome();
|
|
|
insPlyIncomeVo.setOrderno(id.toString());
|
|
insPlyIncomeVo.setOrderno(id.toString());
|
|
|
|
|
+ String signdateStr = insPlyIncomeVo.getSignDate();
|
|
|
|
|
+ LocalDateTime localDateTime = this.LocalDatePareLocalDateTime(signdateStr);
|
|
|
|
|
+ insPlyIncomeVo.setSignDate(null);
|
|
|
BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
|
|
BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
|
|
|
insPlyIncome.setUserId(BaseController.getUser().getId());
|
|
insPlyIncome.setUserId(BaseController.getUser().getId());
|
|
|
insPlyIncome.setDocumentaryFeesStatus("0");
|
|
insPlyIncome.setDocumentaryFeesStatus("0");
|
|
|
insPlyIncome.setHandlingFeesStatus("0");
|
|
insPlyIncome.setHandlingFeesStatus("0");
|
|
|
insPlyIncome.setIsNotCar(insPlyIncomeVo.getIsNotCar()); // 是否是非车
|
|
insPlyIncome.setIsNotCar(insPlyIncomeVo.getIsNotCar()); // 是否是非车
|
|
|
insPlyIncome.setIsNotDocumentary(insPlyIncomeVo.getIsNotDocumentary()); //是否是跟单
|
|
insPlyIncome.setIsNotDocumentary(insPlyIncomeVo.getIsNotDocumentary()); //是否是跟单
|
|
|
|
|
+ insPlyIncome.setSignDate(localDateTime);
|
|
|
|
|
+ insPlyIncome.setDeptId(BaseController.getUser().getDeptId());
|
|
|
|
|
+
|
|
|
|
|
+ insPlyIncome.setCreateTime(LocalDate.now());
|
|
|
|
|
+ insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncomeVo.getJqOtherCostsProportion(),insPlyIncomeVo.getSyOtherCostsProportion(),insPlyIncomeVo.getNoOtherCostsProportion()));
|
|
|
|
|
+ insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncomeVo.getJqSuperviseCostsProportion(),insPlyIncomeVo.getSySuperviseCostsProportion(),insPlyIncomeVo.getNoSuperviseCostsProportion()));
|
|
|
|
|
|
|
|
|
|
+ if (insPlyIncome.getJqPremium() != null && insPlyIncome.getJqPremium().compareTo(BigDecimal.ZERO) != 0 && insPlyIncome.getJqSuperviseCostsProportion() != null && insPlyIncome.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ insPlyIncome.setJqSuperviseCostsPremiums(getBigDecimal(insPlyIncome.getJqPremium(), insPlyIncomeVo.getJqSuperviseCostsProportion()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (insPlyIncome.getSyPremium() != null && insPlyIncome.getSyPremium().compareTo(BigDecimal.ZERO) != 0 && insPlyIncome.getSySuperviseCostsProportion() != null && insPlyIncome.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ insPlyIncome.setSySuperviseCostsPremiums(getBigDecimal(insPlyIncome.getSyPremium(), insPlyIncomeVo.getSySuperviseCostsProportion()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (insPlyIncome.getNoPremium() != null && insPlyIncome.getNoPremium().compareTo(BigDecimal.ZERO) != 0 && insPlyIncome.getNoSuperviseCostsProportion() != null && insPlyIncome.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ insPlyIncome.setNoSuperviseCostsPremiums(getBigDecimal(insPlyIncome.getNoPremium(), insPlyIncomeVo.getNoSuperviseCostsProportion()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (insPlyIncome.getJqPremium() != null && insPlyIncome.getJqPremium().compareTo(BigDecimal.ZERO) != 0 && insPlyIncome.getJqOtherCostsProportion() != null && insPlyIncome.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ insPlyIncome.setJqOtherCostsPremium(getBigDecimal(insPlyIncome.getJqPremium(), insPlyIncomeVo.getJqOtherCostsProportion()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (insPlyIncome.getSyPremium() != null && insPlyIncome.getSyPremium().compareTo(BigDecimal.ZERO) != 0 && insPlyIncome.getSyOtherCostsProportion() != null && insPlyIncome.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ insPlyIncome.setSyOtherCostsPremium(getBigDecimal(insPlyIncome.getSyPremium(), insPlyIncomeVo.getSyOtherCostsProportion()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (insPlyIncome.getNoPremium() != null && insPlyIncome.getNoPremium().compareTo(BigDecimal.ZERO) != 0 && insPlyIncome.getNoOtherCostsProportion() != null && insPlyIncome.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ insPlyIncome.setNoOtherCostsPremium(getBigDecimal(insPlyIncome.getNoPremium(), insPlyIncomeVo.getNoOtherCostsProportion()));
|
|
|
|
|
+ }
|
|
|
|
|
+ insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),insPlyIncome.getOtherFeevalue(),null));
|
|
|
|
|
+
|
|
|
|
|
+ String partnerCompaniesId = insPlyIncome.getPartnerCompaniesId();
|
|
|
|
|
+ insPlyIncome.setPartnerCompaniesId(partnerCompaniesId);
|
|
|
|
|
+ EsmInsCompany esmInsCompany = EsmInsCompanyService.getById(partnerCompaniesId);
|
|
|
|
|
+ String name = esmInsCompany.getNamesimple(); //合作名称
|
|
|
|
|
+ insPlyIncome.setPartnerCompaniesName(name);
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
- params.put("companyId", insPlyIncomeVo.getCompanyId());
|
|
|
|
|
- params.put("partnerCompaniesId", insPlyIncomeVo.getPartnerCompaniesId());
|
|
|
|
|
|
|
+ params.put("agreeId",insPlyIncomeVo.getAgreeId());
|
|
|
|
|
|
|
|
PtlAgreement ptlAgreement = ptlAgreementService.selectAgreeId(params);
|
|
PtlAgreement ptlAgreement = ptlAgreementService.selectAgreeId(params);
|
|
|
if (ObjectUtils.isEmpty(ptlAgreement)) {
|
|
if (ObjectUtils.isEmpty(ptlAgreement)) {
|
|
@@ -1375,28 +1413,20 @@ handlingProportion,
|
|
|
insPlyIncomeVo.setCrudStatus("1");
|
|
insPlyIncomeVo.setCrudStatus("1");
|
|
|
this.saveLog(insPlyIncomeVo); //添加日志
|
|
this.saveLog(insPlyIncomeVo); //添加日志
|
|
|
|
|
|
|
|
-// HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
-//
|
|
|
|
|
-// if(StringUtils.isNotEmpty(insPlyIncomeVo.getIsNotCar())){
|
|
|
|
|
-// params.put("isNotCar",insPlyIncomeVo.getIsNotCar());
|
|
|
|
|
-// }
|
|
|
|
|
-// params.put("isOther","1");
|
|
|
|
|
-// if(StringUtils.isNotEmpty(insPlyIncomeVo.getYear())){
|
|
|
|
|
-// params.put("year",insPlyIncomeVo.getYear());
|
|
|
|
|
-// }
|
|
|
|
|
-// if(StringUtils.isNotEmpty(insPlyIncomeVo.getCompanyId())){
|
|
|
|
|
-// params.put("companyId",insPlyIncomeVo.getCompanyId());
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// List<InsPlyIncome> list= this.baseMapper.NonSettlementQuery(params);
|
|
|
|
|
-// if(!CollectionUtils.isEmpty(list)){
|
|
|
|
|
-// for (InsPlyIncome item :list){
|
|
|
|
|
-// return HttpResult.ok(item.getIds());
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private LocalDateTime LocalDatePareLocalDateTime(String signdateStr) {
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
+
|
|
|
|
|
+ // 将字符串解析为LocalDate
|
|
|
|
|
+ LocalDate signdate = LocalDate.parse(signdateStr, formatter);
|
|
|
|
|
+ // 创建一个 LocalTime 对象表示中午12点
|
|
|
|
|
+ LocalTime noon = LocalTime.of(12, 0);
|
|
|
|
|
+ // 使用 LocalDate 和 LocalTime 来创建 LocalDateTime
|
|
|
|
|
+ return LocalDateTime.of(signdate, noon);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 删除id 已开票或者已结算都不可以进行 删除
|
|
* 删除id 已开票或者已结算都不可以进行 删除
|
|
|
* 因为跟单没有关联表 也无法关联到开票表所以只能按照 条件去查询判断 保司机构 id
|
|
* 因为跟单没有关联表 也无法关联到开票表所以只能按照 条件去查询判断 保司机构 id
|
|
@@ -1519,7 +1549,7 @@ handlingProportion,
|
|
|
|
|
|
|
|
String id = insPlyIncomeVo.getId(); // 开票id
|
|
String id = insPlyIncomeVo.getId(); // 开票id
|
|
|
SettlementDocumentaryFeesEntity settlementDocumentaryFeesServiceById = settlementDocumentaryFeesService.getById(id); //
|
|
SettlementDocumentaryFeesEntity settlementDocumentaryFeesServiceById = settlementDocumentaryFeesService.getById(id); //
|
|
|
- BigDecimal allAmount = settlementDocumentaryFeesServiceById.getTotalAmount();
|
|
|
|
|
|
|
+ BigDecimal allAmount = settlementDocumentaryFeesServiceById.getSettlementAmount();
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
@@ -1565,6 +1595,88 @@ handlingProportion,
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult<Object> batchSumBalance(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
|
|
+
|
|
|
|
|
+ List<InsPlyIncomeVo> multipleSelection = insPlyIncomeVo.getMultipleSelection();
|
|
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
+ BigDecimal settleMentAmount = BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal settleNotMentAmount = BigDecimal.ZERO;
|
|
|
|
|
+ for (InsPlyIncomeVo item : multipleSelection){
|
|
|
|
|
+ SettlementDocumentaryFeesEntity settlementDocumentaryFeesVo = new SettlementDocumentaryFeesEntity();
|
|
|
|
|
+ if(item.getSettlementAmount() ==null || item .getSettlementAmount().compareTo(BigDecimal.ZERO) <0){
|
|
|
|
|
+ throw new SystemException("请输入正确金额");
|
|
|
|
|
+ }
|
|
|
|
|
+ String id = item.getId();
|
|
|
|
|
+ SettlementDocumentaryFeesEntity settlementDocumentaryFeesEntity = settlementDocumentaryFeesService.getBaseMapper().selectById(id); // 开票
|
|
|
|
|
+ BigDecimal invoicedNotSettledAmount = settlementDocumentaryFeesEntity.getInvoicedNotSettledAmount();//未结算金额
|
|
|
|
|
+ if(item.getSettlementAmount().compareTo(invoicedNotSettledAmount) >0){
|
|
|
|
|
+ throw new SystemException("结算金额大于未结算金额");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(item.getSettlementAmount().compareTo(BigDecimal.ZERO) >0){
|
|
|
|
|
+ settlementDocumentaryFeesVo.setInvoiceId(settlementDocumentaryFeesEntity.getInvoicId()); //开票号
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementTime(insPlyIncomeVo.getSettlementTime()); //结算时间
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementStatus("2"); //2为结算状态
|
|
|
|
|
+ settlementDocumentaryFeesVo.setCompanyId(settlementDocumentaryFeesEntity.getCompanyId()); // 保险公司id
|
|
|
|
|
+ settlementDocumentaryFeesVo.setPartnerCompaniesId(settlementDocumentaryFeesEntity.getPartnerCompaniesId()); //合作公司id
|
|
|
|
|
+ settlementDocumentaryFeesVo.setUnsettledAmount(insPlyIncomeVo.getInvoicCommissionFeevalue().subtract(insPlyIncomeVo.getSettlementAmount())); //未结算金额
|
|
|
|
|
+ settlementDocumentaryFeesVo.setIsNotCar(settlementDocumentaryFeesEntity.getIsNotCar()); // 是否是非车
|
|
|
|
|
+ settlementDocumentaryFeesVo.setInvoicingMethod(settlementDocumentaryFeesEntity.getInvoicingMethod()); //开票方式
|
|
|
|
|
+ settlementDocumentaryFeesVo.setTaxPoints(settlementDocumentaryFeesEntity.getTaxPoints()); //税点
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementImageId(settlementDocumentaryFeesEntity.getSettlementImageId());
|
|
|
|
|
+ if ("0".equals(insPlyIncomeVo.getInvoicingMethod())) {
|
|
|
|
|
+ settlementDocumentaryFeesVo.setExpendAmount(settlementDocumentaryFeesEntity.getSettlementAmount().multiply(BigDecimal.ONE.subtract(insPlyIncomeVo.getTaxPoints().divide(new BigDecimal(100)))));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ settlementDocumentaryFeesVo.setExpendAmount(settlementDocumentaryFeesEntity.getSettlementAmount()); //进账金额
|
|
|
|
|
+ }
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementAmount(insPlyIncomeVo.getSettlementAmount()); //进账金额
|
|
|
|
|
+ settlementDocumentaryFeesVo.setHandlingFeesStatus(settlementDocumentaryFeesEntity.getHandlingFeesStatus());
|
|
|
|
|
+ settlementDocumentaryFeesVo.setTotalAmount(insPlyIncomeVo.getInvoicCommissionFeevalue());
|
|
|
|
|
+ settlementDocumentaryFeesVo.setCreateTime(LocalDateTime.now());
|
|
|
|
|
+ settlementDocumentaryFeesVo.setParentId(insPlyIncomeVo.getId());
|
|
|
|
|
+ settlementDocumentaryFeesVo.setAgreementType("2"); //1平台 2 保险
|
|
|
|
|
+
|
|
|
|
|
+ // 生成跟单费结算记录
|
|
|
|
|
+ SettlementDocumentaryLogEntity settlementDocumentaryLogEntity = new SettlementDocumentaryLogEntity();
|
|
|
|
|
+ settlementDocumentaryLogEntity.setAmount(settlementDocumentaryFeesVo.getSettlementAmount()); // 结算金额
|
|
|
|
|
+ settlementDocumentaryLogEntity.setSettlementDocumentaryId(settlementDocumentaryFeesEntity.getId()); // 关联id
|
|
|
|
|
+ settlementDocumentaryLogEntity.setAmountType("2"); //跟单费结算
|
|
|
|
|
+ settlementDocumentaryLogEntity.setCreateTime(new Date());
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementSumId(insPlyIncomeVo.getSettlementSumId());
|
|
|
|
|
+ settlementDocumentaryFeesService.getBaseMapper().insert(settlementDocumentaryFeesVo);
|
|
|
|
|
+ settlementDocumentaryLogService.save(settlementDocumentaryLogEntity);
|
|
|
|
|
+ //修改开票金额
|
|
|
|
|
+
|
|
|
|
|
+ BigDecimal add = settlementDocumentaryFeesEntity.getInvoicedSettledAmount().add(insPlyIncomeVo.getSettlementAmount());
|
|
|
|
|
+ settlementDocumentaryFeesEntity.setInvoicedSettledAmount(add);
|
|
|
|
|
+
|
|
|
|
|
+ BigDecimal subtract = settlementDocumentaryFeesEntity.getTotalAmount().subtract(add);
|
|
|
|
|
+ settlementDocumentaryFeesEntity.setInvoicedNotSettledAmount(subtract);
|
|
|
|
|
+
|
|
|
|
|
+ if (subtract.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
+ settlementDocumentaryFeesEntity.setCompletionStatus("2");
|
|
|
|
|
+ } else if (subtract.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ settlementDocumentaryFeesEntity.setCompletionStatus("1");
|
|
|
|
|
+ }
|
|
|
|
|
+ settlementDocumentaryFeesService.updateById(settlementDocumentaryFeesEntity);
|
|
|
|
|
+ settleMentAmount = settleMentAmount.add(settlementDocumentaryFeesEntity.getInvoicedSettledAmount());
|
|
|
|
|
+ settleNotMentAmount = settleNotMentAmount.add(settlementDocumentaryFeesEntity.getInvoicedNotSettledAmount());
|
|
|
|
|
+ }
|
|
|
|
|
+// 更新金额
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ SettlementDocumentaryFeesSumEntity settlementDocumentaryFeesSumEntity = settlementDocumentaryFeesSumService.getById(insPlyIncomeVo.getSettlementSumId());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setInvoicedSettledAmount(settleMentAmount);
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setInvoicedNotSettledAmount(settleNotMentAmount);
|
|
|
|
|
+ if (settleNotMentAmount.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setCompletionStatus("2");
|
|
|
|
|
+ } else if (settleNotMentAmount.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setCompletionStatus("1");
|
|
|
|
|
+ }
|
|
|
|
|
+ settlementDocumentaryFeesSumService.updateById(settlementDocumentaryFeesSumEntity);
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* @param insPlyIncomeVo
|
|
* @param insPlyIncomeVo
|
|
|
* @return
|
|
* @return
|
|
@@ -1947,9 +2059,39 @@ handlingProportion,
|
|
|
} else {
|
|
} else {
|
|
|
settlementDocumentaryFeesVo.setExpendAmount(insPlyIncomeVo.getSettlementAmount());
|
|
settlementDocumentaryFeesVo.setExpendAmount(insPlyIncomeVo.getSettlementAmount());
|
|
|
}
|
|
}
|
|
|
|
|
+// 跟单生成批次表
|
|
|
|
|
+ SettlementDocumentaryFeesSumEntity settlementDocumentaryFeesSumEntity = this.saveSumSettlement(insPlyIncomeVo);
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementSumId(settlementDocumentaryFeesSumEntity.getId());
|
|
|
return settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
|
|
return settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private SettlementDocumentaryFeesSumEntity saveSumSettlement(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
|
|
+ String handlingFeesStatus = insPlyIncomeVo.getHandlingFeesStatus();
|
|
|
|
|
+ SettlementDocumentaryFeesSumEntity settlementDocumentaryFeesSumEntity = new SettlementDocumentaryFeesSumEntity();
|
|
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
|
|
+ if("1".equals(handlingFeesStatus)){
|
|
|
|
|
+ List<InsPlyIncomeVo> nowInsPlyIncomeVo = insPlyIncomeVo.getMultipleSelection();
|
|
|
|
|
+ for (InsPlyIncomeVo item: nowInsPlyIncomeVo ){
|
|
|
|
|
+ totalAmount = totalAmount.add(item.getSettlementAmount()) ;
|
|
|
|
|
+ }
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setPartnerCompaniesId(insPlyIncomeVo.getPartnerCompaniesId());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setCompanyId(insPlyIncomeVo.getCompanyId());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setCreateTime(new Date());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setInvoicId(insPlyIncomeVo.getInvoicId());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setInvoicingMethod(insPlyIncomeVo.getInvoicingMethod());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setIsNotCar(insPlyIncomeVo.getIsNotCar());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setSettlementStatus("1");
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setUserId(BaseController.getUser().getId());
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setInvoicedSettledAmount(BigDecimal.ZERO);
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setCompletionStatus("0");
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setTotalAmount(totalAmount);// 开票总额
|
|
|
|
|
+ settlementDocumentaryFeesSumEntity.setInvoicedNotSettledAmount(totalAmount);
|
|
|
|
|
+ settlementDocumentaryFeesSumService.getBaseMapper().insert(settlementDocumentaryFeesSumEntity);
|
|
|
|
|
+ return settlementDocumentaryFeesSumEntity;
|
|
|
|
|
+ }
|
|
|
|
|
+ return settlementDocumentaryFeesSumEntity;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult pinHandlingexcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response) {
|
|
public HttpResult pinHandlingexcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
@@ -2230,11 +2372,14 @@ handlingProportion,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional
|
|
|
public HttpResult<Object> singleInvoic(InsPlyIncomeVo insPlyIncomeVo) {
|
|
public HttpResult<Object> singleInvoic(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
|
|
|
|
|
// 通过ids 查出跟单非结算单
|
|
// 通过ids 查出跟单非结算单
|
|
|
SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo(); // 生成跟单费结算表
|
|
SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo(); // 生成跟单费结算表
|
|
|
if (!CollectionUtils.isEmpty(insPlyIncomeVo.getMultipleSelection())) {
|
|
if (!CollectionUtils.isEmpty(insPlyIncomeVo.getMultipleSelection())) {
|
|
|
|
|
+ SettlementDocumentaryFeesSumEntity settlementDocumentaryFeesSumEntity = this.saveSumSettlement(insPlyIncomeVo);
|
|
|
|
|
+
|
|
|
for (InsPlyIncomeVo insPlyIncomeVo1 : insPlyIncomeVo.getMultipleSelection()) {
|
|
for (InsPlyIncomeVo insPlyIncomeVo1 : insPlyIncomeVo.getMultipleSelection()) {
|
|
|
|
|
|
|
|
insPlyIncomeVo.setSettlementAmount(insPlyIncomeVo1.getSettlementAmount());
|
|
insPlyIncomeVo.setSettlementAmount(insPlyIncomeVo1.getSettlementAmount());
|
|
@@ -2297,6 +2442,7 @@ handlingProportion,
|
|
|
BigDecimal settlementAmount = insPlyIncomeVo.getSettlementAmount();
|
|
BigDecimal settlementAmount = insPlyIncomeVo.getSettlementAmount();
|
|
|
settlementDocumentaryFeesVo.setExpendAmount(settlementAmount.multiply(BigDecimal.ONE.subtract(insPlyIncomeVo.getTaxPoints().divide(new BigDecimal(100)))));
|
|
settlementDocumentaryFeesVo.setExpendAmount(settlementAmount.multiply(BigDecimal.ONE.subtract(insPlyIncomeVo.getTaxPoints().divide(new BigDecimal(100)))));
|
|
|
}
|
|
}
|
|
|
|
|
+ settlementDocumentaryFeesVo.setSettlementSumId(settlementDocumentaryFeesSumEntity.getId());
|
|
|
settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
|
|
settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2492,4 +2638,6 @@ handlingProportion,
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|