|
@@ -88,12 +88,37 @@ public class SaleInquiryFormController {
|
|
|
//@AutoLog(value = "销售询价单-分页列表查询")
|
|
|
@ApiOperation(value = "销售询价单-分页列表查询", notes = "销售询价单-分页列表查询")
|
|
|
@GetMapping(value = "/list")
|
|
|
- @PermissionData(pageComponent="saleCode/saleInquiryForm/SaleInquiryFormList")
|
|
|
+ @PermissionData(pageComponent = "saleCode/saleInquiryForm/SaleInquiryFormList")
|
|
|
public Result<IPage<SaleInquiryForm>> queryPageList(SaleInquiryForm saleInquiryForm,
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
HttpServletRequest req) {
|
|
|
+
|
|
|
+ String shipName = saleInquiryForm.getShipName();
|
|
|
+// String imo = saleInquiryForm.getImo();
|
|
|
+
|
|
|
+ QueryWrapper<SaleInquiryFormShip> shipQueryWrapper = new QueryWrapper<>();
|
|
|
+ if(StringUtils.isNotBlank(shipName)){
|
|
|
+ shipQueryWrapper.eq("ship_name", shipName);
|
|
|
+ saleInquiryForm.setShipName(null);
|
|
|
+ }
|
|
|
+// if(StringUtils.isNotBlank(imo)){
|
|
|
+//
|
|
|
+// shipQueryWrapper.eq("imo", imo);
|
|
|
+// saleInquiryForm.setImo(null);
|
|
|
+// }
|
|
|
+
|
|
|
QueryWrapper<SaleInquiryForm> queryWrapper = QueryGenerator.initQueryWrapper(saleInquiryForm, req.getParameterMap());
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(shipName)){
|
|
|
+
|
|
|
+ List<SaleInquiryFormShip> list = saleInquiryFormShipService.list(shipQueryWrapper);
|
|
|
+ if (list.size() > 0) {
|
|
|
+ String[] headId = list.stream().map(SaleInquiryFormShip::getHeadId).toArray(String[]::new);
|
|
|
+ queryWrapper.in("id", headId);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
Page<SaleInquiryForm> page = new Page<SaleInquiryForm>(pageNo, pageSize);
|
|
|
IPage<SaleInquiryForm> pageList = saleInquiryFormService.page(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
@@ -117,14 +142,13 @@ public class SaleInquiryFormController {
|
|
|
HttpServletRequest req) {
|
|
|
|
|
|
|
|
|
-
|
|
|
- LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
|
|
- if(!sysUser.getUsername().equals("admin")){
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ if (!sysUser.getUsername().equals("admin")) {
|
|
|
|
|
|
String orgCode = sysUser.getOrgCode();
|
|
|
- if(StringUtils.isNotBlank(orgCode)){
|
|
|
+ if (StringUtils.isNotBlank(orgCode)) {
|
|
|
SysDepart dept = sysDepartService.queryDeptByCode(orgCode);
|
|
|
- if(dept != null){
|
|
|
+ if (dept != null) {
|
|
|
saleInquiryForm.setInquiryTeam(dept.getId());
|
|
|
}
|
|
|
}
|
|
@@ -344,7 +368,7 @@ public class SaleInquiryFormController {
|
|
|
Integer status = o.getStatus();
|
|
|
String code = o.getBillCode();
|
|
|
|
|
|
- if(status != null && status != 0){
|
|
|
+ if (status != null && status != 0) {
|
|
|
sb.append("单号" + code).append("已报价,请勿取消提交;");
|
|
|
continue;
|
|
|
}
|
|
@@ -357,10 +381,10 @@ public class SaleInquiryFormController {
|
|
|
queryPurInquiryForm.eq("del_flag", "0");
|
|
|
|
|
|
List<PurInquiryForm> listPurInquiryForm = purInquiryFormService.list(queryPurInquiryForm);
|
|
|
- if(listPurInquiryForm.size() > 0){
|
|
|
+ if (listPurInquiryForm.size() > 0) {
|
|
|
List<String> codeList = listPurInquiryForm.stream().map(PurInquiryForm::getBillCode).collect(Collectors.toList());
|
|
|
String codes = StringUtils.join(codeList.toArray(), ",");
|
|
|
- sb.append("单号" + code).append("已被供应商询价单使用,请勿取消提交"+codes+";");
|
|
|
+ sb.append("单号" + code).append("已被供应商询价单使用,请勿取消提交" + codes + ";");
|
|
|
continue;
|
|
|
}
|
|
|
|