From b1beb49d54b46d7d0c94c09ab87ce165e87b3e2d Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Tue, 2 Apr 2024 11:24:37 +0800 Subject: [PATCH] '123' --- .../web/controller/quot/QuotController.java | 172 ++++++ .../controller/system/SysLoginController.java | 10 +- .../main/java/com/ruoyi/quot/domain/Quot.java | 320 ++++++++++ .../java/com/ruoyi/quot/domain/QuotFile.java | 102 ++++ .../com/ruoyi/quot/domain/QuotMaterial.java | 115 ++++ .../com/ruoyi/quot/mapper/QuotFileMapper.java | 46 ++ .../com/ruoyi/quot/mapper/QuotMapper.java | 87 +++ .../ruoyi/quot/service/IQuotFileService.java | 47 ++ .../com/ruoyi/quot/service/IQuotService.java | 61 ++ .../service/impl/QuotFileServiceImpl.java | 74 +++ .../quot/service/impl/QuotServiceImpl.java | 134 +++++ .../resources/mapper/quot/QuotFileMapper.xml | 55 ++ .../main/resources/mapper/quot/QuotMapper.xml | 193 ++++++ ruoyi-ui/src/api/quot/quot.js | 63 ++ ruoyi-ui/src/store/modules/user.js | 23 +- ruoyi-ui/src/views/quot/quot/index.vue | 563 ++++++++++++++++++ 16 files changed, 2060 insertions(+), 5 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotFile.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotFileMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotFileService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotFileServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml create mode 100644 ruoyi-ui/src/api/quot/quot.js create mode 100644 ruoyi-ui/src/views/quot/quot/index.vue 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 new file mode 100644 index 0000000..0a546fc --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -0,0 +1,172 @@ +package com.ruoyi.web.controller.quot; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.MinioUtil; +import com.ruoyi.common.utils.uuid.UUID; +import com.ruoyi.quot.domain.QuotFile; +import com.ruoyi.quot.service.IQuotFileService; +import com.ruoyi.web.utils.IdUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +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; +import org.springframework.web.multipart.MultipartFile; + +/** + * 报价Controller + * + * @author ruoyi + * @date 2024-04-01 + */ +@RestController +@RequestMapping("/quot/quot") +public class QuotController extends BaseController +{ + @Autowired + private IQuotService quotService; + + @Autowired + private IQuotFileService quotFileService; + + /** + * 查询报价列表 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:list')") + @GetMapping("/list") + public TableDataInfo list(Quot quot) + { + startPage(); + List list = quotService.selectQuotList(quot); + return getDataTable(list); + } + + /** + * 导出报价列表 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:export')") + @Log(title = "报价", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Quot quot) + { + List list = quotService.selectQuotList(quot); + ExcelUtil util = new ExcelUtil(Quot.class); + util.exportExcel(response, list, "报价数据"); + } + + /** + * 获取报价详细信息 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:query')") + @GetMapping(value = "/{quotId}") + public AjaxResult getInfo(@PathVariable("quotId") String quotId) + { + return success(quotService.selectQuotByQuotId(quotId)); + } + + /** + * 新增报价 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:add')") + @Log(title = "报价", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Quot quot) + { + quot.setQuotId(UUID.fastUUID().toString()); + quot.setQuotCode(IdUtils.createNo("BJD_",2)); + quot.setCreateBy(getUsername()); + return toAjax(quotService.insertQuot(quot)); + } + + /** + * 修改报价 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:edit')") + @Log(title = "报价", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Quot quot) + { + return toAjax(quotService.updateQuot(quot)); + } + + /** + * 删除报价 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:remove')") + @Log(title = "报价", businessType = BusinessType.DELETE) + @DeleteMapping("/{quotIds}") + public AjaxResult remove(@PathVariable String[] quotIds) + { + return toAjax(quotService.deleteQuotByQuotIds(quotIds)); + } + + /** + * 头像上传SysNoticeMapper + */ + @Log(title = "上传报价附件", businessType = BusinessType.INSERT) + @PostMapping("/quotFile") + public AjaxResult quotFile(@RequestParam("quotFile") MultipartFile file,@RequestParam("quotId") String quotId) throws Exception + { + if(!StringUtils.isEmpty(quotId)){ + if (!file.isEmpty()) + { + QuotFile quotFile= new QuotFile(); + quotFile.setFileId(UUID.fastUUID().toString()); + + String url = FileUploadUtils.uploadMinio(file,"quot-manage", "quot/"+quotId); + int index = url.lastIndexOf("/")+1; + String fileName = url.substring(index); + quotFile.setFileName(fileName); + quotFile.setFileUrl(url); + quotFile.setFileSize(file.getSize()); + quotFile.setFileTime(DateUtils.getTime()); + quotFile.setQuotId(quotId); + quotFileService.insertQuotFile(quotFile); + } + }else{ + return error("系统异常,报价单号为空!"); + } + return success("上传成功!"); + } + + /** + * 查询附件列表 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:list')") + @GetMapping("/quotFileList") + public TableDataInfo quotFileList(QuotFile quotFile) + { + startPage(); + List list = quotFileService.selectQuotFileList(quotFile); + return getDataTable(list); + } + + /** + * 删除附件列表 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:list')") + @PostMapping("/quotFileDelete") + public AjaxResult quotFileDelete(QuotFile quotFile) { + String fileId = quotFile.getFileId(); + try { + QuotFile quotfile = quotFileService.selectQuotFileByFileId(fileId); + quotFileService.deleteQuotFileByFileId(fileId); + MinioUtil.removeObject("quot-manage", quotfile.getFileName()); + }catch(Exception e){ + return error("系统异常!"); + } + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index d959a17..cf7c306 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -19,7 +19,7 @@ import com.ruoyi.system.service.ISysMenuService; /** * 登录验证 - * + * * @author ruoyi */ @RestController @@ -36,7 +36,7 @@ public class SysLoginController /** * 登录方法 - * + * * @param loginBody 登录信息 * @return 结果 */ @@ -53,7 +53,7 @@ public class SysLoginController /** * 获取用户信息 - * + * * @return 用户信息 */ @GetMapping("getInfo") @@ -68,12 +68,14 @@ public class SysLoginController ajax.put("user", user); ajax.put("roles", roles); ajax.put("permissions", permissions); + + //获取SAP编码 和 名称 TODO return ajax; } /** * 获取路由信息 - * + * * @return 路由信息 */ @GetMapping("getRouters") diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java new file mode 100644 index 0000000..68e6140 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java @@ -0,0 +1,320 @@ +package com.ruoyi.quot.domain; + +import java.util.List; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 报价对象 quot + * + * @author ruoyi + * @date 2024-04-01 + */ +public class Quot extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private String quotId; + + /** 报价单号 */ + @Excel(name = "报价单号") + private String quotCode; + + /** 业务员编码 */ + private String quotSalesmanBm; + + /** 业务员 */ + @Excel(name = "业务员") + private String quotSalesmanName; + + /** 客户编码 */ + private String quotCustomerBm; + /** 客户名称 */ + @Excel(name = "客户名称") + private String quotCustomerName; + + /** 业务员所属部门id */ + private String quotSalesmanDeptId; + + /** 业务员所属部门 */ + private String quotSalesmanDeptName; + + /** 地址 */ + private String quotAddress; + + /** 联系电话 */ + private String quotPhone; + + /** 询价日期 */ + @Excel(name = "询价日期") + private String quotInquiryDate; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String quotProject; + + /** 报价日期 */ + @Excel(name = "报价日期") + private String quotQuotationDate; + + /** 报价来源 */ + private String quotQuotationFrom; + + /** 报价要求 */ + @Excel(name = "报价要求") + private String quotQuotationRequire; + + /** 反馈说明 */ + @Excel(name = "反馈说明") + private String quotFeedbackExplanation; + + /** 数量 */ + @Excel(name = "数量") + private String quotQuantity; + + /** 总价 */ + @Excel(name = "总价") + private String quotTotalPrice; + + /** 审核人账号 */ + private String quotCheckUserName; + + /** 审核人 */ + @Excel(name = "审核人") + private String quotCheckUserNickname; + + /** 提交状态 */ + @Excel(name = "提交状态") + private String quotApprovalStatus; + + /** 报价单-产品信息 */ + private List quotMaterialList; + + public void setQuotId(String quotId) + { + this.quotId = quotId; + } + + public String getQuotId() + { + return quotId; + } + public void setQuotCode(String quotCode) + { + this.quotCode = quotCode; + } + + public String getQuotCode() + { + return quotCode; + } + public void setQuotSalesmanBm(String quotSalesmanBm) + { + this.quotSalesmanBm = quotSalesmanBm; + } + + public String getQuotSalesmanBm() + { + return quotSalesmanBm; + } + public void setQuotSalesmanName(String quotSalesmanName) + { + this.quotSalesmanName = quotSalesmanName; + } + + public String getQuotSalesmanName() + { + return quotSalesmanName; + } + public void setQuotCustomerName(String quotCustomerName) + { + this.quotCustomerName = quotCustomerName; + } + + public String getQuotCustomerBm() {return quotCustomerBm;} + public void setQuotCustomerBm(String quotCustomerBm) {this.quotCustomerBm = quotCustomerBm;} + + public String getQuotCustomerName() + { + return quotCustomerName; + } + public void setQuotSalesmanDeptId(String quotSalesmanDeptId) + { + this.quotSalesmanDeptId = quotSalesmanDeptId; + } + + public String getQuotSalesmanDeptId() + { + return quotSalesmanDeptId; + } + public void setQuotSalesmanDeptName(String quotSalesmanDeptName) + { + this.quotSalesmanDeptName = quotSalesmanDeptName; + } + + public String getQuotSalesmanDeptName() + { + return quotSalesmanDeptName; + } + public void setQuotAddress(String quotAddress) + { + this.quotAddress = quotAddress; + } + + public String getQuotAddress() + { + return quotAddress; + } + public void setQuotPhone(String quotPhone) + { + this.quotPhone = quotPhone; + } + + public String getQuotPhone() + { + return quotPhone; + } + public void setQuotInquiryDate(String quotInquiryDate) + { + this.quotInquiryDate = quotInquiryDate; + } + + public String getQuotInquiryDate() + { + return quotInquiryDate; + } + public void setQuotProject(String quotProject) + { + this.quotProject = quotProject; + } + + public String getQuotProject() + { + return quotProject; + } + public void setQuotQuotationDate(String quotQuotationDate) + { + this.quotQuotationDate = quotQuotationDate; + } + + public String getQuotQuotationDate() + { + return quotQuotationDate; + } + public void setQuotQuotationFrom(String quotQuotationFrom) + { + this.quotQuotationFrom = quotQuotationFrom; + } + + public String getQuotQuotationFrom() + { + return quotQuotationFrom; + } + public void setQuotQuotationRequire(String quotQuotationRequire) + { + this.quotQuotationRequire = quotQuotationRequire; + } + + public String getQuotQuotationRequire() + { + return quotQuotationRequire; + } + public void setQuotFeedbackExplanation(String quotFeedbackExplanation) + { + this.quotFeedbackExplanation = quotFeedbackExplanation; + } + + public String getQuotFeedbackExplanation() + { + return quotFeedbackExplanation; + } + public void setQuotQuantity(String quotQuantity) + { + this.quotQuantity = quotQuantity; + } + + public String getQuotQuantity() + { + return quotQuantity; + } + public void setQuotTotalPrice(String quotTotalPrice) + { + this.quotTotalPrice = quotTotalPrice; + } + + public String getQuotTotalPrice() + { + return quotTotalPrice; + } + public void setQuotCheckUserName(String quotCheckUserName) + { + this.quotCheckUserName = quotCheckUserName; + } + + public String getQuotCheckUserName() + { + return quotCheckUserName; + } + public void setQuotCheckUserNickname(String quotCheckUserNickname) + { + this.quotCheckUserNickname = quotCheckUserNickname; + } + + public String getQuotCheckUserNickname() + { + return quotCheckUserNickname; + } + public void setQuotApprovalStatus(String quotApprovalStatus) + { + this.quotApprovalStatus = quotApprovalStatus; + } + + public String getQuotApprovalStatus() + { + return quotApprovalStatus; + } + + public List getQuotMaterialList() + { + return quotMaterialList; + } + + public void setQuotMaterialList(List quotMaterialList) + { + this.quotMaterialList = quotMaterialList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("quotId", getQuotId()) + .append("quotCode", getQuotCode()) + .append("quotSalesmanBm", getQuotSalesmanBm()) + .append("quotSalesmanName", getQuotSalesmanName()) + .append("quotCustomerName", getQuotCustomerName()) + .append("quotSalesmanDeptId", getQuotSalesmanDeptId()) + .append("quotSalesmanDeptName", getQuotSalesmanDeptName()) + .append("quotAddress", getQuotAddress()) + .append("quotPhone", getQuotPhone()) + .append("quotInquiryDate", getQuotInquiryDate()) + .append("quotProject", getQuotProject()) + .append("quotQuotationDate", getQuotQuotationDate()) + .append("quotQuotationFrom", getQuotQuotationFrom()) + .append("quotQuotationRequire", getQuotQuotationRequire()) + .append("quotFeedbackExplanation", getQuotFeedbackExplanation()) + .append("quotQuantity", getQuotQuantity()) + .append("quotTotalPrice", getQuotTotalPrice()) + .append("quotCheckUserName", getQuotCheckUserName()) + .append("quotCheckUserNickname", getQuotCheckUserNickname()) + .append("quotApprovalStatus", getQuotApprovalStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("quotMaterialList", getQuotMaterialList()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotFile.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotFile.java new file mode 100644 index 0000000..c660aae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotFile.java @@ -0,0 +1,102 @@ +package com.ruoyi.quot.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 报价单-文件对象 quot_file + * + * @author ruoyi + * @date 2024-04-01 + */ +public class QuotFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private String fileId; + + /** 文件名称 */ + private String fileName; + + /** 文件地址 */ + private String fileUrl; + + /** 文件大小 */ + private Long fileSize; + + /** 上传时间 */ + private String fileTime; + + /** */ + private String quotId; + + public void setFileId(String fileId) + { + this.fileId = fileId; + } + + public String getFileId() + { + return fileId; + } + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getFileName() + { + return fileName; + } + public void setFileUrl(String fileUrl) + { + this.fileUrl = fileUrl; + } + + public String getFileUrl() + { + return fileUrl; + } + public void setFileSize(Long fileSize) + { + this.fileSize = fileSize; + } + + public Long getFileSize() + { + return fileSize; + } + public void setFileTime(String fileTime) + { + this.fileTime = fileTime; + } + + public String getFileTime() + { + return fileTime; + } + public void setQuotId(String quotId) + { + this.quotId = quotId; + } + + public String getQuotId() + { + return quotId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("fileId", getFileId()) + .append("fileName", getFileName()) + .append("fileUrl", getFileUrl()) + .append("fileSize", getFileSize()) + .append("fileTime", getFileTime()) + .append("quotId", getQuotId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java new file mode 100644 index 0000000..678977a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java @@ -0,0 +1,115 @@ +package com.ruoyi.quot.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 报价单-产品对象 quot_material + * + * @author ruoyi + * @date 2024-04-01 + */ +public class QuotMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private String matId; + + /** 型号 */ + private String matXingh; + + /** 规格 */ + private String matGuig; + + /** 电压 */ + private String matDiany; + + /** 单位 */ + private String matDanw; + + /** 数量 */ + private Long matSl; + + /** */ + private String quotId; + + public void setMatId(String matId) + { + this.matId = matId; + } + + public String getMatId() + { + return matId; + } + public void setMatXingh(String matXingh) + { + this.matXingh = matXingh; + } + + public String getMatXingh() + { + return matXingh; + } + public void setMatGuig(String matGuig) + { + this.matGuig = matGuig; + } + + public String getMatGuig() + { + return matGuig; + } + public void setMatDiany(String matDiany) + { + this.matDiany = matDiany; + } + + public String getMatDiany() + { + return matDiany; + } + public void setMatDanw(String matDanw) + { + this.matDanw = matDanw; + } + + public String getMatDanw() + { + return matDanw; + } + public void setMatSl(Long matSl) + { + this.matSl = matSl; + } + + public Long getMatSl() + { + return matSl; + } + public void setQuotId(String quotId) + { + this.quotId = quotId; + } + + public String getQuotId() + { + return quotId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("matId", getMatId()) + .append("matXingh", getMatXingh()) + .append("matGuig", getMatGuig()) + .append("matDiany", getMatDiany()) + .append("matDanw", getMatDanw()) + .append("matSl", getMatSl()) + .append("quotId", getQuotId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotFileMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotFileMapper.java new file mode 100644 index 0000000..7b4c9db --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotFileMapper.java @@ -0,0 +1,46 @@ +package com.ruoyi.quot.mapper; + +import com.ruoyi.quot.domain.QuotFile; + +import java.util.List; + +/** + * 报价单-文件Mapper接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface QuotFileMapper +{ + /** + * 查询报价单-文件 + * + * @param fileId 报价单-文件主键 + * @return 报价单-文件 + */ + public QuotFile selectQuotFileByFileId(String fileId); + + /** + * 查询报价单-文件列表 + * + * @param quotFile 报价单-文件 + * @return 报价单-文件集合 + */ + public List selectQuotFileList(QuotFile quotFile); + + /** + * 新增报价单-文件 + * + * @param quotFile 报价单-文件 + * @return 结果 + */ + public int insertQuotFile(QuotFile quotFile); + + /** + * 删除报价单-文件 + * + * @param fileId 报价单-文件主键 + * @return 结果 + */ + public int deleteQuotFileByFileId(String fileId); +} 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 new file mode 100644 index 0000000..a777995 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java @@ -0,0 +1,87 @@ +package com.ruoyi.quot.mapper; + +import java.util.List; +import com.ruoyi.quot.domain.Quot; +import com.ruoyi.quot.domain.QuotMaterial; + +/** + * 报价Mapper接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface QuotMapper +{ + /** + * 查询报价 + * + * @param quotId 报价主键 + * @return 报价 + */ + public Quot selectQuotByQuotId(String quotId); + + /** + * 查询报价列表 + * + * @param quot 报价 + * @return 报价集合 + */ + public List selectQuotList(Quot quot); + + /** + * 新增报价 + * + * @param quot 报价 + * @return 结果 + */ + public int insertQuot(Quot quot); + + /** + * 修改报价 + * + * @param quot 报价 + * @return 结果 + */ + public int updateQuot(Quot quot); + + /** + * 删除报价 + * + * @param quotId 报价主键 + * @return 结果 + */ + public int deleteQuotByQuotId(String quotId); + + /** + * 批量删除报价 + * + * @param quotIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQuotByQuotIds(String[] quotIds); + + /** + * 批量删除报价单-产品 + * + * @param quotIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQuotMaterialByQuotIds(String[] quotIds); + + /** + * 批量新增报价单-产品 + * + * @param quotMaterialList 报价单-产品列表 + * @return 结果 + */ + public int batchQuotMaterial(List quotMaterialList); + + + /** + * 通过报价主键删除报价单-产品信息 + * + * @param quotId 报价ID + * @return 结果 + */ + public int deleteQuotMaterialByQuotId(String quotId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotFileService.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotFileService.java new file mode 100644 index 0000000..dc573ec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotFileService.java @@ -0,0 +1,47 @@ +package com.ruoyi.quot.service; + +import com.ruoyi.quot.domain.QuotFile; + +import java.util.List; + +/** + * 报价单-文件Service接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface IQuotFileService +{ + + /** + * 查询报价单-文件 + * + * @param fileId 报价单-文件主键 + * @return 报价单-文件 + */ + public QuotFile selectQuotFileByFileId(String fileId); + + /** + * 查询报价单-文件列表 + * + * @param quotFile 报价单-文件 + * @return 报价单-文件集合 + */ + public List selectQuotFileList(QuotFile quotFile); + + /** + * 新增报价单-文件 + * + * @param quotFile 报价单-文件 + * @return 结果 + */ + public int insertQuotFile(QuotFile quotFile); + + /** + * 删除报价单-文件信息 + * + * @param fileId 报价单-文件主键 + * @return 结果 + */ + public int deleteQuotFileByFileId(String fileId); +} 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 new file mode 100644 index 0000000..923d8ba --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java @@ -0,0 +1,61 @@ +package com.ruoyi.quot.service; + +import java.util.List; +import com.ruoyi.quot.domain.Quot; + +/** + * 报价Service接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface IQuotService +{ + /** + * 查询报价 + * + * @param quotId 报价主键 + * @return 报价 + */ + public Quot selectQuotByQuotId(String quotId); + + /** + * 查询报价列表 + * + * @param quot 报价 + * @return 报价集合 + */ + public List selectQuotList(Quot quot); + + /** + * 新增报价 + * + * @param quot 报价 + * @return 结果 + */ + public int insertQuot(Quot quot); + + /** + * 修改报价 + * + * @param quot 报价 + * @return 结果 + */ + public int updateQuot(Quot quot); + + /** + * 批量删除报价 + * + * @param quotIds 需要删除的报价主键集合 + * @return 结果 + */ + public int deleteQuotByQuotIds(String[] quotIds); + + /** + * 删除报价信息 + * + * @param quotId 报价主键 + * @return 结果 + */ + public int deleteQuotByQuotId(String quotId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotFileServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotFileServiceImpl.java new file mode 100644 index 0000000..81fcc8e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotFileServiceImpl.java @@ -0,0 +1,74 @@ +package com.ruoyi.quot.service.impl; + +import java.util.List; + +import com.ruoyi.quot.domain.QuotFile; +import com.ruoyi.quot.mapper.QuotFileMapper; +import com.ruoyi.quot.service.IQuotFileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 报价单-文件Service业务层处理 + * + * @author ruoyi + * @date 2024-04-01 + */ +@Service +public class QuotFileServiceImpl implements IQuotFileService +{ + @Autowired + private QuotFileMapper quotFileMapper; + + /** + * 查询报价单-文件 + * + * @param fileId 报价单-文件主键 + * @return 报价单-文件 + */ + @Override + public QuotFile selectQuotFileByFileId(String fileId) + { + return quotFileMapper.selectQuotFileByFileId(fileId); + } + + + /** + * 查询报价单-文件列表 + * + * @param quotFile 报价单-文件 + * @return 报价单-文件 + */ + @Override + public List selectQuotFileList(QuotFile quotFile) + { + return quotFileMapper.selectQuotFileList(quotFile); + } + + /** + * 新增报价单-文件 + * + * @param quotFile 报价单-文件 + * @return 结果 + */ + @Override + @Transactional + public int insertQuotFile(QuotFile quotFile) + { + return quotFileMapper.insertQuotFile(quotFile); + } + + /** + * 删除报价单-文件信息 + * + * @param fileId 报价单-文件主键 + * @return 结果 + */ + @Override + @Transactional + public int deleteQuotFileByFileId(String fileId) + { + return quotFileMapper.deleteQuotFileByFileId(fileId); + } +} 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 new file mode 100644 index 0000000..5308353 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java @@ -0,0 +1,134 @@ +package com.ruoyi.quot.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.quot.domain.QuotMaterial; +import com.ruoyi.quot.mapper.QuotMapper; +import com.ruoyi.quot.domain.Quot; +import com.ruoyi.quot.service.IQuotService; + +/** + * 报价Service业务层处理 + * + * @author ruoyi + * @date 2024-04-01 + */ +@Service +public class QuotServiceImpl implements IQuotService +{ + @Autowired + private QuotMapper quotMapper; + + /** + * 查询报价 + * + * @param quotId 报价主键 + * @return 报价 + */ + @Override + public Quot selectQuotByQuotId(String quotId) + { + return quotMapper.selectQuotByQuotId(quotId); + } + + /** + * 查询报价列表 + * + * @param quot 报价 + * @return 报价 + */ + @Override + public List selectQuotList(Quot quot) + { + return quotMapper.selectQuotList(quot); + } + + /** + * 新增报价 + * + * @param quot 报价 + * @return 结果 + */ + @Transactional + @Override + public int insertQuot(Quot quot) + { + quot.setCreateTime(DateUtils.getNowDate()); + int rows = quotMapper.insertQuot(quot); + insertQuotMaterial(quot); + return rows; + } + + /** + * 修改报价 + * + * @param quot 报价 + * @return 结果 + */ + @Transactional + @Override + public int updateQuot(Quot quot) + { + quot.setUpdateTime(DateUtils.getNowDate()); + quotMapper.deleteQuotMaterialByQuotId(quot.getQuotId()); + insertQuotMaterial(quot); + return quotMapper.updateQuot(quot); + } + + /** + * 批量删除报价 + * + * @param quotIds 需要删除的报价主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteQuotByQuotIds(String[] quotIds) + { + quotMapper.deleteQuotMaterialByQuotIds(quotIds); + return quotMapper.deleteQuotByQuotIds(quotIds); + } + + /** + * 删除报价信息 + * + * @param quotId 报价主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteQuotByQuotId(String quotId) + { + quotMapper.deleteQuotMaterialByQuotId(quotId); + return quotMapper.deleteQuotByQuotId(quotId); + } + + /** + * 新增报价单-产品信息 + * + * @param quot 报价对象 + */ + public void insertQuotMaterial(Quot quot) + { + List quotMaterialList = quot.getQuotMaterialList(); + String quotId = quot.getQuotId(); + if (StringUtils.isNotNull(quotMaterialList)) + { + List list = new ArrayList(); + for (QuotMaterial quotMaterial : quotMaterialList) + { + quotMaterial.setQuotId(quotId); + list.add(quotMaterial); + } + if (list.size() > 0) + { + quotMapper.batchQuotMaterial(list); + } + } + } +} diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml new file mode 100644 index 0000000..2337c1d --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + select file_id, file_name, file_url, file_size, file_time, quot_id from quot_file + + + + + + + + insert into quot_file + + file_id, + file_name, + file_url, + file_size, + file_time, + quot_id, + + + #{fileId}, + #{fileName}, + #{fileUrl}, + #{fileSize}, + #{fileTime}, + #{quotId}, + + + + + delete from quot_file where file_id = #{fileId} + + diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml new file mode 100644 index 0000000..e22e951 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select quot_id, quot_code, quot_salesman_bm, quot_salesman_name, quot_customer_bm, + quot_customer_name,quot_salesman_dept_id, quot_salesman_dept_name, quot_address, + quot_phone, quot_inquiry_date, quot_project, quot_quotation_date, quot_quotation_from, + quot_quotation_require, quot_feedback_explanation, quot_quantity, quot_total_price, + quot_check_user_name, quot_check_user_nickname, quot_approval_status, + create_by, create_time, update_by, update_time from quot + + + + + + + + insert into quot + + quot_id, + quot_code, + quot_salesman_bm, + quot_salesman_name, + quot_customer_bm, + quot_customer_name, + quot_salesman_dept_id, + quot_salesman_dept_name, + quot_address, + quot_phone, + quot_inquiry_date, + quot_project, + quot_quotation_date, + quot_quotation_from, + quot_quotation_require, + quot_feedback_explanation, + quot_quantity, + quot_total_price, + quot_check_user_name, + quot_check_user_nickname, + quot_approval_status, + create_by, + create_time, + update_by, + update_time, + + + #{quotId}, + #{quotCode}, + #{quotSalesmanBm}, + #{quotSalesmanName}, + #{quotCustomerBm}, + #{quotCustomerName}, + #{quotSalesmanDeptId}, + #{quotSalesmanDeptName}, + #{quotAddress}, + #{quotPhone}, + #{quotInquiryDate}, + #{quotProject}, + #{quotQuotationDate}, + #{quotQuotationFrom}, + #{quotQuotationRequire}, + #{quotFeedbackExplanation}, + #{quotQuantity}, + #{quotTotalPrice}, + #{quotCheckUserName}, + #{quotCheckUserNickname}, + #{quotApprovalStatus}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update quot + + quot_code = #{quotCode}, + quot_salesman_bm = #{quotSalesmanBm}, + quot_salesman_name = #{quotSalesmanName}, + quot_customer_bm = #{quotCustomerBm}, + quot_customer_name = #{quotCustomerName}, + quot_salesman_dept_id = #{quotSalesmanDeptId}, + quot_salesman_dept_name = #{quotSalesmanDeptName}, + quot_address = #{quotAddress}, + quot_phone = #{quotPhone}, + quot_inquiry_date = #{quotInquiryDate}, + quot_project = #{quotProject}, + quot_quotation_date = #{quotQuotationDate}, + quot_quotation_from = #{quotQuotationFrom}, + quot_quotation_require = #{quotQuotationRequire}, + quot_feedback_explanation = #{quotFeedbackExplanation}, + quot_quantity = #{quotQuantity}, + quot_total_price = #{quotTotalPrice}, + quot_check_user_name = #{quotCheckUserName}, + quot_check_user_nickname = #{quotCheckUserNickname}, + quot_approval_status = #{quotApprovalStatus}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where quot_id = #{quotId} + + + + delete from quot where quot_id = #{quotId} + + + + delete from quot where quot_id in + + #{quotId} + + + + + delete from quot_material where quot_id in + + #{quotId} + + + + + delete from quot_material where quot_id = #{quotId} + + + + insert into quot_material( mat_id, mat_xingh, mat_guig, mat_diany, mat_danw, mat_sl, quot_id) values + + ( #{item.matId}, #{item.matXingh}, #{item.matGuig}, #{item.matDiany}, #{item.matDanw}, #{item.matSl}, #{item.quotId}) + + + diff --git a/ruoyi-ui/src/api/quot/quot.js b/ruoyi-ui/src/api/quot/quot.js new file mode 100644 index 0000000..df0564d --- /dev/null +++ b/ruoyi-ui/src/api/quot/quot.js @@ -0,0 +1,63 @@ +import request from '@/utils/request' + +// 查询报价列表 +export function listQuot(query) { + return request({ + url: '/quot/quot/list', + method: 'get', + params: query + }) +} + +// 查询报价详细 +export function getQuot(quotId) { + return request({ + url: '/quot/quot/' + quotId, + method: 'get' + }) +} + +// 新增报价 +export function addQuot(data) { + return request({ + url: '/quot/quot', + method: 'post', + data: data + }) +} + +// 修改报价 +export function updateQuot(data) { + return request({ + url: '/quot/quot', + method: 'put', + data: data + }) +} + +// 删除报价 +export function delQuot(quotId) { + return request({ + url: '/quot/quot/' + quotId, + method: 'delete' + }) +} + +// 查询附件列表 +export function quotFileList(query) { + return request({ + url: '/quot/quot/quotFileList', + method: 'get', + params: query + }) +} + +//删除附件 +export function quotFileDelete(fileId) { + return request({ + url: '/quot/quot/quotFileDelete', + method: 'post', + params: {fileId:fileId} + }) +} + diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js index 381bc38..2f13767 100644 --- a/ruoyi-ui/src/store/modules/user.js +++ b/ruoyi-ui/src/store/modules/user.js @@ -9,7 +9,11 @@ const user = { name: '', avatar: '', roles: [], - permissions: [] + permissions: [], + sapBm: '', + sapUserName: '', + deptId: '', + deptName: '' }, mutations: { @@ -30,6 +34,18 @@ const user = { }, SET_PERMISSIONS: (state, permissions) => { state.permissions = permissions + }, + SET_SAPBM: (state, sapBm) => { + state.sapBm = sapBm + }, + SET_SAPUSERNAME: (state, sapUserName) => { + state.sapUserName = sapUserName + }, + SET_DEPTID: (state, deptId) => { + state.deptId = deptId + }, + SET_DEPTNAME: (state, deptName) => { + state.deptName = deptName } }, @@ -82,6 +98,11 @@ const user = { commit('SET_ID', user.userId) commit('SET_NAME', user.userName) commit('SET_AVATAR', avatar) + + commit('SET_SAPBM', '4100000058') + commit('SET_SAPUSERNAME', '薛建梅') + commit('SET_DEPTID', user.dept.deptId) + commit('SET_DEPTNAME', user.dept.deptName) resolve(res) }).catch(error => { reject(error) diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue new file mode 100644 index 0000000..942abb7 --- /dev/null +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -0,0 +1,563 @@ + + +