From 2345140de5808c495ab96aaf5ce1f5d98234c492 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Fri, 24 Nov 2023 18:25:54 +0800 Subject: [PATCH] =?UTF-8?q?[add:]=20=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E8=A1=A8=E4=B8=BB=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysCustomerController.java | 25 +- .../SysCustomerQouteController.java | 145 +++++++ .../ruoyi/system/domain/SysCustomerQuote.java | 218 ++++++++++ .../system/mapper/SysCustomerQuoteMapper.java | 68 ++++ .../service/ISysCustomerQuoteService.java | 68 ++++ .../impl/SySCustomerQuoteServiceImpl.java | 54 +++ .../mapper/system/SysCustomerQuoteMapper.xml | 133 ++++++ .../templates/system/customer/add.html | 23 +- .../templates/system/customer/customer.html | 96 +++-- .../templates/system/customerQuote/add.html | 144 +++++++ .../system/customerQuote/customerQuote.html | 382 ++++++++++++++++++ 11 files changed, 1314 insertions(+), 42 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQouteController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SySCustomerQuoteServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml create mode 100644 ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java index 44e23940..2f3e4cec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java @@ -43,7 +43,7 @@ import java.util.Map; @RequestMapping("/system/customer") public class SysCustomerController extends BaseController { - private String prefix = "system/customer"; + private final String prefix = "system/customer"; @Autowired private ISysCustomerService sysCustomerService; @@ -114,8 +114,7 @@ public class SysCustomerController extends BaseController List sysCustomerList = sysCustomerService.selectSysCustomerList(sysCustomer1); if (sysCustomerList.size() == 1){ SysCustomer sysCustomer2 = sysCustomerList.get(0); - return AjaxResult.error("该客户已被其他业务员添加"+"客户名称 :" + sysCustomerList.get(0).getEnterpriseName() + "事业部: "+ - "" + sysCustomerList.get(0).getCustomerPurser() + " 业务员" + sysCustomerList.get(0).getBusinessMembers()); + return AjaxResult.error("该客户已被其他业务员添加"+"客户名称 :" + sysCustomerList.get(0).getEnterpriseName() + "事业部: "+ sysCustomerList.get(0).getCustomerPurser() + " 业务员" + sysCustomerList.get(0).getBusinessMembers()); }else if (sysCustomerList.size() == 0){ sysCustomerService.insertSysCustomer(sysCustomer); Long customer_id = sysCustomerService.selectSysCustomerList(sysCustomer).get(0).getCustomerId(); @@ -160,6 +159,24 @@ public class SysCustomerController extends BaseController @PostMapping("/edit") @ResponseBody public AjaxResult editSave(SysCustomer sysCustomer) + { + //添加操作记录 + SysCustomerOper sysCustomerOper = new SysCustomerOper(); + sysCustomerOper.setPurser(sysCustomer.getCustomerPurser()); + sysCustomerOper.setEnterpriseCode(sysCustomerOper.getEnterpriseCode()); + sysCustomerOper.setEnterpriseName(sysCustomer.getEnterpriseName()); + sysCustomerOper.setOper("修改"); + sysCustomerOper.setOperPeople(ShiroUtils.getLoginName()); + sysCustomerOper.setOperStatus(sysCustomer.getDeginflag()); + sysCustomerOperService.insertSysCustomerOper(sysCustomerOper); + //审核客户表 + return toAjax(sysCustomerService.updateSysCustomer(sysCustomer)); + } + @RequiresPermissions("system:customer:audit") + @Log(title = "客户基本信息", businessType = BusinessType.UPDATE) + @PostMapping("/audit") + @ResponseBody + public AjaxResult editaudit(SysCustomer sysCustomer) { //添加操作记录 SysCustomerOper sysCustomerOper = new SysCustomerOper(); @@ -169,11 +186,11 @@ public class SysCustomerController extends BaseController sysCustomerOper.setOper("审核"); sysCustomerOper.setOperPeople(ShiroUtils.getLoginName()); sysCustomerOper.setOperStatus(sysCustomer.getDeginflag()); + sysCustomerOper.setRemark(sysCustomer.getRemark()); sysCustomerOperService.insertSysCustomerOper(sysCustomerOper); //审核客户表 return toAjax(sysCustomerService.updateSysCustomer(sysCustomer)); } - /** * 删除客户基本信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQouteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQouteController.java new file mode 100644 index 00000000..2fe2be60 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQouteController.java @@ -0,0 +1,145 @@ +package com.ruoyi.system.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.remind.service.RemindService; +import com.ruoyi.system.domain.SysCustomerQuote; +import com.ruoyi.system.domain.exportDto.SysCustomerDto; +import com.ruoyi.system.service.ISysCustomerOperService; +import com.ruoyi.system.service.ISysCustomerQuoteService; +import com.ruoyi.system.service.ISysDictTypeService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 客户报价信息Controller + * + * @author ruoyi + * @date 2022-11-02 + */ +@Controller +@RequestMapping("/system/customerQuote") +public class SysCustomerQouteController extends BaseController +{ + private final String prefix = "system/customerQuote"; + + @Autowired + private ISysCustomerQuoteService sysCustomerQuoteService; + @Autowired + private ISysDictTypeService sysDictTypeService; + @Autowired + private RemindService remindService; + @Autowired + private ISysCustomerOperService sysCustomerOperService; + + @RequiresPermissions("system:customerQuote:view") + @GetMapping() + public String customerQoute() + { + return prefix + "/customerQuote"; + } + + /** + * 查询客户报价信息列表 + */ + @RequiresPermissions("system:customerQuote:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SysCustomerQuote sysCustomerQoute) + { + startPage(); + List list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQoute); + return getDataTable(list); + } + + + /** + * 新增客户报价信息 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存客户报价信息 + */ + @RequiresPermissions("system:customerQuote:add") + @Log(title = "客户报价信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(SysCustomerQuote sysCustomerQuote) + { + return toAjax(sysCustomerQuoteService.insertSysCustomerQuote(sysCustomerQuote)); + } + + + + /** + * 修改客户报价信息 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + SysCustomerQuote sysCustomerQuote = sysCustomerQuoteService.selectSysCustomerQuoteById(id); + mmap.put("sysCustomerQuote", sysCustomerQuote); + return prefix + "/edit"; + } + /** + * 修改保存客户报价信息 + */ + @RequiresPermissions("system:customer:edit") + @Log(title = "客户报价信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(SysCustomerQuote sysCustomerQuote) + { + //审核客户表 + return toAjax(sysCustomerQuoteService.updateSysCustomerQuote(sysCustomerQuote)); + } + + /** + * 删除客户报价信息 + */ + @RequiresPermissions("system:customerQuote:remove") + @Log(title = "客户报价信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String[] ids) + { + return toAjax(sysCustomerQuoteService.deleteSysCustomerQuoteByIds(ids)); + } + + //查找客户代码和名称 + @PostMapping( "/getcode") + @ResponseBody + public List code(){ + List list= sysCustomerQuoteService.selectSysCustomerQuoteBycode(); + return list; + } + + @RequiresPermissions("system:customerQuote:export") + @Log(title = "客户报价信息", businessType = BusinessType.EXPORT) + @RequestMapping("/exportCustomerInfo") + @ResponseBody + public void exportCustomerInfo(@RequestBody String selectData, HttpServletResponse response) throws IOException { + //数据处理 + JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData); + JSONArray jsonArray = jsonObject.getJSONArray("selectData"); + List selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java new file mode 100644 index 00000000..4eb41555 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java @@ -0,0 +1,218 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +public class SysCustomerQuote extends BaseEntity { + private static final long serialVersionUID = 1L; + //客户报价表id + private Long id; + //客户报价编号 + private String supplierCode; + //客户的编号 + private String customerCode; + //客户名称/企业名称 + private String customerName; + //物料合计 + private String enterprise; + //数量合计 + private String enterpirseSum; + //报价币种 + private String commonCurrency; + //不含税总价(RMB) + private Double noRmbTax; + //函数总价 + private Double rmbTax; + //不含税总价(美元) + private String noUsbTax; + //含税总价(美元) + private String usbtax; + //审核标识 0 未审核 1 审核通过 2 审核拒绝 + private String deginFlag; + //删除表示 + private String delFlag; + private String createBy; + private Date createTime; + private String updateBy; + private Date updateTime; + private String remark; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSupplierCode() { + return supplierCode; + } + + public void setSupplierCode(String supplierCode) { + this.supplierCode = supplierCode; + } + + public String getCustomerCode() { + return customerCode; + } + + public void setCustomerCode(String customerCode) { + this.customerCode = customerCode; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getEnterprise() { + return enterprise; + } + + public void setEnterprise(String enterprise) { + this.enterprise = enterprise; + } + + public String getEnterpirseSum() { + return enterpirseSum; + } + + public void setEnterpirseSum(String enterpirseSum) { + this.enterpirseSum = enterpirseSum; + } + + public String getCommonCurrency() { + return commonCurrency; + } + + public void setCommonCurrency(String commonCurrency) { + this.commonCurrency = commonCurrency; + } + + public Double getNoRmbTax() { + return noRmbTax; + } + + public void setNoRmbTax(Double noRmbTax) { + this.noRmbTax = noRmbTax; + } + + public Double getRmbTax() { + return rmbTax; + } + + public void setRmbTax(Double rmbTax) { + this.rmbTax = rmbTax; + } + + public String getNoUsbTax() { + return noUsbTax; + } + + public void setNoUsbTax(String noUsbTax) { + this.noUsbTax = noUsbTax; + } + + public String getUsbtax() { + return usbtax; + } + + public void setUsbtax(String usbtax) { + this.usbtax = usbtax; + } + + public String getDeginFlag() { + return deginFlag; + } + + public void setDeginFlag(String deginFlag) { + this.deginFlag = deginFlag; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + @Override + public String getCreateBy() { + return createBy; + } + + @Override + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public String getUpdateBy() { + return updateBy; + } + + @Override + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + @Override + public Date getUpdateTime() { + return updateTime; + } + + @Override + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + @Override + public String getRemark() { + return remark; + } + + @Override + public void setRemark(String remark) { + this.remark = remark; + } + + @Override + public String toString() { + return "SysCutomerQuote{" + + "id=" + id + + ", supplierCode='" + supplierCode + '\'' + + ", customerCode='" + customerCode + '\'' + + ", customerName='" + customerName + '\'' + + ", enterprise='" + enterprise + '\'' + + ", enterpirseSum='" + enterpirseSum + '\'' + + ", commonCurrency='" + commonCurrency + '\'' + + ", noRmbTax=" + noRmbTax + + ", rmbTax=" + rmbTax + + ", noUsbTax='" + noUsbTax + '\'' + + ", usbtax='" + usbtax + '\'' + + ", deginFlag='" + deginFlag + '\'' + + ", delFlag='" + delFlag + '\'' + + ", createBy='" + createBy + '\'' + + ", createTime=" + createTime + + ", updateBy='" + updateBy + '\'' + + ", updateTime=" + updateTime + + ", remark='" + remark + '\'' + + '}'; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java new file mode 100644 index 00000000..7ea6ce66 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.SysCustomerQuote; + +import java.util.List; + +/** + * 客户报价信息Mapper接口 + * + * @author ruoyi + * @date 2022-11-02 + */ +public interface SysCustomerQuoteMapper +{ + /** + * 查询客户报价信息 + * + * @param id 客户报价信息ID + * @return 客户报价信息 + */ + + SysCustomerQuote selectSysCustomerQuoteById(Long id); + + /** + * 查询客户报价信息列表 + * + * @param sysCustomerQuote 客户报价信息 + * @return 客户报价信息集合 + */ + List selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote); + + /** + * 新增客户报价信息 + * + * @param sysCustomerQuote 客户报价信息 + * @return 结果 + */ + int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote); + + /** + * 修改客户报价信息 + * + * @param sysCustomerQuote 客户报价信息 + * @return 结果 + */ + int updateSysCustomerQuote(SysCustomerQuote sysCustomerQuote); + + /** + * 删除客户报价信息 + * + * @param id 客户报价信息ID + * @return 结果 + */ + int deleteSysCustomerQuoteById(Long id); + + /** + * 批量删除客户报价信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteSysCustomerQuoteByIds(String[] ids); + + + List selectSysCustomerQuoteBycode(); + + SysCustomerQuote selectSysCustomerByCustomerCode(String customerCode); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java new file mode 100644 index 00000000..6cb160d1 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java @@ -0,0 +1,68 @@ +package com.ruoyi.system.service; + +import com.ruoyi.system.domain.SysCustomerQuote; + +import java.util.List; + +/** + * 客户报价信息service接口 + * + * @author ruoyi + * @date 2022-11-02 + */ +public interface ISysCustomerQuoteService +{ + /** + * 查询客户报价信息 + * + * @param id 客户报价信息ID + * @return 客户报价信息 + */ + + SysCustomerQuote selectSysCustomerQuoteById(Long id); + + /** + * 查询客户报价信息列表 + * + * @param sysCustomerQuote 客户报价信息 + * @return 客户报价信息集合 + */ + List selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote); + + /** + * 新增客户报价信息 + * + * @param sysCustomerQuote 客户报价信息 + * @return 结果 + */ + int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote); + + /** + * 修改客户报价信息 + * + * @param sysCustomerQuote 客户报价信息 + * @return 结果 + */ + int updateSysCustomerQuote(SysCustomerQuote sysCustomerQuote); + + /** + * 删除客户报价信息 + * + * @param id 客户报价信息ID + * @return 结果 + */ + int deleteSysCustomerQuoteById(Long id); + + /** + * 批量删除客户报价信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteSysCustomerQuoteByIds(String[] ids); + + + List selectSysCustomerQuoteBycode(); + + SysCustomerQuote selectSysCustomerByCustomerCode(String customerCode); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SySCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SySCustomerQuoteServiceImpl.java new file mode 100644 index 00000000..ed7fb7d0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SySCustomerQuoteServiceImpl.java @@ -0,0 +1,54 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.domain.SysCustomerQuote; +import com.ruoyi.system.mapper.SysCustomerQuoteMapper; +import com.ruoyi.system.service.ISysCustomerQuoteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class SySCustomerQuoteServiceImpl implements ISysCustomerQuoteService { + @Autowired + private SysCustomerQuoteMapper sysCustomerQuoteMapper; + @Override + public SysCustomerQuote selectSysCustomerQuoteById(Long id) { + return sysCustomerQuoteMapper.selectSysCustomerQuoteById(id); + } + + @Override + public List selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote) { + return sysCustomerQuoteMapper.selectSysCustomerQuoteList(sysCustomerQuote); + } + + @Override + public int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { + return sysCustomerQuoteMapper.insertSysCustomerQuote(sysCustomerQuote); + } + + @Override + public int updateSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { + return sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); + } + + @Override + public int deleteSysCustomerQuoteById(Long id) { + return sysCustomerQuoteMapper.deleteSysCustomerQuoteById(id); + } + + @Override + public int deleteSysCustomerQuoteByIds(String[] ids) { + return sysCustomerQuoteMapper.deleteSysCustomerQuoteByIds(ids); + } + + @Override + public List selectSysCustomerQuoteBycode() { + return null; + } + + @Override + public SysCustomerQuote selectSysCustomerByCustomerCode(String customerCode) { + return sysCustomerQuoteMapper.selectSysCustomerByCustomerCode(customerCode); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml new file mode 100644 index 00000000..dc0ef218 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id,supplierCode,customerCode,enterprise,enterpriseSum,common_currency,noRmbTax,noUsbTax,degin_flaf,del_flag,create_by,create_time,update_by,update_time,remark from sys_customer_quote + + + + + + + + + + + + + insert into sys_customer_quote + + supplierCode, + customerCode, + customerName, + enterprise, + enterpriseSum, + common_currency, + noRmbTax, + rmbTax, + noUsbTax, + usbTax, + create_by, + update_by, + update_time, + remark, + degin_flag, + del_flag, + create_time, + + + #{supplierCode}, + #{customerCode}, + #{customerName}, + #{enterprise}, + #{enterpriseSum}, + #{common_currency}, + #{noRmbTax}, + #{rmbTax}, + #{noUsbTax}, + #{usbTax}, + #{create_by}, + #{update_by}, + #{update_time}, + #{remark}, + 0, + 0, + now(), + + + + + update sys_customer_quote + + supplierCode = #{supplierCode}, + customerCode = #{customerCode}, + customerName = #{customerName}, + enterprise = #{enterprise}, + enterpriseSum = #{enterpriseSum}, + common_currency = #{common_currency},, + noRmbTax = #{noRmbTax}, + rmbTax = #{rmbTax}, + noUsbTax = #{noUsbTax}, + usbTax = #{usbTax}, + degin_flag = #{deginFlag}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateBy}, + remark = #{remark}, + del_flag, + update_time = CONCAT_WS(',',NOW(),update_time), + + where customer_id = #{customerId} + + + delete from sys_customer_quote where id = #{id} + + + + delete from sys_customer_quote where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/add.html b/ruoyi-admin/src/main/resources/templates/system/customer/add.html index 3a8733ed..f4f75101 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/add.html @@ -302,7 +302,7 @@
- +
@@ -680,38 +678,41 @@