|
|
@@ -9,6 +9,7 @@ import com.jzg.commons.core.base.BaseController;
|
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.commons.entity.dto.CostCalculateRespVO;
|
|
|
import com.jzg.commons.entity.dto.InsFeeOrdersParam;
|
|
|
+import com.jzg.commons.entity.orders.po.InsFeeAudit;
|
|
|
import com.jzg.commons.entity.orders.po.InsOrders;
|
|
|
import com.jzg.commons.entity.orders.po.InsOrdersCosts;
|
|
|
import com.jzg.commons.entity.po.InsFeeOrders;
|
|
|
@@ -19,6 +20,7 @@ import com.jzg.commons.util.AssertionUtils;
|
|
|
import com.jzg.commons.util.BigDecimalUtil;
|
|
|
import com.jzg.commons.util.StringUtils;
|
|
|
import com.jzg.quotation.commons.client.OrgClient;
|
|
|
+import com.jzg.quotation.summary.mapper.InsFeeAuditMapper;
|
|
|
import com.jzg.quotation.summary.mapper.InsFeeOrdersMapper;
|
|
|
import com.jzg.quotation.summary.service.InsFeeOrdersService;
|
|
|
import com.jzg.quotation.summary.service.InsOrdersCostsService;
|
|
|
@@ -26,12 +28,14 @@ import com.jzg.quotation.summary.service.InsOrdersService;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* @author quchen
|
|
|
@@ -56,6 +60,8 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
|
|
|
@Resource
|
|
|
private InsFeeOrdersMapper insFeeOrdersMapper;
|
|
|
+ @Autowired
|
|
|
+ private InsFeeAuditMapper insFeeAuditMapper;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -83,13 +89,24 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
* @date 2026/6/24 9:46
|
|
|
*/
|
|
|
@Override
|
|
|
- public InsFeeOrders calcCosts(PtlAgreementCostRatioVo ptlAgreementCostRatioVo) {
|
|
|
+ public HttpResult<InsFeeOrders> calcCosts(PtlAgreementCostRatioVo ptlAgreementCostRatioVo) {
|
|
|
log.info("调整费用。不同费用的比例信息是:[{}]", JSONUtil.toJsonStr(ptlAgreementCostRatioVo));
|
|
|
+ InsFeeAudit insFeeAudit = insFeeAuditMapper.selectFeeAuditByOrderNo(ptlAgreementCostRatioVo.getOrderNo());
|
|
|
+ if(insFeeAudit == null){
|
|
|
+ String msg = String.format("根据订单号[%s]未找到费用审核记录",ptlAgreementCostRatioVo.getOrderNo());
|
|
|
+ log.error("根据订单号[{}]未找到费用审核记录",ptlAgreementCostRatioVo.getOrderNo());
|
|
|
+ return HttpResult.error(msg);
|
|
|
+ }
|
|
|
+ if("1".equals(Objects.toString(insFeeAudit.getAuditStatus(),"")) ){
|
|
|
+ String msg =String.format("订单号为[%s]的订单已经审核通过,无法进行费用调整", ptlAgreementCostRatioVo.getOrderNo());
|
|
|
+ log.error(msg);
|
|
|
+ return HttpResult.error(msg);
|
|
|
+ }
|
|
|
InsFeeOrders insFeeOrders = getInsFeeOrders(ptlAgreementCostRatioVo);
|
|
|
log.info("调整后费用.参数[{}]真实结果是[{}]", JSONUtil.toJsonStr(ptlAgreementCostRatioVo), JSONUtil.toJsonStr(insFeeOrders));
|
|
|
// 保存比例
|
|
|
this.updateById(insFeeOrders);
|
|
|
- return insFeeOrders;
|
|
|
+ return HttpResult.ok(insFeeOrders);
|
|
|
}
|
|
|
|
|
|
/**
|