修改bug

This commit is contained in:
yangjun 2026-03-20 15:32:20 +08:00
parent c73447ed19
commit 982f348cec
6 changed files with 64 additions and 50 deletions

View File

@ -156,6 +156,7 @@ public class ConfigMaterialInfo implements Serializable {
private String tagType;
private String brandType;//品牌
private String manufacturer;//生产厂家
/**是否医保报销 0否 1是*/
@Dict(dicCode = "yn")

View File

@ -86,6 +86,34 @@ public class NuBizSuppliersInfoController extends JeecgController<NuBizSuppliers
IPage<NuBizSuppliersInfo> pageList = nuBizSuppliersInfoService.page(page, queryWrapper);
return Result.OK(pageList);
}
@ApiOperation(value="供应商信息-分页列表查询", notes="供应商信息-分页列表查询")
@GetMapping(value = "/syncList")
public Result<IPage<NuBizSuppliersInfo>> syncList(NuBizSuppliersInfo nuBizSuppliersInfo,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//查询当前用户的配置供应商
List<ConfigSuppliersInfo> list = configSuppliersInfoService.list();
//查询管理平台供应商
QueryWrapper<NuBizSuppliersInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBizSuppliersInfo, req.getParameterMap());
queryWrapper.eq("iz_wlxx","Y");
Page<NuBizSuppliersInfo> page = new Page<NuBizSuppliersInfo>(pageNo, pageSize);
IPage<NuBizSuppliersInfo> pageList = nuBizSuppliersInfoService.page(page, queryWrapper);
pageList.getRecords().forEach(item->{
ConfigSuppliersInfo par = list.stream()
.filter(item1 -> item1.getId().equals(item.getId()))
.findFirst()
.orElse(null);
if(par != null && par.getId() != null){
item.setSfgx("1");
item.setIzEnabled(par.getIzEnabled());
}
});
return Result.OK(pageList);
}
/**
* 添加

View File

@ -4,10 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
@ -101,4 +99,10 @@ public class NuBizSuppliersInfo implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
@TableField(exist = false)
private String sfgx;
@TableField(exist = false)
@Dict(dicCode = "iz_enabled")
private String izEnabled;
}

View File

@ -70,6 +70,10 @@ public class NuBizSuppliersMaterialInfo implements Serializable {
@Excel(name = "品牌型号", width = 15)
@ApiModelProperty(value = "品牌型号")
private java.lang.String brandType;
/**生产厂家*/
@Excel(name = "生产厂家", width = 15)
@ApiModelProperty(value = "生产厂家")
private java.lang.String manufacturer;
/**销售单价*/
@Excel(name = "销售单价", width = 15)
@ApiModelProperty(value = "销售单价")

View File

@ -1,9 +1,6 @@
package com.nu.modules.configSuppliersInfo.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@ -13,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
import com.nu.modules.ConfigMaterial.service.IConfigMaterialInfoService;
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersInfo;
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersMaterialInfo;
import com.nu.modules.bizSuppliers.service.INuBizSuppliersInfoService;
import com.nu.modules.bizSuppliers.service.INuBizSuppliersMaterialInfoService;
@ -34,6 +32,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -59,6 +58,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class ConfigSuppliersInfoController extends JeecgController<ConfigSuppliersInfo, IConfigSuppliersInfoService> {
@Autowired
private IConfigSuppliersInfoService configSuppliersInfoService;
@Autowired
private INuBizSuppliersInfoService nuBizSuppliersInfoService;
/**
*
* 分页列表查询
@ -206,8 +207,21 @@ public class ConfigSuppliersInfoController extends JeecgController<ConfigSupplie
@RequiresPermissions("configSuppliersInfo:config_suppliers_info:add")
@PostMapping(value = "/updateWlType")
public void updateWlType(@RequestBody ConfigSuppliersInfo configSuppliersInfo) {
configSuppliersInfo.setWlType("1");
configSuppliersInfoService.updateById(configSuppliersInfo);
//判断是否在本地有数据
ConfigSuppliersInfo configSuppliersInfoOld = configSuppliersInfoService.getById(configSuppliersInfo.getId());
if(configSuppliersInfoOld == null){
//查询机构信息
NuBizSuppliersInfo nuBizSuppliersInfo = nuBizSuppliersInfoService.getById(configSuppliersInfo.getId());
BeanUtils.copyProperties(nuBizSuppliersInfo,configSuppliersInfo);
//将供应商拉取到本地
List<ConfigSuppliersInfo> configSuppliersInfoList = new ArrayList<>();
configSuppliersInfo.setWlType("1");
configSuppliersInfoList.add(configSuppliersInfo);
configSuppliersInfoService.addBatch(configSuppliersInfoList);
}
configSuppliersInfoService.updateWlType(configSuppliersInfo);
// return Result.OK("跟新成功!");

View File

@ -50,14 +50,11 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
@Override
// @Transactional(rollbackFor = Exception.class)
public void addBatch(List<ConfigSuppliersInfo> configSuppliersInfo) {
List<ConfigMaterialInfo> wlList = configMaterialInfoService.list();
for (ConfigSuppliersInfo configSuppliersInfo1 : configSuppliersInfo) {
configSuppliersInfo1.setSourceType("2");
baseMapper.insert(configSuppliersInfo1);
SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
BeanUtils.copyProperties(configSuppliersInfo1, suppliersInfoMQDto);
//todo 更新管理平台机构申请关系
rabbitMQUtil.sendToExchange("nu.suppliers.suppliersApplyAdd", "nu.suppliers.suppliersApplyAdd", suppliersInfoMQDto);
}
}
@ -80,10 +77,7 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
}
// 查询供应商对应的物料
List<NuBizSuppliersMaterialInfo> xsList = nuBizSuppliersMaterialInfoService.list(
new QueryWrapper<NuBizSuppliersMaterialInfo>()
.eq("suppliers_id", configSuppliersInfo.getId())
);
List<NuBizSuppliersMaterialInfo> xsList = nuBizSuppliersMaterialInfoService.list( new QueryWrapper<NuBizSuppliersMaterialInfo>().eq("suppliers_id", configSuppliersInfo.getId()) );
// 如果xsList为空跳过当前循环
if (xsList == null || xsList.isEmpty()) {
return;
@ -93,7 +87,8 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
ConfigMaterialInfo wl = wlList.stream()
.filter(wl1 -> Objects.equals(wl1.getMaterialName(), xs.getMaterialName())
&& Objects.equals(wl1.getSpecificationModel(), xs.getSpecificationModel())
&& Objects.equals(wl1.getBrandType(), xs.getBrandType()))
&& Objects.equals(wl1.getBrandType(), xs.getBrandType())
&& Objects.equals(wl1.getManufacturer(), xs.getManufacturer()))
.findFirst()
.orElse(null);
if (wl != null) {
@ -110,37 +105,5 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
wl.setSuppliers(suppliers);
configMaterialInfoService.updateById(wl);
}
// 取两个列表的交集并设置suppliersId
// List<ConfigMaterialInfo> commonList = wlList.stream()
// .filter(wl -> wl != null) // 过滤掉null的物料
// .filter(wl -> xsList.stream()
// .filter(xs -> xs != null) // 过滤掉null的供应商物料
// .anyMatch(xs -> {
// return true;
// })
// )
// .map(wl -> {
// // 找到对应的xs项目
// NuBizSuppliersMaterialInfo matchedXs = xsList.stream()
// .filter(xs -> xs != null)
// .findFirst()
// .orElse(null);
//
// if (matchedXs != null && matchedXs.getId() != null) {
// String suppliers = wl.getSuppliers();
// if (StringUtils.isEmpty( suppliers)) {
// suppliers = configSuppliersInfo.getId();
// }else{
// suppliers = suppliers +","+configSuppliersInfo.getId();
// }
// wl.setSuppliers(suppliers);
// configMaterialInfoService.updateById(wl);
// }
// return wl;
// })
// .collect(Collectors.toList());
}
}