From 179b3fbc8bf1a7bb0e36b426d93ea94d30260a1c Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Mon, 26 Sep 2022 14:06:04 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=88=86=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E4=B8=8B=E7=9A=84=E9=94=80=E5=94=AE=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=8F=8A=E9=83=A8=E9=97=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysorganization/SysOrganizationFeign.java | 7 +- .../SysOrganizationFeignFallback.java | 5 ++ .../SysOrganizationMapper.java | 3 + .../sysorganization/SysOrganizationMapper.xml | 68 +++++++++++-------- .../sysorganization/SysOrganizationRest.java | 5 ++ .../SysOrganizationService.java | 18 +++++ .../biz/sysstafforg/SysStaffOrgMapper.java | 2 + .../biz/sysstafforg/SysStaffOrgMapper.xml | 14 +++- .../biz/sysstafforg/SysStaffOrgService.java | 4 ++ .../ScmVehicleGressionService.java | 21 +++++- 10 files changed, 115 insertions(+), 32 deletions(-) diff --git a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeign.java b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeign.java index 053588b729..879377e42e 100644 --- a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeign.java +++ b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeign.java @@ -1,6 +1,5 @@ package com.yxt.anrui.portal.api.sysorganization; -import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -8,6 +7,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -134,4 +134,9 @@ public interface SysOrganizationFeign { @ResponseBody @ApiOperation("根据当前用户的所在组织获取当前用户所在的分公司") ResultBean getOrgSid(@PathVariable(value = "sid") String sid); + + @GetMapping("/selectOrgList") + @ResponseBody + @ApiOperation("当前分公司销售部门及部门人员") + ResultBean> selectOrgList(@SpringQueryMap SysOrganizationListQuery query); } \ No newline at end of file diff --git a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeignFallback.java b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeignFallback.java index 6484d77eca..a7bd307be5 100644 --- a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeignFallback.java +++ b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationFeignFallback.java @@ -137,4 +137,9 @@ public class SysOrganizationFeignFallback implements SysOrganizationFeign { public ResultBean getOrgSid(String sid) { return null; } + + @Override + public ResultBean> selectOrgList(SysOrganizationListQuery query) { + return null; + } } \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.java index bd391f31a5..d10355bfe8 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.java @@ -105,4 +105,7 @@ public interface SysOrganizationMapper extends BaseMapper { SysOrgVo getListOrgByBrand(String sid); + List selectOrgList(String orgSid); + + List selectByOrgDeptSid(String orgDeptSid); } \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.xml b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.xml index 707f11b47b..9a0dd40813 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.xml +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationMapper.xml @@ -5,26 +5,26 @@ SELECT * - FROM sys_organization LIMIT 0,1 + FROM sys_organization + LIMIT 0,1 SELECT so.name, so.psid, so.id, so.sid, so.orgSidPath FROM sys_organization so - WHERE isDept = 0 AND so.sid = #{sid} + WHERE isDept = 0 + AND so.sid = #{sid} ORDER BY psid + + + + \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationRest.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationRest.java index 7ecd5563b7..eaa7f0230c 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationRest.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationRest.java @@ -356,4 +356,9 @@ public class SysOrganizationRest implements SysOrganizationFeign { String orgSid = sysOrganizationService.getOrgSid(sid); return rb.success().setData(orgSid); } + + @Override + public ResultBean> selectOrgList(SysOrganizationListQuery query) { + return sysOrganizationService.selectOrgList(query); + } } diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationService.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationService.java index ca0e262de6..31f1711941 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationService.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysorganization/SysOrganizationService.java @@ -477,4 +477,22 @@ public class SysOrganizationService extends MybatisBaseService> selectOrgList(SysOrganizationListQuery query) { + ResultBean> rb = ResultBean.fireFail(); + //根据用户sid查询分公司sid + String orgDeptSid = sysStaffOrgService.selectByUserSid(query.getUserSid()); + String orgSid = getOrgSid(orgDeptSid); + //根据分公司名称查询销售部门的部门 + List sysOrganizationListVos = baseMapper.selectOrgList(orgSid); + sysOrganizationListVos.removeAll(Collections.singleton(null)); + if (!sysOrganizationListVos.isEmpty()) { + for (SysOrganizationListVo vo : sysOrganizationListVos) { + orgDeptSid = vo.getOrgDeptSid(); + List sysOrgStaffVoList = baseMapper.selectByOrgDeptSid(orgDeptSid); + vo.setStaffinfoVoList(sysOrgStaffVoList); + } + } + return rb.success().setData(sysOrganizationListVos); + } } \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.java index 9384ef8d24..280bd0fc5c 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.java @@ -102,4 +102,6 @@ public interface SysStaffOrgMapper extends BaseMapper { List selectByStaffS(String staffSid); List selectByOrgSid(String sid); + + String selectByUserSid(String userSid); } \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.xml b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.xml index 1cbe120b0e..c6b98ab524 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.xml +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgMapper.xml @@ -90,6 +90,18 @@ + + \ No newline at end of file diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgService.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgService.java index 79cdc7715c..8afbc56ccb 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgService.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstafforg/SysStaffOrgService.java @@ -281,4 +281,8 @@ public class SysStaffOrgService extends MybatisBaseService selectByOrgSid(String sid) { return baseMapper.selectByOrgSid(sid); } + + public String selectByUserSid(String userSid) { + return baseMapper.selectByUserSid(userSid); + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java index 15bc378e61..87f03503ff 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java @@ -677,10 +677,25 @@ public class ScmVehicleGressionService extends MybatisBaseService scmVehicleGressionVehDtos = dto.getScmVehicleGressionVehs(); + String vinNo = ""; + for (ScmVehicleGressionVehDto v : scmVehicleGressionVehDtos) { + //根据车辆sid查询存放地点是否与该存放地点一致。将不一致的查询出来 + ResultBean baseVehicleSelectVoResultBean = baseVehicleFeign.details(v.getVehSid()); + if (!baseVehicleSelectVoResultBean.getSuccess()) { + return rb.setMsg("选择的车辆中包含车辆不存在的数据"); + } + BaseVehicleSelectVo baseVehicleSelectVo = baseVehicleSelectVoResultBean.getData(); + if (!dto.getLocationSid().equals(baseVehicleSelectVo.getLocation())) { + vinNo = v.getVehVin() + ","; + } + } + if (StringUtils.isNotBlank(vinNo)) { + vinNo = vinNo.replace(",", ""); + return rb.setMsg(vinNo + "的车辆不再该现存放地点内"); + } + //判断要提交的车辆sid是否存在于临时表中 for (ScmVehicleGressionVehDto v : scmVehicleGressionVehDtos) { List carSidList = baseVehicleTempstateFeign.selectAll("001").getData(); for (BaseVehicleTempstateVo vv : carSidList) { From 56ee3c48fbd86d7c968d71f883794e85d6f5ae1f Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Mon, 26 Sep 2022 14:10:17 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=88=86=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E4=B8=8B=E7=9A=84=E9=94=80=E5=94=AE=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=8F=8A=E9=83=A8=E9=97=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/sysorganization/SysOrgStaffVo.java | 17 ++++++++++++++ .../SysOrganizationListQuery.java | 16 +++++++++++++ .../SysOrganizationListVo.java | 23 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrgStaffVo.java create mode 100644 anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListQuery.java create mode 100644 anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListVo.java diff --git a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrgStaffVo.java b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrgStaffVo.java new file mode 100644 index 0000000000..64b868b1ee --- /dev/null +++ b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrgStaffVo.java @@ -0,0 +1,17 @@ +package com.yxt.anrui.portal.api.sysorganization; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/26 11:48 + * @Description + */ +@Data +public class SysOrgStaffVo implements Vo { + private static final long serialVersionUID = -4311553944345419092L; + + private String staffName; + private String staffSid; +} diff --git a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListQuery.java b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListQuery.java new file mode 100644 index 0000000000..debd0cf119 --- /dev/null +++ b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListQuery.java @@ -0,0 +1,16 @@ +package com.yxt.anrui.portal.api.sysorganization; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/26 11:49 + * @Description + */ +@Data +public class SysOrganizationListQuery implements Query { + private static final long serialVersionUID = 8657016527420117948L; + + private String userSid; +} diff --git a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListVo.java b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListVo.java new file mode 100644 index 0000000000..584bfb9b3b --- /dev/null +++ b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysorganization/SysOrganizationListVo.java @@ -0,0 +1,23 @@ +package com.yxt.anrui.portal.api.sysorganization; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.List; + +/** + * @Author dimengzhe + * @Date 2022/9/26 11:42 + * @Description + */ +@Data +public class SysOrganizationListVo implements Vo { + private static final long serialVersionUID = -3709239161608411765L; + + private String orgDeptSid; + private String orgDeptName; + + private List staffinfoVoList; + + +} From 8a66320f8b0d8a148fe67345f148ae5df10b3c7e Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Mon, 26 Sep 2022 14:49:00 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=88=86=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E4=B8=8B=E4=B8=9A=E5=8A=A1=E5=91=98=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E5=AE=A2=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crmcustomertemp/CrmCustomerTempFeign.java | 8 +++++++- .../CrmCustomerTempFeignFallback.java | 5 +++++ .../CrmCustomerTempListQuery.java | 17 +++++++++++++++++ .../CrmCustomerTempListVo.java | 19 +++++++++++++++++++ .../CrmCustomerTempMapper.java | 1 + .../crmcustomertemp/CrmCustomerTempMapper.xml | 7 +++++++ .../crmcustomertemp/CrmCustomerTempRest.java | 5 +++++ .../CrmCustomerTempService.java | 13 +++++++++++++ doc/databases/base_tables.sql | 2 ++ 9 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListQuery.java create mode 100644 anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListVo.java diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java index d07dc6c1e2..93b80f3b8b 100644 --- a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java @@ -8,6 +8,7 @@ import com.yxt.common.core.vo.PagerVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -149,6 +150,11 @@ public interface CrmCustomerTempFeign { @ResponseBody @GetMapping("/selectCustomerFile/{customerSid}") - public ResultBean> selectCustomerFile(@PathVariable("customerSid")String customerSid); + public ResultBean> selectCustomerFile(@PathVariable("customerSid") String customerSid); + + @ResponseBody + @GetMapping("/selectCustomerList") + @ApiOperation("查询该分公司业务员下的客户列表") + ResultBean> selectCustomerList(@SpringQueryMap CrmCustomerTempListQuery query); } \ No newline at end of file diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java index 551ea612e5..082e12e22f 100644 --- a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java @@ -120,5 +120,10 @@ public class CrmCustomerTempFeignFallback implements CrmCustomerTempFeign { return null; } + @Override + public ResultBean> selectCustomerList(CrmCustomerTempListQuery query) { + return null; + } + } \ No newline at end of file diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListQuery.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListQuery.java new file mode 100644 index 0000000000..97255c2000 --- /dev/null +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListQuery.java @@ -0,0 +1,17 @@ +package com.yxt.anrui.crm.api.crmcustomertemp; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/26 14:30 + * @Description + */ +@Data +public class CrmCustomerTempListQuery implements Query { + private static final long serialVersionUID = -8235453055415557265L; + + private String userSid; + private String staffSid; +} diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListVo.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListVo.java new file mode 100644 index 0000000000..5c7958c9df --- /dev/null +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempListVo.java @@ -0,0 +1,19 @@ +package com.yxt.anrui.crm.api.crmcustomertemp; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/26 14:28 + * @Description + */ +@Data +public class CrmCustomerTempListVo implements Vo { + private static final long serialVersionUID = 5338688085476236821L; + + private String name; + private String sid; + private String mobile; + +} diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.java b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.java index d717d7a8b4..2105142b36 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.java +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.java @@ -118,4 +118,5 @@ public interface CrmCustomerTempMapper extends BaseMapper { CrmCustomerTempVo selByMobile(@Param("mobile") String mobile); + List selectCustomerList(@Param("orgSid") String orgSid, @Param("staffSid") String staffSid); } \ No newline at end of file diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.xml b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.xml index 2fc3dc7661..ffe5a53526 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.xml +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempMapper.xml @@ -205,4 +205,11 @@ FROM crm_customer_temp WHERE mobile = #{mobile} + + \ No newline at end of file diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java index 040143a4fa..faaed9f779 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java @@ -268,5 +268,10 @@ public class CrmCustomerTempRest implements CrmCustomerTempFeign { return crmCustomerFileService.selectCustomerFile(customerSid); } + @Override + public ResultBean> selectCustomerList(CrmCustomerTempListQuery query) { + return crmCustomerTempService.selectCustomerList(query); + } + } diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java index 96088ff15a..c2dcddd659 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java @@ -23,6 +23,7 @@ import com.yxt.anrui.crm.biz.crmvehicledemand.CrmVehicledemandService; import com.yxt.anrui.crm.biz.crmvisit.CrmVisitService; import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; import com.yxt.anrui.portal.api.dictcommon.DictCommonVo; +import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; import com.yxt.anrui.portal.api.sysuser.SysUserFeign; import com.yxt.anrui.portal.api.sysuser.SysUserInfoVo; import com.yxt.anrui.portal.api.sysuser.SysUserVo; @@ -85,6 +86,8 @@ public class CrmCustomerTempService extends MybatisBaseService listPage(PagerQuery pq) { @@ -877,4 +880,14 @@ public class CrmCustomerTempService extends MybatisBaseService> selectCustomerList(CrmCustomerTempListQuery query) { + ResultBean> rb = ResultBean.fireFail(); + String staffSid = query.getStaffSid(); + //根据用户sid查询分公司sid + String orgSid = sysStaffOrgFeign.getPathSidByUserSid(query.getUserSid()).getData(); + List list = baseMapper.selectCustomerList(orgSid, staffSid); + list.removeAll(Collections.singleton(null)); + return rb.success().setData(list); + } } \ No newline at end of file diff --git a/doc/databases/base_tables.sql b/doc/databases/base_tables.sql index 3cfd4399d8..7c3c4e040f 100644 --- a/doc/databases/base_tables.sql +++ b/doc/databases/base_tables.sql @@ -922,8 +922,10 @@ CREATE TABLE `base_vehicle_out` `isTerminal` varchar(64) DEFAULT NULL COMMENT '是否为终端客户', `customerName` varchar(255) DEFAULT NULL COMMENT '客户名称', `mobile` varchar(255) DEFAULT NULL COMMENT '手机号', + `customerSid` varchar(255) DEFAULT NULL COMMENT '客户sid', `actualCustomer` varchar(255) DEFAULT NULL COMMENT '实际购车人名称', `actualMobile` varchar(255) DEFAULT NULL COMMENT '实际购车人手机号', + `actualSid` varchar(255) DEFAULT NULL COMMENT '实际购车人sid', `giftsDescription` varchar(255) DEFAULT NULL COMMENT '赠品说明', `distributorName` varchar(255) DEFAULT NULL COMMENT '二次经销商', `rebateAmount` varchar(255) DEFAULT NULL COMMENT '返利金额', From 7e2db685f5a7356e10b0854582f3f03f8965d6c0 Mon Sep 17 00:00:00 2001 From: hp <2969694837@qq.com> Date: Mon, 26 Sep 2022 14:54:50 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anrui/base/biz/basevehicle/BaseVehicleService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java index 9fcb95ffcb..82db1d4e63 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java @@ -803,7 +803,7 @@ public class BaseVehicleService extends MybatisBaseService wrapper.eq("bv.vehicleState", VehicleState.StockEnum.STOCK.getCode()).or().eq("bv.vehicleState", VehicleState.StockEnum.ING_STOCK.getCode()).or().eq("bv.vehicleState", VehicleState.StockEnum.DR_STOCK.getCode())); qw.eq("bv.lockedState", VehicleState.LockEnum.UN_LOCK.getCode()); - qw.eq("bv.isProblemVeh","0"); + qw.eq("bv.isProblemVeh", "0"); } return qw; } @@ -1697,7 +1697,9 @@ public class BaseVehicleService extends MybatisBaseService qw = new QueryWrapper<>(); qw.and(wrapper -> wrapper.eq("bv.vehicleState", VehicleState.StockEnum.STOCK.getCode()).or().eq("bv.vehicleState", VehicleState.StockEnum.RETURNING_STOCK.getCode()).or().eq("bv.vehicleState", VehicleState.StockEnum.DCZ_STOCK.getCode()).or().eq("bv.vehicleState", VehicleState.StockEnum.DR_STOCK.getCode())); - qw.notIn("bv.vinNo", vinNoList); + if (vinNoList.size() > 0) { + qw.notIn("bv.vinNo", vinNoList); + } List list = baseMapper.selectInventoryRecords(userOrgSid, qw); return rb.success().setData(list); } From f2e5fc8265be50f8bc92d94ef0bb982ca8ebf433 Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Mon, 26 Sep 2022 15:36:12 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=BB=8F=E9=94=80?= =?UTF-8?q?=E5=95=86=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basedistributor/BaseDistributorFeign.java | 4 ++++ .../BaseDistributorFeignFallback.java | 5 +++++ .../BaseDistributorListQuery.java | 16 ++++++++++++++++ .../BaseDistributorListVo.java | 19 +++++++++++++++++++ .../api/basevehicleout/BaseVehicleOut.java | 6 ++++++ .../api/basevehicleout/BaseVehicleOutDto.java | 6 ++++++ .../BaseDistributorMapper.java | 2 ++ .../basedistributor/BaseDistributorMapper.xml | 7 +++++++ .../basedistributor/BaseDistributorRest.java | 5 +++++ .../BaseDistributorService.java | 8 ++++++++ doc/databases/base_tables.sql | 1 + 11 files changed, 79 insertions(+) create mode 100644 anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListQuery.java create mode 100644 anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListVo.java diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java index 7c83a164d8..794e441b6a 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java @@ -132,4 +132,8 @@ public interface BaseDistributorFeign { @ApiOperation("移动-经销商附件清单保存修改") @PostMapping("/saveDistributorFileInfo") ResultBean saveDistributorFileInfo(@RequestBody BaseFileDto dto); + + @ApiOperation("二级经销商列表") + @GetMapping("/selectDisList") + ResultBean> selectDisList(@SpringQueryMap BaseDistributorListQuery query); } \ No newline at end of file diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java index 6db9939ee8..fb16cd8006 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java @@ -142,5 +142,10 @@ public class BaseDistributorFeignFallback implements BaseDistributorFeign { return null; } + @Override + public ResultBean> selectDisList(BaseDistributorListQuery query) { + return null; + } + } \ No newline at end of file diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListQuery.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListQuery.java new file mode 100644 index 0000000000..479d5547df --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListQuery.java @@ -0,0 +1,16 @@ +package com.yxt.anrui.base.api.basedistributor; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/26 15:11 + * @Description + */ +@Data +public class BaseDistributorListQuery implements Query { + private static final long serialVersionUID = -7474049355274135681L; + + private String userSid; +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListVo.java new file mode 100644 index 0000000000..bcf7c1ae9c --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorListVo.java @@ -0,0 +1,19 @@ +package com.yxt.anrui.base.api.basedistributor; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/26 14:56 + * @Description + */ +@Data +public class BaseDistributorListVo implements Vo { + private static final long serialVersionUID = 7567158573644935938L; + + private String name; + private String sid; + + +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOut.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOut.java index 82962a33e2..a6ff4431ed 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOut.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOut.java @@ -48,4 +48,10 @@ public class BaseVehicleOut extends BaseEntity { private String actualCustomer; @ApiModelProperty("实际购车人电话") private String actualMobile; + @ApiModelProperty("实际购车人sid") + private String actualSid; + @ApiModelProperty("二次经销商sid") + private String distributorSid; + @ApiModelProperty("客户sid") + private String customerSid; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOutDto.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOutDto.java index f37830d579..1ac6a38eb3 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOutDto.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicleout/BaseVehicleOutDto.java @@ -35,12 +35,16 @@ public class BaseVehicleOutDto implements Dto { private String isTerminal; @ApiModelProperty("客户名称") private String customerName; + @ApiModelProperty("客户sid") + private String customerSid; @ApiModelProperty("手机号") private String mobile; @ApiModelProperty("赠品说明") private String giftsDescription; @ApiModelProperty("二次经销商") private String distributorName; + @ApiModelProperty("二次经销商sid") + private String distributorSid; @ApiModelProperty("返利金额") private String rebateAmount; @@ -48,4 +52,6 @@ public class BaseVehicleOutDto implements Dto { private String actualCustomer; @ApiModelProperty("实际购车人电话") private String actualMobile; + @ApiModelProperty("实际购车人sid") + private String actualSid; } diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java index b72e173bfa..d7f72222c9 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java @@ -118,4 +118,6 @@ public interface BaseDistributorMapper extends BaseMapper { BaseDistributor selectBySidOne(String sid); void updateInvoiceBySid(@Param("invoBankNum") String invoBankNum, @Param("invoBank") String invoBank, @Param("invoPhone") String invoPhone, @Param("sid") String sid); + + List selectDisList(String orgSid); } \ No newline at end of file diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml index 18b9d8ee81..0532174017 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml @@ -187,4 +187,11 @@ invoBank = #{invoBank} where sid = #{sid} + + \ No newline at end of file diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorRest.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorRest.java index 91cd29691e..47d494a470 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorRest.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorRest.java @@ -249,4 +249,9 @@ public class BaseDistributorRest implements BaseDistributorFeign { public ResultBean saveDistributorFileInfo(BaseFileDto dto) { return baseDistributorService.saveDistributorFileInfo(dto); } + + @Override + public ResultBean> selectDisList(BaseDistributorListQuery query) { + return baseDistributorService.selectDisList(query); + } } diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorService.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorService.java index d40b991726..73d932ea70 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorService.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorService.java @@ -754,4 +754,12 @@ public class BaseDistributorService extends MybatisBaseService> selectDisList(BaseDistributorListQuery query) { + ResultBean> rb = ResultBean.fireFail(); + String orgSid = sysStaffOrgFeign.getPathSidByUserSid(query.getUserSid()).getData(); + List list = baseMapper.selectDisList(orgSid); + list.removeAll(Collections.singleton(null)); + return rb.success().setData(list); + } } \ No newline at end of file diff --git a/doc/databases/base_tables.sql b/doc/databases/base_tables.sql index 7c3c4e040f..f9fb530dbb 100644 --- a/doc/databases/base_tables.sql +++ b/doc/databases/base_tables.sql @@ -928,6 +928,7 @@ CREATE TABLE `base_vehicle_out` `actualSid` varchar(255) DEFAULT NULL COMMENT '实际购车人sid', `giftsDescription` varchar(255) DEFAULT NULL COMMENT '赠品说明', `distributorName` varchar(255) DEFAULT NULL COMMENT '二次经销商', + `distributorSid` varchar(255) DEFAULT NULL COMMENT '二次经销商sid', `rebateAmount` varchar(255) DEFAULT NULL COMMENT '返利金额', PRIMARY KEY (`id`), KEY `id` (`id`) From a63925a0174137a978cd136da9f1a0ec01459863 Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Mon, 26 Sep 2022 17:04:21 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9C=AA=E5=94=AE=E4=B9=B0=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseVehicleActualSalesService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleactualsales/BaseVehicleActualSalesService.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleactualsales/BaseVehicleActualSalesService.java index dd3dfefb6d..dd68005c4f 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleactualsales/BaseVehicleActualSalesService.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleactualsales/BaseVehicleActualSalesService.java @@ -382,6 +382,16 @@ public class BaseVehicleActualSalesService extends MybatisBaseService detailsList = dto.getDetailsList(); + for (BaseVehicleActualDetailsDto f : detailsList) { + BaseVehicle baseVehicle = baseVehicleService.selectByVinNoAndOrgSid(f.getVinNo(), useOrgSid); + baseVehicle.setVinNo(f.getVinNo()); + baseVehicle.setSettlementStatus(VehicleState.BuyoutEnum.PRE_BUYOUT.getCode()); + baseVehicle.setSettlementStatusValue(VehicleState.BuyoutEnum.PRE_BUYOUT.getRemarks()); + baseVehicleService.updateVeh(baseVehicle); + } bv.setTaskId(baseVehicleActualSales.getTaskId()); bv.setTaskDefKey(baseVehicleActualSales.getNodeId()); bv.setComment("重新提交"); From 96eb82303971b6f65565566ce80f1ec7dd634347 Mon Sep 17 00:00:00 2001 From: God <10745413@qq.com> Date: Mon, 26 Sep 2022 17:47:35 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9,PC?= =?UTF-8?q?=E7=9B=98=E5=BA=93=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scmspecialrebate/ScmSpecialRebateVo.java | 3 +- .../ScmSpecialRebateWithApplyVo.java | 2 +- .../ScmVehicleInventoryFeign.java | 5 ++ .../ScmVehicleInventoryFeignFallback.java | 5 ++ .../ScmVehicleInventoryQuery.java | 2 +- .../ScmVehicleInventoryVo.java | 6 +- .../ScmVehicleStayInventoryQuery.java | 58 +++++++++++++++++++ .../AppScmVehInventorymonthVo.java | 2 - .../ScmVehInventorymonthFeign.java | 2 +- .../ScmVehInventorymonthQuery.java | 20 +++---- .../ScmVehInventorymonthVo.java | 36 ++++++++---- .../ScmSpecialRebateRest.java | 17 ++++++ .../ScmSpecialRebateService.java | 7 +-- .../ScmSpecialRebateWithMapper.java | 3 + .../ScmSpecialRebateWithMapper.xml | 4 ++ .../ScmSpecialRebateWithService.java | 5 ++ .../ScmVehicleInventoryRest.java | 7 +++ .../ScmVehicleInventoryService.java | 25 +++++++- .../ScmVehInventorymonthMapper.xml | 10 +++- .../ScmVehInventorymonthService.java | 37 +++++++++++- 20 files changed, 216 insertions(+), 40 deletions(-) create mode 100644 anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleStayInventoryQuery.java diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebate/ScmSpecialRebateVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebate/ScmSpecialRebateVo.java index 8cc0034591..e328f83d33 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebate/ScmSpecialRebateVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebate/ScmSpecialRebateVo.java @@ -74,7 +74,8 @@ public class ScmSpecialRebateVo implements Vo { @ApiModelProperty("预计返利") private String estimateRebate; // 预计返利 @ApiModelProperty("预提日期") - private String withholdingDate; // 预提日期 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date withholdingDate; // 预提日期 @ApiModelProperty("预提日期(页面展示)") private String withholdingDateCopy; // 预提日期(页面展示) @ApiModelProperty("上传日期") diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyVo.java index 61e03989ea..1820960eff 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyVo.java @@ -64,7 +64,7 @@ public class ScmSpecialRebateWithApplyVo implements Vo { @ApiModelProperty("预提申请") private String withApply; // 预提申请 @ApiModelProperty("预提返利合计") - private String withRebateTotal; // 预提返利合计 + private Integer withRebateTotal; // 预提返利合计 @ApiModelProperty("创建人姓名") private String createByName; // 创建人姓名 @ApiModelProperty("使用组织sid") diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeign.java index ee9c33a61b..59b134a48f 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeign.java @@ -59,6 +59,11 @@ public interface ScmVehicleInventoryFeign { @ResponseBody public ResultBean> listPage(@RequestBody PagerQuery pq); + @ApiOperation("待盘库记录列表") + @PostMapping("/stayListPage") + @ResponseBody + public ResultBean> stayListPage(@RequestBody PagerQuery pq); + @ApiOperation("盘库修改状态") @PostMapping("/updateState") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeignFallback.java index 8da5a7d7c2..fd63d33de2 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryFeignFallback.java @@ -52,6 +52,11 @@ public class ScmVehicleInventoryFeignFallback implements ScmVehicleInventoryFeig return rb.setMsg("接口anrui_scm/scmvehicleinventory/listPage无法访问"); } + @Override + public ResultBean> stayListPage(PagerQuery pq) { + return null; + } + @Override public ResultBean updateState(String sid, String inventoryStateKey, String inventoryState, String certificateKey, String certificate, String remarks) { return null; diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryQuery.java index 44b1b1fbbb..d1a6f04421 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryQuery.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryQuery.java @@ -51,7 +51,7 @@ import lombok.Data; public class ScmVehicleInventoryQuery implements Query { @ApiModelProperty("车架号") - private String mainSid; // 车架号 + private String vinNo; // 车架号 @ApiModelProperty("盘库开始日期") @JsonProperty("InventStartDate") private String InventStartDate; diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryVo.java index 2f27047514..75cdbe5d91 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleInventoryVo.java @@ -56,9 +56,13 @@ public class ScmVehicleInventoryVo implements Vo { private String sid; // sid @ApiModelProperty("车架号") - private String mainSid; // 车架号 + private String vinNo; // 车架号 + @ApiModelProperty("主表sid") + private String mainSid; // 主表sid @ApiModelProperty("存放地点") private String location; // 存放地点 + @ApiModelProperty("存放地点sid") + private String locationSid; // 存放地点sid @ApiModelProperty("盘库日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date InventoryDate; // 盘库日期 diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleStayInventoryQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleStayInventoryQuery.java new file mode 100644 index 0000000000..5d6f62054a --- /dev/null +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/ScmVehicleStayInventoryQuery.java @@ -0,0 +1,58 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.scm.api.scmvehicleinventory; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui_scm(anrui_scm)
+ * File: ScmVehicleInventoryQuery.java
+ * Class: anrui_scm.api.scmvehicleinventory.ScmVehicleInventoryQuery
+ * Description: 盘库记录 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-06-15 14:30:59
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "盘库记录 查询条件", description = "盘库记录 查询条件") +public class ScmVehicleStayInventoryQuery implements Query { + + @ApiModelProperty("车架号") + private String vinNo; // 车架号 + @ApiModelProperty("存放地点sid") + private String locationSid; // 存放地点sid + @ApiModelProperty("创建组织") + private String createOrgSid; // 创建组织 +} 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 index 3a2e806918..b2f0bb47e6 100644 --- 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 @@ -83,6 +83,4 @@ public class AppScmVehInventorymonthVo implements Vo { private String normalNumber; @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 dbc05bcfcf..6c375289ee 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 @@ -58,7 +58,7 @@ import java.util.List; fallback = ScmVehInventorymonthFeignFallback.class) public interface ScmVehInventorymonthFeign { - @ApiOperation("根据条件分页查询数据的列表") + @ApiOperation("PC端-获取盘库报告列表") @PostMapping("/listPage") @ResponseBody public ResultBean> listPage(@RequestBody PagerQuery pq); diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthQuery.java index bbb8f2367f..989c721f5d 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthQuery.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthQuery.java @@ -26,6 +26,7 @@ package com.yxt.anrui.scm.api.scmvehinventorymonth; +import com.fasterxml.jackson.annotation.JsonProperty; import com.yxt.common.core.query.Query; import io.swagger.annotations.ApiModel; @@ -49,15 +50,12 @@ import lombok.Data; @ApiModel(value = "月度盘库 查询条件", description = "月度盘库 查询条件") public class ScmVehInventorymonthQuery implements Query { - @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 createByName; + @ApiModelProperty("创建开始日期") + private String createStartTime; // 创建开始日期 + @ApiModelProperty("创建结束日期") + private String createEndTime; // 创建结束日期 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java index edbbbdfd6c..286280f908 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java @@ -26,6 +26,7 @@ package com.yxt.anrui.scm.api.scmvehinventorymonth; +import com.fasterxml.jackson.annotation.JsonFormat; import com.yxt.common.core.vo.Vo; import io.swagger.annotations.ApiModel; @@ -52,18 +53,29 @@ import java.util.Date; public class ScmVehInventorymonthVo implements Vo { private String sid; // sid - - @ApiModelProperty("编号(yyyyMMdd)") + @ApiModelProperty("生成报告状态") + private String state; + @ApiModelProperty("编号(yyyyMMdd)") private String billNo; // 编号(yyyyMMdd) @ApiModelProperty("创建时间") - private Date createTime; // 使用组织名称 - @ApiModelProperty("创建组织") - private String createOrgSid; // 创建组织 - @ApiModelProperty("创建组织名称") - private String createOrgName; // 创建组织名称 - @ApiModelProperty("使用组织") - private String useOrgSid; // 使用组织 - @ApiModelProperty("使用组织名称") - private String useOrgName; // 使用组织名称 - + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date createTime; // + @ApiModelProperty("创建人") + private String createByName; + @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("正常数量") + private String normalNumber; + @ApiModelProperty("是否显示生成报告按钮 剩余盘库记录=0时显示") + private Boolean showBtn; } diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateRest.java index 7576ff1277..144c7dfb33 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateRest.java @@ -26,7 +26,11 @@ package com.yxt.anrui.scm.biz.scmspecialrebate; import com.yxt.anrui.scm.api.scmspecialrebate.*; +import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApply; +import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyVo; import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebate; +import com.yxt.anrui.scm.biz.scmspecialrebatewith.ScmSpecialRebateWithService; +import com.yxt.anrui.scm.biz.scmspecialrebatewithapply.ScmSpecialRebateWithApplyService; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -35,6 +39,8 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * Project: anrui-scm(专项返利管理)
* File: ScmSpecialRebateFeignFallback.java
@@ -55,6 +61,10 @@ public class ScmSpecialRebateRest implements ScmSpecialRebateFeign { @Autowired private ScmSpecialRebateService scmSpecialRebateService; + @Autowired + private ScmSpecialRebateWithService scmSpecialRebateWithService; + @Autowired + private ScmSpecialRebateWithApplyService scmSpecialRebateWithApplyService; @Override @ApiOperation("根据条件分页查询数据的列表") @@ -85,6 +95,13 @@ public class ScmSpecialRebateRest implements ScmSpecialRebateFeign { public ResultBean delBySids(@RequestBody String[] sids){ ResultBean rb = ResultBean.fireFail(); for (String sid : sids) { + List stringList = scmSpecialRebateWithService.fetchBySpecialReBateSid(sid); + for (String s : stringList) { + ScmSpecialRebateWithApply scmSpecialRebateWithApply = scmSpecialRebateWithApplyService.fetchBySid(s); + if (!scmSpecialRebateWithApply.getNodeState().equals("待提交")){ + return rb.setMsg("所选数据中包含已提交专项返利信息,无法删除"); + } + } ScmSpecialRebate scmSpecialRebate = scmSpecialRebateService.fetchBySid(sid); Integer state = scmSpecialRebate.getState(); if (state == 1){ diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateService.java index 09a459ce51..8a3d99151e 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebate/ScmSpecialRebateService.java @@ -227,10 +227,9 @@ public class ScmSpecialRebateService extends MybatisBaseService page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); for (ScmSpecialRebateVo record : pagging.getRecords()) { - String withholdingDate = record.getWithholdingDate(); - Date parse = DateUtil.parse(withholdingDate); - int year = DateUtil.year(parse); - int month = DateUtil.month(parse) + 1; + Date withholdingDate = record.getWithholdingDate(); + int year = DateUtil.year(withholdingDate); + int month = DateUtil.month(withholdingDate) + 1; String withholdingDateCopy = year + "年" + month + "月"; record.setWithholdingDateCopy(withholdingDateCopy); } diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.java index 12c23b74fb..ec6a9eaf7a 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.java @@ -38,6 +38,7 @@ import com.yxt.anrui.scm.api.scmspecialrebatewith.ScmSpecialRebateWith; import com.yxt.anrui.scm.api.scmspecialrebatewith.ScmSpecialRebateWithVo; import java.util.List; +import java.util.Map; /** * Project: anrui-scm(专项返利)
@@ -72,4 +73,6 @@ public interface ScmSpecialRebateWithMapper extends BaseMapper fetchSpecialReBateSidByMainSid(String businessSid); + + List fetchBySpecialReBateSid(String sid); } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.xml b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.xml index 81d0c7d72f..c4c0d9e010 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.xml +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithMapper.xml @@ -29,4 +29,8 @@ WHERE ssrw.`mainSid` = #{sid} GROUP BY ssr.`calculationModeKey` + + \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithService.java index e2a7714fb3..3d78a28d34 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewith/ScmSpecialRebateWithService.java @@ -48,6 +48,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * Project: anrui-scm(专项返利)
@@ -140,4 +141,8 @@ public class ScmSpecialRebateWithService extends MybatisBaseService fetchBySpecialReBateSid(String sid) { + return baseMapper.fetchBySpecialReBateSid(sid); + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryRest.java index 32b4ce38ff..5b0a10c4f5 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryRest.java @@ -70,6 +70,13 @@ public class ScmVehicleInventoryRest implements ScmVehicleInventoryFeign { return rb.success().setData(pv); } + @Override + public ResultBean> stayListPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = scmVehicleInventoryService.stayListPage(pq); + return rb.success().setData(pv); + } + @Override public ResultBean updateState(String sid, String inventoryStateKey, String inventoryState, String certificateKey, String certificate, String remarks) { return scmVehicleInventoryService.updateState(sid, inventoryStateKey, inventoryState, remarks); diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryService.java index ff3183a3c3..f0056a8c64 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryService.java @@ -35,6 +35,7 @@ import com.yxt.anrui.base.api.basevehicle.BaseVehicleVo; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; import com.yxt.anrui.scm.api.scmfile.ScmFile; import com.yxt.anrui.scm.api.scmvehicleinventory.*; +import com.yxt.anrui.scm.api.scmvehicleinventory.ScmVehicleStayInventoryQuery; import com.yxt.anrui.scm.api.scmvehiclepatrolinspectionsheet.ScmVehiclePatrolinspectionsheetDto; import com.yxt.anrui.scm.api.scmvehiclestayinventory.*; import com.yxt.anrui.scm.api.scmvehinventorymonth.AppScmVehInventorymonthVo; @@ -104,8 +105,8 @@ public class ScmVehicleInventoryService extends MybatisBaseService qw = new QueryWrapper<>(); qw.eq("createOrgSid", query.getCreateOrgSid()); - if (StringUtils.isNotBlank(query.getMainSid())) { - qw.like("mainSid", query.getMainSid()); + if (StringUtils.isNotBlank(query.getVinNo())) { + qw.like("vinNo", query.getVinNo()); } if (StringUtils.isNotBlank(query.getLocationSid())) { qw.eq("locationSid", query.getLocationSid()); @@ -113,14 +114,34 @@ public class ScmVehicleInventoryService extends MybatisBaseService= date_format('" + inventStartDate + "','%Y-%m-%d')"). apply(StringUtils.isNotEmpty(inventEndDate), "date_format (InventoryDate,'%Y-%m-%d') <= date_format('" + inventEndDate + "','%Y-%m-%d')" ); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + public PagerVo stayListPage(PagerQuery pq) { + ScmVehicleStayInventoryQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("createOrgSid", query.getCreateOrgSid()); + if (StringUtils.isNotBlank(query.getVinNo())) { + qw.like("vinNo", query.getVinNo()); + } + if (StringUtils.isNotBlank(query.getLocationSid())) { + qw.eq("locationSid", query.getLocationSid()); + } + qw.eq("InventoryStateKey", ""); IPage page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); + for (ScmVehicleInventoryVo record : pagging.getRecords()) { + record.setInventoryState(""); + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } 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 index 5c17002d35..c881494b05 100644 --- 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 @@ -4,7 +4,15 @@ 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 index c2a3a1b6af..8f58fc320c 100644 --- 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 @@ -97,9 +97,38 @@ public class ScmVehInventorymonthService extends MybatisBaseService listPageVo(PagerQuery pq) { ScmVehInventorymonthQuery query = pq.getParams(); - QueryWrapper qw = createQueryWrapper(query); + QueryWrapper qw = new QueryWrapper<>(); + String createStartTime = query.getCreateStartTime(); + String createEndTime = query.getCreateEndTime(); + qw.eq("createOrgSid", query.getCreateOrgSid()); + qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(createEndTime), "date_format (createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" + ); + if (StringUtils.isNotBlank(query.getCreateByName())) { + qw.like("createByName", query.getCreateByName()); + } + qw.orderByDesc("id"); IPage page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); + for (ScmVehInventorymonthVo record : pagging.getRecords()) { + String mainSid = record.getSid(); + AppVehInventorymonthVo vo = scmVehicleInventoryService.getMonthByMainSid(mainSid); + record.setSurplusNumber(String.valueOf(vo.getSurplusNumber())); + record.setTotalNumber(String.valueOf(vo.getTotalNumber())); + record.setLossNumber(String.valueOf(vo.getLossNumber())); + record.setDamageNumber(String.valueOf(vo.getDamageNumber())); + record.setProfitNumber(String.valueOf(vo.getProfitNumber())); + record.setActualNumber(String.valueOf(vo.getProfitNumber() + vo.getNormalNumber() + vo.getDamageNumber() + vo.getLossNumber())); + if ("0".equals(record.getState())) { + if (vo.getSurplusNumber() == 0) { + record.setShowBtn(true); + } else { + record.setShowBtn(false); + } + } else { + record.setShowBtn(false); + } + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } @@ -151,8 +180,10 @@ public class ScmVehInventorymonthService extends MybatisBaseService 0) { for (AppScmVehicleCarInventoryListPageVo vehicleCarInventoryListPageVo : vehicleCarInventoryListPageVos) { ScmVehInventorymonth scmVehInventorymonth = fetchBySid(vehicleCarInventoryListPageVo.getMainSid()); - if (scmVehInventorymonth.getState() == 0) { - return rb.setMsg("上次盘库记录未生成报告,请先生成再操作!"); + if (scmVehInventorymonth != null) { + if (scmVehInventorymonth.getState() == 0) { + return rb.setMsg("上次盘库记录未生成报告,请先生成再操作!"); + } } } }