|
@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ydtech.constants.enums.dict.FeeAuditAuditstatus;
|
|
import com.ydtech.constants.enums.dict.FeeAuditAuditstatus;
|
|
|
|
|
+import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
|
import com.ydtech.constants.enums.dict.insurance.TrafficManagementVehicleType;
|
|
import com.ydtech.constants.enums.dict.insurance.TrafficManagementVehicleType;
|
|
|
|
|
+import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
|
import com.ydtech.modules.admin.model.vo.SysChannelGroupPageVo;
|
|
import com.ydtech.modules.admin.model.vo.SysChannelGroupPageVo;
|
|
@@ -26,25 +28,33 @@ import com.ydtech.modules.fnc.service.InsFeeAuditHistoryService;
|
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
|
import com.ydtech.modules.fnc.service.impl.InsFeeAuditServiceImpl;
|
|
import com.ydtech.modules.fnc.service.impl.InsFeeAuditServiceImpl;
|
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
|
|
+import com.ydtech.modules.order.entity.InsFeeOrder;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.order.OrderStatusCodeEnum;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.zijin.constants.enums.OrderStatusEnum;
|
|
|
import com.ydtech.modules.order.entity.vo.FeeOrderNewRecordVo;
|
|
import com.ydtech.modules.order.entity.vo.FeeOrderNewRecordVo;
|
|
|
import com.ydtech.modules.order.entity.vo.FeeOrderNewVo;
|
|
import com.ydtech.modules.order.entity.vo.FeeOrderNewVo;
|
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
|
|
+import com.ydtech.modules.order.service.InsFeeOrderService;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
|
|
+import com.ydtech.modules.protocol.constants.ValidStatus;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreement;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreement;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAreaLicense;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAreaLicense;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementService;
|
|
import com.ydtech.modules.protocol.service.PtlAgreementService;
|
|
|
import com.ydtech.modules.protocol.service.PtlAreaLicenseService;
|
|
import com.ydtech.modules.protocol.service.PtlAreaLicenseService;
|
|
|
|
|
+import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
import com.ydtech.modules.protocols.dao.PtlAgreementProductCostsNewMapper;
|
|
import com.ydtech.modules.protocols.dao.PtlAgreementProductCostsNewMapper;
|
|
|
import com.ydtech.modules.protocols.entity.po.*;
|
|
import com.ydtech.modules.protocols.entity.po.*;
|
|
|
import com.ydtech.modules.protocols.entity.vo.*;
|
|
import com.ydtech.modules.protocols.entity.vo.*;
|
|
|
import com.ydtech.modules.protocols.service.*;
|
|
import com.ydtech.modules.protocols.service.*;
|
|
|
|
|
+import com.ydtech.utils.ObjectUtil;
|
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
@@ -97,12 +107,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PtlAgreementProductCostsNewMapper ptlAgreementProductCostsNewMapper;
|
|
private PtlAgreementProductCostsNewMapper ptlAgreementProductCostsNewMapper;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private InsFeeAuditHistoryService insFeeAuditHistoryService;
|
|
private InsFeeAuditHistoryService insFeeAuditHistoryService;
|
|
|
- private InsFeeOrderConfigServiceImpl insFeeOrderConfigServiceImpl;
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private InsFeeAuditServiceImpl insFeeAuditServiceImpl;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Page<PtlAgreementProductCostsNew> getProductPage(Page page, SysChannelGroupPageVo sysChannelGroupPageVo) {
|
|
public Page<PtlAgreementProductCostsNew> getProductPage(Page page, SysChannelGroupPageVo sysChannelGroupPageVo) {
|
|
@@ -179,7 +185,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
.gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now());
|
|
.gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 费用状态
|
|
|
|
|
+ ptlAgreementProductCostsNewLambdaQueryWrapper
|
|
|
|
|
+ .eq(agreementProductQueryVo.getValidStatus() != null, PtlAgreementProductCostsNew::getValidStatus, agreementProductQueryVo.getValidStatus());
|
|
|
//统配描述
|
|
//统配描述
|
|
|
if (agreementProductQueryVo.getDesc() != null) {
|
|
if (agreementProductQueryVo.getDesc() != null) {
|
|
|
ptlAgreementProductCostsNewLambdaQueryWrapper.like(PtlAgreementProductCostsNew::getDesc, agreementProductQueryVo.getDesc());
|
|
ptlAgreementProductCostsNewLambdaQueryWrapper.like(PtlAgreementProductCostsNew::getDesc, agreementProductQueryVo.getDesc());
|
|
@@ -360,16 +368,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
}
|
|
}
|
|
|
if ("checkbox".equals(ptlAgreementUndwrtRulesAttr.getAttrType()) || "select".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
|
|
if ("checkbox".equals(ptlAgreementUndwrtRulesAttr.getAttrType()) || "select".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
|
|
|
//车辆类型不显示代码k33 显示普通货车
|
|
//车辆类型不显示代码k33 显示普通货车
|
|
|
- if(ptlAgreementUndwrtRulesAttr.getAttrCode().equals("CarClass"))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (ptlAgreementUndwrtRulesAttr.getAttrCode().equals("CarClass")) {
|
|
|
String[] split = v.get(i).getMin().split(",");
|
|
String[] split = v.get(i).getMin().split(",");
|
|
|
desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含";
|
|
desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含";
|
|
|
for (String s : split) {
|
|
for (String s : split) {
|
|
|
desc += TrafficManagementVehicleType.getDesc(s) + ",";
|
|
desc += TrafficManagementVehicleType.getDesc(s) + ",";
|
|
|
}
|
|
}
|
|
|
- desc = desc.substring(0,desc.length()-1);
|
|
|
|
|
|
|
+ desc = desc.substring(0, desc.length() - 1);
|
|
|
desc += "\n";
|
|
desc += "\n";
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含" + v.get(i).getMin() + "\n";
|
|
desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含" + v.get(i).getMin() + "\n";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -521,6 +528,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
.lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
|
|
.lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
|
|
|
.gt(PtlAgreementProductCostsNew::getCostsEndDate, formattedDateTime)
|
|
.gt(PtlAgreementProductCostsNew::getCostsEndDate, formattedDateTime)
|
|
|
.eq(PtlAgreementProductCostsNew::getIsAudit, "1")//查找审核已通过的
|
|
.eq(PtlAgreementProductCostsNew::getIsAudit, "1")//查找审核已通过的
|
|
|
|
|
+ .eq(PtlAgreementProductCostsNew::getValidStatus, ValidStatus.AVS_1.getCode()) // 有效状态
|
|
|
.orderBy(true, true, PtlAgreementProductCostsNew::getPriorityLevel));
|
|
.orderBy(true, true, PtlAgreementProductCostsNew::getPriorityLevel));
|
|
|
|
|
|
|
|
List<AgreementProductCosts> agreementProductCosts = new ArrayList<>();
|
|
List<AgreementProductCosts> agreementProductCosts = new ArrayList<>();
|
|
@@ -721,7 +729,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//
|
|
//
|
|
|
// //单独处理车牌号
|
|
// //单独处理车牌号
|
|
|
// if ("LicenseNo".equals(x.getAttrCode()) && (x.getMin() != null && !x.getMin().equals(""))) {
|
|
// if ("LicenseNo".equals(x.getAttrCode()) && (x.getMin() != null && !x.getMin().equals(""))) {
|
|
|
-//// x.setOperator(x.getDictLabal().getJSONObject(0).getString("parentNumber"));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /// / x.setOperator(x.getDictLabal().getJSONObject(0).getString("parentNumber"));
|
|
|
// x.setOperator("0");
|
|
// x.setOperator("0");
|
|
|
// x.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
// x.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
// x.setId(0);
|
|
// x.setId(0);
|
|
@@ -761,7 +770,6 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
// return true;
|
|
// return true;
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
-
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Override
|
|
@Override
|
|
|
public boolean costsUpdate(AgreementProductCosts agreementProductCosts) {
|
|
public boolean costsUpdate(AgreementProductCosts agreementProductCosts) {
|
|
@@ -785,10 +793,13 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//清空交强险信息
|
|
//清空交强险信息
|
|
|
agreementProductCosts.clearJqInfo();
|
|
agreementProductCosts.clearJqInfo();
|
|
|
}
|
|
}
|
|
|
- PtlAgreementProductCostsNew old = getById(agreementProductCosts.getId());
|
|
|
|
|
|
|
|
|
|
|
|
+ PtlAgreementProductCostsNew old = getById(agreementProductCosts.getId());
|
|
|
|
|
+ if (!ValidStatus.AVS_0.getCode().equals(old.getValidStatus())) {
|
|
|
|
|
+ throw new SystemException("请先禁用后再编辑费用");
|
|
|
|
|
+ }
|
|
|
//更新费用主表信息
|
|
//更新费用主表信息
|
|
|
- PtlAgreementProductCostsNew ptlAgreementProductCost= ptlAgreementProductCostsNewService.getById(agreementProductCosts.getId());
|
|
|
|
|
|
|
+ PtlAgreementProductCostsNew ptlAgreementProductCost = ptlAgreementProductCostsNewService.getById(agreementProductCosts.getId());
|
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
|
|
|
BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNew);
|
|
BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNew);
|
|
|
//修改审核状态为未审核
|
|
//修改审核状态为未审核
|
|
@@ -2437,4 +2448,69 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNews = baseMapper.selectOne(queryWrapper);
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNews = baseMapper.selectOne(queryWrapper);
|
|
|
return ptlAgreementProductCostsNews;
|
|
return ptlAgreementProductCostsNews;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult costsDisable(String costsId) {
|
|
|
|
|
+ PtlAgreementProductCostsNew ptlAgreementProductCostsNew = getById(costsId);
|
|
|
|
|
+ AssertionUtils.isEmpty(ptlAgreementProductCostsNew, "未查询到此协议");
|
|
|
|
|
+
|
|
|
|
|
+ // 查询费用列表
|
|
|
|
|
+ List<InsFeeOrderNew> insFeeOrderNews = insFeeOrderNewService
|
|
|
|
|
+ .lambdaQuery()
|
|
|
|
|
+ .eq(InsFeeOrderNew::getCostsId, costsId)
|
|
|
|
|
+ .list();
|
|
|
|
|
+
|
|
|
|
|
+ List<String> insFeeOrderIdList = insFeeOrderNews.stream().map(InsFeeOrderNew::getCostsId).collect(Collectors.toList());
|
|
|
|
|
+ if (insFeeOrderIdList.isEmpty()) {
|
|
|
|
|
+ return HttpResult.ok("修改成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 修改订单二维码状态
|
|
|
|
|
+ insAreaCompanyService.lambdaUpdate()
|
|
|
|
|
+ .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
|
|
|
|
|
+ .in(InsAreaCompany::getId, insFeeOrderIdList)
|
|
|
|
|
+ .update();
|
|
|
|
|
+ ptlAgreementProductCostsNew.setValidStatus(ValidStatus.AVS_0.getCode());
|
|
|
|
|
+ boolean b = updateById(ptlAgreementProductCostsNew);
|
|
|
|
|
+ AssertionUtils.isSucceed(b, "修改费用状态失败");
|
|
|
|
|
+ return HttpResult.ok("修改成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional
|
|
|
|
|
+ public HttpResult<Object> costsBatchDisable(List<String> costsIdList) {
|
|
|
|
|
+ List<PtlAgreementProductCostsNew> list = lambdaQuery()
|
|
|
|
|
+ .in(PtlAgreementProductCostsNew::getId, costsIdList)
|
|
|
|
|
+ .list();
|
|
|
|
|
+
|
|
|
|
|
+ if (list.isEmpty() || list.size() != costsIdList.size()) {
|
|
|
|
|
+ throw new SystemException("请选择正确的费用");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询费用列表
|
|
|
|
|
+ List<InsFeeOrderNew> insFeeOrderNews = insFeeOrderNewService
|
|
|
|
|
+ .lambdaQuery()
|
|
|
|
|
+ .in(InsFeeOrderNew::getCostsId, costsIdList)
|
|
|
|
|
+ .list();
|
|
|
|
|
+
|
|
|
|
|
+ List<String> insFeeOrderIdList = insFeeOrderNews.stream().map(InsFeeOrderNew::getCostsId).collect(Collectors.toList());
|
|
|
|
|
+ if (insFeeOrderIdList.isEmpty()) {
|
|
|
|
|
+ return HttpResult.ok("修改成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 修改订单二维码状态
|
|
|
|
|
+ insAreaCompanyService.lambdaUpdate()
|
|
|
|
|
+ .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
|
|
|
|
|
+ .in(InsAreaCompany::getId, insFeeOrderIdList)
|
|
|
|
|
+ .update();
|
|
|
|
|
+
|
|
|
|
|
+ list.forEach(ptlAgreementProductCostsNew -> ptlAgreementProductCostsNew.setValidStatus(ValidStatus.AVS_0.getCode()));
|
|
|
|
|
+
|
|
|
|
|
+ boolean b = updateBatchById(list);
|
|
|
|
|
+ AssertionUtils.isSucceed(b, "修改费用状态失败");
|
|
|
|
|
+ return HttpResult.ok("修改成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|