|
|
@@ -3,18 +3,22 @@ package com.ydtech.modules.inv.controller;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.bean.copier.CopyOptions;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.core.page.PageResult;
|
|
|
+import com.ydtech.modules.admin.model.SysUser;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.base.model.dto.BaseDto;
|
|
|
import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetails;
|
|
|
import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetailsHistory;
|
|
|
+import com.ydtech.modules.inv.model.InvInsExternalBillsDetails;
|
|
|
import com.ydtech.modules.inv.model.vo.req.InvInsExternalBillsDetailsReqVO;
|
|
|
import com.ydtech.modules.inv.service.InvChannelsExternalBillsDetailsHistoryService;
|
|
|
import com.ydtech.modules.inv.service.InvChannelsExternalBillsDetailsService;
|
|
|
+import com.ydtech.modules.inv.service.InvInsExternalBillsDetailsService;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
@@ -26,11 +30,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.function.Function;
|
|
|
|
|
|
/**
|
|
|
* 财务 - 渠道 - 外部票据控制层 详情
|
|
|
@@ -44,11 +50,18 @@ import java.util.List;
|
|
|
@Slf4j
|
|
|
public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
+ //渠道
|
|
|
+ @Resource
|
|
|
private InvChannelsExternalBillsDetailsService icebdService;
|
|
|
- @Autowired
|
|
|
+
|
|
|
+ //渠道 历史
|
|
|
+ @Resource
|
|
|
private InvChannelsExternalBillsDetailsHistoryService icebdhService;
|
|
|
|
|
|
+ //保险公司
|
|
|
+ @Resource
|
|
|
+ private InvInsExternalBillsDetailsService InvInsExternalBillsDetailsService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 分页查询
|
|
|
@@ -58,10 +71,14 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@PostMapping(value = "/queryPage")
|
|
|
- public HttpResult queryPage(@RequestBody InvInsExternalBillsDetailsReqVO reqVo) {
|
|
|
+ public HttpResult<PageResult<InvChannelsExternalBillsDetails>> queryPage(@RequestBody InvInsExternalBillsDetailsReqVO reqVo) {
|
|
|
|
|
|
LambdaQueryWrapper<InvChannelsExternalBillsDetails> lqw = new LambdaQueryWrapper();
|
|
|
lqw.eq(StringUtils.isNotEmpty(reqVo.getBatchNum()), InvChannelsExternalBillsDetails::getBatchNum, reqVo.getBatchNum());
|
|
|
+ lqw.eq(StringUtils.isNotEmpty(reqVo.getStatus()), InvChannelsExternalBillsDetails::getStatus, reqVo.getStatus());
|
|
|
+ lqw.eq(StringUtils.isNotEmpty(reqVo.getInsCompanyId()), InvChannelsExternalBillsDetails::getInsCompanyId, reqVo.getInsCompanyId());
|
|
|
+ lqw.eq(StringUtils.isNotEmpty(reqVo.getChannel()), InvChannelsExternalBillsDetails::getChannel, reqVo.getChannel());
|
|
|
+ lqw.eq(StringUtils.isNotEmpty(reqVo.getPlateNum()), InvChannelsExternalBillsDetails::getPlateNum, reqVo.getPlateNum());
|
|
|
|
|
|
Page p = PageRequest.buildPageRequestByVo(reqVo);
|
|
|
IPage<InvChannelsExternalBillsDetails> pResult = icebdService.page(p, lqw);
|
|
|
@@ -78,69 +95,11 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @PutMapping("/aaaaa")
|
|
|
- @ApiOperation(value = "测试用户ID是否获取到", notes = "" +
|
|
|
- "参数1:列表ID" +
|
|
|
- "</br>参数2:通过状态(1通过,2失败)" +
|
|
|
- "</br>参数3:类型(1报价,2核保)")
|
|
|
- public HttpResult aaaa(@RequestBody BaseDto dto) {
|
|
|
-// public HttpResult aaaa(@ApiIgnore @RequestBody BaseDto dto) {
|
|
|
-// log.error("********************");
|
|
|
-// log.error("Authorization:"+request.getHeader("Authorization"));
|
|
|
-// log.error("token:"+request.getHeader("token"));
|
|
|
-//
|
|
|
-//
|
|
|
-// Authentication authentication = SecurityUtils.getAuthentication();
|
|
|
-//
|
|
|
-// JwtAuthenticatioToken j = (JwtAuthenticatioToken) authentication;
|
|
|
-// log.error("JwtAuthenticatioToken:"+j);
|
|
|
-// log.error("JwtAuthenticatioToken token:"+j.getToken());
|
|
|
-// log.error("*********end********");
|
|
|
-//
|
|
|
-// log.error("测试获取的用户ID 2222:"+getUserId2());
|
|
|
-// log.error("测试获取的用户ID 1111:"+getUserId());
|
|
|
-// return HttpResult.ok("获取用户ID测试:",getUserId());
|
|
|
-// return HttpResult.ok("获取用户部门ID:",getdeptId(request));
|
|
|
- return HttpResult.ok(dto);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/bbbb")
|
|
|
- @ApiOperation(value = "测试用户ID是否获取到2222")
|
|
|
- public HttpResult bbbb() {
|
|
|
- return HttpResult.ok("获取用户信息测试:", getUser());
|
|
|
-// return HttpResult.ok("获取用户ID测试2222:",getUserId2());
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PostMapping(value = "/demo02")
|
|
|
- @ApiOperation(value = "数据导入")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file"),
|
|
|
- @ApiImplicitParam(name = "batchNum", value = "批次号", required = true, dataType = "String")
|
|
|
- })
|
|
|
- public HttpResult demo02(@RequestPart MultipartFile file, @RequestParam String batchNum) {
|
|
|
- //业务代码
|
|
|
- return HttpResult.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/demo03")
|
|
|
- @ApiOperation(value = "查询")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file"),
|
|
|
- @ApiImplicitParam(name = "batchNum", value = "批次号", required = true, dataType = "String")
|
|
|
- })
|
|
|
- public HttpResult demo03(@RequestParam @NotBlank(message = "报价号ID不能为空") String quoteNo) {
|
|
|
- return HttpResult.ok();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
|
|
|
@ApiOperation(value = "修改")
|
|
|
@PostMapping(value = "/edit")
|
|
|
@Transactional
|
|
|
- public HttpResult edit(@RequestBody InvChannelsExternalBillsDetails icebd, HttpServletRequest request) {
|
|
|
+ public HttpResult edit(@RequestBody InvChannelsExternalBillsDetails icebd) {
|
|
|
|
|
|
|
|
|
List<InvChannelsExternalBillsDetailsHistory> list = icebdhService.gainListByEditId(icebd.getId());
|
|
|
@@ -183,4 +142,72 @@ public class InvChannelsExternalBillsDetailsController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/receive/{batchNum}")
|
|
|
+ @ApiOperation(value = "确认领取")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "batchNum", value = "批次号", required = true, dataType = "String")
|
|
|
+ })
|
|
|
+ @Transactional
|
|
|
+ public HttpResult receive(@PathVariable String batchNum) {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<InvChannelsExternalBillsDetails> lqw = new LambdaQueryWrapper<>();
|
|
|
+ lqw.select(InvChannelsExternalBillsDetails::getPlateNum);
|
|
|
+ lqw.eq(InvChannelsExternalBillsDetails::getBatchNum,batchNum);
|
|
|
+// List<InvChannelsExternalBillsDetails> iebdList = icebdService.list(lqw);
|
|
|
+ //车牌号
|
|
|
+ List<String> plateNums = icebdService.listObjs(lqw, new Function<Object, String>() {
|
|
|
+ @Override
|
|
|
+ public String apply(Object id) {
|
|
|
+ return id.toString();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //保险公司 更新状态
|
|
|
+ LambdaUpdateWrapper<InvInsExternalBillsDetails> insLuw = new LambdaUpdateWrapper<>();
|
|
|
+ insLuw.set(InvInsExternalBillsDetails::getStatus,"1");
|
|
|
+ insLuw.in(InvInsExternalBillsDetails::getPlateNum,plateNums);
|
|
|
+ InvInsExternalBillsDetailsService.update(insLuw);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //渠道 更新批次号状态
|
|
|
+ LambdaUpdateWrapper<InvChannelsExternalBillsDetails> luw = new LambdaUpdateWrapper<>();
|
|
|
+ luw.set(InvChannelsExternalBillsDetails::getStatus,"1");
|
|
|
+ luw.eq(InvChannelsExternalBillsDetails::getBatchNum,batchNum);
|
|
|
+ icebdService.update(luw);
|
|
|
+
|
|
|
+ return HttpResult.ok("领取成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "/batchPay")
|
|
|
+ @ApiOperation(value = "批量支付")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "ids", value = "渠道数据ID数组", dataType = "String", paramType = "body", allowMultiple = true, required = true)
|
|
|
+ })
|
|
|
+ public HttpResult pay(@RequestBody List<String> ids) {
|
|
|
+ SysUser user = getUser();
|
|
|
+ icebdService.pay(ids,user);
|
|
|
+
|
|
|
+ return HttpResult.ok("支付成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "/pay/{id}")
|
|
|
+ @ApiOperation(value = "支付")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id", value = "渠道数据ID", dataType = "String", paramType = "path", required = true)
|
|
|
+ })
|
|
|
+ public HttpResult pay(@PathVariable String id) {
|
|
|
+ SysUser user = getUser();
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
+ ids.add(id);
|
|
|
+
|
|
|
+ icebdService.pay(ids,user);
|
|
|
+
|
|
|
+ return HttpResult.ok("支付成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|