Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 3 weeks ago
parent
commit
9ee7203912
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  2. 46
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  3. 35
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java
  4. 37
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteVo.java
  5. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java
  6. 22
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  7. 330
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  8. 9
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml
  9. BIN
      ruoyi-admin/src/main/resources/static/attachments/客户报价1.xlsx
  10. BIN
      ruoyi-admin/src/main/resources/static/attachments/客户报价2.xlsx
  11. BIN
      ruoyi-admin/src/main/resources/static/attachments/客户报价3.xlsx
  12. BIN
      ruoyi-admin/src/main/resources/static/attachments/客户报价4.xlsx
  13. 3
      ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
  14. 186
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html
  15. 6
      ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html
  16. 6
      ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html
  17. 59
      ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html

4
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java

@ -509,7 +509,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail: list1) {
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode);
warehouseStorageOrderDetail.setWarehouseStorageType("0");
warehouseStorageOrderDetail.setMaterialDeptType("0");
warehouseStorageOrderDetail.setMaterialDeptType("1");
warehouseStorageOrderDetail.setWarehouseDeptType("1");
notifyArrivedNum = notifyArrivedNum + warehouseStorageOrderDetail.getNotifyArriveNum();
storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail);
@ -533,7 +533,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail: list2) {
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode1);
warehouseStorageOrderDetail.setWarehouseStorageType("0");
warehouseStorageOrderDetail.setMaterialDeptType("1");
warehouseStorageOrderDetail.setMaterialDeptType("0");
warehouseStorageOrderDetail.setWarehouseDeptType("0");
notifyArrivedNum1 = notifyArrivedNum + warehouseStorageOrderDetail.getNotifyArriveNum();
storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail);

46
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -335,4 +335,50 @@ public class SysCustomerQuoteController extends BaseController
}
/**
* 导出客户报价模板1
* */
@RequiresPermissions("system:customerQuote:exportCustomerQuoteOne")
@Log(title = "客户报价信息", businessType = BusinessType.EXPORT)
@GetMapping("/exportCustomerQuoteOne/{supplierCode}")
public void exportCustomerQuoteOne(@PathVariable("supplierCode") String supplierCode, HttpServletResponse response){
sysCustomerQuoteService.exportCustomerQuoteOne(supplierCode,response);
}
/**
* 导出客户报价模板2
* */
@RequiresPermissions("system:customerQuote:exportCustomerQuoteTwo")
@Log(title = "客户报价信息", businessType = BusinessType.EXPORT)
@GetMapping("/exportCustomerQuoteTwo/{supplierCode}")
public void exportCustomerQuoteTwo(@PathVariable("supplierCode") String supplierCode, HttpServletResponse response){
sysCustomerQuoteService.exportCustomerQuoteTwo(supplierCode,response);
}
/**
* 导出客户报价模板3
* */
@RequiresPermissions("system:customerQuote:exportCustomerQuoteThree")
@Log(title = "客户报价信息", businessType = BusinessType.EXPORT)
@GetMapping("/exportCustomerQuoteThree/{supplierCode}")
public void exportCustomerQuoteThree(@PathVariable("supplierCode") String supplierCode, HttpServletResponse response){
sysCustomerQuoteService.exportCustomerQuoteThree(supplierCode,response);
}
/**
* 导出客户报价模板4
* */
@RequiresPermissions("system:customerQuote:exportCustomerQuoteFour")
@Log(title = "客户报价信息", businessType = BusinessType.EXPORT)
@GetMapping("/exportCustomerQuoteFour/{supplierCode}")
public void exportCustomerQuoteFour(@PathVariable("supplierCode") String supplierCode, HttpServletResponse response){
sysCustomerQuoteService.exportCustomerQuoteFour(supplierCode,response);
}
}

35
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java

@ -0,0 +1,35 @@
package com.ruoyi.system.domain.Vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 采购报价子表导出模板类
* */
@Data
public class ExportCustomerQuoteChildVo {
/** 物料的描述 */
private String describe;
/** 物料的数量 */
private BigDecimal materialNum;
/** 物料的含税单价 */
private BigDecimal materialTaxMoney;
/** 物料的不含税单价 */
private BigDecimal materialNoTaxMoney;
/** 物料的含税总价 */
private BigDecimal materialAllTaxSum;
/** 物料的不含税总价 */
private BigDecimal materialAllNoTaxSum;
}

37
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteVo.java

@ -0,0 +1,37 @@
package com.ruoyi.system.domain.Vo;
import lombok.Data;
/**
* 采购报价导出模板类
* */
@Data
public class ExportCustomerQuoteVo {
/** 客户报价编号 */
private String supplierCode;
/** 报价日期*/
private String pricingDate;
/** 联系人 from */
private String contacts;
/** 联系电话 from */
private String contactNumberFrom;
/** 邮箱 from */
private String companyEmail;
/** 客户第一联系人 to */
private String customerContact;
/** 客户第一联系人电话 to */
private String contactNumberTo;
/** 客户第一联系人邮箱 to */
private String customerEmail;
}

8
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java

@ -90,6 +90,14 @@ public interface SysCustomerQuoteMapper
public SysCustomerQuote selectSysCustomerByCustomerQuoteCode(String customerCode);
/**
* 根据报价单号查询报价单信息
* */
public SysCustomerQuote selectSysCustomerBySupplierCode(String supplierCode);
List<SysCustomerQuote> selectSysCustomerQuoteBycode();
public int cancelSysCustomerQuoteById(Long id);

22
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -6,6 +6,7 @@ import com.ruoyi.system.domain.SysCustomerQuoteVo;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -85,4 +86,25 @@ public interface ISysCustomerQuoteService
ProcessInstance restoreSysCustomerById(Long id);
public ProcessInstance submitApply(SysCustomerQuote sysCustomerQuote);
/**
* 导出客户报价模板1
* */
void exportCustomerQuoteOne(String supplierCode, HttpServletResponse response);
/**
* 导出客户报价模板2
* */
void exportCustomerQuoteTwo(String supplierCode, HttpServletResponse response);
/**
* 导出客户报价模板3
* */
void exportCustomerQuoteThree(String supplierCode, HttpServletResponse response);
/**
* 导出客户报价模板4
* */
void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response);
}

330
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -1,5 +1,9 @@
package com.ruoyi.system.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.github.pagehelper.Page;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
@ -9,17 +13,20 @@ import com.ruoyi.common.service.ICommonService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileDownloadUtils;
import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.SysCustomerQuoteChildMapper;
import com.ruoyi.system.mapper.SysCustomerQuoteMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo;
import com.ruoyi.system.domain.Vo.ExportSalesOrderChildVo;
import com.ruoyi.system.domain.Vo.ExportSalesOrderVo;
import com.ruoyi.system.mapper.*;
import com.ruoyi.system.service.ISysAttachFileService;
import com.ruoyi.system.service.ISysAttachService;
import com.ruoyi.system.service.ISysCustomerQuoteService;
import com.ruoyi.system.service.ISysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
@ -30,8 +37,13 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.*;
@Slf4j
@Service
public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
@Autowired
@ -43,6 +55,9 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
@Autowired
private SysUserMapper userMapper;
@Autowired
private SysCompanyInformationMapper companyInformationMapper;
@Autowired
private TaskService taskService;
@ -54,6 +69,14 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
@Autowired
private ISysRoleService roleService;
@Autowired
private SysCustomerMapper sysCustomerMapper;
private final static String RMB = "1"; //RMB
@Override
public SysCustomerQuoteVo selectSysCustomerQuoteById(Long id) {
SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(id);
@ -352,4 +375,305 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
variables.put("authority",1);
}
}
/**
* 导出客户报价模板1
* */
@Override
public void exportCustomerQuoteOne(String supplierCode, HttpServletResponse response) {
String fileName = "客户报价1.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
try {
String fileRelativePath = fileDownloadUtils.getFileRelativePath(fileName);
String realFileName = supplierCode +"-" + fileName.substring(0, fileName.indexOf(".")) + ".xlsx";
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(realFileName, "UTF-8"));
response.setContentType("application/octet-stream");
//to
SysCustomerQuote sysCustomerQuote = sysCustomerQuoteMapper.selectSysCustomerBySupplierCode(supplierCode);
if(sysCustomerQuote==null){
log.warn("客户报价信息不存在:{}", supplierCode);
}
List<SysCustomerQuoteChild> sysCustomerQuoteChildren = sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildByQuoteId(sysCustomerQuote.getSupplierCode());
String customerCode = sysCustomerQuote.getCustomerCode();
SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(customerCode);
List<SysCompanyInformation> companyInformations = companyInformationMapper.selectSysCompanyInformationAllList();
//from
SysCompanyInformation sysCompanyInformation = companyInformations.get(0);
HashMap<String, Object> map = new HashMap<>();
String pricingDate = sysCustomerQuote.getPricingDate();
map.put("supplierCode", sysCustomerQuote.getSupplierCode());
map.put("pricingDate", pricingDate);
map.put("contacts", sysCompanyInformation.getContacts());
map.put("contactNumberFrom", sysCompanyInformation.getContactNumber());
map.put("companyEmail", sysCompanyInformation.getCompanyEmail());
map.put("customerContact", sysCustomerVo.getCustomerContact());
map.put("contactNumberTo", sysCustomerVo.getContactNumber());
map.put("customerEmail", sysCustomerVo.getCustomerEmail());
List<ExportCustomerQuoteChildVo> exportCustomerQuoteChildVos = new ArrayList<>();
for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildren) {
ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo();
exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe());
exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum());
//区分币种
setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild);
exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo);
}
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileRelativePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
workBook.fill(map, sheet);
workBook.fill(exportCustomerQuoteChildVos, fillConfig, sheet);
workBook.finish();
} catch (IOException e) {
throw new RuntimeException("文件处理失败",e);
}
}
/**
* 导出客户报价模板2
* */
@Override
public void exportCustomerQuoteTwo(String supplierCode, HttpServletResponse response) {
String fileName = "客户报价2.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
try {
String fileRelativePath = fileDownloadUtils.getFileRelativePath(fileName);
String realFileName = supplierCode +"-" + fileName.substring(0, fileName.indexOf(".")) + ".xlsx";
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(realFileName, "UTF-8"));
response.setContentType("application/octet-stream");
//to
SysCustomerQuote sysCustomerQuote = sysCustomerQuoteMapper.selectSysCustomerBySupplierCode(supplierCode);
if(sysCustomerQuote==null){
log.warn("客户报价信息不存在:{}", supplierCode);
}
List<SysCustomerQuoteChild> sysCustomerQuoteChildren = sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildByQuoteId(sysCustomerQuote.getSupplierCode());
String customerCode = sysCustomerQuote.getCustomerCode();
SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(customerCode);
HashMap<String, Object> map = new HashMap<>();
String pricingDate = sysCustomerQuote.getPricingDate();
map.put("supplierCode", sysCustomerQuote.getSupplierCode());
map.put("pricingDate", pricingDate);
map.put("customerContact", sysCustomerVo.getCustomerContact());
map.put("contactNumberTo", sysCustomerVo.getContactNumber());
map.put("customerEmail", sysCustomerVo.getCustomerEmail());
List<ExportCustomerQuoteChildVo> exportCustomerQuoteChildVos = new ArrayList<>();
for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildren) {
ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo();
exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe());
exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum());
//区分币种
setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild);
exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo);
}
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileRelativePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
workBook.fill(map, sheet);
workBook.fill(exportCustomerQuoteChildVos, fillConfig, sheet);
workBook.finish();
} catch (IOException e) {
throw new RuntimeException("文件处理失败",e);
}
}
/**
* 导出客户报价模板3
* */
@Override
public void exportCustomerQuoteThree(String supplierCode, HttpServletResponse response) {
String fileName = "客户报价3.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
try {
String fileRelativePath = fileDownloadUtils.getFileRelativePath(fileName);
String realFileName = supplierCode +"-" + fileName.substring(0, fileName.indexOf(".")) + ".xlsx";
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(realFileName, "UTF-8"));
response.setContentType("application/octet-stream");
//to
SysCustomerQuote sysCustomerQuote = sysCustomerQuoteMapper.selectSysCustomerBySupplierCode(supplierCode);
if(sysCustomerQuote==null){
log.warn("客户报价信息不存在:{}", supplierCode);
}
List<SysCustomerQuoteChild> sysCustomerQuoteChildren = sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildByQuoteId(sysCustomerQuote.getSupplierCode());
String customerCode = sysCustomerQuote.getCustomerCode();
SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(customerCode);
List<SysCompanyInformation> companyInformations = companyInformationMapper.selectSysCompanyInformationAllList();
//from
SysCompanyInformation sysCompanyInformation = companyInformations.get(0);
HashMap<String, Object> map = new HashMap<>();
String pricingDate = sysCustomerQuote.getPricingDate();
map.put("supplierCode", sysCustomerQuote.getSupplierCode());
map.put("pricingDate", pricingDate);
map.put("contacts", sysCompanyInformation.getContacts());
map.put("contactNumberFrom", sysCompanyInformation.getContactNumber());
map.put("companyEmail", sysCompanyInformation.getCompanyEmail());
map.put("customerContact", sysCustomerVo.getCustomerContact());
map.put("contactNumberTo", sysCustomerVo.getContactNumber());
map.put("customerEmail", sysCustomerVo.getCustomerEmail());
List<ExportCustomerQuoteChildVo> exportCustomerQuoteChildVos = new ArrayList<>();
for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildren) {
ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo();
exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe());
exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum());
//区分币种
setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild);
exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo);
}
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileRelativePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
workBook.fill(map, sheet);
workBook.fill(exportCustomerQuoteChildVos, fillConfig, sheet);
workBook.finish();
} catch (IOException e) {
throw new RuntimeException("文件处理失败",e);
}
}
/**
* 导出客户报价模板4
* */
@Override
public void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response) {
String fileName = "客户报价4.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
try {
String fileRelativePath = fileDownloadUtils.getFileRelativePath(fileName);
String realFileName = supplierCode +"-" + fileName.substring(0, fileName.indexOf(".")) + ".xlsx";
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(realFileName, "UTF-8"));
response.setContentType("application/octet-stream");
//to
SysCustomerQuote sysCustomerQuote = sysCustomerQuoteMapper.selectSysCustomerBySupplierCode(supplierCode);
if(sysCustomerQuote==null){
log.warn("客户报价信息不存在:{}", supplierCode);
}
List<SysCustomerQuoteChild> sysCustomerQuoteChildren = sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildByQuoteId(sysCustomerQuote.getSupplierCode());
String customerCode = sysCustomerQuote.getCustomerCode();
SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(customerCode);
HashMap<String, Object> map = new HashMap<>();
String pricingDate = sysCustomerQuote.getPricingDate();
map.put("supplierCode", sysCustomerQuote.getSupplierCode());
map.put("pricingDate", pricingDate);
map.put("customerContact", sysCustomerVo.getCustomerContact());
map.put("contactNumberTo", sysCustomerVo.getContactNumber());
map.put("customerEmail", sysCustomerVo.getCustomerEmail());
List<ExportCustomerQuoteChildVo> exportCustomerQuoteChildVos = new ArrayList<>();
for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildren) {
ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo();
exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe());
exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum());
//区分币种
setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild);
exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo);
}
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileRelativePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
workBook.fill(map, sheet);
workBook.fill(exportCustomerQuoteChildVos, fillConfig, sheet);
workBook.finish();
} catch (IOException e) {
throw new RuntimeException("文件处理失败",e);
}
}
//区分不同币种的金额
private void setMaterialPrice(ExportCustomerQuoteChildVo vo, SysCustomerVo sysCustomerVo, SysCustomerQuoteChild child) {
if (RMB.equals(sysCustomerVo.getCommonCurrency())) {
// RMB
BigDecimal noTax = child.getMaterialNoRmb() != null ? child.getMaterialNoRmb() : BigDecimal.ZERO;
BigDecimal tax = child.getMaterialRmb() != null ? child.getMaterialRmb() : BigDecimal.ZERO;
BigDecimal allNoTax = child.getMaterialNoRmbSum() != null ? child.getMaterialNoRmbSum() : BigDecimal.ZERO;
BigDecimal allTax = child.getMaterialRmbSum() != null ? child.getMaterialRmbSum() : BigDecimal.ZERO;
vo.setMaterialNoTaxMoney(noTax);
vo.setMaterialTaxMoney(tax);
vo.setMaterialAllNoTaxSum(allNoTax);
vo.setMaterialAllTaxSum(allTax);
} else {
// USD
BigDecimal noTax = child.getMaterialNoUsd() != null ? child.getMaterialNoUsd() : BigDecimal.ZERO;
BigDecimal tax = child.getUsdTax() != null ? child.getUsdTax() : BigDecimal.ZERO;
BigDecimal allNoTax = child.getMaterialNoUsdSum() != null ? child.getMaterialNoUsdSum() : BigDecimal.ZERO;
BigDecimal allTax = child.getMaterialUsdSum() != null ? child.getMaterialUsdSum() : BigDecimal.ZERO;
vo.setMaterialNoTaxMoney(noTax);
vo.setMaterialTaxMoney(tax);
vo.setMaterialAllNoTaxSum(allNoTax);
vo.setMaterialAllTaxSum(allTax);
}
}
}

9
ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml

@ -103,10 +103,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select customerCode,cusotomerName from sys_customer_quote
</select>
<select id="selectSysCustomerBySupplierCode" parameterType="String" resultMap="SysCustomerQuoteResult">
<include refid="selectSysCustomerQuoteVo"/>
where supplierCode = #{supplierCode}
</select>
<select id="selectSysCustomerByCustomerQuoteCode" parameterType="String" resultMap="SysCustomerQuoteResult">
<include refid="selectSysCustomerQuoteVo"/>
where customerCode = #{cusotomerCode}
</select>
<insert id="insertSysCustomerQuote" parameterType="SysCustomerQuote" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_quote
<trim prefix="(" suffix=")" suffixOverrides=",">

BIN
ruoyi-admin/src/main/resources/static/attachments/客户报价1.xlsx

Binary file not shown.

BIN
ruoyi-admin/src/main/resources/static/attachments/客户报价2.xlsx

Binary file not shown.

BIN
ruoyi-admin/src/main/resources/static/attachments/客户报价3.xlsx

Binary file not shown.

BIN
ruoyi-admin/src/main/resources/static/attachments/客户报价4.xlsx

Binary file not shown.

3
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@ -47,7 +47,7 @@ var table = {
paginationLoop: false,
pageSize: 10,
pageNumber: 1,
pageList: [10, 25, 50],
pageList: [10, 100, 1000],
toolbar: "toolbar",
loadingFontSize: 13,
striped: false,
@ -71,6 +71,7 @@ var table = {
rightFixedColumns: false,
fixedRightNumber: 0,
queryParams: $.table.queryParams,
height: $(window).height() - 100,
rowStyle: {},
};
var options = $.extend(defaults, options);

186
ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

@ -70,6 +70,20 @@
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:customerQuote:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteOne()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteOne">
<i class="fa fa-download"></i> 导出客户报价1
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteTwo()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteTwo">
<i class="fa fa-download"></i> 导出客户报价2
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteThree()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteThree">
<i class="fa fa-download"></i> 导出客户报价3
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteFour()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteFour">
<i class="fa fa-download"></i> 导出客户报价4
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table>
@ -117,7 +131,6 @@
restoreUrl: prefix + "/restore/{id}",
detailUrl: prefix + "/detail/{id}",
exportUrl: prefix + "/export",
pageSize: 5,
pageList: [5, 10, 25, 50],
modalName: "客户报价表",
fixedColumns:true,
@ -207,6 +220,177 @@
};
$.table.init(options);
});
// 导出客户报价模板1
function exportCustomerQuoteOne(){
const selectRows = $("#bootstrap-table").bootstrapTable('getSelections');
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1";//审核通过
const DELETE_FLAG = "2"; //作废
if (selectRows.length === 1){
const row = selectRows[0];
// 检查是否已作废
if (row.useStatus === DELETE_FLAG) {
showWarning("该订单已作废");
}else {
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
if (row.commonCurrency === '1'){
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的客户报价吗?", function() {
// 如果用户点击确定,继续导出
var supplierCode = row.supplierCode;
window.location.href = prefix + "/exportCustomerQuoteOne/" + supplierCode;
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}else {
showWarning("请选择报价币种为RMB的数据进行导出");
}
} else {
showWarning("请先审核");
}
}
}else {
$.modal.alertWarning("请选择一条数据");
return;
}
}
// 导出客户报价模板2
function exportCustomerQuoteTwo(){
const selectRows = $("#bootstrap-table").bootstrapTable('getSelections');
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1";//审核通过
const DELETE_FLAG = "2"; //作废
if (selectRows.length === 1){
const row = selectRows[0];
// 检查是否已作废
if (row.useStatus === DELETE_FLAG) {
showWarning("该订单已作废");
}else {
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
if (row.commonCurrency === '2'){
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的客户报价吗?", function() {
// 如果用户点击确定,继续导出
var supplierCode = row.supplierCode;
window.location.href = prefix + "/exportCustomerQuoteTwo/" + supplierCode;
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}else {
showWarning("请选择报价币种为美元的数据进行导出");
}
} else {
showWarning("请先审核");
}
}
}else {
$.modal.alertWarning("请选择一条数据");
return;
}
}
// 导出客户报价模板3
function exportCustomerQuoteThree(){
const selectRows = $("#bootstrap-table").bootstrapTable('getSelections');
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1";//审核通过
const DELETE_FLAG = "2"; //作废
if (selectRows.length === 1){
const row = selectRows[0];
// 检查是否已作废
if (row.useStatus === DELETE_FLAG) {
showWarning("该订单已作废");
}else {
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
if (row.commonCurrency === '2'){
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的客户报价吗?", function() {
// 如果用户点击确定,继续导出
var supplierCode = row.supplierCode;
window.location.href = prefix + "/exportCustomerQuoteThree/" + supplierCode;
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}else {
showWarning("请选择报价币种为美元的数据进行导出");
}
} else {
showWarning("请先审核");
}
}
}else {
$.modal.alertWarning("请选择一条数据");
return;
}
}
// 导出客户报价模板4
function exportCustomerQuoteFour(){
const selectRows = $("#bootstrap-table").bootstrapTable('getSelections');
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1";//审核通过
const DELETE_FLAG = "2"; //作废
if (selectRows.length === 1){
const row = selectRows[0];
// 检查是否已作废
if (row.useStatus === DELETE_FLAG) {
showWarning("该订单已作废");
}else {
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
if (row.commonCurrency === '2'){
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的客户报价吗?", function() {
// 如果用户点击确定,继续导出
var supplierCode = row.supplierCode;
window.location.href = prefix + "/exportCustomerQuoteFour/" + supplierCode;
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}else {
showWarning("请选择报价币种为美元的数据进行导出");
}
} else {
showWarning("请先审核");
}
}
}else {
$.modal.alertWarning("请选择一条数据");
return;
}
}
// 显示警告消息的通用函数
function showWarning(message) {
$.modal.msgWarning(message);
}
</script>
</body>
</html>

6
ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html

@ -61,9 +61,9 @@
<label class="col-sm-6 control-label is-required">是否含税:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}"
name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
<input required type="radio" th:id="${'confirmTax_' + dict.dictCode}"
name="confirmTax" th:value="${dict.dictValue}" th:field="*{confirmTax}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>

6
ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html

@ -61,9 +61,9 @@
<label class="col-sm-6 control-label is-required">是否含税:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}"
name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
<input required type="radio" th:id="${'confirmTax_' + dict.dictCode}"
name="confirmTax" th:value="${dict.dictValue}" th:field="*{confirmTax}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>

59
ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html

@ -83,7 +83,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input id="enterpriseName" name="enterpriseName" class="form-control" type="text">
<input id="enterpriseName" name="enterpriseName" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -181,16 +181,29 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否含税:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<input required type="radio" th:id="${'confirmTax_' + dict.dictCode}"
name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label is-required">是否含税:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">-->
<!-- <input required type="radio" th:id="${'confirmTax_' + dict.dictCode}"-->
<!-- name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}">-->
<!-- <label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-4 control-label is-required">是否含税:</label>
<div class="col-sm-8">
<!-- 报价币种单选按钮 -->
<div class="radio-inline">
<label><input type="radio" name="confirmTax" value="0">不含税</label>
</div>
<div class="radio-inline">
<label><input type="radio" name="confirmTax" value="1">含税</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否开票:</label>
@ -748,6 +761,34 @@
}
});
$(document).ready(function() {
$("#commonCurrency_add").on('change', function() {
var selectedValue = $(this).val();
var $radioTax = $('input:radio[name="confirmTax"][value="1"]');
var $radioNo = $('input:radio[name="confirmTax"][value="0"]');
// 设置含税单选按钮选中
if(selectedValue ==="1"){
console.log("1:"+selectedValue);
$radioNo.removeAttr('checked');
$radioTax.prop('checked','checked');
// $("input[name='confirmFax']").val(1);
console.log($radioTax.prop('checked'));
}else if(selectedValue ==="2"){
console.log("2:"+selectedValue);
$radioTax.removeAttr('checked',false);
$radioNo.prop('checked',true);
// $radioTax.removeAttr('checked');
// $radioNo.attr('checked','checked');
console.log($radioNo.prop('checked'));
}
});
});
$('#enterpriseCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='enterpriseName']").val(data.enterpriseName);

Loading…
Cancel
Save