|
@@ -17,6 +17,7 @@ import org.jeecg.modules.baseCode.service.ISerialPatternService;
|
|
|
import org.jeecg.modules.purCode.entity.*;
|
|
import org.jeecg.modules.purCode.entity.*;
|
|
|
import org.jeecg.modules.purCode.service.*;
|
|
import org.jeecg.modules.purCode.service.*;
|
|
|
import org.jeecg.modules.purCode.vo.SupplierQuotationDetails;
|
|
import org.jeecg.modules.purCode.vo.SupplierQuotationDetails;
|
|
|
|
|
+import org.jeecg.modules.saleCode.entity.SaleQuotation;
|
|
|
import org.jeecg.modules.saleCode.service.ISaleQuotationService;
|
|
import org.jeecg.modules.saleCode.service.ISaleQuotationService;
|
|
|
import org.jeecg.modules.saleCode.vo.SaleInquiryFormAlert;
|
|
import org.jeecg.modules.saleCode.vo.SaleInquiryFormAlert;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
@@ -75,6 +76,8 @@ public class PurPurchaseQuotationController {
|
|
|
private IPurOrderService purOrderService;
|
|
private IPurOrderService purOrderService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IBaseExchangeRateService baseExchangeRateService;
|
|
private IBaseExchangeRateService baseExchangeRateService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IPurQuotationSelectionProductService purQuotationSelectionProductService;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -100,6 +103,39 @@ public class PurPurchaseQuotationController {
|
|
|
return Result.OK(pageList);
|
|
return Result.OK(pageList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "获取采购报价单中的技术资料", notes = "获取采购报价单中的技术资料-分页列表查询")
|
|
|
|
|
+ @GetMapping(value = "/queryByFileList")
|
|
|
|
|
+ public Result<IPage<PurPurchaseQuotation>> queryByFileList(PurPurchaseQuotation purPurchaseQuotation,
|
|
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "100") Integer pageSize,
|
|
|
|
|
+ HttpServletRequest req) {
|
|
|
|
|
+
|
|
|
|
|
+ String id = purPurchaseQuotation.getId();
|
|
|
|
|
+ purPurchaseQuotation.setId(null);
|
|
|
|
|
+
|
|
|
|
|
+ QueryWrapper<PurPurchaseQuotation> queryWrapper = QueryGenerator.initQueryWrapper(purPurchaseQuotation, req.getParameterMap());
|
|
|
|
|
+ Page<PurPurchaseQuotation> page = new Page<PurPurchaseQuotation>(pageNo, pageSize);
|
|
|
|
|
+
|
|
|
|
|
+ List<PurQuotationSelectionProduct> listChild = purQuotationSelectionProductService.selectByMainId(id);
|
|
|
|
|
+ if(listChild.size() > 0){
|
|
|
|
|
+
|
|
|
|
|
+ String result = listChild.stream()
|
|
|
|
|
+ .map(product -> String.valueOf(product.getSourceId2()))
|
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
|
+
|
|
|
|
|
+// List<String> test = listChild.stream().map(PurQuotationSelectionProduct::getSourceId2).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ queryWrapper.in("id", Arrays.asList(result.split(",")));
|
|
|
|
|
+ IPage<PurPurchaseQuotation> pageList = purPurchaseQuotationService.page(page, queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ return Result.OK(pageList);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 采购报价单选定页签 - 供应商报价明细
|
|
* 采购报价单选定页签 - 供应商报价明细
|
|
|
*
|
|
*
|
|
@@ -192,6 +228,10 @@ public class PurPurchaseQuotationController {
|
|
|
*/
|
|
*/
|
|
|
public BigDecimal getRateByUsd(Date yearMonth, String currency) {
|
|
public BigDecimal getRateByUsd(Date yearMonth, String currency) {
|
|
|
|
|
|
|
|
|
|
+ if("美元".equals(currency)){
|
|
|
|
|
+ return BigDecimal.ONE;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String year = String.valueOf(yearMonth.getYear() + 1900);
|
|
String year = String.valueOf(yearMonth.getYear() + 1900);
|
|
|
String month = String.valueOf(yearMonth.getMonth() + 1);
|
|
String month = String.valueOf(yearMonth.getMonth() + 1);
|
|
|
|
|
|
|
@@ -224,7 +264,7 @@ public class PurPurchaseQuotationController {
|
|
|
exchangeRate = list2.get(0).getExchangeRate();
|
|
exchangeRate = list2.get(0).getExchangeRate();
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
- return BigDecimal.ONE;
|
|
|
|
|
|
|
+ return BigDecimal.ZERO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -258,6 +298,22 @@ public class PurPurchaseQuotationController {
|
|
|
return Result.OK(pageList);
|
|
return Result.OK(pageList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查看历史报价
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "采购报价单-查看历史报价", notes = "采购报价单-查看历史报价")
|
|
|
|
|
+ @GetMapping(value = "/queryHisByInfo")
|
|
|
|
|
+ public Result<List<PurPurchaseQuotation>> queryHisByInfo(@RequestParam(name = "quotationSuppiler", required = true) String quotationSuppiler,
|
|
|
|
|
+ @RequestParam(name = "productId", required = true) String productId) {
|
|
|
|
|
+ List<PurPurchaseQuotation> saleQuotationProductList = purPurchaseQuotationService.selectHisByInfo(quotationSuppiler,productId);
|
|
|
|
|
+
|
|
|
|
|
+ return Result.OK(saleQuotationProductList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 供应商报价汇总金额
|
|
* 供应商报价汇总金额
|
|
|
*
|
|
*
|
|
@@ -461,6 +517,7 @@ public class PurPurchaseQuotationController {
|
|
|
if (list.size() == 0) {
|
|
if (list.size() == 0) {
|
|
|
return Result.error("数据为空!");
|
|
return Result.error("数据为空!");
|
|
|
}
|
|
}
|
|
|
|
|
+// List<String> listId = new ArrayList<>();
|
|
|
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for (PurPurchaseQuotation o : list) {
|
|
for (PurPurchaseQuotation o : list) {
|
|
@@ -472,6 +529,24 @@ public class PurPurchaseQuotationController {
|
|
|
sb.append("单据编码" + code).append("已提交,请勿再次提交;");
|
|
sb.append("单据编码" + code).append("已提交,请勿再次提交;");
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// BigDecimal totalAmount = o.getTotalAmount();
|
|
|
|
|
+// String currency = o.getCurrency();
|
|
|
|
|
+// String id = o.getId();
|
|
|
|
|
+//
|
|
|
|
|
+// if(!"美元".equals(currency)){
|
|
|
|
|
+//
|
|
|
|
|
+// BigDecimal rate = this.getRateByUsd(new Date(), currency);
|
|
|
|
|
+// if(rate.compareTo(BigDecimal.ZERO) == 0){
|
|
|
|
|
+// return Result.error("当前币种("+currency+")未维护汇率,无法提交!");
|
|
|
|
|
+// }
|
|
|
|
|
+// totalAmount = totalAmount.multiply(rate);
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// if(totalAmount.compareTo(new BigDecimal("2000")) >= 0 ){
|
|
|
|
|
+// listId.add(id);
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(sb.toString())) {
|
|
if (StringUtils.isNotBlank(sb.toString())) {
|
|
@@ -483,9 +558,68 @@ public class PurPurchaseQuotationController {
|
|
|
ent.setSubmit("1");
|
|
ent.setSubmit("1");
|
|
|
purPurchaseQuotationService.update(ent, queryWrapper);
|
|
purPurchaseQuotationService.update(ent, queryWrapper);
|
|
|
|
|
|
|
|
|
|
+// if(listId.size() > 0){
|
|
|
|
|
+//
|
|
|
|
|
+// QueryWrapper<PurPurchaseQuotation> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
|
+// queryWrapper2.in("id",listId);
|
|
|
|
|
+// PurPurchaseQuotation ent2 = new PurPurchaseQuotation();
|
|
|
|
|
+//// 提交(1是 0否 2待审核)
|
|
|
|
|
+// ent2.setSubmit("2");
|
|
|
|
|
+// purPurchaseQuotationService.update(ent2, queryWrapper2);
|
|
|
|
|
+//
|
|
|
|
|
+// return Result.OK("提交成功(本单报价金额超过2000美金,需上级审批)!");
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
return Result.OK("提交成功!");
|
|
return Result.OK("提交成功!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 审批
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param ids
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @AutoLog(value = "采购报价单-审批")
|
|
|
|
|
+ @ApiOperation(value = "采购报价单-审批", notes = "采购报价单-审批")
|
|
|
|
|
+ @RequiresPermissions("purCode:pur_purchase_quotation:approval")
|
|
|
|
|
+ @GetMapping(value = "/approvalBatch")
|
|
|
|
|
+ public Result<String> approvalBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
|
+
|
|
|
|
|
+ QueryWrapper<PurPurchaseQuotation> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.in("id", Arrays.asList(ids.split(",")));
|
|
|
|
|
+
|
|
|
|
|
+ List<PurPurchaseQuotation> list = purPurchaseQuotationService.list(queryWrapper);
|
|
|
|
|
+ if (list.size() == 0) {
|
|
|
|
|
+ return Result.error("数据为空!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
|
|
+ for (PurPurchaseQuotation o : list) {
|
|
|
|
|
+ //提交(1-是 ,0-否 ,2-待审批)
|
|
|
|
|
+ String submit = o.getSubmit();
|
|
|
|
|
+ String code = o.getBillCode();
|
|
|
|
|
+
|
|
|
|
|
+ if (submit != null && submit != "" && !submit.equals("2")) {
|
|
|
|
|
+ sb.append("单据编码" + code).append("无需审批;");
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotBlank(sb.toString())) {
|
|
|
|
|
+
|
|
|
|
|
+ return Result.error(sb.toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
|
+ PurPurchaseQuotation ent = new PurPurchaseQuotation();
|
|
|
|
|
+ ent.setSubmit("1");
|
|
|
|
|
+ ent.setApprovalBy(sysUser.getUsername());
|
|
|
|
|
+ ent.setApprovalTime(new Date());
|
|
|
|
|
+ purPurchaseQuotationService.update(ent, queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ return Result.OK("审批成功!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 批量取消提交
|
|
* 批量取消提交
|
|
|
*
|
|
*
|
|
@@ -633,6 +767,37 @@ public class PurPurchaseQuotationController {
|
|
|
return mv;
|
|
return mv;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 导出excel
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param request
|
|
|
|
|
+ * @param purPurchaseQuotation
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequiresPermissions("purCode:pur_purchase_quotation:exportXls")
|
|
|
|
|
+ @RequestMapping(value = "/exportXls2")
|
|
|
|
|
+ public ModelAndView exportXls2(HttpServletRequest request, PurPurchaseQuotation purPurchaseQuotation) {
|
|
|
|
|
+ // Step.1 组装查询条件查询数据
|
|
|
|
|
+ QueryWrapper<PurPurchaseQuotation> queryWrapper = QueryGenerator.initQueryWrapper(purPurchaseQuotation, request.getParameterMap());
|
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
|
+
|
|
|
|
|
+ //配置选中数据查询条件
|
|
|
|
|
+ String selections = request.getParameter("selections");
|
|
|
|
|
+ if (oConvertUtils.isNotEmpty(selections)) {
|
|
|
|
|
+ List<String> selectionList = Arrays.asList(selections.split(","));
|
|
|
|
|
+ queryWrapper.in("id", selectionList);
|
|
|
|
|
+ }
|
|
|
|
|
+ //Step.2 获取导出数据
|
|
|
|
|
+ List<PurPurchaseQuotation> purPurchaseQuotationList = purPurchaseQuotationService.list(queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ // Step.4 AutoPoi 导出Excel
|
|
|
|
|
+ ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
|
|
+ mv.addObject(NormalExcelConstants.FILE_NAME, "采购报价单列表");
|
|
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, PurPurchaseQuotation.class);
|
|
|
|
|
+ mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("采购报价单数据", "导出人:" + sysUser.getRealname(), "采购报价单"));
|
|
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, purPurchaseQuotationList);
|
|
|
|
|
+ return mv;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 通过excel导入数据
|
|
* 通过excel导入数据
|
|
|
*
|
|
*
|