|
@@ -4,11 +4,9 @@ import com.jzg.commons.constants.dict.InsOrderStatusEnum;
|
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.commons.entity.finance.po.InsPlyIncome;
|
|
import com.jzg.commons.entity.finance.po.InsPlyIncome;
|
|
|
import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
|
|
import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
|
|
|
-import com.jzg.commons.entity.finance.vo.ImportExcelResultVo;
|
|
|
|
|
-import com.jzg.commons.entity.finance.vo.InvoicingVo;
|
|
|
|
|
-import com.jzg.commons.entity.finance.vo.ReceivableQueryVo;
|
|
|
|
|
-import com.jzg.commons.entity.finance.vo.SettlementVo;
|
|
|
|
|
|
|
+import com.jzg.commons.entity.finance.vo.*;
|
|
|
import com.jzg.commons.request.RequestSingleParam;
|
|
import com.jzg.commons.request.RequestSingleParam;
|
|
|
|
|
+import com.jzg.commons.util.AssertionUtils;
|
|
|
import com.jzg.organization.service.ReceivableService;
|
|
import com.jzg.organization.service.ReceivableService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -16,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author jzg
|
|
* @author jzg
|
|
@@ -34,55 +34,70 @@ public class ReceivableController {
|
|
|
private ReceivableService receivableService;
|
|
private ReceivableService receivableService;
|
|
|
|
|
|
|
|
// 拉取已审核订单
|
|
// 拉取已审核订单
|
|
|
- @PostMapping("pullAuditedOrder")
|
|
|
|
|
- @Operation(summary = "拉取已审核订单")
|
|
|
|
|
- public HttpResult pullAuditedOrder(String orderNo){
|
|
|
|
|
- InsPlyIncome auditedOrder = receivableService.getAuditedOrder(orderNo, InsOrderStatusEnum.UNDERWRITED.getCode(),"1");
|
|
|
|
|
- boolean result = receivableService.saveAuditedOrder(auditedOrder);
|
|
|
|
|
- return result ? HttpResult.ok("拉取成功") : HttpResult.error("拉取失败");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// @PostMapping("pullAuditedOrder")
|
|
|
|
|
+// @Operation(summary = "拉取已审核订单")
|
|
|
|
|
+// public HttpResult pullAuditedOrder(@RequestSingleParam("orderNo") String orderNo){
|
|
|
|
|
+// InsPlyIncome auditedOrder = receivableService.getAuditedOrder(orderNo, InsOrderStatusEnum.UNDERWRITED.getCode(),"1");
|
|
|
|
|
+// boolean result = receivableService.saveAuditedOrder(auditedOrder);
|
|
|
|
|
+// return result ? HttpResult.ok("拉取成功") : HttpResult.error("拉取失败");
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
@PostMapping("getUnauditedOrder")
|
|
@PostMapping("getUnauditedOrder")
|
|
|
@Operation(summary = "获取未审核的订单")
|
|
@Operation(summary = "获取未审核的订单")
|
|
|
- public HttpResult getUnauditedOrder(String orderNo){
|
|
|
|
|
- InsPlyIncome auditedOrder = receivableService.getAuditedOrder(orderNo, InsOrderStatusEnum.UNDERWRITED.getCode(),"0");
|
|
|
|
|
|
|
+ public HttpResult getUnauditedOrder(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
|
|
+ if (receivableQueryVo.getAgreementType().equals(""))
|
|
|
|
|
+ {
|
|
|
|
|
+ receivableQueryVo.setAgreementType("1");
|
|
|
|
|
+ }
|
|
|
|
|
+ InsPlyIncome auditedOrder = receivableService.getUnauditedOrder(receivableQueryVo);
|
|
|
|
|
+ AssertionUtils.isEmpty(auditedOrder,"订单不存在");
|
|
|
|
|
+// boolean result = receivableService.saveAuditedOrder(auditedOrder);
|
|
|
|
|
+ List<InsPlyIncome> result = new ArrayList<>();
|
|
|
|
|
+ result.add(auditedOrder);
|
|
|
|
|
+ return HttpResult.ok(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("addReceivable")
|
|
|
|
|
+ @Operation(summary = "添加应收记录")
|
|
|
|
|
+ public HttpResult addReceivable(@RequestSingleParam("orderNo") List<String> orderNo){
|
|
|
|
|
+ List<InsPlyIncome> auditedOrder = receivableService.getUnauditOrderList(orderNo, InsOrderStatusEnum.UNDERWRITED.getCode(),"0");
|
|
|
|
|
+ AssertionUtils.isEmpty(auditedOrder,"订单不存在");
|
|
|
boolean result = receivableService.saveAuditedOrder(auditedOrder);
|
|
boolean result = receivableService.saveAuditedOrder(auditedOrder);
|
|
|
- return result ? HttpResult.ok("拉取成功") : HttpResult.error("拉取失败");
|
|
|
|
|
|
|
+ return result ? HttpResult.ok("添加成功") : HttpResult.error("添加失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("getCommissionReceivableList")
|
|
@PostMapping("getCommissionReceivableList")
|
|
|
@Operation(summary = "获取私有协议手续费列表")
|
|
@Operation(summary = "获取私有协议手续费列表")
|
|
|
public HttpResult getCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
public HttpResult getCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
receivableQueryVo.setQueryType("1");
|
|
receivableQueryVo.setQueryType("1");
|
|
|
- return HttpResult.ok(receivableService.getReceivableList(receivableQueryVo));
|
|
|
|
|
|
|
+ return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("getOtherReceivableList")
|
|
@PostMapping("getOtherReceivableList")
|
|
|
@Operation(summary = "获取私有协议跟单费列表")
|
|
@Operation(summary = "获取私有协议跟单费列表")
|
|
|
public HttpResult getOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
public HttpResult getOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
receivableQueryVo.setQueryType("2");
|
|
receivableQueryVo.setQueryType("2");
|
|
|
- return HttpResult.ok(receivableService.getReceivableList(receivableQueryVo));
|
|
|
|
|
|
|
+ return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("getJyCommissionReceivableList")
|
|
@PostMapping("getJyCommissionReceivableList")
|
|
|
@Operation(summary = "获取私有协议驾意险手续费列表")
|
|
@Operation(summary = "获取私有协议驾意险手续费列表")
|
|
|
public HttpResult getJyCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
public HttpResult getJyCommissionReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
receivableQueryVo.setQueryType("3");
|
|
receivableQueryVo.setQueryType("3");
|
|
|
- return HttpResult.ok(receivableService.getReceivableList(receivableQueryVo));
|
|
|
|
|
|
|
+ return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("getJyOtherReceivableList")
|
|
@PostMapping("getJyOtherReceivableList")
|
|
|
@Operation(summary = "获取私有协议驾意险跟单费列表")
|
|
@Operation(summary = "获取私有协议驾意险跟单费列表")
|
|
|
public HttpResult getJyOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
public HttpResult getJyOtherReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
receivableQueryVo.setQueryType("4");
|
|
receivableQueryVo.setQueryType("4");
|
|
|
- return HttpResult.ok(receivableService.getReceivableList(receivableQueryVo));
|
|
|
|
|
|
|
+ return HttpResult.ok(receivableService.getReceivablePage(receivableQueryVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- @PostMapping("getPlatformReceivableList")
|
|
|
|
|
- @Operation(summary = "获取平台协议驾意险列表")
|
|
|
|
|
- public void getPlatformReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @PostMapping("getSelectedReceivableList")
|
|
|
|
|
+ @Operation(summary = "获取选中应收列表")
|
|
|
|
|
+ public HttpResult getSelectedReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
|
|
+ return HttpResult.ok(receivableService.getReceivableList(receivableQueryVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("commissionInvoicing")
|
|
@PostMapping("commissionInvoicing")
|
|
@@ -90,14 +105,15 @@ public class ReceivableController {
|
|
|
public HttpResult commissionInvoicing(@RequestBody InvoicingVo invoicingVo){
|
|
public HttpResult commissionInvoicing(@RequestBody InvoicingVo invoicingVo){
|
|
|
// 设置手续费开票
|
|
// 设置手续费开票
|
|
|
invoicingVo.setInvoiceType("1");
|
|
invoicingVo.setInvoiceType("1");
|
|
|
- boolean invoicingCheck = receivableService.invoicingCheck(invoicingVo);
|
|
|
|
|
- if(!invoicingCheck){
|
|
|
|
|
- return HttpResult.error("有订单占用");
|
|
|
|
|
|
|
+// boolean invoicingCheck = receivableService.invoicingCheck(invoicingVo);
|
|
|
|
|
+// if(!invoicingCheck){
|
|
|
|
|
+// return HttpResult.error("有订单占用");
|
|
|
|
|
+// }
|
|
|
|
|
+ InvoiceingResult result = receivableService.addInvoicing(invoicingVo);
|
|
|
|
|
+ if (Objects.nonNull(result)){
|
|
|
|
|
+ return HttpResult.ok("开票成功",result);
|
|
|
}
|
|
}
|
|
|
- boolean result = receivableService.addInvoicing(invoicingVo);
|
|
|
|
|
-
|
|
|
|
|
- return result ? HttpResult.ok("开票成功") : HttpResult.error("开票失败");
|
|
|
|
|
-
|
|
|
|
|
|
|
+ return HttpResult.error("开票失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("otherInvoicing")
|
|
@PostMapping("otherInvoicing")
|
|
@@ -109,8 +125,11 @@ public class ReceivableController {
|
|
|
if(!invoicingCheck){
|
|
if(!invoicingCheck){
|
|
|
return HttpResult.error("有订单占用");
|
|
return HttpResult.error("有订单占用");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- return HttpResult.ok();
|
|
|
|
|
|
|
+ InvoiceingResult result = receivableService.addInvoicing(invoicingVo);
|
|
|
|
|
+ if (Objects.nonNull(result)){
|
|
|
|
|
+ return HttpResult.ok("开票成功",result);
|
|
|
|
|
+ }
|
|
|
|
|
+ return HttpResult.error("开票失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("invoicingCheck")
|
|
@PostMapping("invoicingCheck")
|
|
@@ -162,11 +181,23 @@ public class ReceivableController {
|
|
|
ImportExcelResultVo importExcelResultVo = receivableService.importJyData(file);
|
|
ImportExcelResultVo importExcelResultVo = receivableService.importJyData(file);
|
|
|
return HttpResult.ok(importExcelResultVo);
|
|
return HttpResult.ok(importExcelResultVo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/getPlatFormReceivableList")
|
|
|
|
|
+ @Operation(summary = "获取平台协议列表")
|
|
|
|
|
+ public HttpResult getPlatFormReceivableList(@RequestBody ReceivableQueryVo receivableQueryVo){
|
|
|
|
|
+ receivableQueryVo.setQueryType("1");
|
|
|
|
|
+ return HttpResult.ok(receivableService.getPlatFormReceivableList(receivableQueryVo));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-// @PostMapping("batchModify")
|
|
|
|
|
-// @Operation(summary = "批量修改")
|
|
|
|
|
-// public HttpResult batchModify(@RequestBody List<SettlementVo> settlementVoList){
|
|
|
|
|
-// return receivableService.batchModify(settlementVoList) ? HttpResult.ok("批量修改成功") : HttpResult.error("批量修改失败");
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ @PostMapping("/invoiceRecord")
|
|
|
|
|
+ @Operation(summary = "获取开票记录")
|
|
|
|
|
+ public HttpResult getInvoiceRecord(@RequestBody InvoiceRecordQueryVo invoiceRecordQueryVo){
|
|
|
|
|
+ return HttpResult.ok(receivableService.getInvoiceRecordList(invoiceRecordQueryVo));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/getInvoiceRecordDetail")
|
|
|
|
|
+ @Operation(summary = "获取开票记录详情")
|
|
|
|
|
+ public HttpResult getInvoiceRecordDetail(@RequestSingleParam("id") String id){
|
|
|
|
|
+ return HttpResult.ok(receivableService.getInvoiceRecordDetail(id));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|