diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/ContractController.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/ContractController.java new file mode 100644 index 0000000..80b17c8 --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/ContractController.java @@ -0,0 +1,114 @@ +package com.ruoyi.crm.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +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.crm.domain.Contract; +import com.ruoyi.crm.service.IContractService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 合同列表Controller + * + * @author lin + * @date 2024-04-07 + */ +@RestController +@RequestMapping("/crm/contract") +public class ContractController extends BaseController +{ + @Autowired + private IContractService contractService; + + /** + * 查询合同列表列表 + */ + @PreAuthorize("@ss.hasPermi('crm:contract:list')") + @GetMapping("/list") + public TableDataInfo list(Contract contract) + { + startPage(); + List list = contractService.selectContractList(contract); + return getDataTable(list); + } + + /** + * 导出合同列表列表 + */ + @PreAuthorize("@ss.hasPermi('crm:contract:export')") + @Log(title = "合同列表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Contract contract) + { + List list = contractService.selectContractList(contract); + ExcelUtil util = new ExcelUtil(Contract.class); + util.exportExcel(response, list, "合同列表数据"); + } + + /** + * 获取合同列表详细信息 + */ + @PreAuthorize("@ss.hasPermi('crm:contract:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(contractService.selectContractById(id)); + } + + /** + * 新增合同列表 + */ + @PreAuthorize("@ss.hasPermi('crm:contract:add')") + @Log(title = "合同列表", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Contract contract) + { + contract.setHandledBy(getUsername()); + contract.setStatus("0"); + return toAjax(contractService.insertContract(contract)); + } + + /** + * 修改合同列表 + */ + @PreAuthorize("@ss.hasPermi('crm:contract:edit')") + @Log(title = "合同列表", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Contract contract) + { + return toAjax(contractService.updateContract(contract)); + } + + /** + * 删除合同列表 + */ + @PreAuthorize("@ss.hasPermi('crm:contract:remove')") + @Log(title = "合同列表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(contractService.deleteContractByIds(ids)); + } + + /** 审批订单 */ + @PreAuthorize("@ss.hasPermi('crm:contract:approve')") + @Log(title = "订单", businessType = BusinessType.UPDATE) + @PutMapping("/approve/{id}") + public AjaxResult approve(@PathVariable Long id){ + return toAjax(contractService.approve(id)); + } +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/ElectronicContractController.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/ElectronicContractController.java new file mode 100644 index 0000000..073dcff --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/ElectronicContractController.java @@ -0,0 +1,68 @@ +package com.ruoyi.crm.controller; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.crm.domain.Contract; +import com.ruoyi.crm.domain.ElectronicContract; +import com.ruoyi.crm.service.IElectronicContractService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +@RestController +@RequestMapping("/crm/electronicContract") +public class ElectronicContractController extends BaseController { +// private String basePath="D:\\CompanyProject\\img\\"; + private String basePath = "/home/ruoyi/uploadPath"; + @Autowired + private IElectronicContractService electronicContractService; + + @GetMapping("/list") + public TableDataInfo list() + { + startPage(); + List list = electronicContractService.selectElectronicContractList(); + return getDataTable(list); + } + + @PostMapping() + public AjaxResult add(@RequestBody ElectronicContract electronicContract){ + electronicContract.setFounder(getUsername()); + electronicContract.setCreateTime(new Date()); + System.out.println(electronicContract.getUrl()); + return toAjax(electronicContractService.add(electronicContract)); + } + + @PostMapping("/upload") + public AjaxResult uploadpdf(MultipartFile file){ + + String originalFilename = file.getOriginalFilename(); + String suffix = originalFilename.substring(originalFilename.lastIndexOf("."));//后缀,.jpg等类型 + //使用uuid随机生成文件名,防止文件名重复造成文件覆盖 + String fileName = UUID.randomUUID().toString()+suffix; + + //创建一个目录对象 + File dir=new File(basePath); + //判断目录是否存在 + if(!dir.exists()) + { + dir.mkdirs(); + } + try { + file.transferTo(new File(basePath+fileName)); + } catch (IOException e) { + e.printStackTrace(); + } + return AjaxResult.success(fileName); + } +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/QuotationController.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/QuotationController.java index 95ef21a..4537faa 100644 --- a/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/QuotationController.java +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/controller/QuotationController.java @@ -99,6 +99,12 @@ public class QuotationController extends BaseController return toAjax(quotationService.updateQuotation(quotation)); } + @GetMapping("/quotationlist") + public AjaxResult quotationList(){ + List quotationList = quotationService.selectAll(); + return AjaxResult.success(quotationList); + } + /** * 删除产品报价 */ diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/domain/Contract.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/domain/Contract.java new file mode 100644 index 0000000..bfd80ca --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/domain/Contract.java @@ -0,0 +1,168 @@ +package com.ruoyi.crm.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +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; + +/** + * 合同列表对象 contract + * + * @author lin + * @date 2024-04-07 + */ +public class Contract extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 合同名称 */ + @Excel(name = "合同名称") + private String title; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String customerName; + + /** 客户编号 */ + @Excel(name = "客户编号") + private String customerId; + + /** 订单编号 */ + @Excel(name = "订单编号") + private String orderNo; + + /** 发起人 */ + @Excel(name = "发起人") + private String handledBy; + + /** 合同状态 */ + @Excel(name = "合同状态") + private String status; + + /** 合同金额 */ + @Excel(name = "合同金额") + private BigDecimal contractPrice; + + /** 发起时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "发起时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + public void setCustomerName(String customerName) + { + this.customerName = customerName; + } + + public String getCustomerName() + { + return customerName; + } + public void setCustomerId(String customerId) + { + this.customerId = customerId; + } + + public String getCustomerId() + { + return customerId; + } + public void setOrderNo(String orderNo) + { + this.orderNo = orderNo; + } + + public String getOrderNo() + { + return orderNo; + } + public void setHandledBy(String handledBy) + { + this.handledBy = handledBy; + } + + public String getHandledBy() + { + return handledBy; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setContractPrice(BigDecimal contractPrice) + { + this.contractPrice = contractPrice; + } + + public BigDecimal getContractPrice() + { + return contractPrice; + } + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("customerName", getCustomerName()) + .append("customerId", getCustomerId()) + .append("orderNo", getOrderNo()) + .append("handledBy", getHandledBy()) + .append("status", getStatus()) + .append("contractPrice", getContractPrice()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .toString(); + } +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/domain/ElectronicContract.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/domain/ElectronicContract.java new file mode 100644 index 0000000..604ffa2 --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/domain/ElectronicContract.java @@ -0,0 +1,75 @@ +package com.ruoyi.crm.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +public class ElectronicContract extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + @Excel(name = "模板地址") + private String url; + @Excel(name = "合同名称") + private String title; + @Excel(name = "创建人") + private String founder; + @Excel(name = "创建时间") + private Date createTime; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getFounder() { + return founder; + } + + public void setFounder(String founder) { + this.founder = founder; + } + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public String toString() { + return "ElectronicContract{" + + "id=" + id + + ", url='" + url + '\'' + + ", title='" + title + '\'' + + ", founder='" + founder + '\'' + + ", createTime=" + createTime + + '}'; + } +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/ContractMapper.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/ContractMapper.java new file mode 100644 index 0000000..c744221 --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/ContractMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.crm.mapper; + +import java.util.List; +import com.ruoyi.crm.domain.Contract; + +/** + * 合同列表Mapper接口 + * + * @author lin + * @date 2024-04-07 + */ +public interface ContractMapper +{ + /** + * 查询合同列表 + * + * @param id 合同列表主键 + * @return 合同列表 + */ + public Contract selectContractById(Long id); + + /** + * 查询合同列表列表 + * + * @param contract 合同列表 + * @return 合同列表集合 + */ + public List selectContractList(Contract contract); + + /** + * 新增合同列表 + * + * @param contract 合同列表 + * @return 结果 + */ + public int insertContract(Contract contract); + + /** + * 修改合同列表 + * + * @param contract 合同列表 + * @return 结果 + */ + public int updateContract(Contract contract); + + /** + * 删除合同列表 + * + * @param id 合同列表主键 + * @return 结果 + */ + public int deleteContractById(Long id); + + /** + * 批量删除合同列表 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteContractByIds(Long[] ids); +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/ElectronicContractMapper.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/ElectronicContractMapper.java new file mode 100644 index 0000000..4c60214 --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/ElectronicContractMapper.java @@ -0,0 +1,12 @@ +package com.ruoyi.crm.mapper; + +import com.ruoyi.crm.domain.ElectronicContract; + +import java.util.List; + +public interface ElectronicContractMapper { + + List selectElectronicContractList(); + + int add(ElectronicContract electronicContract); +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/QuotationMapper.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/QuotationMapper.java index eb5c615..a2a32d1 100644 --- a/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/QuotationMapper.java +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/mapper/QuotationMapper.java @@ -58,4 +58,6 @@ public interface QuotationMapper * @return 结果 */ public int deleteQuotationByIds(Long[] ids); + + List selectList(); } diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IContractService.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IContractService.java new file mode 100644 index 0000000..23e55af --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IContractService.java @@ -0,0 +1,63 @@ +package com.ruoyi.crm.service; + +import java.util.List; +import com.ruoyi.crm.domain.Contract; + +/** + * 合同列表Service接口 + * + * @author lin + * @date 2024-04-07 + */ +public interface IContractService +{ + /** + * 查询合同列表 + * + * @param id 合同列表主键 + * @return 合同列表 + */ + public Contract selectContractById(Long id); + + /** + * 查询合同列表列表 + * + * @param contract 合同列表 + * @return 合同列表集合 + */ + public List selectContractList(Contract contract); + + /** + * 新增合同列表 + * + * @param contract 合同列表 + * @return 结果 + */ + public int insertContract(Contract contract); + + /** + * 修改合同列表 + * + * @param contract 合同列表 + * @return 结果 + */ + public int updateContract(Contract contract); + + /** + * 批量删除合同列表 + * + * @param ids 需要删除的合同列表主键集合 + * @return 结果 + */ + public int deleteContractByIds(Long[] ids); + + /** + * 删除合同列表信息 + * + * @param id 合同列表主键 + * @return 结果 + */ + public int deleteContractById(Long id); + + int approve(Long id); +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IElectronicContractService.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IElectronicContractService.java new file mode 100644 index 0000000..9eedbba --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IElectronicContractService.java @@ -0,0 +1,11 @@ +package com.ruoyi.crm.service; + +import com.ruoyi.crm.domain.ElectronicContract; + +import java.util.List; + +public interface IElectronicContractService { + List selectElectronicContractList(); + + int add(ElectronicContract electronicContract); +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IQuotationService.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IQuotationService.java index d6c362b..d1faff0 100644 --- a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IQuotationService.java +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/IQuotationService.java @@ -58,4 +58,7 @@ public interface IQuotationService * @return 结果 */ public int deleteQuotationById(Long id); + + List selectAll(); + } diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/ContractServiceImpl.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/ContractServiceImpl.java new file mode 100644 index 0000000..e4925aa --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/ContractServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.crm.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.crm.mapper.ContractMapper; +import com.ruoyi.crm.domain.Contract; +import com.ruoyi.crm.service.IContractService; + +import javax.annotation.Resource; + +/** + * 合同列表Service业务层处理 + * + * @author lin + * @date 2024-04-07 + */ +@Service +public class ContractServiceImpl implements IContractService +{ + @Resource + private ContractMapper contractMapper; + + /** + * 查询合同列表 + * + * @param id 合同列表主键 + * @return 合同列表 + */ + @Override + public Contract selectContractById(Long id) + { + return contractMapper.selectContractById(id); + } + + /** + * 查询合同列表列表 + * + * @param contract 合同列表 + * @return 合同列表 + */ + @Override + public List selectContractList(Contract contract) + { + return contractMapper.selectContractList(contract); + } + + /** + * 新增合同列表 + * + * @param contract 合同列表 + * @return 结果 + */ + @Override + public int insertContract(Contract contract) + { + return contractMapper.insertContract(contract); + } + + /** + * 修改合同列表 + * + * @param contract 合同列表 + * @return 结果 + */ + @Override + public int updateContract(Contract contract) + { + return contractMapper.updateContract(contract); + } + + /** + * 批量删除合同列表 + * + * @param ids 需要删除的合同列表主键 + * @return 结果 + */ + @Override + public int deleteContractByIds(Long[] ids) + { + return contractMapper.deleteContractByIds(ids); + } + + /** + * 删除合同列表信息 + * + * @param id 合同列表主键 + * @return 结果 + */ + @Override + public int deleteContractById(Long id) + { + return contractMapper.deleteContractById(id); + } + + @Override + public int approve(Long id) { + Contract contract = contractMapper.selectContractById(id); + contract.setStatus("1"); + return contractMapper.updateContract(contract); + } +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/CrmOrderServiceImpl.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/CrmOrderServiceImpl.java index 91fbfc0..779c00f 100644 --- a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/CrmOrderServiceImpl.java +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/CrmOrderServiceImpl.java @@ -146,6 +146,9 @@ public class CrmOrderServiceImpl implements ICrmOrderService crmCustomer.setStatus(CustomerFolder.CUSTOMER.getCode()); crmCustomer.setDealStatus("1"); customerService.updateCrmCustomer(crmCustomer); + + + return crmOrderMapper.updateCrmOrder(crmOrder); } diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/ElectronicContractServiceImpl.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/ElectronicContractServiceImpl.java new file mode 100644 index 0000000..094146c --- /dev/null +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/ElectronicContractServiceImpl.java @@ -0,0 +1,27 @@ +package com.ruoyi.crm.service.impl; + +import com.ruoyi.crm.domain.ElectronicContract; +import com.ruoyi.crm.mapper.ElectronicContractMapper; +import com.ruoyi.crm.service.IElectronicContractService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class ElectronicContractServiceImpl implements IElectronicContractService { + + @Resource + private ElectronicContractMapper electronicContractMapper; + + @Override + public List selectElectronicContractList() { + return electronicContractMapper.selectElectronicContractList(); + } + + @Override + public int add(ElectronicContract electronicContract) { + return electronicContractMapper.add(electronicContract); + } + +} diff --git a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/QuotationServiceImpl.java b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/QuotationServiceImpl.java index b7b058d..21fc6ba 100644 --- a/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/QuotationServiceImpl.java +++ b/ruoyi-crm/src/main/java/com/ruoyi/crm/service/impl/QuotationServiceImpl.java @@ -92,4 +92,9 @@ public class QuotationServiceImpl implements IQuotationService { return quotationMapper.deleteQuotationById(id); } + + @Override + public List selectAll() { + return quotationMapper.selectList(); + } } diff --git a/ruoyi-crm/src/main/resources/mapper/crm/ContractMapper.xml b/ruoyi-crm/src/main/resources/mapper/crm/ContractMapper.xml new file mode 100644 index 0000000..a0661d1 --- /dev/null +++ b/ruoyi-crm/src/main/resources/mapper/crm/ContractMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + select id, title, customer_name, customer_id, order_no, handled_by, status, contract_price, start_time, end_time from contract + + + + + + + + insert into contract + + title, + customer_name, + customer_id, + order_no, + handled_by, + status, + contract_price, + start_time, + end_time, + + + #{title}, + #{customerName}, + #{customerId}, + #{orderNo}, + #{handledBy}, + #{status}, + #{contractPrice}, + #{startTime}, + #{endTime}, + + + + + update contract + + title = #{title}, + customer_name = #{customerName}, + customer_id = #{customerId}, + order_no = #{orderNo}, + handled_by = #{handledBy}, + status = #{status}, + contract_price = #{contractPrice}, + start_time = #{startTime}, + end_time = #{endTime}, + + where id = #{id} + + + + delete from contract where id = #{id} + + + + delete from contract where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-crm/src/main/resources/mapper/crm/ElectronicContractMapper.xml b/ruoyi-crm/src/main/resources/mapper/crm/ElectronicContractMapper.xml new file mode 100644 index 0000000..4fb6361 --- /dev/null +++ b/ruoyi-crm/src/main/resources/mapper/crm/ElectronicContractMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + select id, title, url, founder, create_time from electronic_contract + + + + insert into electronic_contract + + title, + url, + founder, + create_time, + + + #{title}, + #{url}, + #{founder}, + #{createTime}, + + + + + \ No newline at end of file diff --git a/ruoyi-crm/src/main/resources/mapper/crm/QuotationMapper.xml b/ruoyi-crm/src/main/resources/mapper/crm/QuotationMapper.xml index 59587c8..dd06101 100644 --- a/ruoyi-crm/src/main/resources/mapper/crm/QuotationMapper.xml +++ b/ruoyi-crm/src/main/resources/mapper/crm/QuotationMapper.xml @@ -78,6 +78,9 @@ where id = #{id} + insert into quotation diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/InterceptorConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/InterceptorConfig.java new file mode 100644 index 0000000..2090afc --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/InterceptorConfig.java @@ -0,0 +1,20 @@ +package com.ruoyi.framework.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class InterceptorConfig implements WebMvcConfigurer { + +// private String basePath="D:\\CompanyProject\\img\\"; + private String basePath = "/home/ruoyi/uploadPath"; + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + String filePath = "file:"+basePath; + //图片资源映射     //其中/images是访问图片资源的前缀,比如要访问test1.png。则全路径为:http://localhost:端口号/images/test1.png + registry.addResourceHandler("/pdf/**") + .addResourceLocations(filePath);//此处为设置服务端存储图片的路径(前段上传到后台的图片保存位置) + } +} \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 818cce0..4f794fe 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -99,7 +99,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 对于登录login 注册register 验证码captchaImage 允许匿名访问 .antMatchers("/login", "/register", "/captchaImage", "/intelligentForm/selectDynamicDataById","/intelligentForm/collectData", - "/h5/login/wxLogin","/h5/login/h5Login").anonymous() + "/h5/login/wxLogin","/h5/login/h5Login","/crm/electronicContract/upload","/pdf/**").anonymous() .antMatchers( HttpMethod.GET, "/", diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/TenantInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/TenantInterceptor.java index fad69ed..699bf13 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/TenantInterceptor.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/TenantInterceptor.java @@ -50,10 +50,14 @@ public class TenantInterceptor implements HandlerInterceptor { Pattern pattern = Pattern.compile("^/profile.*"); Pattern patterns = Pattern.compile("^/intelligentForm.*"); Pattern patternByWx = Pattern.compile("^/h5/login.*"); + Pattern compile = Pattern.compile("/crm/electronicContract/upload"); + Pattern compile1 = Pattern.compile("^/pdf.*"); Matcher matcher = pattern.matcher(url); Matcher matchers = patterns.matcher(url); Matcher matcherByWx = patternByWx.matcher(url); - if (matcher.find() || matchers.find() || matcherByWx.find()){ + Matcher matcher1 = compile.matcher(url); + Matcher matcher2 = compile1.matcher(url); + if (matcher.find() || matchers.find() || matcherByWx.find() || matcher1.find() || matcher2.find()){ //使用正则表达式过滤以"/profile","/intelligentForm"开头的请求路径,直接放行 return true; } diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 39eb942..266992e 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -36,6 +36,8 @@ }, "dependencies": { "@riophae/vue-treeselect": "0.4.0", + "@vue-office/pdf": "^1.6.5", + "@vue/composition-api": "^1.7.2", "axios": "0.24.0", "clipboard": "2.0.8", "core-js": "3.19.1", @@ -56,6 +58,7 @@ "vue-clipboard2": "^0.3.3", "vue-count-to": "1.0.13", "vue-cropper": "0.5.5", + "vue-demi": "^0.14.7", "vue-meta": "2.4.0", "vue-router": "3.4.9", "vuedraggable": "2.24.3", diff --git a/ruoyi-ui/src/api/crm/contract.js b/ruoyi-ui/src/api/crm/contract.js new file mode 100644 index 0000000..cfee0d2 --- /dev/null +++ b/ruoyi-ui/src/api/crm/contract.js @@ -0,0 +1,51 @@ +import request from '@/utils/request' + +// 查询合同列表列表 +export function listContract(query) { + return request({ + url: '/crm/contract/list', + method: 'get', + params: query + }) +} + +// 查询合同列表详细 +export function getContract(id) { + return request({ + url: '/crm/contract/' + id, + method: 'get' + }) +} + +// 新增合同列表 +export function addContract(data) { + return request({ + url: '/crm/contract', + method: 'post', + data: data + }) +} + +// 修改合同列表 +export function updateContract(data) { + return request({ + url: '/crm/contract', + method: 'put', + data: data + }) +} + +// 删除合同列表 +export function delContract(id) { + return request({ + url: '/crm/contract/' + id, + method: 'delete' + }) +} +//审批合同 +export function approveContract(id){ + return request({ + url: '/crm/contract/approve/'+id, + method: 'put' + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/api/crm/quotation.js b/ruoyi-ui/src/api/crm/quotation.js index ccbe2de..1c4b27b 100644 --- a/ruoyi-ui/src/api/crm/quotation.js +++ b/ruoyi-ui/src/api/crm/quotation.js @@ -34,7 +34,14 @@ export function updateQuotation(data) { data: data }) } - +//查询报价单列表 +export function listquotation(query){ + return request({ + url: '/crm/quotation/quotationlist', + method: 'get', + params: query + }) +} // 删除产品报价 export function delQuotation(id) { return request({ diff --git a/ruoyi-ui/src/api/crm/template.js b/ruoyi-ui/src/api/crm/template.js new file mode 100644 index 0000000..2fe8ba5 --- /dev/null +++ b/ruoyi-ui/src/api/crm/template.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +export function getelectronicContract() { + return request({ + url: '/crm/electronicContract/list', + method: 'get' + }) + } + +// 新增合同模板 +export function addelectronicContract(data) { + return request({ + url: '/crm/electronicContract', + method: 'post', + data: data + }) + } + \ No newline at end of file diff --git a/ruoyi-ui/src/views/crm/electronicContract/contract.vue b/ruoyi-ui/src/views/crm/electronicContract/contract.vue new file mode 100644 index 0000000..3c0d97f --- /dev/null +++ b/ruoyi-ui/src/views/crm/electronicContract/contract.vue @@ -0,0 +1,461 @@ + + + diff --git a/ruoyi-ui/src/views/crm/electronicContract/template.vue b/ruoyi-ui/src/views/crm/electronicContract/template.vue new file mode 100644 index 0000000..8cfc0a5 --- /dev/null +++ b/ruoyi-ui/src/views/crm/electronicContract/template.vue @@ -0,0 +1,214 @@ + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/crm/order/list.vue b/ruoyi-ui/src/views/crm/order/list.vue index 6a65d0f..580a5c2 100644 --- a/ruoyi-ui/src/views/crm/order/list.vue +++ b/ruoyi-ui/src/views/crm/order/list.vue @@ -332,7 +332,6 @@ export default { }, handleEdit(row){ - const orderNo = row.orderNo console.log(orderNo,'121'); getCustomerOrder(orderNo).then(response => { diff --git a/ruoyi-ui/src/views/crm/pallet/quotation.vue b/ruoyi-ui/src/views/crm/pallet/quotation.vue index b1ec7f3..1afcb9a 100644 --- a/ruoyi-ui/src/views/crm/pallet/quotation.vue +++ b/ruoyi-ui/src/views/crm/pallet/quotation.vue @@ -582,6 +582,7 @@ export default { this.reset(); this.open = true; this.title = "添加产品报价"; + // console.log(this.form) }, /** 修改按钮操作 */ handleUpdate(row) { diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index a5d0f76..c839037 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -35,7 +35,8 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://127.0.0.1:8080/api`, + // target: `http://127.0.0.1:8080/api`, + target: `http://101.43.112.107:8080/api`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''