From 7aee8056bab693f504678a7a32e982e3e108c469 Mon Sep 17 00:00:00 2001
From: hp <2969694837@qq.com>
Date: Mon, 19 Sep 2022 09:24:13 +0800
Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E5=BA=93=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AppScmVehInventorymonthQuery.java | 64 +++++++
.../AppScmVehInventorymonthVo.java | 80 +++++++++
.../ScmVehInventorymonthFeign.java | 8 +
.../ScmVehInventorymonthFeignFallback.java | 5 +
.../ScmVehInventorymonthMapper.java | 65 +++++++
.../ScmVehInventorymonthMapper.xml | 13 ++
.../ScmVehInventorymonthRest.java | 106 +++++++++++
.../ScmVehInventorymonthService.java | 170 ++++++++++++++++++
.../ScmVehInventoryreportMapper.java | 65 +++++++
.../ScmVehInventoryreportMapper.xml | 13 ++
.../ScmVehInventoryreportRest.java | 100 +++++++++++
.../ScmVehInventoryreportService.java | 110 ++++++++++++
12 files changed, 799 insertions(+)
create mode 100644 anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthQuery.java
create mode 100644 anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthVo.java
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.java
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.xml
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthRest.java
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.java
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.xml
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportRest.java
create mode 100644 anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportService.java
diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthQuery.java
new file mode 100644
index 0000000000..3804f55d70
--- /dev/null
+++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthQuery.java
@@ -0,0 +1,64 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.api.scmvehinventorymonth;
+
+
+import com.yxt.common.core.query.Query;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventorymonthQuery.java
+ * Class: com.yxt.anrui.scm.api.api.scmvehinventorymonth.ScmVehInventorymonthQuery
+ * Description: 月度盘库 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Data
+@ApiModel(value = "月度盘库 查询条件", description = "月度盘库 查询条件")
+public class AppScmVehInventorymonthQuery implements Query {
+
+ @ApiModelProperty("用户sid")
+ private String userSid;
+ @ApiModelProperty("报告编号/创建人")
+ private String names;
+ @ApiModelProperty("创建日期")
+ private String date;
+ @ApiModelProperty("盘库报告sid")
+ private String reportSid;
+ @ApiModelProperty("盘库结果")
+ private String state;
+ @ApiModelProperty("使用组织名称")
+ private String useOrgSid;
+
+}
diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthVo.java
new file mode 100644
index 0000000000..0cacb26fc4
--- /dev/null
+++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/AppScmVehInventorymonthVo.java
@@ -0,0 +1,80 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.api.scmvehinventorymonth;
+
+
+import com.yxt.common.core.vo.Vo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventorymonthVo.java
+ * Class: com.yxt.anrui.scm.api.api.scmvehinventorymonth.ScmVehInventorymonthVo
+ * Description: 月度盘库 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Data
+@ApiModel(value = "月度盘库 视图数据对象", description = "月度盘库 视图数据对象")
+public class AppScmVehInventorymonthVo implements Vo {
+
+ private String sid; // sid
+
+ @ApiModelProperty("编号(yyyyMMdd)")
+ private String billNo; // 编号(yyyyMMdd)
+ @ApiModelProperty("创建组织")
+ private String createOrgSid; // 创建组织
+ @ApiModelProperty("创建组织名称")
+ private String createOrgName; // 创建组织名称
+ @ApiModelProperty("使用组织")
+ private String useOrgSid; // 使用组织
+ @ApiModelProperty("使用组织名称")
+ private String useOrgName; // 使用组织名称
+ @ApiModelProperty("剩余盘库记录数量")
+ private String surplusNumber;
+ @ApiModelProperty("盘库记录总数数量")
+ private String totalNumber;
+ @ApiModelProperty("盘亏数量")
+ private String lossNumber;
+ @ApiModelProperty("盘损数量")
+ private String damageNumber;
+ @ApiModelProperty("盘盈数量")
+ private String profitNumber;
+ @ApiModelProperty("实盘数量")
+ private String actualNumber;
+ @ApiModelProperty("是否显示生成报告按钮 剩余盘库记录=0时显示")
+ private Boolean showBtn;
+
+
+
+}
diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeign.java
index 2c6babb992..8769eec4f1 100644
--- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeign.java
+++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeign.java
@@ -25,6 +25,8 @@
*********************************************************/
package com.yxt.anrui.scm.api.scmvehinventorymonth;
+import com.yxt.anrui.scm.api.scmvehicleinventory.AppScmVehicleCarInventoryListPageQuery;
+import com.yxt.anrui.scm.api.scmvehicleinventory.AppScmVehicleCarInventoryListPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.yxt.common.core.query.PagerQuery;
@@ -81,5 +83,11 @@ public interface ScmVehInventorymonthFeign {
@ResponseBody
public ResultBean getInventoryRecords(@PathVariable("userSid") String userSid);
+ @ApiOperation("手机端-获取盘库报告列表")
+ @PostMapping("/getCarInventoryReportList")
+ @ResponseBody
+ public ResultBean> getCarInventoryReportList(@RequestBody PagerQuery pagerQuery);
+
+
}
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeignFallback.java
index 86b6cfa149..6d1261968f 100644
--- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeignFallback.java
+++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthFeignFallback.java
@@ -74,4 +74,9 @@ public class ScmVehInventorymonthFeignFallback implements ScmVehInventorymonthFe
public ResultBean getInventoryRecords(String userSid) {
return null;
}
+
+ @Override
+ public ResultBean> getCarInventoryReportList(PagerQuery pagerQuery) {
+ return null;
+ }
}
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.java
new file mode 100644
index 0000000000..84e780f6f0
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.java
@@ -0,0 +1,65 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.biz.scmvehinventorymonth;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonth;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthVo;
+
+import java.util.List;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventorymonthMapper.java
+ * Class: com.yxt.anrui.scm.api.biz.scmvehinventorymonth.ScmVehInventorymonthMapper
+ * Description: 月度盘库.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Mapper
+public interface ScmVehInventorymonthMapper extends BaseMapper {
+
+ //@Update("update scm_veh_inventorymonth set name=#{msg} where id=#{id}")
+ //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw);
+
+ IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw);
+
+ List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw);
+
+ @Select("select * from scm_veh_inventorymonth")
+ List selectListVo();
+}
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.xml b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.xml
new file mode 100644
index 0000000000..30c3f5f15d
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthMapper.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthRest.java
new file mode 100644
index 0000000000..57edb4b2be
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthRest.java
@@ -0,0 +1,106 @@
+package com.yxt.anrui.scm.biz.scmvehinventorymonth; /*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+
+
+import com.yxt.anrui.scm.api.scmvehinventorymonth.*;
+import com.yxt.anrui.scm.biz.scmvehinventorymonth.ScmVehInventorymonthService;
+import com.yxt.common.core.query.PagerQuery;
+import com.yxt.common.core.result.ResultBean;
+import com.yxt.common.core.vo.PagerVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventorymonthFeignFallback.java
+ * Class: com.yxt.anrui.scm.api.biz.scmvehinventorymonth.ScmVehInventorymonthRest
+ * Description: 月度盘库.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Api(tags = "月度盘库")
+@RestController("com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthRest")
+@RequestMapping("v1/scmvehinventorymonth")
+public class ScmVehInventorymonthRest implements ScmVehInventorymonthFeign {
+
+ @Autowired
+ private ScmVehInventorymonthService scmVehInventorymonthService;
+
+ @Override
+ @ApiOperation("根据条件分页查询数据的列表")
+ @PostMapping("/listPage")
+ public ResultBean> listPage(@RequestBody PagerQuery pq) {
+ ResultBean rb = ResultBean.fireFail();
+ PagerVo pv = scmVehInventorymonthService.listPageVo(pq);
+ return rb.success().setData(pv);
+ }
+
+ @Override
+ @ApiOperation("新增或修改")
+ @PostMapping("/save")
+ public ResultBean save(@RequestBody ScmVehInventorymonthDto dto) {
+ ResultBean rb = ResultBean.fireFail();
+ scmVehInventorymonthService.saveOrUpdateDto(dto);
+ return rb.success();
+ }
+
+ @Override
+ @ApiOperation("根据sid批量删除")
+ @PostMapping("/delBySids")
+ public ResultBean delBySids(@RequestBody String[] sids) {
+ ResultBean rb = ResultBean.fireFail();
+ scmVehInventorymonthService.delBySids(sids);
+ return rb.success();
+ }
+
+ @Override
+ @ApiOperation("根据SID获取一条记录")
+ @GetMapping("/fetchDetailsBySid/{sid}")
+ public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid) {
+ ResultBean rb = ResultBean.fireFail();
+ ScmVehInventorymonthDetailsVo vo = scmVehInventorymonthService.fetchDetailsVoBySid(sid);
+ return rb.success().setData(vo);
+ }
+
+ @Override
+ public ResultBean getInventoryRecords(String userSid) {
+ return scmVehInventorymonthService.getInventoryRecords(userSid);
+ }
+
+ @Override
+ public ResultBean> getCarInventoryReportList(PagerQuery pagerQuery) {
+ return null;
+ }
+}
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java
new file mode 100644
index 0000000000..b0b93d6ac4
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java
@@ -0,0 +1,170 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.biz.scmvehinventorymonth;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yxt.anrui.base.api.basevehicle.AppScmInventoryRecordsVo;
+import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign;
+import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
+import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
+import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
+import com.yxt.anrui.portal.api.sysuser.SysUserVo;
+import com.yxt.anrui.scm.api.scmvehicleinventory.ScmVehicleInventory;
+import com.yxt.anrui.scm.biz.scmvehicleinventory.ScmVehicleInventoryService;
+import org.apache.commons.lang3.StringUtils;
+import com.yxt.common.base.service.MybatisBaseService;
+import com.yxt.common.base.utils.PagerUtil;
+import com.yxt.common.core.query.PagerQuery;
+import com.yxt.common.core.result.ResultBean;
+import com.yxt.common.core.vo.PagerVo;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonth;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthQuery;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthVo;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthDetailsVo;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthDto;
+import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthFeign;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventorymonthService.java
+ * Class: com.yxt.anrui.scm.api.biz.scmvehinventorymonth.ScmVehInventorymonthService
+ * Description: 月度盘库 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Service
+public class ScmVehInventorymonthService extends MybatisBaseService {
+
+ @Autowired
+ SysStaffOrgFeign sysStaffOrgFeign;
+ @Autowired
+ BaseVehicleFeign baseVehicleFeign;
+ @Autowired
+ SysUserFeign sysUserFeign;
+ @Autowired
+ ScmVehicleInventoryService scmVehicleInventoryService;
+
+
+ private QueryWrapper createQueryWrapper(ScmVehInventorymonthQuery query) {
+ // todo: 这里根据具体业务调整查询条件
+ // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
+ QueryWrapper qw = new QueryWrapper<>();
+ return qw;
+ }
+
+ public PagerVo listPageVo(PagerQuery pq) {
+ ScmVehInventorymonthQuery query = pq.getParams();
+ QueryWrapper qw = createQueryWrapper(query);
+ IPage page = PagerUtil.queryToPage(pq);
+ IPage pagging = baseMapper.selectPageVo(page, qw);
+ PagerVo p = PagerUtil.pageToVo(pagging, null);
+ return p;
+ }
+
+ public void saveOrUpdateDto(ScmVehInventorymonthDto dto) {
+ String dtoSid = dto.getSid();
+ if (StringUtils.isBlank(dtoSid)) {
+ this.insertByDto(dto);
+ return;
+ }
+ this.updateByDto(dto);
+ }
+
+ public void insertByDto(ScmVehInventorymonthDto dto) {
+ ScmVehInventorymonth entity = new ScmVehInventorymonth();
+ BeanUtil.copyProperties(dto, entity, "id", "sid");
+ baseMapper.insert(entity);
+ }
+
+ public void updateByDto(ScmVehInventorymonthDto dto) {
+ String dtoSid = dto.getSid();
+ if (StringUtils.isBlank(dtoSid)) {
+ return;
+ }
+ ScmVehInventorymonth entity = fetchBySid(dtoSid);
+ BeanUtil.copyProperties(dto, entity, "id", "sid");
+ baseMapper.updateById(entity);
+ }
+
+ public ScmVehInventorymonthDetailsVo fetchDetailsVoBySid(String sid) {
+ ScmVehInventorymonth entity = fetchBySid(sid);
+ ScmVehInventorymonthDetailsVo vo = new ScmVehInventorymonthDetailsVo();
+ BeanUtil.copyProperties(entity, vo);
+ return vo;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public ResultBean getInventoryRecords(String userSid) {
+ ResultBean rb = ResultBean.fireFail();
+ String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData();
+ SysUserVo sysUserVo = sysUserFeign.fetchBySid(userSid).getData();
+ SysStaffOrg sysStaffOrg = sysStaffOrgFeign.getOrgByStaffSid(sysUserVo.getStaffSid()).getData();
+ boolean inventoryState = scmVehicleInventoryService.getInventoryState(userSid);
+ if (inventoryState) {
+ return rb.setMsg("盘库记录生成失败,记录存在未确认数据");
+ }
+ List list = baseVehicleFeign.selectInventoryRecords(userSid).getData();
+ ScmVehInventorymonth scmVehInventorymonth = new ScmVehInventorymonth();
+ scmVehInventorymonth.setBillNo("");
+ scmVehInventorymonth.setCreateOrgSid(useOrgSid);
+ scmVehInventorymonth.setCreateOrgName(sysStaffOrg.getOrgName());
+ scmVehInventorymonth.setUseOrgSid(useOrgSid);
+ scmVehInventorymonth.setUseOrgName(sysStaffOrg.getOrgName());
+ save(scmVehInventorymonth);
+ list.removeAll(Collections.singleton(null));
+ if (!list.isEmpty()) {
+ for (AppScmInventoryRecordsVo appScmInventoryRecordsVo : list) {
+ ScmVehicleInventory scmVehicleInventory = new ScmVehicleInventory();
+ scmVehicleInventory.setVinNo(appScmInventoryRecordsVo.getVin());
+ scmVehicleInventory.setMainSid(scmVehInventorymonth.getSid());
+ scmVehicleInventory.setLocation(appScmInventoryRecordsVo.getWarehouse());
+ scmVehicleInventory.setLocationSid(appScmInventoryRecordsVo.getWarehouseSid());
+ scmVehicleInventory.setInventoryState("无");
+ scmVehicleInventory.setInventoryStateKey("");
+ scmVehicleInventory.setCreateOrgSid(useOrgSid);
+ scmVehicleInventory.setUseOrgSid(useOrgSid);
+ scmVehicleInventoryService.save(scmVehicleInventory);
+ }
+ } else {
+ return rb.setMsg("暂无需要盘库记录");
+ }
+ return rb.success();
+ }
+}
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.java
new file mode 100644
index 0000000000..1cff5b00bd
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.java
@@ -0,0 +1,65 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.biz.scmvehinventoryreport;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreport;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo;
+
+import java.util.List;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventoryreportMapper.java
+ * Class: com.yxt.anrui.scm.api.biz.scmvehinventoryreport.ScmVehInventoryreportMapper
+ * Description: 盘库报告.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Mapper
+public interface ScmVehInventoryreportMapper extends BaseMapper {
+
+ //@Update("update scm_veh_inventoryreport set name=#{msg} where id=#{id}")
+ //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw);
+
+ IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw);
+
+ List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw);
+
+ @Select("select * from scm_veh_inventoryreport")
+ List selectListVo();
+}
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.xml b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.xml
new file mode 100644
index 0000000000..045bca48fb
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportMapper.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportRest.java
new file mode 100644
index 0000000000..475a96f50c
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportRest.java
@@ -0,0 +1,100 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.biz.scmvehinventoryreport;
+
+import com.yxt.common.core.query.PagerQuery;
+import com.yxt.common.core.result.ResultBean;
+import com.yxt.common.core.vo.PagerVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreport;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportQuery;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDetailsVo;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDto;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportFeign;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventoryreportFeignFallback.java
+ * Class: com.yxt.anrui.scm.api.biz.scmvehinventoryreport.ScmVehInventoryreportRest
+ * Description: 盘库报告.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Api(tags = "盘库报告")
+@RestController("com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportRest")
+@RequestMapping("v1/scmvehinventoryreport")
+public class ScmVehInventoryreportRest implements ScmVehInventoryreportFeign {
+
+ @Autowired
+ private ScmVehInventoryreportService scmVehInventoryreportService;
+
+ @Override
+ @ApiOperation("根据条件分页查询数据的列表")
+ @PostMapping("/listPage")
+ public ResultBean> listPage(@RequestBody PagerQuery pq){
+ ResultBean rb = ResultBean.fireFail();
+ PagerVo pv = scmVehInventoryreportService.listPageVo(pq);
+ return rb.success().setData(pv);
+ }
+
+ @Override
+ @ApiOperation("新增或修改")
+ @PostMapping("/save")
+ public ResultBean save(@RequestBody ScmVehInventoryreportDto dto){
+ ResultBean rb = ResultBean.fireFail();
+ scmVehInventoryreportService.saveOrUpdateDto(dto);
+ return rb.success();
+ }
+
+ @Override
+ @ApiOperation("根据sid批量删除")
+ @PostMapping("/delBySids")
+ public ResultBean delBySids(@RequestBody String[] sids){
+ ResultBean rb = ResultBean.fireFail();
+ scmVehInventoryreportService.delBySids(sids);
+ return rb.success();
+ }
+
+ @Override
+ @ApiOperation("根据SID获取一条记录")
+ @GetMapping("/fetchDetailsBySid/{sid}")
+ public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){
+ ResultBean rb = ResultBean.fireFail();
+ ScmVehInventoryreportDetailsVo vo = scmVehInventoryreportService.fetchDetailsVoBySid(sid);
+ return rb.success().setData(vo);
+ }
+}
diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportService.java
new file mode 100644
index 0000000000..ea7055cae2
--- /dev/null
+++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventoryreport/ScmVehInventoryreportService.java
@@ -0,0 +1,110 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.anrui.scm.biz.scmvehinventoryreport;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.commons.lang3.StringUtils;
+import com.yxt.common.base.service.MybatisBaseService;
+import com.yxt.common.base.utils.PagerUtil;
+import com.yxt.common.core.query.PagerQuery;
+import com.yxt.common.core.result.ResultBean;
+import com.yxt.common.core.vo.PagerVo;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreport;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportQuery;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDetailsVo;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDto;
+import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportFeign;
+
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Project: aaa(aaa)
+ * File: ScmVehInventoryreportService.java
+ * Class: com.yxt.anrui.scm.api.biz.scmvehinventoryreport.ScmVehInventoryreportService
+ * Description: 盘库报告 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-09-16 15:52:05
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Service
+public class ScmVehInventoryreportService extends MybatisBaseService {
+ private QueryWrapper createQueryWrapper(ScmVehInventoryreportQuery query) {
+ // todo: 这里根据具体业务调整查询条件
+ // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
+ QueryWrapper qw = new QueryWrapper<>();
+ return qw;
+ }
+
+ public PagerVo listPageVo(PagerQuery pq) {
+ ScmVehInventoryreportQuery query = pq.getParams();
+ QueryWrapper qw = createQueryWrapper(query);
+ IPage page = PagerUtil.queryToPage(pq);
+ IPage pagging = baseMapper.selectPageVo(page, qw);
+ PagerVo p = PagerUtil.pageToVo(pagging, null);
+ return p;
+ }
+
+ public void saveOrUpdateDto(ScmVehInventoryreportDto dto){
+ String dtoSid = dto.getSid();
+ if (StringUtils.isBlank(dtoSid)) {
+ this.insertByDto(dto);
+ return;
+ }
+ this.updateByDto(dto);
+ }
+
+ public void insertByDto(ScmVehInventoryreportDto dto){
+ ScmVehInventoryreport entity = new ScmVehInventoryreport();
+ BeanUtil.copyProperties(dto, entity, "id", "sid");
+ baseMapper.insert(entity);
+ }
+
+ public void updateByDto(ScmVehInventoryreportDto dto){
+ String dtoSid = dto.getSid();
+ if (StringUtils.isBlank(dtoSid)) {
+ return;
+ }
+ ScmVehInventoryreport entity = fetchBySid(dtoSid);
+ BeanUtil.copyProperties(dto, entity, "id", "sid");
+ baseMapper.updateById(entity);
+ }
+
+ public ScmVehInventoryreportDetailsVo fetchDetailsVoBySid(String sid){
+ ScmVehInventoryreport entity = fetchBySid(sid);
+ ScmVehInventoryreportDetailsVo vo = new ScmVehInventoryreportDetailsVo();
+ BeanUtil.copyProperties(entity, vo);
+ return vo;
+ }
+}
\ No newline at end of file