From 1efe171bc013909adaa8e3300a0b9ce6c2e24d85 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Tue, 18 Jun 2024 17:13:48 +0800 Subject: [PATCH] '123' --- .../web/controller/quot/QuotController.java | 1 - .../controller/redBook/RedBookController.java | 66 +++++++++++ .../main/resources/mapper/quot/QuotMapper.xml | 9 +- ruoyi-ui/src/api/redBook/redBook.js | 8 ++ ruoyi-ui/src/assets/styles/variables.scss | 2 +- ruoyi-ui/src/views/quot/quot/index.vue | 16 +-- ruoyi-ui/src/views/redBook/productSelect.vue | 31 ++++- .../statisticsQuot/statisticsQuot/index.vue | 110 ++++++++++-------- 8 files changed, 180 insertions(+), 63 deletions(-) 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 5fce405..ba11e8d 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 @@ -839,7 +839,6 @@ public class QuotController extends BaseController @GetMapping("/listStatisticsQuotQuot") public TableDataInfo listStatisticsQuotQuot(Quot quot) { - startPage(); List list = quotService.selectStatisticsQuotList(quot); return getDataTable(list); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index 21ff7e2..7f2e38d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -12,11 +12,15 @@ import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.customer.domain.Customer; import com.ruoyi.quot.domain.Quot; +import com.ruoyi.quot.domain.QuotFile; import com.ruoyi.quot.domain.QuotMaterial; +import com.ruoyi.quot.service.IQuotFileService; +import com.ruoyi.quot.service.IQuotService; import com.ruoyi.redBook.domain.*; import com.ruoyi.redBook.service.IRedBookService; import com.ruoyi.redBook.service.impl.AsyncRbTaskService; @@ -55,6 +59,13 @@ public class RedBookController extends BaseController @Resource private AsyncRbTaskService asyncRbTaskService; + @Resource + private IQuotService iQuotService; + + @Autowired + private IQuotFileService quotFileService; + + /** * 获取目录 * @param product @@ -240,6 +251,61 @@ public class RedBookController extends BaseController } return success(quot); } + + /** + * 生成询价单 + * @param quot + * @return + */ + @DataSource(DataSourceType.MASTER) + @Log(title = "生成询价单", businessType = BusinessType.INSERT) + @PostMapping("/madeXjQuot") + public void madeXjQuot(HttpServletResponse response, @RequestBody OAQuot quot) + { + + Quot xjquot = new Quot(); + xjquot.setQuotId(UUID.fastUUID().toString()); + String quotCode = redBookService.getCode("BJD"); + xjquot.setQuotCode(quotCode); + xjquot.setQuotApprovalStatus("0"); + xjquot.setQuotSalesmanCode(getUsername()); + xjquot.setQuotSalesmanBm(getLoginUser().getUser().getSapUserBm()); + xjquot.setQuotSalesmanName(getLoginUser().getUser().getNickName()); + xjquot.setQuotSalesmanDeptId(getLoginUser().getUser().getDept().getDeptId()+""); + xjquot.setQuotSalesmanDeptName(getLoginUser().getUser().getDept().getDeptName()); + xjquot.setCreateBy(getUsername()); + iQuotService.insertQuot(xjquot); + + /** 上传清单附件 **/ + /* String relation_id = xjquot.getQuotId(); + if(!StringUtils.isEmpty(relation_id)){ + if (!file.isEmpty()) + { + QuotFile quotFile= new QuotFile(); + quotFile.setFileId(UUID.fastUUID().toString()); + + String url = FileUploadUtils.uploadMinio(file,"quot-manage", "quot/"+relation_id); + int index = url.lastIndexOf("/")+1; + String fileName = url.substring(index);//获取文件名 + + int index2 = url.indexOf("/quot/"); + String fileBucketName = url.substring(index2);//获取文件对应文件服务器中地址-供后面删除功能用 + + quotFile.setFileName(fileName); + quotFile.setFileBucketName(fileBucketName); + quotFile.setFileUrl(url); + quotFile.setFileSize(file.getSize()); + quotFile.setFileTime(DateUtils.getTime()); + quotFile.setFileType("quotXjFile"); + quotFile.setRelationId(relation_id); + quotFileService.insertQuotFile(quotFile); + } + }else{ + return error("系统异常,询价单号为空!"); + }*/ + /** 上传清单附件 **/ + // return success(xjquot); + } /** * 报价单提交 * @param quot diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index d82c02c..7ba2bb2 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -514,7 +514,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and quot_customer_name like concat('%', #{quotCustomerName}, '%') and quot_project like concat('%', #{quotProject}, '%') and quot_salesman_name like concat('%', #{quotSalesmanName}, '%') + + and datediff(d, a.quot_quotation_date, #{params.beginTime}) 0 + + + and datediff(d, a.quot_quotation_date, #{params.endTime}) =]]> 0 + + and a.quot_approval_status = '2' - order by a.quot_inquiry_date desc + order by a.quot_quotation_date desc diff --git a/ruoyi-ui/src/api/redBook/redBook.js b/ruoyi-ui/src/api/redBook/redBook.js index 45d1727..9726e89 100644 --- a/ruoyi-ui/src/api/redBook/redBook.js +++ b/ruoyi-ui/src/api/redBook/redBook.js @@ -108,6 +108,14 @@ export function saveQuot(data) { data: data }) } +//生成报价单 +export function madeXjQuot(data) { + return request({ + url: '/redBook/redBook/madeXjQuot', + method: 'post', + data: data + }) +} //提交报价单 export function commitQuot(data) { return request({ diff --git a/ruoyi-ui/src/assets/styles/variables.scss b/ruoyi-ui/src/assets/styles/variables.scss index 34484d4..3539b26 100644 --- a/ruoyi-ui/src/assets/styles/variables.scss +++ b/ruoyi-ui/src/assets/styles/variables.scss @@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17; $base-sub-menu-hover:#001528; */ -$base-sidebar-width: 200px; +$base-sidebar-width: 210px; // the :export directive is the magic sauce for webpack // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index 2701ac4..8e906d1 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -163,6 +163,11 @@ + + + @@ -171,11 +176,6 @@ - - - - + @@ -1659,8 +1659,8 @@ export default { } }); this.form.quotQuantity = sums[6]; - this.form.quotTotalPrice = checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11]; - this.form.quotMaterialsCount = data.length; + this.form.quotTotalPrice = this.form.quotTotalPrice?this.form.quotTotalPrice:checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11]; + this.form.quotMaterialsCount = this.form.quotMaterialsCount?this.form.quotMaterialsCount:data.length; return sums; }, diff --git a/ruoyi-ui/src/views/redBook/productSelect.vue b/ruoyi-ui/src/views/redBook/productSelect.vue index fc785d2..c92935c 100644 --- a/ruoyi-ui/src/views/redBook/productSelect.vue +++ b/ruoyi-ui/src/views/redBook/productSelect.vue @@ -8,6 +8,7 @@ 搜索 + 生成报价单 保存 清空信息 @@ -269,7 +270,7 @@