|
@@ -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.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1254,7 +1257,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 +1357,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 +1411,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 +1547,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<>();
|