ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpClinicWarehousingController.java
@@ -1,19 +1,19 @@ package com.ruoyi.web.controller.api; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.basic.PageInfo; import com.ruoyi.common.core.domain.BaseModel; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.framework.web.service.TokenService; import com.ruoyi.system.dto.ClinicOutboundGoodsDto; import com.ruoyi.system.dto.InventoryDto; import com.ruoyi.system.dto.WarehouseGoodsDto; import com.ruoyi.system.dto.clinicWarehouseGoodsDto; import com.ruoyi.system.model.TCrmClinic; import com.ruoyi.system.model.TCrmSupplier; import com.ruoyi.system.model.TErpClinicOutbound; import com.ruoyi.system.model.TErpGoods; import com.ruoyi.system.model.*; import com.ruoyi.system.query.*; import com.ruoyi.system.service.*; import com.ruoyi.system.vo.*; @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -44,15 +45,21 @@ private final TokenService tokenService; private final TCrmClinicService crmClinicService; private final TCrmSupplierService crmSupplierService; private final TErpClinicWarehousingBatchService erpClinicWarehousingBatchService; private final TErpGoodsUnitService erpGoodsUnitService; @Autowired public TErpClinicWarehousingController(TErpClinicWarehousingService erpClinicWarehousingService, TErpGoodsService erpGoodsService, TokenService tokenService, TCrmClinicService crmClinicService,TCrmSupplierService crmSupplierService) { TCrmClinicService crmClinicService,TCrmSupplierService crmSupplierService,TErpClinicWarehousingBatchService erpClinicWarehousingBatchService, TErpGoodsUnitService erpGoodsUnitService) { this.erpClinicWarehousingService = erpClinicWarehousingService; this.erpGoodsService = erpGoodsService; this.tokenService = tokenService; this.crmClinicService = crmClinicService; this.crmSupplierService = crmSupplierService; this.erpClinicWarehousingBatchService = erpClinicWarehousingBatchService; this.erpGoodsUnitService = erpGoodsUnitService; } @@ -62,7 +69,7 @@ /** * 获取erp问题上报管理列表 */ @ApiOperation(value = "展示获取库存分页列表") @ApiOperation(value = "诊所 获取库存分页列表") @PostMapping(value = "/pageList") public R<PageInfo<TErpGoodsVO>> pageList(@RequestBody TErpGoodsQuery query) { @@ -84,6 +91,33 @@ } return R.ok(erpClinicWarehousingService.pageList(query,user)); } /** * 获取erp问题上报管理列表 */ @ApiOperation(value = "诊所 获取库存库存不足") @PostMapping(value = "/pageNotInventoryGoodsList") public R<List<TErpGoodsVO>> pageNotInventoryGoodsList(@RequestBody TErpGoodsQuery query) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); if(roleType == 4){ // 供应商 TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) .eq(TCrmSupplier::getUserId, user.getUserId()) .last("LIMIT 1")); query.setSupplierClinicId(crmSupplier.getId()); } if(roleType == 5){ // 诊所 TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) .eq(TCrmClinic::getUserId, user.getUserId()) .last("LIMIT 1")); query.setSupplierClinicId(crmClinic.getId()); } return R.ok(erpClinicWarehousingService.pageList1(query,user)); } @@ -194,6 +228,9 @@ return R.ok(erpGoodsService.warehouseGoodsPageList(query,user,supplierClinicId)); } @ApiOperation(value = "诊所 入库商品详情") @GetMapping(value = "/warehouseGoodsDetail/{id}") public R<WarehouseGoodsDetailVo> warehouseGoodsDetail(@PathVariable String id) { @@ -231,7 +268,7 @@ @ApiOperation(value = "诊所 入库商品操作") @PostMapping(value = "/warehouseGoods") public R<?> warehouseGoods(@RequestBody @Valid List<clinicWarehouseGoodsDto> dtos) { public R<?> warehouseGoods(@RequestBody @Valid WarehouseGoodsDto dto) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); String supplierClinicId =null; @@ -242,9 +279,37 @@ .last("LIMIT 1")); supplierClinicId = crmClinic.getId(); } erpClinicWarehousingService.warehouseGoods(dtos,user,supplierClinicId); erpClinicWarehousingService.warehouseGoods(dto,user,supplierClinicId); return R.ok(); } @ApiOperation(value = "诊所 获取草稿") @GetMapping(value = "/getWarehouseGoodsDraft") public R<List<TErpClinicWarehousingBatch>> getWarehouseGoodsDraft() { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); String supplierClinicId =null; ArrayList<TErpClinicWarehousingBatch> clinicWarehouseGoodsDtos = new ArrayList<>(); if(roleType == 5){ // 诊所 TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) .eq(TCrmClinic::getUserId, user.getUserId()) .last("LIMIT 1")); supplierClinicId = crmClinic.getId(); List<TErpClinicWarehousing> list = erpClinicWarehousingService.list(new LambdaQueryWrapper<TErpClinicWarehousing>().eq(TErpClinicWarehousing::getClinicId, supplierClinicId).eq(TErpClinicWarehousing::getStatus, 1).orderByDesc(BaseModel::getCreateTime)); if(list.isEmpty()){ return R.ok(clinicWarehouseGoodsDtos); } List<TErpClinicWarehousingBatch> list1 = erpClinicWarehousingBatchService.list(new LambdaQueryWrapper<TErpClinicWarehousingBatch>().eq(TErpClinicWarehousingBatch::getWarehousingId, list.get(0).getId())); for (TErpClinicWarehousingBatch tErpClinicWarehousingBatch : list1) { String goodsId = tErpClinicWarehousingBatch.getGoodsId(); TErpGoods tErpGoods = erpGoodsService.getOne(new LambdaQueryWrapper<TErpGoods>().eq(TErpGoods::getId, goodsId)); TErpGoodsUnit byId = erpGoodsUnitService.getById(tErpGoods.getPackingUnitId()); tErpClinicWarehousingBatch.setUnitName(byId.getUnitName()); } return R.ok(list1); } return R.ok(clinicWarehouseGoodsDtos); } ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpGoodsController.java
@@ -116,12 +116,15 @@ } return R.ok(erpGoodsService.pageList(query,user)); } /** * 获取erp问题上报管理列表 */ @ApiOperation(value = "诊所 一键获取商品分页列表") @PostMapping(value = "/pageAddList") public R<Page<TErpGoods>> pageAddList(BasePage query) { public R<Page<TErpGoods>> pageAddList(@RequestBody BasePage query) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); String clinicSupplierId=null; @@ -134,7 +137,7 @@ } Page<TErpGoods> tErpGoodsPage = new Page<>(query.getPageNum(), query.getPageSize()); Page<TErpGoods> page = erpGoodsService.page(tErpGoodsPage, new LambdaQueryWrapper<TErpGoods>().eq(TErpGoods::getGoodsSource, 1).eq(BaseModel::getDisabled, 0).isNotNull(TErpGoods::getPlatformCommissionPrice).last("and (NOT FIND_IN_SET(" + clinicSupplierId + ",clinic_ids) or clinic_ids is null)")); Page<TErpGoods> page = erpGoodsService.page(tErpGoodsPage, new LambdaQueryWrapper<TErpGoods>().eq(TErpGoods::getGoodsSource, 1).eq(TErpGoods::getState,1).eq(BaseModel::getDisabled, 0).isNotNull(TErpGoods::getPlatformCommissionPrice).last("and (NOT FIND_IN_SET(" + clinicSupplierId + ",clinic_ids) or clinic_ids is null)")); for (TErpGoods record : page.getRecords()) { TCrmSupplier byId = crmSupplierService.getById(record.getSupplierClinicId()); record.setSupplierName(byId.getSupplierName()); @@ -145,6 +148,45 @@ } return R.ok(page); } /** * 获取erp问题上报管理列表 */ @ApiOperation(value = "诊所 一键获取商品 获取全部") @PostMapping(value = "/getAllGoodsList") public R<?> getAllGoodsList() { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); String clinicSupplierId=null; if(roleType == 5){ // 诊所 TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) .eq(TCrmClinic::getUserId, user.getUserId()) .last("LIMIT 1")); clinicSupplierId = crmClinic.getId(); } List<TErpGoods> list = erpGoodsService.list(new LambdaQueryWrapper<TErpGoods>().eq(TErpGoods::getGoodsSource, 1).eq(TErpGoods::getState,1).eq(BaseModel::getDisabled, 0).isNotNull(TErpGoods::getPlatformCommissionPrice).last("and (NOT FIND_IN_SET(" + clinicSupplierId + ",clinic_ids) or clinic_ids is null)")); for (TErpGoods goods : list) { String clinicIds = goods.getClinicIds(); if(clinicIds == null || clinicIds.isEmpty()){ goods.setClinicIds(clinicSupplierId); }else { String[] split = clinicIds.split(","); ArrayList<String> split1 = new ArrayList<>(); for (String s : split) { split1.add(s); } if(!split1.contains(clinicSupplierId)){ split1.add(clinicSupplierId); goods.setClinicIds(String.join(",",split1)); } } } erpGoodsService.updateBatchById(list); return R.ok(); } @@ -203,6 +245,7 @@ } goods.setCreateId(user.getUserId().toString()); goods.setGoodsIdCode(dto.getGoodsIdCode()); goods.setClinicPurchasePrice(dto.getSalesAmount()); return R.ok(erpGoodsService.save(goods)); } @@ -266,9 +309,9 @@ @ApiOperation(value = "诊所 一键添加商品") @PostMapping(value = "/addSupplierGoods") public R<Boolean> addSupplierGoods(String goodsIds) { List<String> split = Arrays.asList(goodsIds.split(",")); List<TErpGoods> list = erpGoodsService.list(new LambdaQueryWrapper<TErpGoods>().in(TErpGoods::getId, split)); public R<Boolean> addSupplierGoods(@RequestBody AddSupplierGoodsDto dto) { // List<String> split = Arrays.asList(goodsIds.split(",")); List<TErpGoods> list = erpGoodsService.list(new LambdaQueryWrapper<TErpGoods>().in(TErpGoods::getId, dto.getGoodsIds())); SysUser user = tokenService.getLoginUser().getUser(); String cid = null; @@ -279,12 +322,21 @@ cid = crmClinic.getId(); for (TErpGoods goods : list) { String clinicIds = goods.getClinicIds(); List<String> split1 = Arrays.asList(clinicIds.split(",")); if(clinicIds==null || clinicIds.isEmpty()){ goods.setClinicIds( cid); }else { String[] split = clinicIds.split(","); List<String> split1 = new ArrayList<>(); for (String s : split) { split1.add(s); } if(!split1.contains(cid)){ split1.add(cid); goods.setClinicIds(String.join(",",split1)); } } } erpGoodsService.updateBatchById(list); } return R.ok(); ruoyi-system/src/main/java/com/ruoyi/system/dto/AddSupplierGoodsDto.java
New file @@ -0,0 +1,10 @@ package com.ruoyi.system.dto; import lombok.Data; import java.util.List; @Data public class AddSupplierGoodsDto { private List<String> goodsIds; } ruoyi-system/src/main/java/com/ruoyi/system/dto/WarehouseGoodsDto.java
New file @@ -0,0 +1,17 @@ package com.ruoyi.system.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("诊所入库操作") public class WarehouseGoodsDto { @ApiModelProperty("1草稿") private Integer status; @ApiModelProperty("商品信息") private List<clinicWarehouseGoodsDto> dtos; } ruoyi-system/src/main/java/com/ruoyi/system/dto/clinicWarehouseGoodsDto.java
@@ -7,6 +7,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; @Data @@ -31,14 +32,14 @@ @ApiModelProperty(value = "生产日期") @NotNull(message = "生产日期不能为空") private LocalDateTime productionDate; private LocalDate productionDate; @ApiModelProperty(value = "有效日期") @NotNull(message = "有效日期不能为空") private LocalDateTime expiryDate; private LocalDate expiryDate; @ApiModelProperty(value = "供应商id") @NotBlank(message = "供应商id不能为空") // @NotBlank(message = "供应商id不能为空") private String supplierId; } ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpClinicWarehousingMapper.java
@@ -33,6 +33,6 @@ List<TErpClinicOutboundPageListVO> outboundPageList(@Param("query") TClinicOutboundQuery query, @Param("pageInfo") PageInfo<TErpClinicOutboundPageListVO> pageInfo, @Param("user") SysUser user, @Param("supplierClinicId") String supplierClinicId, @Param("sTime") String sTime, @Param("eTime") String eTime); List<TErpGoodsVO> pageList1(@Param("query") TErpGoodsQuery query, @Param("user") SysUser user); } ruoyi-system/src/main/java/com/ruoyi/system/model/TErpClinicWarehousing.java
@@ -67,4 +67,7 @@ @ApiModelProperty(value = "盘点id") @TableField("inventory_id") private String inventoryId; @ApiModelProperty(value = "入库状态 1=草稿 2=正常") private Integer status; } ruoyi-system/src/main/java/com/ruoyi/system/query/TErpGoodsQuery.java
@@ -29,6 +29,9 @@ @ApiModelProperty(value = "库存管理条件 不足传1") private Integer type; @ApiModelProperty(value = "1入库 其他不传") private Integer category; @ApiModelProperty(value = "供应商id/诊所id") private String supplierClinicId; } ruoyi-system/src/main/java/com/ruoyi/system/service/TErpClinicWarehousingService.java
@@ -5,6 +5,7 @@ import com.ruoyi.common.basic.PageInfo; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.system.dto.ClinicOutboundGoodsDto; import com.ruoyi.system.dto.WarehouseGoodsDto; import com.ruoyi.system.dto.clinicWarehouseGoodsDto; import com.ruoyi.system.model.TErpClinicWarehousing; import com.ruoyi.system.model.TErpGoods; @@ -38,9 +39,12 @@ PageInfo<TErpClinicOutboundPageListVO> outboundPageList(TClinicOutboundQuery query, SysUser user, String supplierClinicId); void warehouseGoods(@Valid List<clinicWarehouseGoodsDto> dtos, SysUser user, String supplierClinicId); void warehouseGoods(@Valid WarehouseGoodsDto dto, SysUser user, String supplierClinicId); void outboundGoods(@Valid ClinicOutboundGoodsDto dto, SysUser user, String supplierClinicId); List<TErpGoodsVO> pageList1(TErpGoodsQuery query, SysUser user); } ruoyi-system/src/main/java/com/ruoyi/system/service/TErpGoodsService.java
@@ -72,4 +72,7 @@ OutboundGoodsDetailVo outboundGoodsDetail(String id); PageInfo<TErpGoodsVO> pageList1(TErpGoodsQuery query, SysUser user); } ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpClinicWarehousingServiceImpl.java
@@ -8,6 +8,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.system.dto.ClinicOutboundGoodsDto; import com.ruoyi.system.dto.OutboundGoodsNextDto; import com.ruoyi.system.dto.WarehouseGoodsDto; import com.ruoyi.system.dto.clinicWarehouseGoodsDto; import com.ruoyi.system.mapper.*; import com.ruoyi.system.model.*; @@ -238,6 +239,24 @@ pageInfo.setRecords(list); return pageInfo; } @Override public List<TErpGoodsVO> pageList1(TErpGoodsQuery query, SysUser user) { List<TErpGoodsVO> list = this.baseMapper.pageList1(query,user); if(list.isEmpty()){ return list; } List<String> typeIds = list.stream().map(TErpGoods::getTypeId).collect(Collectors.toList()); if(!typeIds.isEmpty()){ List<TErpGoodsType> typeList = erpGoodsTypeMapper.selectBatchIds(typeIds); for (TErpGoodsVO tErpGoodsVO : list) { typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName())); tErpGoodsVO.setTypeName(tErpGoodsVO.getTypeName()); } } return list; } @Override public PageInfo<TErpClinicWarehousePageListVO> warehousePageList(TClinicWarehouseQuery query, SysUser user, String supplierClinicId) { @@ -282,31 +301,29 @@ } @Override public void warehouseGoods(List<clinicWarehouseGoodsDto> dtos, SysUser user, String supplierClinicId) { public void warehouseGoods(WarehouseGoodsDto dtos, SysUser user, String supplierClinicId) { // dtos根据供应商分组 Map<String, List<clinicWarehouseGoodsDto>> collect = dtos.stream().collect(Collectors.groupingBy(clinicWarehouseGoodsDto::getSupplierId)); // Map<String, List<clinicWarehouseGoodsDto>> collect = dtos.stream().collect(Collectors.groupingBy(clinicWarehouseGoodsDto::getSupplierId)); for (Map.Entry<String, List<clinicWarehouseGoodsDto>> stringListEntry : collect.entrySet()) { String key = stringListEntry.getKey(); List<clinicWarehouseGoodsDto> value = stringListEntry.getValue(); // for (Map.Entry<String, List<clinicWarehouseGoodsDto>> stringListEntry : collect.entrySet()) { TErpClinicWarehousing tErpClinicWarehousing = new TErpClinicWarehousing(); tErpClinicWarehousing.setClinicId(supplierClinicId); tErpClinicWarehousing.setCreateId(user.getUserId().toString()); tErpClinicWarehousing.setWarehouseNo("G"+ DateUtils.dateTimeNow()); tErpClinicWarehousing.setCreateTime(LocalDateTime.now()); tErpClinicWarehousing.setSupplierId(key); tErpClinicWarehousing.setType(3); tErpClinicWarehousing.setStatus(dtos.getStatus()); this.save(tErpClinicWarehousing); BigDecimal totalPrice = new BigDecimal(0); for (clinicWarehouseGoodsDto dto : value) { for (clinicWarehouseGoodsDto dto : dtos.getDtos()) { TErpClinicWarehousingBatch tErpClinicWarehousingBatch = new TErpClinicWarehousingBatch(); tErpClinicWarehousingBatch.setWarehousingId(tErpClinicWarehousing.getId()); tErpClinicWarehousingBatch.setWarehousingNumber(dto.getPurchaseCount()); tErpClinicWarehousingBatch.setBatchNumber(dto.getBatchNumber()); tErpClinicWarehousingBatch.setProductionDate(dto.getProductionDate()); tErpClinicWarehousingBatch.setExpiryDate(dto.getExpiryDate()); tErpClinicWarehousingBatch.setProductionDate(dto.getProductionDate().atStartOfDay()); tErpClinicWarehousingBatch.setExpiryDate(dto.getExpiryDate().atStartOfDay()); tErpClinicWarehousingBatch.setGoodsId(dto.getId()); TErpGoods goods = erpGoodsMapper.selectById(dto.getId()); tErpClinicWarehousingBatch.setGoodsName(goods.getGoodsName()); @@ -324,7 +341,7 @@ tErpClinicWarehousing.setTotalPrice(totalPrice); this.updateById(tErpClinicWarehousing); } // } } ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
@@ -101,6 +101,31 @@ typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName())); } } List<String> collect = list.stream().filter(e -> e.getGoodsSource() == 1).map(TErpGoods::getSupplierClinicId).collect(Collectors.toList()); if (!collect.isEmpty()) { List<TCrmSupplier> crmClinics = crmSupplierMapper.selectBatchIds(collect); for (TErpGoodsVO tErpGoodsVO : list) { crmClinics.stream().filter(t -> t.getId().equals(tErpGoodsVO.getSupplierClinicId())).findFirst().ifPresent(t -> tErpGoodsVO.setSupplierName(t.getSupplierName())); } } pageInfo.setRecords(list); return pageInfo; } @Override public PageInfo<TErpGoodsVO> pageList1(TErpGoodsQuery query, SysUser user) { PageInfo<TErpGoodsVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<TErpGoodsVO> list = this.baseMapper.pageList(query, pageInfo, user); if (list.isEmpty()) { return pageInfo; } List<String> typeIds = list.stream().map(TErpGoods::getTypeId).collect(Collectors.toList()); if (!typeIds.isEmpty()) { List<TErpGoodsType> typeList = erpGoodsTypeMapper.selectBatchIds(typeIds); for (TErpGoodsVO tErpGoodsVO : list) { typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName())); } } pageInfo.setRecords(list); return pageInfo; ruoyi-system/src/main/java/com/ruoyi/system/vo/WarehouseGoodsVo.java
New file @@ -0,0 +1,51 @@ package com.ruoyi.system.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.time.LocalDateTime; @Data @ApiModel("诊所 商品入库vo") public class WarehouseGoodsVo { @ApiModelProperty(value = "商品id") private String id; @ApiModelProperty(value = "单价") private BigDecimal unitAmount; @ApiModelProperty(value = "销售价格") private BigDecimal salesAmount; @ApiModelProperty(value = "采购数量") @NotNull(message = "采购数量不能为空") private Integer purchaseCount; @ApiModelProperty(value = "批次号") @NotBlank(message = "批次号不能为空") private String batchNumber; @ApiModelProperty(value = "生产日期") @NotNull(message = "生产日期不能为空") private LocalDateTime productionDate; @ApiModelProperty(value = "有效日期") @NotNull(message = "有效日期不能为空") private LocalDateTime expiryDate; @ApiModelProperty(value = "供应商id") // @NotBlank(message = "供应商id不能为空") private String supplierId; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "国药准字号") private String quasiNumber; } ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml
@@ -156,6 +156,24 @@ and t1.outbound_type = #{query.type} </if> order by t1.create_time desc </select> <select id="pageList1" resultType="com.ruoyi.system.vo.TErpGoodsVO"> select * from ( select <include refid="Base_Column_List1"/> COALESCE(sum(t2.purchase_count), 0) - COALESCE(sum(t3.outbound_count), 0) as allNum, SUM(t2.unit_amount * (t2.purchase_count - COALESCE(t3.outbound_count, 0))) as allTotalPrice, COALESCE(sum(t3.outbound_count), 0) as outNum from t_erp_goods t1 left join t_erp_clinic_warehousing_batch t2 on t1.id = t2.goods_id left join t_erp_clinic_outbound_goods t3 on t2.id = t3.warehousing_id where t1.disabled = 0 and t2.id is not null and t1.goods_source =2 and t1.supplier_clinic_id =#{query.supplierClinicId} GROUP BY t1.id ) o where 1=1 <if test="query.type != null and query.type ==1"> and o.warning_inventory > (o.allNum-o.outNum) </if> order by o.create_time desc </select> </mapper> ruoyi-system/src/main/resources/mapper/system/TErpGoodsMapper.xml
@@ -50,7 +50,7 @@ taboo, precautions, interaction, storage storage,supplier_name </sql> <select id="pageList" resultType="com.ruoyi.system.vo.TErpGoodsVO">