diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index bab5541..7d5af67 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Mon Jun 03 10:50:48 CST 2024 +#Mon Jun 03 14:49:50 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.120 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 85cacc1..2242eb9 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 @@ -161,7 +161,8 @@ public class QuotController extends BaseController quot.setCreateBy(getUsername()); quot.setQuotSalesmanCode(getUsername()); quot.setUpdateBy(getUsername()); - return toAjax(quotService.insertQuot(quot)); + quotService.insertQuot(quot); + return success(quot); } /** @@ -416,6 +417,19 @@ public class QuotController extends BaseController return success(); } + /** + * 报价单提交核价协助 + */ + @PreAuthorize("@ss.hasPermi('quot:quot:assistJsw')") + @Log(title = "报价单提交金思维协助", businessType = BusinessType.OTHER) + @PostMapping("/commitJswQuot") + public AjaxResult commitJswQuot(@RequestBody Quot quot) + { + + // TODO 对接金思维接口 + return success(); + } + /** * 发送信息-报价组提交核价协助 * @param quotHj @@ -441,11 +455,15 @@ public class QuotController extends BaseController //Quot info = quotService.selectQuotByQuotId(quot_id); String quot_jsxz_approval_status = quot.getQuotJsxzApprovalStatus(); String quot_hj_approval_status = quot.getQuotHjApprovalStatus(); + String quot_jsw_approval_status = quot.getQuotJswApprovalStatus(); if("1".equals(quot_jsxz_approval_status)){ return error("技术协助还未完成"); } if("1".equals(quot_hj_approval_status)){ - return error("核价还未完成"); + return error("核价协助还未完成"); + } + if("1".equals(quot_jsw_approval_status)){ + return error("金思维协助还未完成"); } quot.setQuotQuotationDate(DateUtils.getNowDate());//报价单-报价日期设置为 当前日期 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java index eea8e5b..847d455 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java @@ -1,43 +1,95 @@ package com.ruoyi.web.controller.tool.quot; import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONObject; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.customer.domain.qcc.QccFuzzySearchJsonResult; +import com.ruoyi.quot.domain.Quot; +import com.ruoyi.quot.domain.QuotMaterial; +import com.ruoyi.quot.service.IQuotService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; +import java.util.List; + @Api("报价单数据接收") @RestController @RequestMapping("/jsw/jsw") public class quotJswController extends BaseController { + @Autowired + private IQuotService quotService; + @ApiOperation("同步报价数据") @PostMapping("/updateQuot") public R updateQuot(@RequestBody String quotJson) { - quotModel quot = JSON.parseObject(quotJson, quotModel.class); - /*if(StringUtils.isBlank(quot.getQuotJswCode())){ - return R.fail("金思维报价单号不能为空"); + try{ + quotModel quot = JSON.parseObject(quotJson, quotModel.class); + if(quot==null){ + return R.fail("参数异常为空"); + } + if(StringUtils.isBlank(quot.getQuotJswCode())){ + return R.fail("金思维报价单号不能为空"); + } + if(StringUtils.isBlank(quot.getQuotCode())){ + return R.fail("客户报价单号不能为空"); + } + if(StringUtils.isBlank(quot.getQuotTongPrice())){ + return R.fail("铜价不能为空"); + } + if(StringUtils.isBlank(quot.getQuotLvPrice())){ + return R.fail("铝价不能为空"); + } + if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){ + return R.fail("整单料价价差率不能为空"); + } + + List materials = quot.getQuotMaterial(); + if(materials==null || materials.size()==0){ + return R.fail("明细不能为空"); + } + + // 更新报价单 + String quotId = quotService.selectQuotByQuotCode(quot.getQuotCode()); + Quot q = quotService.selectQuotByQuotId(quotId); + q.setQuotJswCode(quot.getQuotJswCode()); + q.setQuotLvPrice(quot.getQuotLvPrice()); + q.setQuotTongPrice(quot.getQuotTongPrice()); + q.setQuotMatpriceDiff(quot.getQuotMatpriceDiff()); + + List qmaterials = new ArrayList(); + QuotMaterial quotMaterial = new QuotMaterial(); + for(quotMaterialModel model:materials){ + quotMaterial = new QuotMaterial(); + quotMaterial.setMatXingh(model.getMatXingh()); + quotMaterial.setMatGuig(model.getMatGuig()); + quotMaterial.setMatDiany(model.getMatDiany()); + quotMaterial.setMatDanw(model.getMatDanw()); + quotMaterial.setMatStandard(model.getMatStandard()); + quotMaterial.setMatSl(model.getMatSl()); + quotMaterial.setMatRemark(model.getMatRemark()); + quotMaterial.setMatMatprice(model.getMatMatprice()); + quotMaterial.setMatPrice(model.getMatPrice()); + quotMaterial.setMatQuotPrice(model.getMatQuotPrice()); + quotMaterial.setMatQuotAllPrice(model.getMatQuotAllPrice()); + quotMaterial.setMatMatpriceDiff(model.getMatMatpriceDiff()); + quotMaterial.setIndex(model.getIndex()); + qmaterials.add(quotMaterial); + } + + q.setQuotMaterialList(qmaterials); + quotService.updateQuot(q); + }catch(Exception e){ + return R.fail(e.getMessage()); } - if(StringUtils.isBlank(quot.getQuotCode())){ - return R.fail("客户报价单号不能为空"); - } - if(StringUtils.isBlank(quot.getQuotTongPrice())){ - return R.fail("铜价不能为空"); - } - if(StringUtils.isBlank(quot.getQuotLvPrice())){ - return R.fail("铝价不能为空"); - } - if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){ - return R.fail("整单料价价差率不能为空"); - }*/ + return R.ok(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java index a8b1a7d..a20422a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java @@ -7,6 +7,9 @@ import java.math.BigDecimal; @ApiModel(value = "quotMaterialModel", description = "报价单产品明细") public class quotMaterialModel { + @ApiModelProperty("行号") + private Integer index;//行号 + @ApiModelProperty("型号") private String matXingh;//型号 @@ -41,12 +44,14 @@ public class quotMaterialModel { private BigDecimal matQuotAllPrice;//报价金额 @ApiModelProperty("料价价差率") - private String matMatpriceDiff;//料价价差率 + private BigDecimal matMatpriceDiff;//料价价差率 + + public Integer getIndex() { return index; } + public void setIndex(Integer index) { this.index = index; } public String getMatXingh() { return matXingh; } - public void setMatXingh(String matXingh) { this.matXingh = matXingh; } @@ -54,7 +59,6 @@ public class quotMaterialModel { public String getMatGuig() { return matGuig; } - public void setMatGuig(String matGuig) { this.matGuig = matGuig; } @@ -62,7 +66,6 @@ public class quotMaterialModel { public String getMatDiany() { return matDiany; } - public void setMatDiany(String matDiany) { this.matDiany = matDiany; } @@ -70,7 +73,6 @@ public class quotMaterialModel { public String getMatStandard() { return matStandard; } - public void setMatStandard(String matStandard) { this.matStandard = matStandard; } @@ -78,7 +80,6 @@ public class quotMaterialModel { public BigDecimal getMatSl() { return matSl; } - public void setMatSl(BigDecimal matSl) { this.matSl = matSl; } @@ -86,7 +87,6 @@ public class quotMaterialModel { public String getMatDanw() { return matDanw; } - public void setMatDanw(String matDanw) { this.matDanw = matDanw; } @@ -94,7 +94,6 @@ public class quotMaterialModel { public String getMatRemark() { return matRemark; } - public void setMatRemark(String matRemark) { this.matRemark = matRemark; } @@ -102,7 +101,6 @@ public class quotMaterialModel { public BigDecimal getMatMatprice() { return matMatprice; } - public void setMatMatprice(BigDecimal matMatprice) { this.matMatprice = matMatprice; } @@ -110,7 +108,6 @@ public class quotMaterialModel { public BigDecimal getMatPrice() { return matPrice; } - public void setMatPrice(BigDecimal matPrice) { this.matPrice = matPrice; } @@ -118,7 +115,6 @@ public class quotMaterialModel { public BigDecimal getMatQuotPrice() { return matQuotPrice; } - public void setMatQuotPrice(BigDecimal matQuotPrice) { this.matQuotPrice = matQuotPrice; } @@ -126,16 +122,12 @@ public class quotMaterialModel { public BigDecimal getMatQuotAllPrice() { return matQuotAllPrice; } - public void setMatQuotAllPrice(BigDecimal matQuotAllPrice) { this.matQuotAllPrice = matQuotAllPrice; } - public String getMatMatpriceDiff() { - return matMatpriceDiff; - } - - public void setMatMatpriceDiff(String matMatpriceDiff) { + public BigDecimal getMatMatpriceDiff() { return matMatpriceDiff; } + public void setMatMatpriceDiff(BigDecimal matMatpriceDiff) { this.matMatpriceDiff = matMatpriceDiff; } } 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 d7cdf51..9fe2bb4 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 @@ -24,6 +24,9 @@ public class Quot extends BaseEntity @Excel(name = "报价单号") private String quotCode; + /** 金思维报价单号 */ + private String quotJswCode; + /** 业务员账号 */ private String quotSalesmanCode; @@ -143,6 +146,10 @@ public class Quot extends BaseEntity private String quotHjPricingDate;//核价日期 private String quotHjRemark;//核价备注 + + /** 金思维 **/ + private String quotJswApprovalStatus; + /** 报价单-产品信息 */ private List quotMaterialList; @@ -164,6 +171,9 @@ public class Quot extends BaseEntity { return quotCode; } + public String getQuotJswCode() { return quotJswCode; } + + public void setQuotJswCode(String quotJswCode) { this.quotJswCode = quotJswCode; } public String getQuotSalesmanCode() { return quotSalesmanCode; } public void setQuotSalesmanCode(String quotSalesmanCode) { this.quotSalesmanCode = quotSalesmanCode; } @@ -338,10 +348,7 @@ public class Quot extends BaseEntity public String getCreateName() {return createName;} public void setCreateName(String createName) {this.createName = createName;} - public List getQuotMaterialList() - { - return quotMaterialList; - } + public List getQuotMaterialList() { return quotMaterialList; } public void setQuotMaterialList(List quotMaterialList) { @@ -412,4 +419,7 @@ public class Quot extends BaseEntity public String getQuotHjRemark() { return quotHjRemark; } public void setQuotHjRemark(String quotHjRemark) { this.quotHjRemark = quotHjRemark; } + public String getQuotJswApprovalStatus() { return quotJswApprovalStatus; } + + public void setQuotJswApprovalStatus(String quotJswApprovalStatus) { this.quotJswApprovalStatus = quotJswApprovalStatus; } } 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 20e62b4..666d484 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 @@ -60,7 +60,7 @@ public class QuotMaterial extends BaseEntity private BigDecimal matQuotAllPrice; /** 料价价差率 */ - private String matMatpriceDiff; + private BigDecimal matMatpriceDiff; /** 排序 */ private Integer index;//序号 @@ -140,9 +140,9 @@ public class QuotMaterial extends BaseEntity public BigDecimal getMatQuotAllPrice() { return matQuotAllPrice; } public void setMatQuotAllPrice(BigDecimal matQuotAllPrice) { this.matQuotAllPrice = matQuotAllPrice; } - public String getMatMatpriceDiff() { return matMatpriceDiff; } + public BigDecimal getMatMatpriceDiff() { return matMatpriceDiff; } - public void setMatMatpriceDiff(String matMatpriceDiff) { this.matMatpriceDiff = matMatpriceDiff; } + public void setMatMatpriceDiff(BigDecimal matMatpriceDiff) { this.matMatpriceDiff = matMatpriceDiff; } public Integer getIndex() { return index; } public void setIndex(Integer index) { this.index = index; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java index f626dd0..cbb2ee4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java @@ -21,6 +21,13 @@ public interface QuotMapper */ public Quot selectQuotByQuotId(String quotId); + /** + * 根据报价单号获取信息 + * @param quotCode + * @return + */ + String selectQuotByQuotCode(String quotCode); + /** * 查询报价列表 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java index f4fa28b..20d355a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java @@ -21,6 +21,14 @@ public interface IQuotService */ public Quot selectQuotByQuotId(String quotId); + + /** + * 根据报价单号获取信息 + * @param quotCode + * @return + */ + String selectQuotByQuotCode(String quotCode); + /** * 查询报价列表 * @@ -90,4 +98,5 @@ public interface IQuotService * @return */ Boolean checkExistQuot(String username, String quotCustomerBm, String quotProject); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java index f66fe68..265d696 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java @@ -40,6 +40,16 @@ public class QuotServiceImpl implements IQuotService return quotMapper.selectQuotByQuotId(quotId); } + /** + * 根据报价单号获取信息 + * @param quotCode + * @return + */ + @Override + public String selectQuotByQuotCode(String quotCode) { + return quotMapper.selectQuotByQuotCode(quotCode); + } + /** * 查询报价列表 * diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index a5eb0fb..cb528b5 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -61,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -89,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select a.quot_id, a.quot_code, a.quot_salesman_code, a.quot_salesman_bm, a.quot_salesman_name, a.quot_customer_bm, + 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_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, @@ -107,7 +110,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.quot_hj_id,a.quot_hj_approval_status, h.quot_hj_code,h.quot_hj_pricing_date, - h.quot_hj_remark + h.quot_hj_remark, + + a.quot_jsw_approval_status from quot a @@ -128,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + +