From 8d4e901748b2022d1e14e9eb67c0b9720064e842 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Thu, 4 Jul 2024 15:31:43 +0800 Subject: [PATCH 1/9] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 11 ++++ .../controller/redBook/RedBookController.java | 48 +++++++++++---- .../main/java/com/ruoyi/quot/domain/Quot.java | 6 ++ .../com/ruoyi/quot/domain/QuotMaterial.java | 12 ++++ .../main/resources/mapper/quot/QuotMapper.xml | 16 +++-- ruoyi-ui/src/views/quot/quot/index.vue | 60 +++++++++++++++---- 6 files changed, 125 insertions(+), 28 deletions(-) create mode 100644 ABAP_AS_WITH_POOL.jcoDestination diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination new file mode 100644 index 0000000..0e7b9ed --- /dev/null +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -0,0 +1,11 @@ +#for tests only ! +#Thu Jul 04 15:05:23 CST 2024 +jco.destination.pool_capacity=10 +jco.client.lang=ZH +jco.client.ashost=172.19.0.125 +jco.client.saprouter= +jco.client.user=RFC +jco.client.sysnr=00 +jco.destination.peak_limit=10 +jco.client.passwd=654321 +jco.client.client=800 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 9c2a120..2ee2544 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 @@ -267,23 +267,46 @@ public class RedBookController extends BaseController public AjaxResult madeXjQuot(HttpServletResponse response, @RequestBody OAQuot quot) { Quot xjquot = new Quot(); - File excelFile = null; + List materials = new ArrayList(); + QuotMaterial xjquotMaterials = new QuotMaterial(); + /*File excelFile = null;*/ try{ xjquot.setQuotId(UUID.fastUUID().toString()); String quotCode = redBookService.getCode("BJD"); xjquot.setQuotCode(quotCode); - xjquot.setQuotApprovalStatus("0"); - xjquot.setQuotSalesmanCode(getUsername()); - xjquot.setQuotSalesmanBm(getLoginUser().getUser().getSapUserBm()); - xjquot.setQuotSalesmanName(getLoginUser().getUser().getNickName()); - xjquot.setQuotSalesmanDeptId(getLoginUser().getUser().getDept().getDeptId()+""); - xjquot.setQuotSalesmanDeptName(getLoginUser().getUser().getDept().getDeptName()); + xjquot.setQuotApprovalStatus("0");//询价单状态设置为 待提交 + xjquot.setQuotSalesmanCode(getUsername());//业务员id + xjquot.setQuotSalesmanBm(getLoginUser().getUser().getSapUserBm());//业务员编码 + xjquot.setQuotSalesmanName(getLoginUser().getUser().getNickName());//业务员名称 + xjquot.setQuotSalesmanDeptId(getLoginUser().getUser().getDept().getDeptId()+"");//部门id + xjquot.setQuotSalesmanDeptName(getLoginUser().getUser().getDept().getDeptName());//部门名称 + xjquot.setQuotRbDateUid(quot.getRbDateUid());//调价日期 xjquot.setCreateBy(getUsername()); - iQuotService.insertQuot(xjquot); List list = quot.getSelectedResultData(); + /** ===================================插入询价单明细表==================================*/ + for(OAQuotProduct op:list){ + xjquotMaterials = new QuotMaterial(); + xjquotMaterials.setMatXingh(op.getName_1());//型号 + xjquotMaterials.setMatGuig(op.getSpec());//规格 + xjquotMaterials.setMatDiany(op.getVoltage());//电压 + xjquotMaterials.setMatDanw(op.getStu());//单位 + xjquotMaterials.setMatSl(op.getCount());//数量 + xjquotMaterials.setMatPrice(new BigDecimal(op.getPrice()));//红本价 + xjquotMaterials.setMatPerc(op.getPer());//一次折扣 + xjquotMaterials.setMatPerc2(op.getPer2());//二次折扣 + xjquotMaterials.setMatQuotPrice(op.getSetPrice());//报价单价 + xjquotMaterials.setMatQuotAllPrice(op.getAllPrice());//报价金额 - File directory = new File("xjQuotFile/"); + xjquotMaterials.setIndex(op.getIndex()); + materials.add(xjquotMaterials); + } + xjquot.setQuotMaterialList(materials); + iQuotService.insertQuot(xjquot); + + /** ===================================插入询价单明细表==================================*/ + /** ===================================产品明细生成附件==================================*/ + /**File directory = new File("xjQuotFile/"); // 如果文件夹不存在,则创建文件夹 if (!directory.exists()) { directory.mkdir(); @@ -292,7 +315,7 @@ public class RedBookController extends BaseController File file = excelUtil.exportXjQuotExcel(response,excelFile,xjquot,list); MultipartFile multipartFile = convert(file); - /** 上传清单附件 **/ + // 上传清单附件 String relation_id = xjquot.getQuotId(); if(!StringUtils.isEmpty(relation_id)){ if (!multipartFile.isEmpty()) @@ -320,8 +343,9 @@ public class RedBookController extends BaseController }else{ return error("系统异常,询价单号为空!"); } - /** 上传清单附件 **/ - FileUtils.delete(excelFile); + // 上传清单附件 + FileUtils.delete(excelFile);*/ + /** ===================================产品明细生成附件==================================*/ }catch(Exception e){ return error("系统异常"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java index d04f524..e0abed8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java @@ -85,6 +85,9 @@ public class Quot extends BaseEntity /** 明细条数 */ private Integer quotMaterialsCount; + /** 调价日期 */ + private String quotRbDateUid; + /** 铝价 */ private String quotLvPrice; @@ -301,6 +304,9 @@ public class Quot extends BaseEntity public Integer getQuotMaterialsCount() { return quotMaterialsCount; } public void setQuotMaterialsCount(Integer quotMaterialsCount) { this.quotMaterialsCount = quotMaterialsCount; } + public String getQuotRbDateUid() { return quotRbDateUid; } + + public void setQuotRbDateUid(String quotRbDateUid) { this.quotRbDateUid = quotRbDateUid; } public String getQuotLvPrice() { return quotLvPrice; } public void setQuotLvPrice(String quotLvPrice) { this.quotLvPrice = quotLvPrice; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java index ad9c4f6..a8de819 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java @@ -53,6 +53,12 @@ public class QuotMaterial extends BaseEntity /** 红本价 */ private BigDecimal matPrice; + /** 一次折扣 */ + private BigDecimal matPerc; + + /** 二次折扣 */ + private BigDecimal matPerc2; + /** 报价 */ private BigDecimal matQuotPrice; @@ -138,6 +144,12 @@ public class QuotMaterial extends BaseEntity public void setMatMatprice(BigDecimal matMatprice) { this.matMatprice = matMatprice; } public BigDecimal getMatPrice() { return matPrice; } + public BigDecimal getMatPerc() { return matPerc; } + public void setMatPerc(BigDecimal matPerc) { this.matPerc = matPerc; } + + public BigDecimal getMatPerc2() { return matPerc2; } + public void setMatPerc2(BigDecimal matPerc2) { this.matPerc2 = matPerc2; } + public void setMatPrice(BigDecimal matPrice) { this.matPrice = matPrice; } public BigDecimal getMatQuotPrice() { return matQuotPrice; } diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index a991f8c..cb7dd3b 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -90,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -114,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.quot_customer_name,a.quot_salesman_dept_id, a.quot_salesman_dept_name, a.quot_address, a.quot_contacts, a.quot_phone, a.quot_inquiry_date, a.quot_project, a.quot_quotation_date, a.quot_quotation_from, a.quot_quotation_require, a.quot_feedback_explanation, a.quot_quantity, a.quot_total_price, - a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status,a.quot_materials_count, + a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status,a.quot_materials_count,a.quot_rbDateUid, a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_matprice_diff2,a.quot_print,a.quot_print_user_name,u3.nick_name quot_print_user_nickName, a.create_by, a.create_time, a.update_by, a.update_time, u.nick_name create_name,a.quot_handle, @@ -161,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select a.quot_id, a.quot_code,a.quot_jsw_code, a.quot_salesman_code, a.quot_salesman_bm, a.quot_salesman_name, a.quot_customer_bm,a.quot_customer_name, a.quot_salesman_dept_id, a.quot_salesman_dept_name, a.quot_address, a.quot_contacts, a.quot_phone, a.quot_inquiry_date, a.quot_project, a.quot_quotation_date, a.quot_quotation_from, a.quot_quotation_require, a.quot_feedback_explanation, - a.quot_quantity, a.quot_total_price, a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status, + a.quot_quantity, a.quot_total_price, a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status,a.quot_rbDateUid, a.quot_materials_count,a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_matprice_diff2,a.quot_print,a.quot_print_user_name,u3.nick_name quot_print_user_nickName, a.create_by, a.create_time, a.update_by, a.update_time,a.quot_handle, @@ -184,6 +187,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.mat_remark as sub_mat_remark, b.mat_matprice as sub_mat_matprice, b.mat_price as sub_mat_price, + b.mat_perc as sub_mat_perc, + b.mat_perc2 as sub_mat_perc2, b.mat_quot_price as sub_mat_quot_price, b.mat_quot_tp as sub_mat_quot_tp, @@ -239,6 +244,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quot_check_user_name, quot_approval_status, quot_materials_count, + quot_rbDateUid, quot_lv_price, quot_tong_price, quot_matprice_diff, @@ -288,6 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{quotCheckUserName}, #{quotApprovalStatus}, #{quotMaterialsCount}, + #{quotRbDateUid}, #{quotLvPrice}, #{quotTongPrice}, #{quotMatpriceDiff}, @@ -392,6 +399,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quot_check_user_name = #{quotCheckUserName}, quot_approval_status = #{quotApprovalStatus}, quot_materials_count = #{quotMaterialsCount}, + quot_rbDateUid = #{quotRbDateUid}, quot_lv_price = #{quotLvPrice}, quot_tong_price = #{quotTongPrice}, quot_matprice_diff = #{quotMatpriceDiff}, @@ -442,9 +450,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into quot_material( mat_id, mat_xingh, mat_guig, mat_diany,mat_standard, mat_danw, mat_sl,mat_remark, quot_id,xh,number,mat_matprice,mat_price,mat_quot_price,mat_quot_tp,mat_quot_allPrice,mat_matprice_diff) values + insert into quot_material( mat_id, mat_xingh, mat_guig, mat_diany,mat_standard, mat_danw, mat_sl,mat_remark, quot_id,xh,number,mat_matprice,mat_price,mat_perc,mat_perc2,mat_quot_price,mat_quot_tp,mat_quot_allPrice,mat_matprice_diff) values - ( #{item.matId}, #{item.matXingh}, #{item.matGuig}, #{item.matDiany}, #{item.matStandard}, #{item.matDanw}, cast(#{item.matSl,jdbcType=DECIMAL} as decimal(18,3)),#{item.matRemark}, #{item.quotId}, #{item.xh}, #{item.index}, cast(#{item.matMatprice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotTp,jdbcType=DECIMAL} as decimal(18,3)),cast(#{item.matQuotAllPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matMatpriceDiff,jdbcType=DECIMAL} as decimal(18,3))) + ( #{item.matId}, #{item.matXingh}, #{item.matGuig}, #{item.matDiany}, #{item.matStandard}, #{item.matDanw}, cast(#{item.matSl,jdbcType=DECIMAL} as decimal(18,3)),#{item.matRemark}, #{item.quotId}, #{item.xh}, #{item.index}, cast(#{item.matMatprice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matPerc,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.matPerc2,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.matQuotPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotTp,jdbcType=DECIMAL} as decimal(18,3)),cast(#{item.matQuotAllPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matMatpriceDiff,jdbcType=DECIMAL} as decimal(18,3))) diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index 5bf1ca2..fbbc3a8 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -526,6 +526,15 @@ + + + + + 导入 @@ -538,32 +547,32 @@ @@ -571,11 +580,21 @@ - + + + + + + + - +