diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index ee158ac..d913671 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Wed May 29 13:58:29 CST 2024 +#Fri May 31 09:03:02 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.120 @@ -7,5 +7,5 @@ jco.client.saprouter= jco.client.user=RFC jco.client.sysnr=00 jco.destination.peak_limit=10 -jco.client.passwd=654321 +jco.client.passwd=dK4Y;AwNNY+M!AP8*j!bqsNgHiN+no{qJ7swP{yqQ,;.~I8T jco.client.client=300 diff --git a/logon/jnlogo_CKX20240531091305985620.png b/logon/jnlogo_CKX20240531091305985620.png new file mode 100644 index 0000000..4b005d0 Binary files /dev/null and b/logon/jnlogo_CKX20240531091305985620.png differ diff --git a/logon/wc_TSR20240531091306068374.png b/logon/wc_TSR20240531091306068374.png new file mode 100644 index 0000000..ae1f9fa Binary files /dev/null and b/logon/wc_TSR20240531091306068374.png differ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 6ad8cb2..85cacc1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -144,8 +144,8 @@ public class QuotController extends BaseController public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { ExcelUtil util = new ExcelUtil(QuotMaterial.class); - List userList = util.importExcel(file.getInputStream()); - return success(userList); + List materialList = util.importExcel(file.getInputStream()); + return success(materialList); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index 0921dee..3c36f5b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -11,12 +11,11 @@ import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.customer.domain.Customer; -import com.ruoyi.redBook.domain.OAQuotProduct; -import com.ruoyi.redBook.domain.Product; -import com.ruoyi.redBook.domain.OAQuot; -import com.ruoyi.redBook.domain.RbVersionDateResult; +import com.ruoyi.quot.domain.QuotMaterial; +import com.ruoyi.redBook.domain.*; import com.ruoyi.redBook.service.IRedBookService; import com.ruoyi.redBook.service.impl.AsyncRbTaskService; import com.ruoyi.web.utils.IdUtils; @@ -25,6 +24,7 @@ import com.ruoyi.web.utils.rbExcel.excelUtil; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -269,6 +269,75 @@ public class RedBookController extends BaseController excelUtil.exportExcel(response,quot,list); } + /** + * 导出产品明细模板 + * @param response + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) + { + ExcelUtil util = new ExcelUtil(OAQuotProductTemplate.class); + util.importTemplateExcel(response, "产品数据"); + } + + /** + * 导入产品明细 + * @param file + * @param updateSupport + * @return + * @throws Exception + */ + @PostMapping("/importData") + public AjaxResult importData(String rbUid, MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil(OAQuotProductTemplate.class); + List tempList = util.importExcel(file.getInputStream()); + + if(tempList.size()==0){ + return error("导入文件无产品明细数据"); + }else if(tempList.size()>200){ + return error("最多导入200条"); + } + + int index = 1; + for(OAQuotProductTemplate temp:tempList){ + temp.setIndex(index); + temp.setRbUid(rbUid); + index++; + } + + System.out.println("开始时间:" + DateUtils.getTime()); + List> list = ListSplitUtil.averageList(tempList,10); + List OAQuotProducts = new ArrayList<>(); + + //定义一个存所有线程回调函数的list + List>> futureList=new ArrayList<>(); + int num = 1; + for(List lt:list){ + futureList.add(asyncRbTaskService.executeAsyncTask2("线程"+num+"【"+lt.size()+"条】",lt)); + num++; + } + //判断进程是否全部结束** + while (true){ + //回调信息空了就结束** + if (futureList.isEmpty()){ + break; + } + for (int i = 0; i < futureList.size(); i++) { + if (futureList.get(i).isDone()){ + OAQuotProducts.addAll(futureList.get(i).get()); + //判断线程结束,输出回调信息,并将该回调清除 + futureList.remove(i); + }else { + continue; + } + } + } + System.out.println("结束时间:" + DateUtils.getTime()); + Collections.sort(OAQuotProducts); + return success(OAQuotProducts); + } + /** * 获取调价日期 * @param oAQuot diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotModel.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotModel.java index cf48eef..efdb07c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotModel.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotModel.java @@ -21,6 +21,7 @@ public class quotModel { @ApiModelProperty("整单料价价差率") private String quotMatpriceDiff;//整单料价价差率 + @ApiModelProperty("产品明细") private List quotMaterial;//明细 public String getQuotJswCode() { diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java index bcf48f0..a32a8a6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java @@ -2,7 +2,7 @@ package com.ruoyi.redBook.domain; import java.math.BigDecimal; -public class OAQuotProduct { +public class OAQuotProduct implements Comparable{ private Integer index;//序号 private String uid_0;//版本uid private String name_0;//产品型号 @@ -95,4 +95,9 @@ public class OAQuotProduct { public BigDecimal getPer2() { return per2; } public void setPer2(BigDecimal per2) { this.per2 = per2; } + + @Override + public int compareTo(OAQuotProduct p) { + return this.getIndex() - p.getIndex(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProductTemplate.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProductTemplate.java new file mode 100644 index 0000000..2a3e286 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProductTemplate.java @@ -0,0 +1,52 @@ +package com.ruoyi.redBook.domain; + +import com.ruoyi.common.annotation.Excel; + +import java.math.BigDecimal; + +public class OAQuotProductTemplate { + private Integer index; + + private String rbUid; + + @Excel(name = "型号") + private String name_1;//型号 + + @Excel(name = "规格") + private String spec;//规格 + + @Excel(name = "数量") + private BigDecimal count;//数量 + + public Integer getIndex() { return index; } + + public void setIndex(Integer index) { this.index = index; } + + public String getRbUid() { return rbUid; } + + public void setRbUid(String rbUid) { this.rbUid = rbUid; } + + public String getName_1() { + return name_1; + } + + public void setName_1(String name_1) { + this.name_1 = name_1; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java index 8484f7b..157af00 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java @@ -116,6 +116,15 @@ public interface OARedBookMapper */ String getFixDatePrice(@Param("name_0") String name_0,@Param("spec") String spec,@Param("voltage") String voltage, @Param("uid_0") String uid_0); + /** + * 导入明细批量获取红本价格 + * @param name_0 + * @param spec + * @param rbUid + * @return + */ + OAQuotProduct getFixDatePrice2(@Param("name_1") String name_1, @Param("spec") String spec, @Param("uid_0") String rbUid); + /** * 查询已生成的报价单列表 * @param oaQuot diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java index 2bc1cf5..7a4ecfb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java @@ -4,10 +4,7 @@ import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.customer.domain.Customer; import com.ruoyi.quote.domain.CalculateRBParamDto; -import com.ruoyi.redBook.domain.OAQuot; -import com.ruoyi.redBook.domain.OAQuotProduct; -import com.ruoyi.redBook.domain.Product; -import com.ruoyi.redBook.domain.RbVersionDateResult; +import com.ruoyi.redBook.domain.*; import java.util.List; @@ -136,5 +133,18 @@ public interface IRedBookService */ String rb_price_version(); + /** + * 选择调价版本批量获取红本价格 + * @param list + * @return + */ List setRedBookPrice(List list); + + /** + * 导入明细批量获取红本价格 + * @param list + * @return + */ + List setRedBookPrice2(List list); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/AsyncRbTaskService.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/AsyncRbTaskService.java index 5b16427..ce1df69 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/AsyncRbTaskService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/AsyncRbTaskService.java @@ -1,6 +1,8 @@ package com.ruoyi.redBook.service.impl; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.redBook.domain.OAQuotProduct; +import com.ruoyi.redBook.domain.OAQuotProductTemplate; import com.ruoyi.redBook.service.IRedBookService; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.AsyncResult; @@ -16,11 +18,31 @@ public class AsyncRbTaskService { @Resource private IRedBookService iRedBookService; + /** + * 选择调价版本批量获取红本价格 + * @param threadname + * @param list + * @return + */ @Async public Future> executeAsyncTask(String threadname, List list) { System.out.println(threadname); List OAQuotProducts = iRedBookService.setRedBookPrice(list); return new AsyncResult<>( OAQuotProducts); } + + /** + * 导入明细批量获取红本价格 + * @param threadname + * @param list + * @return + */ + @Async + public Future> executeAsyncTask2(String threadname, List list) { + System.out.println(threadname+"开始时间:" + DateUtils.getTime()); + List OAQuotProducts = iRedBookService.setRedBookPrice2(list); + System.out.println(threadname+"结束时间:" + DateUtils.getTime()); + return new AsyncResult<>( OAQuotProducts); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java index b4d6c03..3017694 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java @@ -9,10 +9,7 @@ import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.customer.domain.Bank; import com.ruoyi.customer.domain.Customer; import com.ruoyi.material.domain.CMaterialCost; -import com.ruoyi.redBook.domain.OAQuot; -import com.ruoyi.redBook.domain.OAQuotProduct; -import com.ruoyi.redBook.domain.Product; -import com.ruoyi.redBook.domain.RbVersionDateResult; +import com.ruoyi.redBook.domain.*; import com.ruoyi.redBook.mapper.OARedBookMapper; import com.ruoyi.redBook.service.IRedBookService; import org.springframework.beans.factory.annotation.Autowired; @@ -159,7 +156,7 @@ public class RedBookServiceImpl implements IRedBookService } if (list.size() > 0) { - int batchSize = 200; // 每批次插入的数据量 + int batchSize = 100; // 每批次插入的数据量 for (int i = 0; i < list.size(); i += batchSize) { int toIndex = Math.min(i + batchSize, list.size()); List subList = list.subList(i, toIndex); @@ -199,8 +196,13 @@ public class RedBookServiceImpl implements IRedBookService return oaRedBookMapper.getFixDatePrice(name_0,spec,voltage,uid_0); } + /** + * 选择调价版本批量获取红本价格 + * @param list + * @return + */ @Override - @DataSource(DataSourceType.OAREDBOOK) + @DataSource(DataSourceType.REDBOOK) public List setRedBookPrice(List list) { for(OAQuotProduct oAQuotProduct : list){ String price = oaRedBookMapper.getFixDatePrice(oAQuotProduct.getName_0(),oAQuotProduct.getSpec(),oAQuotProduct.getVoltage(),oAQuotProduct.getUid_0()); @@ -209,6 +211,35 @@ public class RedBookServiceImpl implements IRedBookService return list; } + /** + * 导入明细批量获取红本价格 + * @param list + * @return + */ + @Override + @DataSource(DataSourceType.REDBOOK) + public List setRedBookPrice2(List list) { + List OAQuotProducts = new ArrayList<>(); + OAQuotProduct oAQuotProduct = new OAQuotProduct(); + for(OAQuotProductTemplate oAQuotProductTemplate : list){ + OAQuotProduct rbProduct = oaRedBookMapper.getFixDatePrice2(oAQuotProductTemplate.getName_1(),oAQuotProductTemplate.getSpec(),oAQuotProductTemplate.getRbUid()); + if(rbProduct!=null){ + oAQuotProduct = new OAQuotProduct(); + oAQuotProduct.setIndex(oAQuotProductTemplate.getIndex()); + oAQuotProduct.setUid_0(rbProduct.getUid_0()); + oAQuotProduct.setName_0(rbProduct.getName_0()); + oAQuotProduct.setName_1(oAQuotProductTemplate.getName_1()); + oAQuotProduct.setSpec(oAQuotProductTemplate.getSpec()); + oAQuotProduct.setVoltage(rbProduct.getVoltage()); + oAQuotProduct.setStu(rbProduct.getStu()); + oAQuotProduct.setPrice(rbProduct.getPrice()); + oAQuotProduct.setCount(oAQuotProductTemplate.getCount()); + OAQuotProducts.add(oAQuotProduct); + } + } + return OAQuotProducts; + } + /** * 查询已生成的报价单列表 diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index b387982..a5eb0fb 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -119,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and quot_code like concat('%', #{quotCode}, '%') and quot_customer_name like concat('%', #{quotCustomerName}, '%') and quot_project like concat('%', #{quotProject}, '%') + and quot_print = #{quotPrint} and quot_approval_status = #{quotApprovalStatus} ${params.dataScope} diff --git a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml index 982f02b..e0fe44b 100644 --- a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml @@ -169,8 +169,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select top 1 红本价格 from rb_product_price A inner join [rb_productVersion] B on A.version_uid_0=B.uid_0 where A.[namevoltage] = #{name_0} and A.规格 = #{spec} - and A.电压等级 = #{voltage} and B.uid_0 = #{uid_0} - and (B.sta_0=1 or sta_0=0) order by B.uid_0 desc + and A.电压等级 = #{voltage} and B.uid_0 = #{uid_0} + and (B.sta_0=1 or sta_0=0) + + + diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index dd715cb..cb8fec4 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -18,7 +18,7 @@ const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, // 超时 - timeout: 60000 + timeout: 300000 }) // request拦截器 diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index 30f48a3..8d771f1 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -25,6 +25,16 @@ @keyup.enter.native="handleQuery" /> + + + + + - + @@ -1388,7 +1398,7 @@ export default { 'jsqrDialog': jsqrDialog, 'hjDialog': hjDialog }, - dicts: ['quot_approval_status','quot_jsxz_group','quot_jsxz_chapter','quot_jsxz_approval_status','quot_jsxz_standard','quot_hj_approval_status'], + dicts: ['quot_print', 'quot_approval_status','quot_jsxz_group','quot_jsxz_chapter','quot_jsxz_approval_status','quot_jsxz_standard','quot_hj_approval_status'], data() { return { //选项卡默认 @@ -1426,7 +1436,6 @@ export default { url: process.env.VUE_APP_BASE_API + "/quot/quot/importData" }, - // 报价单-询价附件列表数据 quotXjFileList: [], // 报价单-反馈附件列表数据 diff --git a/ruoyi-ui/src/views/redBook/productSelect.vue b/ruoyi-ui/src/views/redBook/productSelect.vue index 17ab39e..3f76769 100644 --- a/ruoyi-ui/src/views/redBook/productSelect.vue +++ b/ruoyi-ui/src/views/redBook/productSelect.vue @@ -10,7 +10,9 @@ 刷新 生成报价单 - 保存 + 保存 + 导入 + @@ -197,6 +199,34 @@ + + + + + +
将文件拖到此处,或点击上传
+
+ 仅允许导入xls、xlsx格式文件。 + 下载模板 +
+
+ +