From eda91f92ee7a1d6538fc349ebf8ff013769f18b9 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Tue, 4 Jun 2024 15:12:15 +0800 Subject: [PATCH 01/33] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 4 +- .../resources/mapper/quot/QuotFileMapper.xml | 9 +--- ruoyi-ui/src/views/quot/quot/index.vue | 50 ++++++++++++++++--- .../technicalConfirm/jsxzInfo.vue | 2 +- 4 files changed, 47 insertions(+), 18 deletions(-) diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index f67dcdb..decb9d9 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Tue Jun 04 13:59:05 CST 2024 +#Tue Jun 04 14:39:31 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.120 @@ -7,5 +7,5 @@ jco.client.saprouter= jco.client.user=RFC jco.client.sysnr=00 jco.destination.peak_limit=10 -jco.client.passwd=g]8^b-oV5)bg?0=#[a~}U*AcfC4BmB/D}?F8E5.6%iG`lg]L +jco.client.passwd=g5KKZrvN-+Xtpu=Z,M*tL_-D%OFI;:Yt+;TW!Ku,Y~NxIG%z jco.client.client=300 diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml index 94b5075..2ccf1ba 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml @@ -23,14 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and relation_id = #{relationId} - - - and file_type in ('quotJsgfFile','quotXjFile') - - - and file_type = #{fileType} - - + and file_type = #{fileType} order by file_time desc diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index 19910c0..eaa4f6b 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -424,7 +424,7 @@ - 询价附件(先保存再上传产品清单且必须是EXCEL文件) + 清单附件(先保存再上传且必须是EXCEL文件)
+ 技术附件(先保存再上传) +
+ + 上传文件 + +
+ + + + + + + + + + +
技术协助 @@ -526,9 +562,9 @@ - +
特缆协助 @@ -1448,7 +1484,7 @@ export default { }); } }, - //获取报价单-技术规范附件列表 (包含询价附件) + //获取报价单-技术规范附件列表 getQuotJsgfFileList(){ const param = {relationId:this.form.quotId,fileType:'quotJsgfFile'} quotFileList(param).then(response => { @@ -1516,7 +1552,7 @@ export default { this.$modal.msgSuccess(res.msg); if(activeName=='quotXjFile'){ this.getQuotXjFileList(); - }else if(activeName=='quotJsInfo'){ + }else if(activeName=='quotJsgfFile'){ this.getQuotJsgfFileList(); }else if(activeName=='quotFkFile'){ this.getQuotFkFileList(); @@ -1538,7 +1574,7 @@ export default { quotFileDelete(fileId).then(response => { if(activeName=='quotXjFile'){ this.getQuotXjFileList(); - }else if(activeName=='quotJsInfo'){ + }else if(activeName=='quotJsgfInfo'){ this.getQuotJsgfFileList(); }else if(activeName=='quotFkFile'){ this.getQuotFkFileList(); diff --git a/ruoyi-ui/src/views/technicalConfirm/technicalConfirm/jsxzInfo.vue b/ruoyi-ui/src/views/technicalConfirm/technicalConfirm/jsxzInfo.vue index c66365c..5f35acf 100644 --- a/ruoyi-ui/src/views/technicalConfirm/technicalConfirm/jsxzInfo.vue +++ b/ruoyi-ui/src/views/technicalConfirm/technicalConfirm/jsxzInfo.vue @@ -79,7 +79,7 @@ - 技术规范要求(询价附件) + 技术规范要求(技术附件) From 14465188a655fd05e8d91d03f01cd7bc1e5cab1d Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 5 Jun 2024 08:44:12 +0800 Subject: [PATCH 02/33] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 4 +- .../customer/CustomerController.java | 10 ++- .../web/controller/quot/QuotController.java | 13 +++- .../tool/quot/quotJswController.java | 67 ++++++++++++++++--- 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index decb9d9..42afebd 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Tue Jun 04 14:39:31 CST 2024 +#Tue Jun 04 16:46:03 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.120 @@ -7,5 +7,5 @@ jco.client.saprouter= jco.client.user=RFC jco.client.sysnr=00 jco.destination.peak_limit=10 -jco.client.passwd=g5KKZrvN-+Xtpu=Z,M*tL_-D%OFI;:Yt+;TW!Ku,Y~NxIG%z +jco.client.passwd=654321 jco.client.client=300 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java index 9861aba..970b630 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java @@ -141,7 +141,15 @@ public class CustomerController extends BaseController public AjaxResult getReturnUpdateInfo(@PathVariable("cusId") String cusId) { Customer customer = customerService.selectCustomerByCusId(cusId); - customer.setCusApprovalStatus("1");// 提交状态设置为 审核中 + if("2".equals(customer.getCusApprovalStatus())){ + customer.setCusApprovalStatus("1");// 提交状态设置为 审核中 + }else if("0".equals(customer.getCusApprovalStatus())){ + return error("该客户当前状态为【待提交】状态,无法修改"); + }else if("1".equals(customer.getCusApprovalStatus())){ + return error("该客户当前状态为【审批中】状态,无法修改"); + }else if("3".equals(customer.getCusApprovalStatus())){ + return error("该报价单当前状态为【已驳回】状态,无法修改"); + } return success(customer); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 2623ca2..111d37b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -126,8 +126,17 @@ public class QuotController extends BaseController public AjaxResult getReturnUpdateInfo(@PathVariable("quotId") String quotId) { Quot quot = quotService.selectQuotByQuotId(quotId); - quot.setQuotApprovalStatus("1");// 提交状态设置为 协助中 - quotService.updateQuot(quot); + if("2".equals(quot.getQuotApprovalStatus())){ + quot.setQuotApprovalStatus("1");// 提交状态设置为 协助中 + quotService.updateQuot(quot); + }else if("0".equals(quot.getQuotApprovalStatus())){ + return error("该报价单当前状态为【待提交】状态,无法修改"); + }else if("1".equals(quot.getQuotApprovalStatus())){ + return error("该报价单当前状态为【协助中】状态,无法修改"); + }else if("3".equals(quot.getQuotApprovalStatus())){ + return error("该报价单当前状态为【已驳回】状态,无法修改"); + } + return success(quot); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java index aa85df1..a46cd80 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.tool.quot; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson2.JSON; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -49,60 +50,106 @@ public class quotJswController extends BaseController { try{ quotModel quot = JSON.parseObject(quotJson, quotModel.class); if(quot==null){ + String errMsg = "参数异常为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("参数异常为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotJswCode())){ + String errMsg = "金思维报价单号为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("金思维报价单号不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotCode())){ + String errMsg = "客户报价单号为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("客户报价单号不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotTongPrice())){ + String errMsg = "铜价为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("铜价不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotLvPrice())){ + String errMsg = "铝价为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("铝价不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){ + String errMsg = "整单料价价差率为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("整单料价价差率不能为空"); + return R.fail(errMsg); } List materials = quot.getQuotMaterial(); if(materials==null || materials.size()==0){ + String errMsg = "无明细数据,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("明细不能为空"); + return R.fail(errMsg); } // 更新报价单 String quotId = quotService.selectQuotByQuotCode(quot.getQuotCode()); + if(StringUtils.isEmpty(quotId)){ + String errMsg = "报价单号:"+quot.getQuotCode()+" 系统中不存在,同步失败"; + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); + iSysOperLogService.insertOperlog(sysOperLog); + return R.fail(errMsg); + } + Quot q = quotService.selectQuotByQuotId(quotId); + String quotApprovalStatus = q.getQuotApprovalStatus(); + if(!"1".equals(quotApprovalStatus)){ + String errMsg = "报价单号:"+quot.getQuotCode()+" 非协助中状态,同步失败"; + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); + iSysOperLogService.insertOperlog(sysOperLog); + return R.fail(errMsg); + } + + + q.setQuotJswCode(quot.getQuotJswCode()); q.setQuotLvPrice(quot.getQuotLvPrice()); q.setQuotTongPrice(quot.getQuotTongPrice()); @@ -133,16 +180,20 @@ public class quotJswController extends BaseController { q.setQuotMaterialList(qmaterials); quotService.updateQuot(q); }catch(Exception e){ + String errMsg = "接口异常,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail(e.getMessage()); + return R.fail(errMsg); } sysOperLog.setStatus(0); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setJsonResult(R.ok().toString()); iSysOperLogService.insertOperlog(sysOperLog); return R.ok(); } From fcedf22c8d6091564d36ef9a755a7d21ff3fe6df Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 5 Jun 2024 13:05:55 +0800 Subject: [PATCH 03/33] =?UTF-8?q?OA=E5=AF=B9=E6=8E=A5,=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/quot/QuotController.java | 33 ++- .../src/main/resources/application-druid.yml | 9 + .../ruoyi/common/enums/DataSourceType.java | 8 +- .../ruoyi/framework/config/DruidConfig.java | 10 + .../java/com/ruoyi/quot/domain/SysOaQuot.java | 194 ++++++++++++++++++ .../ruoyi/quot/domain/SysOaQuotMaterial.java | 192 +++++++++++++++++ .../com/ruoyi/quot/mapper/QuotMapper.java | 19 ++ .../com/ruoyi/quot/service/IQuotService.java | 13 ++ .../quot/service/impl/QuotServiceImpl.java | 54 +++++ .../main/resources/mapper/quot/QuotMapper.xml | 54 +++++ ruoyi-ui/src/views/quot/quot/index.vue | 14 +- 11 files changed, 593 insertions(+), 7 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuotMaterial.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 111d37b..21b00f5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -14,8 +14,7 @@ import com.ruoyi.common.utils.file.MinioUtil; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.priceVerification.domain.QuotHj; import com.ruoyi.priceVerification.service.IQuotHjService; -import com.ruoyi.quot.domain.QuotFile; -import com.ruoyi.quot.domain.QuotMaterial; +import com.ruoyi.quot.domain.*; import com.ruoyi.quot.service.IQuotFileService; import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysNoticeService; @@ -31,7 +30,6 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.quot.domain.Quot; import com.ruoyi.quot.service.IQuotService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; @@ -464,8 +462,35 @@ public class QuotController extends BaseController @PostMapping("/commitOAQuot") public AjaxResult commitOAQuot(@RequestBody Quot quot) { - // TODO 对接OA + // 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material + SysOaQuot sysOaQuot = new SysOaQuot(); + SysOaQuot oauser = quotService.selectOAUserByUserName(getUsername());// 查询OA用户 + if(oauser==null){ + return error("该账户:"+getUsername()+"在OA中不存在"); + } + + sysOaQuot.setUserId(oauser.getUserId()); + sysOaQuot.setDepartmentId(oauser.getUserId()); + sysOaQuot.setDepartmentId(oauser.getDepartmentId()); + sysOaQuot.setSubmissionTime(DateUtils.getTime()); + sysOaQuot.setQuotId(UUID.fastUUID().toString()); + sysOaQuot.setQuotCode(quot.getQuotCode()); + sysOaQuot.setQuotSalesmanName(quot.getQuotSalesmanName()); + sysOaQuot.setQuotCustomerName(quot.getQuotCustomerName()); + sysOaQuot.setQuotAddress(quot.getQuotAddress()); + sysOaQuot.setQuotPhone(quot.getQuotPhone()); + sysOaQuot.setQuotInquiryDate(quot.getQuotInquiryDate()); + sysOaQuot.setQuotProject(quot.getQuotProject()); + sysOaQuot.setQuotQuotationRequire(quot.getQuotQuotationRequire()); + sysOaQuot.setQuotLvPrice(quot.getQuotLvPrice()); + sysOaQuot.setQuotTongPrice(quot.getQuotTongPrice()); + sysOaQuot.setQuotMatpriceDiff(quot.getQuotMatpriceDiff()); + + sysOaQuot.setMaterials(quot.getQuotMaterialList()); + + quotService.insertSysOAQuot(sysOaQuot); + quot.setQuotOAApprovalStatus("1");// 更新OA提交状态为 审批中 quotService.updateQuot(quot); return success(); diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 6e4964b..af03b69 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -61,6 +61,15 @@ spring: url: jdbc:sqlserver://192.168.9.2:1433;DatabaseName=jn_web username: sa password: it12345 + # OA数据库数据源 + oa: + # 从数据源开关/默认关闭 + enabled: true + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + # 正式数据库 + url: jdbc:sqlserver://192.168.9.182:1433;DatabaseName=ecology + username: sa + password: Itcenter110- # 初始连接数 initialSize: 10 # 最小连接池数量 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java index 3ed2044..5bd48d1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java @@ -43,6 +43,12 @@ public enum DataSourceType * @author JIAL * @updateTime 2024/5/24 15:50 */ - ORDER + ORDER, + + /** + * OA数据库 + */ + OA + } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java index a8b9b66..34861fc 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -94,6 +94,15 @@ public class DruidConfig return druidProperties.dataSource(dataSource); } + @Bean + @ConfigurationProperties("spring.datasource.druid.oa") + @ConditionalOnProperty(prefix = "spring.datasource.druid.oa", name = "enabled", havingValue = "true") + public DataSource oaDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + @Bean(name = "dynamicDataSource") @Primary public DynamicDataSource dataSource(DataSource masterDataSource) @@ -106,6 +115,7 @@ public class DruidConfig setDataSource(targetDataSources, DataSourceType.JNERP.name(), "jnerpDataSource"); setDataSource(targetDataSources, DataSourceType.STORAGE.name(), "storageDataSource"); setDataSource(targetDataSources, DataSourceType.ORDER.name(), "orderDataSource"); + setDataSource(targetDataSources, DataSourceType.OA.name(), "oaDataSource"); return new DynamicDataSource(masterDataSource, targetDataSources); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java new file mode 100644 index 0000000..665b4fe --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java @@ -0,0 +1,194 @@ +package com.ruoyi.quot.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; +import java.util.List; + +/** + * 报价对象 SysOaQuot + * + * @author ruoyi + * @date 2024-04-01 + */ +public class SysOaQuot extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** oa用户id */ + private Integer userId; + + /** oa部门ID */ + private Integer departmentId; + + /** 提交oa时间 */ + private String submissionTime; + + /** 报价单id */ + private String quotId; + + /** 报价单号 */ + private String quotCode; + + /** 业务员 */ + private String quotSalesmanName; + + /** 客户名称 */ + private String quotCustomerName; + + /** 地址 */ + private String quotAddress; + + /** 联系电话 */ + private String quotPhone; + + /** 询价日期 */ + private Date quotInquiryDate; + + /** 项目名称 */ + private String quotProject; + + /** 报价要求 */ + private String quotQuotationRequire; + + /** 铝价 */ + private String quotLvPrice; + + /** 铜价 */ + private String quotTongPrice; + + /** 整单料价价差率 */ + private String quotMatpriceDiff; + + /** 明细 */ + List materials; + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getDepartmentId() { + return departmentId; + } + + public void setDepartmentId(Integer departmentId) { + this.departmentId = departmentId; + } + + public String getSubmissionTime() { + return submissionTime; + } + + public void setSubmissionTime(String submissionTime) { + this.submissionTime = submissionTime; + } + + public String getQuotId() { + return quotId; + } + + public void setQuotId(String quotId) { + this.quotId = quotId; + } + + public String getQuotCode() { + return quotCode; + } + + public void setQuotCode(String quotCode) { + this.quotCode = quotCode; + } + + public String getQuotSalesmanName() { + return quotSalesmanName; + } + + public void setQuotSalesmanName(String quotSalesmanName) { + this.quotSalesmanName = quotSalesmanName; + } + + public String getQuotCustomerName() { + return quotCustomerName; + } + + public void setQuotCustomerName(String quotCustomerName) { + this.quotCustomerName = quotCustomerName; + } + + public String getQuotAddress() { + return quotAddress; + } + + public void setQuotAddress(String quotAddress) { + this.quotAddress = quotAddress; + } + + public String getQuotPhone() { + return quotPhone; + } + + public void setQuotPhone(String quotPhone) { + this.quotPhone = quotPhone; + } + + public Date getQuotInquiryDate() { + return quotInquiryDate; + } + + public void setQuotInquiryDate(Date quotInquiryDate) { + this.quotInquiryDate = quotInquiryDate; + } + + public String getQuotProject() { + return quotProject; + } + + public void setQuotProject(String quotProject) { + this.quotProject = quotProject; + } + + public String getQuotQuotationRequire() { + return quotQuotationRequire; + } + + public void setQuotQuotationRequire(String quotQuotationRequire) { + this.quotQuotationRequire = quotQuotationRequire; + } + + public String getQuotLvPrice() { + return quotLvPrice; + } + + public void setQuotLvPrice(String quotLvPrice) { + this.quotLvPrice = quotLvPrice; + } + + public String getQuotTongPrice() { + return quotTongPrice; + } + + public void setQuotTongPrice(String quotTongPrice) { + this.quotTongPrice = quotTongPrice; + } + + public String getQuotMatpriceDiff() { + return quotMatpriceDiff; + } + + public void setQuotMatpriceDiff(String quotMatpriceDiff) { + this.quotMatpriceDiff = quotMatpriceDiff; + } + + public List getMaterials() { + return materials; + } + + public void setMaterials(List materials) { + this.materials = materials; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuotMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuotMaterial.java new file mode 100644 index 0000000..912af31 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuotMaterial.java @@ -0,0 +1,192 @@ +package com.ruoyi.quot.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * 报价单-产品对象 SysOaQuotMaterial + * + * @author ruoyi + * @date 2024-04-01 + */ +public class SysOaQuotMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 产品ID */ + private String matId; + + /** 型号 */ + private String matXingh; + + /** 规格 */ + private String matGuig; + + /** 电压 */ + private String matDiany; + + /** 标准 */ + private String matStandard; + + /** 单位 */ + private String matDanw; + + /** 数量 */ + private BigDecimal matSl; + + /** 备注 */ + private String matRemark; + + /** 料价 */ + private BigDecimal matMatprice; + + /** 红本价 */ + private BigDecimal matPrice; + + /** 报价 */ + private BigDecimal matQuotPrice; + + /** 报价金额 */ + private BigDecimal matQuotAllPrice; + + /** 料价价差率 */ + private BigDecimal matMatpriceDiff; + + /** 序号 */ + private Integer xh;//序号 + /** 行号 */ + private Integer index;//行号 + + /** 报价单ID */ + private String quotId; + + public String getMatId() { + return matId; + } + + public void setMatId(String matId) { + this.matId = matId; + } + + public String getMatXingh() { + return matXingh; + } + + public void setMatXingh(String matXingh) { + this.matXingh = matXingh; + } + + public String getMatGuig() { + return matGuig; + } + + public void setMatGuig(String matGuig) { + this.matGuig = matGuig; + } + + public String getMatDiany() { + return matDiany; + } + + public void setMatDiany(String matDiany) { + this.matDiany = matDiany; + } + + public String getMatStandard() { + return matStandard; + } + + public void setMatStandard(String matStandard) { + this.matStandard = matStandard; + } + + public String getMatDanw() { + return matDanw; + } + + public void setMatDanw(String matDanw) { + this.matDanw = matDanw; + } + + public BigDecimal getMatSl() { + return matSl; + } + + public void setMatSl(BigDecimal matSl) { + this.matSl = matSl; + } + + public String getMatRemark() { + return matRemark; + } + + public void setMatRemark(String matRemark) { + this.matRemark = matRemark; + } + + public BigDecimal getMatMatprice() { + return matMatprice; + } + + public void setMatMatprice(BigDecimal matMatprice) { + this.matMatprice = matMatprice; + } + + public BigDecimal getMatPrice() { + return matPrice; + } + + public void setMatPrice(BigDecimal matPrice) { + this.matPrice = matPrice; + } + + public BigDecimal getMatQuotPrice() { + return matQuotPrice; + } + + public void setMatQuotPrice(BigDecimal matQuotPrice) { + this.matQuotPrice = matQuotPrice; + } + + public BigDecimal getMatQuotAllPrice() { + return matQuotAllPrice; + } + + public void setMatQuotAllPrice(BigDecimal matQuotAllPrice) { + this.matQuotAllPrice = matQuotAllPrice; + } + + public BigDecimal getMatMatpriceDiff() { + return matMatpriceDiff; + } + + public void setMatMatpriceDiff(BigDecimal matMatpriceDiff) { + this.matMatpriceDiff = matMatpriceDiff; + } + + public Integer getXh() { + return xh; + } + + public void setXh(Integer xh) { + this.xh = xh; + } + + public Integer getIndex() { + return index; + } + + public void setIndex(Integer index) { + this.index = index; + } + + public String getQuotId() { + return quotId; + } + + public void setQuotId(String quotId) { + this.quotId = quotId; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java index b71ae09..f678c2e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.quot.mapper; import java.util.List; import com.ruoyi.quot.domain.Quot; import com.ruoyi.quot.domain.QuotMaterial; +import com.ruoyi.quot.domain.SysOaQuot; import org.apache.ibatis.annotations.Param; /** @@ -122,4 +123,22 @@ public interface QuotMapper */ String checkExistQuot(@Param("quotSalesmanCode") String username, @Param("quotCustomerBm") String quotCustomerBm, @Param("quotProject") String quotProject); + /** + * 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material + * @param sysOaQuot + */ + void insertSysOAQuot(SysOaQuot sysOaQuot); + + /** + * 查询OA用户 + * @param loginid + * @return + */ + SysOaQuot selectOAUserByUserName(String loginid); + + /** + * 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material + * @param subList + */ + void batchSysOaQuotMaterial(List subList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java index 2907572..2a3c64a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java @@ -4,6 +4,7 @@ import java.util.List; import com.ruoyi.customer.domain.Customer; import com.ruoyi.quot.domain.Quot; +import com.ruoyi.quot.domain.SysOaQuot; /** * 报价Service接口 @@ -105,4 +106,16 @@ public interface IQuotService */ Boolean checkExistQuot(String username, String quotCustomerBm, String quotProject); + + /** + * 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material + * @param sysOaQuot + */ + void insertSysOAQuot(SysOaQuot sysOaQuot); + + /** + * 查询OA用户 + * @return + */ + SysOaQuot selectOAUserByUserName(String loginid); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java index b04d608..378871b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java @@ -3,9 +3,12 @@ package com.ruoyi.quot.service.impl; import java.util.List; import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.customer.domain.Customer; +import com.ruoyi.quot.domain.SysOaQuot; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -176,6 +179,26 @@ public class QuotServiceImpl implements IQuotService return !"0".equals(count); } + /** + * 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material + * @param sysOaQuot + */ + @Override + public void insertSysOAQuot(SysOaQuot sysOaQuot) { + quotMapper.insertSysOAQuot(sysOaQuot); + insertSysOAQuotMaterial(sysOaQuot); + } + + /** + * 查询OA用户 + * @return + */ + @Override + @DataSource(DataSourceType.OA) + public SysOaQuot selectOAUserByUserName(String loginid) { + return quotMapper.selectOAUserByUserName(loginid); + } + /** * 新增报价单-产品信息 * @@ -206,4 +229,35 @@ public class QuotServiceImpl implements IQuotService } } } + + /** + * 新增报价单-OA产品信息 + * + * @param sysOaQuot 报价对象 + */ + public void insertSysOAQuotMaterial(SysOaQuot sysOaQuot) + { + List quotMaterialList = sysOaQuot.getMaterials(); + String quotId = sysOaQuot.getQuotId(); + if (StringUtils.isNotNull(quotMaterialList)) + { + List list = new ArrayList(); + for (QuotMaterial quotMaterial : quotMaterialList) + { + quotMaterial.setMatId(UUID.fastUUID().toString()); + //TODO 标准 + quotMaterial.setQuotId(quotId); + list.add(quotMaterial); + } + if (list.size() > 0) + { + int batchSize = 100; // 每批次插入的数据量 + for (int i = 0; i < list.size(); i += batchSize) { + int toIndex = Math.min(i + batchSize, list.size()); + List subList = list.subList(i, toIndex); + quotMapper.batchSysOaQuotMaterial(subList); + } + } + } + } } diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index 11c1048..77cfdb3 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -85,6 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -174,6 +176,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.mat_quot_allPrice as sub_mat_quot_allPrice, b.mat_matprice_diff as sub_mat_matprice_diff, + b.xh as sub_xh, + b.number as sub_number, + b.quot_id as sub_quot_id from quot a left join quot_material b on b.quot_id = a.quot_id @@ -289,6 +294,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + insert into sys_oa_quot + + user_id, + department_id, + submission_time, + quot_id, + quot_code, + quot_salesman_name, + quot_customer_name, + quot_address, + quot_phone, + quot_inquiry_date, + quot_project, + quot_quotation_require, + quot_lv_price, + quot_tong_price, + quot_matprice_diff, + + + #{userId}, + #{departmentId}, + #{submissionTime}, + #{quotId}, + #{quotCode}, + #{quotSalesmanName}, + #{quotCustomerName}, + #{quotAddress}, + #{quotPhone}, + #{quotInquiryDate}, + #{quotProject}, + #{quotQuotationRequire}, + #{quotLvPrice}, + #{quotTongPrice}, + #{quotMatpriceDiff}, + + + update quot @@ -368,6 +415,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + insert into sys_oa_quot_material( mat_id, mat_xingh, mat_guig, mat_diany,mat_standard, mat_danw, mat_sl,mat_remark, quot_id,xh,number,mat_matprice,mat_price,mat_quot_price,mat_quot_allPrice,mat_matprice_diff) values + + ( #{item.matId}, #{item.matXingh}, #{item.matGuig}, #{item.matDiany}, #{item.matStandard}, #{item.matDanw}, cast(#{item.matSl,jdbcType=DECIMAL} as decimal(18,3)),#{item.matRemark}, #{item.quotId}, #{item.xh}, #{item.index}, cast(#{item.matMatprice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotPrice,jdbcType=DECIMAL} as decimal(18,3)),cast(#{item.matQuotAllPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matMatpriceDiff,jdbcType=DECIMAL} as decimal(18,3))) + + +