diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java index a776417..b4e955c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java @@ -75,13 +75,32 @@ public class QuoteCraftController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:ServiceGoods:query')") @PostMapping(value = "/selectQuoteTypeList") - public AjaxResult selectQuoteTypeList() + public AjaxResult selectQuoteTypeList(@RequestBody List ids) { - - QuoteType quoteType = new QuoteType(); - - List quoteTypeList = quoteTypeService.selectQuoteTypeList(quoteType); - return success(quoteType); + if (ids == null || ids.isEmpty()) { + return success(new ArrayList<>()); + } + + QuoteType query = new QuoteType(); + query.setStatus(1L); // 只获取启用状态的数据 + List allTypes = quoteTypeService.selectQuoteTypeList(query); + + // 根据服务项目ID过滤工艺分类 + List filteredTypes = allTypes.stream() + .filter(type -> { + if (type.getGoodId() != null) { + try { + List typeGoodIds = JSON.parseArray(type.getGoodId(), String.class); + return typeGoodIds.stream().anyMatch(goodId -> ids.contains(Long.parseLong(goodId))); + } catch (Exception e) { + return false; + } + } + return false; + }) + .collect(Collectors.toList()); + + return success(filteredTypes); } @@ -143,14 +162,14 @@ public class QuoteCraftController extends BaseController if (quoteCraft.getTypeId()!=null) { String strtype = quoteCraft.getTypeId(); List strtypeList = JSON.parseArray(strtype, String.class); - List intstrtypeList = strtypeList.stream().map(Integer::parseInt).collect(Collectors.toList()); - quoteCraft.setTypeintids(intstrtypeList); + List longTypeList = strtypeList.stream().map(Long::parseLong).collect(Collectors.toList()); + quoteCraft.setTypeintids(longTypeList); } if (quoteCraft.getGoodId()!=null){ String str = quoteCraft.getGoodId(); List stringList = JSON.parseArray(str, String.class); - List intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList()); - quoteCraft.setGoodsintids(intList); + List longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList()); + quoteCraft.setGoodsintids(longList); } } return success(quoteCraft); @@ -164,14 +183,21 @@ public class QuoteCraftController extends BaseController @PostMapping public AjaxResult add(@RequestBody QuoteCraft quoteCraft) { - if(quoteCraft.getGoodsintids().size()>0){ - List intList =quoteCraft.getGoodsintids(); + if(quoteCraft.getGoodsintids() != null && quoteCraft.getGoodsintids().size()>0){ + List longList = quoteCraft.getGoodsintids(); // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); // 再转成json字符串 String json = JSON.toJSONString(strList); quoteCraft.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); + } + if(quoteCraft.getTypeintids() != null && quoteCraft.getTypeintids().size()>0){ + List longList = quoteCraft.getTypeintids(); + // 先转成字符串List + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); + // 再转成json字符串 + String json = JSON.toJSONString(strList); + quoteCraft.setTypeId(json.replaceAll("\",\"", "\", \"")); } return toAjax(quoteCraftService.insertQuoteCraft(quoteCraft)); } @@ -184,14 +210,21 @@ public class QuoteCraftController extends BaseController @PutMapping public AjaxResult edit(@RequestBody QuoteCraft quoteCraft) { - if(quoteCraft.getGoodsintids().size()>0){ - List intList =quoteCraft.getGoodsintids(); + if(quoteCraft.getGoodsintids() != null && quoteCraft.getGoodsintids().size()>0){ + List longList = quoteCraft.getGoodsintids(); // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); // 再转成json字符串 String json = JSON.toJSONString(strList); quoteCraft.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); + } + if(quoteCraft.getTypeintids() != null && quoteCraft.getTypeintids().size()>0){ + List longList = quoteCraft.getTypeintids(); + // 先转成字符串List + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); + // 再转成json字符串 + String json = JSON.toJSONString(strList); + quoteCraft.setTypeId(json.replaceAll("\",\"", "\", \"")); } return toAjax(quoteCraftService.updateQuoteCraft(quoteCraft)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialController.java index 7c1166e..cdea516 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialController.java @@ -106,11 +106,19 @@ public class QuoteMaterialController extends BaseController public AjaxResult getInfo(@PathVariable("id") Long id) { QuoteMaterial quoteMaterial=quoteMaterialService.selectQuoteMaterialById(id); - if (quoteMaterial.getGoodId()!=null){ - String str = quoteMaterial.getGoodId(); - List stringList = JSON.parseArray(str, String.class); - List intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList()); - quoteMaterial.setGoodsintids(intList); + if (quoteMaterial != null) { + if (quoteMaterial.getGoodId() != null) { + String str = quoteMaterial.getGoodId(); + List stringList = JSON.parseArray(str, String.class); + List longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList()); + quoteMaterial.setGoodsintids(longList); + } + if (quoteMaterial.getTypeId() != null) { + String typeStr = quoteMaterial.getTypeId(); + List typeStringList = JSON.parseArray(typeStr, String.class); + List typeLongList = typeStringList.stream().map(Long::parseLong).collect(Collectors.toList()); + quoteMaterial.setTypeintids(typeLongList); + } } return success(quoteMaterial); } @@ -123,14 +131,17 @@ public class QuoteMaterialController extends BaseController @PostMapping public AjaxResult add(@RequestBody QuoteMaterial quoteMaterial) { - if(quoteMaterial.getGoodsintids().size()>0){ - List intList =quoteMaterial.getGoodsintids(); - // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); - // 再转成json字符串 + if (quoteMaterial.getGoodsintids() != null && quoteMaterial.getGoodsintids().size() > 0) { + List longList = quoteMaterial.getGoodsintids(); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); String json = JSON.toJSONString(strList); quoteMaterial.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); + } + if (quoteMaterial.getTypeintids() != null && quoteMaterial.getTypeintids().size() > 0) { + List longList = quoteMaterial.getTypeintids(); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); + String json = JSON.toJSONString(strList); + quoteMaterial.setTypeId(json.replaceAll("\",\"", "\", \"")); } return toAjax(quoteMaterialService.insertQuoteMaterial(quoteMaterial)); } @@ -143,17 +154,17 @@ public class QuoteMaterialController extends BaseController @PutMapping public AjaxResult edit(@RequestBody QuoteMaterial quoteMaterial) { - if(quoteMaterial.getGoodsintids().size()>0){ - System.out.println("#########################"+quoteMaterial.getGoodsintids()); - List intList =quoteMaterial.getGoodsintids(); - // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); - // 再转成json字符串 + if (quoteMaterial.getGoodsintids() != null && quoteMaterial.getGoodsintids().size() > 0) { + List longList = quoteMaterial.getGoodsintids(); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); String json = JSON.toJSONString(strList); quoteMaterial.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); - - + } + if (quoteMaterial.getTypeintids() != null && quoteMaterial.getTypeintids().size() > 0) { + List longList = quoteMaterial.getTypeintids(); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); + String json = JSON.toJSONString(strList); + quoteMaterial.setTypeId(json.replaceAll("\",\"", "\", \"")); } return toAjax(quoteMaterialService.updateQuoteMaterial(quoteMaterial)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java index 414e454..bad1e73 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java @@ -75,6 +75,19 @@ public class QuoteMaterialTypeController extends BaseController util.exportExcel(response, list, "项目报价--物料分类数据"); } + /** + * 获取项目报价--物料分类数据列表(不分页) + */ + @PreAuthorize("@ss.hasPermi('system:QuoteMaterialType:query')") + @GetMapping(value = "/dataList") + public AjaxResult dataList() + { + QuoteMaterialType query = new QuoteMaterialType(); + query.setStatus(1L); // 只获取启用状态的数据 + List list = quoteMaterialTypeService.selectQuoteMaterialTypeList(query); + return success(list); + } + /** * 获取项目报价--物料分类详细信息 */ @@ -86,8 +99,8 @@ public class QuoteMaterialTypeController extends BaseController if (quoteMaterialType.getGoodId()!=null){ String str = quoteMaterialType.getGoodId(); List stringList = JSON.parseArray(str, String.class); - List intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList()); - quoteMaterialType.setGoodsintids(intList); + List longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList()); + quoteMaterialType.setGoodsintids(longList); } return success(quoteMaterialType); @@ -101,14 +114,13 @@ public class QuoteMaterialTypeController extends BaseController @PostMapping public AjaxResult add(@RequestBody QuoteMaterialType quoteMaterialType) { - if(quoteMaterialType.getGoodsintids().size()>0){ - List intList =quoteMaterialType.getGoodsintids(); + if(quoteMaterialType.getGoodsintids() != null && quoteMaterialType.getGoodsintids().size()>0){ + List longList = quoteMaterialType.getGoodsintids(); // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); // 再转成json字符串 String json = JSON.toJSONString(strList); quoteMaterialType.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); } return toAjax(quoteMaterialTypeService.insertQuoteMaterialType(quoteMaterialType)); } @@ -121,17 +133,15 @@ public class QuoteMaterialTypeController extends BaseController @PutMapping public AjaxResult edit(@RequestBody QuoteMaterialType quoteMaterialType) { - if(quoteMaterialType.getGoodsintids().size()>0){ + if(quoteMaterialType.getGoodsintids() != null && quoteMaterialType.getGoodsintids().size()>0){ System.out.println("#########################"+quoteMaterialType.getGoodsintids()); - List intList =quoteMaterialType.getGoodsintids(); + List longList = quoteMaterialType.getGoodsintids(); // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); // 再转成json字符串 String json = JSON.toJSONString(strList); quoteMaterialType.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); System.out.println("#########################"+json.replaceAll("\",\"", "\", \"")); - } return toAjax(quoteMaterialTypeService.updateQuoteMaterialType(quoteMaterialType)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteTypeController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteTypeController.java index 92ad90f..7969086 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteTypeController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteTypeController.java @@ -129,6 +129,19 @@ public class QuoteTypeController extends BaseController } + /** + * 获取项目报价--工艺分类数据列表(不分页) + */ + @PreAuthorize("@ss.hasPermi('system:QuoteType:query')") + @GetMapping(value = "/dataList") + public AjaxResult dataList() + { + QuoteType query = new QuoteType(); + query.setStatus(1L); // 只获取启用状态的数据 + List list = quoteTypeService.selectQuoteTypeList(query); + return success(list); + } + /** * 获取项目报价--工艺分类详细信息 */ @@ -141,8 +154,8 @@ public class QuoteTypeController extends BaseController if (quoteType.getGoodId()!=null){ String str = quoteType.getGoodId(); List stringList = JSON.parseArray(str, String.class); - List intList = stringList.stream().map(Integer::parseInt).collect(Collectors.toList()); - quoteType.setGoodsintids(intList); + List longList = stringList.stream().map(Long::parseLong).collect(Collectors.toList()); + quoteType.setGoodsintids(longList); } @@ -160,14 +173,13 @@ public class QuoteTypeController extends BaseController public AjaxResult add(@RequestBody QuoteType quoteType) { - if(quoteType.getGoodsintids().size()>0){ - List intList =quoteType.getGoodsintids(); + if(quoteType.getGoodsintids() != null && quoteType.getGoodsintids().size()>0){ + List longList = quoteType.getGoodsintids(); // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); // 再转成json字符串 String json = JSON.toJSONString(strList); quoteType.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); } return toAjax(quoteTypeService.insertQuoteType(quoteType)); } @@ -180,18 +192,13 @@ public class QuoteTypeController extends BaseController @PutMapping public AjaxResult edit(@RequestBody QuoteType quoteType) { - - if(quoteType.getGoodsintids().size()>0){ - System.out.println("#########################"+quoteType.getGoodsintids()); - List intList =quoteType.getGoodsintids(); + if(quoteType.getGoodsintids() != null && quoteType.getGoodsintids().size()>0){ + List longList = quoteType.getGoodsintids(); // 先转成字符串List - List strList = intList.stream().map(String::valueOf).collect(Collectors.toList()); + List strList = longList.stream().map(String::valueOf).collect(Collectors.toList()); // 再转成json字符串 String json = JSON.toJSONString(strList); quoteType.setGoodId(json.replaceAll("\",\"", "\", \"")); - //String withSpace = compact.replaceAll("\",\"", "\", \""); - System.out.println("#########################"+json.replaceAll("\",\"", "\", \"")); - } return toAjax(quoteTypeService.updateQuoteType(quoteType)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteCraft.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteCraft.java index 499a3e9..b2dad4d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteCraft.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteCraft.java @@ -46,9 +46,9 @@ public class QuoteCraft extends BaseEntity @Excel(name = "服务名称") private String ServiceName; - private List goodsintids; + private List goodsintids; - private List typeintids; + private List typeintids; /** $column.columnComment */ @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @@ -146,19 +146,19 @@ public class QuoteCraft extends BaseEntity ServiceName = serviceName; } - public List getGoodsintids() { + public List getGoodsintids() { return goodsintids; } - public void setGoodsintids(List goodsintids) { + public void setGoodsintids(List goodsintids) { this.goodsintids = goodsintids; } - public List getTypeintids() { + public List getTypeintids() { return typeintids; } - public void setTypeintids(List typeintids) { + public void setTypeintids(List typeintids) { this.typeintids = typeintids; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterial.java index 5c982ec..1e53d2f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterial.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterial.java @@ -71,7 +71,9 @@ public class QuoteMaterial extends BaseEntity private Date updatedAt; - private List goodsintids; + private List goodsintids; + + private List typeintids; public void setId(Long id) { @@ -185,14 +187,22 @@ public class QuoteMaterial extends BaseEntity this.priceMax = priceMax; } - public List getGoodsintids() { + public List getGoodsintids() { return goodsintids; } - public void setGoodsintids(List goodsintids) { + public void setGoodsintids(List goodsintids) { this.goodsintids = goodsintids; } + public List getTypeintids() { + return typeintids; + } + + public void setTypeintids(List typeintids) { + this.typeintids = typeintids; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterialType.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterialType.java index 155ead7..9d5df69 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterialType.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteMaterialType.java @@ -49,7 +49,7 @@ public class QuoteMaterialType extends BaseEntity @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private Date updatedAt; - private List goodsintids; + private List goodsintids; public void setId(Long id) { @@ -129,11 +129,11 @@ public class QuoteMaterialType extends BaseEntity this.serviceName = serviceName; } - public List getGoodsintids() { + public List getGoodsintids() { return goodsintids; } - public void setGoodsintids(List goodsintids) { + public void setGoodsintids(List goodsintids) { this.goodsintids = goodsintids; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteType.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteType.java index 2b54add..c93f553 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteType.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/QuoteType.java @@ -45,7 +45,7 @@ public class QuoteType extends BaseEntity private List goodsids; - private List goodsintids; + private List goodsintids; @@ -146,11 +146,11 @@ public class QuoteType extends BaseEntity this.goodsids = goodsids; } - public List getGoodsintids() { + public List getGoodsintids() { return goodsintids; } - public void setGoodsintids(List goodsintids) { + public void setGoodsintids(List goodsintids) { this.goodsintids = goodsintids; } diff --git a/ruoyi-ui/src/api/system/QuoteMaterialType.js b/ruoyi-ui/src/api/system/QuoteMaterialType.js index 94edf99..8d4a4dc 100644 --- a/ruoyi-ui/src/api/system/QuoteMaterialType.js +++ b/ruoyi-ui/src/api/system/QuoteMaterialType.js @@ -16,6 +16,14 @@ export function getQuoteMaterialType(id) { method: 'get' }) } + +// 获取项目报价--物料分类数据列表(不分页) +export function getQuoteMaterialTypeDataList() { + return request({ + url: '/system/QuoteMaterialType/dataList', + method: 'get' + }) +} // 任务状态修改 export function changetypeStatus(id, status) { const data = { diff --git a/ruoyi-ui/src/api/system/QuoteType.js b/ruoyi-ui/src/api/system/QuoteType.js index f1391f5..2c80c67 100644 --- a/ruoyi-ui/src/api/system/QuoteType.js +++ b/ruoyi-ui/src/api/system/QuoteType.js @@ -25,6 +25,14 @@ export function getQuoteType(id) { method: 'get' }) } + +// 获取项目报价--工艺分类数据列表(不分页) +export function getQuoteTypeDataList() { + return request({ + url: '/system/QuoteType/dataList', + method: 'get' + }) +} // 任务状态修改 export function changetypeStatus(id, status) { const data = { diff --git a/ruoyi-ui/src/views/system/QuoteCraft/index.vue b/ruoyi-ui/src/views/system/QuoteCraft/index.vue index 2964d3a..824c67e 100644 --- a/ruoyi-ui/src/views/system/QuoteCraft/index.vue +++ b/ruoyi-ui/src/views/system/QuoteCraft/index.vue @@ -1,7 +1,7 @@