ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpProcurementController.java
@@ -11,6 +11,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.framework.web.service.TokenService; import com.ruoyi.system.dto.AddProcurementDto; import com.ruoyi.system.dto.DetailProcurementSendDto; import com.ruoyi.system.dto.UpdateStatusProcurementDto; import com.ruoyi.system.dto.UpdateStatusProcurementLastDto; import com.ruoyi.system.model.*; @@ -63,13 +64,14 @@ private final TCrmBranchService crmBranchService; private final TCrmSalespersonService crmSalespersonService; private final TErpProcurementCommissionService erpProcurementCommissionService; private final TCrmWarehouseService crmWarehouseService; @Autowired public TErpProcurementController(TErpProcurementService erpProcurementService, TokenService tokenService, TCrmClinicService crmClinicService, TErpProcurementGoodsService erpProcurementGoodsService , TErpGoodsService erpGoodsService, TErpClinicWarehousingService erpClinicWarehousingService, TErpClinicWarehousingBatchService erpClinicWarehousingBatchService, TCrmSupplierService crmSupplierService, TErpMaintenanceReminderService erpMaintenanceReminderService, TSysOtherConfigService sysOtherConfigService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService, TCrmBranchService crmBranchService, TCrmSalespersonService crmSalespersonService, TErpProcurementCommissionService erpProcurementCommissionService) { TCrmSupplierService crmSupplierService, TErpMaintenanceReminderService erpMaintenanceReminderService, TSysOtherConfigService sysOtherConfigService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService, TCrmBranchService crmBranchService, TCrmSalespersonService crmSalespersonService, TErpProcurementCommissionService erpProcurementCommissionService, TCrmWarehouseService crmWarehouseService) { this.erpProcurementService = erpProcurementService; this.tokenService = tokenService; this.crmClinicService = crmClinicService; @@ -85,6 +87,8 @@ this.crmBranchService = crmBranchService; this.crmSalespersonService = crmSalespersonService; this.erpProcurementCommissionService = erpProcurementCommissionService; this.crmWarehouseService = crmWarehouseService; } @@ -184,19 +188,24 @@ @ApiOperation(value = "采购详情--发货(仓库角色)") @PostMapping(value = "/detailProcurementSend/{id}") public R<?> detailProcurementSend(@PathVariable String id) { @PostMapping(value = "/detailProcurementSend") public R<?> detailProcurementSend(@RequestBody DetailProcurementSendDto dto) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); String clinicSupplierId=null; if(roleType == 4){ if(roleType == 6){ TCrmWarehouse warehouse = crmWarehouseService.getOne(Wrappers.lambdaQuery(TCrmWarehouse.class) .eq(TCrmWarehouse::getUserId, user.getUserId()) .last("LIMIT 1")); // 供应商 TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) .eq(TCrmSupplier::getUserId, user.getUserId()) .eq(TCrmSupplier::getWarehouseId, warehouse.getId()) .last("LIMIT 1")); clinicSupplierId=crmSupplier.getId(); } erpProcurementService.detailProcurementSend(clinicSupplierId, user, id); erpProcurementService.detailProcurementSend(clinicSupplierId, user, dto.getId(),dto.getLogisticsNumber()); return R.ok(); } ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TOrderController.java
@@ -447,6 +447,11 @@ // 先退分账 在退订单 // 查出采购单 算出价格 下单 算出应该分佣金额 应该分给谁 TErpProcurement erpProcurement = erpProcurementService.getById(id); if(erpProcurement.getStatus()==2){ erpProcurement.setStatus(6); erpProcurementService.updateById(erpProcurement); return R.ok("操作成功"); } // 还未分账成功不能退款 if(erpProcurement.getStatus()==null || erpProcurement.getStatus()!=1){ ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysGoodsController.java
@@ -6,17 +6,21 @@ 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.BasePage; 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.ExchangeGoodsDto; import com.ruoyi.system.dto.TErpGoodsUpdateStatusDto; import com.ruoyi.system.model.*; import com.ruoyi.system.query.ExchangeGoodsRecordQuery; import com.ruoyi.system.query.TSysGoodsExchangeQuery; import com.ruoyi.system.query.TSysGoodsQuery; import com.ruoyi.system.service.*; import com.ruoyi.system.vo.ExchangeGoodsRecordDetailVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,16 +50,19 @@ private final TSysGoodsExchangeService sysGoodsExchangeService; private final TCrmClinicService crmClinicService; private final TCrmClinicPointsService crmClinicPointsService; private final TCrmChangePointsService crmChangePointsService; @Autowired public TSysGoodsController(TokenService tokenService, TSysGoodsService sysGoodsService, TCrmSupplierService crmSupplierService, TSysGoodsExchangeService sysGoodsExchangeService, TCrmClinicService crmClinicService, TCrmClinicPointsService crmClinicPointsService) { public TSysGoodsController(TokenService tokenService, TSysGoodsService sysGoodsService, TCrmSupplierService crmSupplierService, TSysGoodsExchangeService sysGoodsExchangeService, TCrmClinicService crmClinicService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService) { this.sysGoodsService = sysGoodsService; this.tokenService = tokenService; this.crmSupplierService = crmSupplierService; this.sysGoodsExchangeService = sysGoodsExchangeService; this.crmClinicService = crmClinicService; this.crmClinicPointsService = crmClinicPointsService; this.crmChangePointsService = crmChangePointsService; } @@ -291,5 +298,86 @@ return R.fail("请选择正确的角色"); } /** * 兑换商品记录 */ @ApiOperation(value = "兑换商品记录--诊所") @PostMapping(value = "/exchangeGoodsRecord") public R<?> exchangeGoodsRecord(@RequestBody ExchangeGoodsRecordQuery query) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); if (roleType == 5) { // 诊所 TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) .eq(TCrmClinic::getUserId, user.getUserId()) .last("LIMIT 1")); LambdaQueryWrapper<TSysGoodsExchange> eq = new LambdaQueryWrapper<TSysGoodsExchange>().eq(TSysGoodsExchange::getClinicId, crmClinic.getId()); if (query.getName() != null && !query.getName().isEmpty()) { eq.like(TSysGoodsExchange::getGoodsName, query.getName()); } eq.orderByDesc(BaseModel::getCreateTime); PageInfo<TSysGoodsExchange> page = sysGoodsExchangeService.page(new PageInfo<>(query.getPageNum(), query.getPageSize()), eq); return R.ok(page); } return R.fail("请选择正确的角色"); } /** * 兑换商品记录 */ @ApiOperation(value = "兑换商品记录详情--诊所") @GetMapping(value = "/exchangeGoodsRecordDetail/{id}") public R<ExchangeGoodsRecordDetailVo> exchangeGoodsRecord(@PathVariable String id) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); if (roleType == 5) { // 诊所 TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) .eq(TCrmClinic::getUserId, user.getUserId()) .last("LIMIT 1")); TSysGoodsExchange exchangeServiceById = sysGoodsExchangeService.getById(id); if (exchangeServiceById.getClinicId().equals(crmClinic.getId())) { ExchangeGoodsRecordDetailVo vo = new ExchangeGoodsRecordDetailVo(); BeanUtils.copyProperties(exchangeServiceById, vo); String goodsId = vo.getGoodsId(); TSysGoods sysGoods = sysGoodsService.getById(goodsId); vo.setGoodsDetail(sysGoods.getGoodsDetail()); vo.setGoodsCover(sysGoods.getGoodsCover()); return R.ok(vo); } } return R.fail("请选择正确的角色"); } /** * 兑换商品记录 */ @ApiOperation(value = "积分变更记录--诊所") @PostMapping(value = "/pointsRecordDetail") public R<PageInfo<TCrmChangePoints>> pointsRecordDetail(@RequestBody BasePage page) { SysUser user = tokenService.getLoginUser().getUser(); Integer roleType = user.getRoleType(); if (roleType == 5) { // 诊所 TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) .eq(TCrmClinic::getUserId, user.getUserId()) .last("LIMIT 1")); PageInfo<TCrmChangePoints> page1 = crmChangePointsService.page(new PageInfo<>(page.getPageNum(), page.getPageSize()), new LambdaQueryWrapper<TCrmChangePoints>().eq(TCrmChangePoints::getBranchSalespersonId, crmClinic.getId()).eq(TCrmChangePoints::getUserType, 3).orderByDesc(BaseModel::getCreateTime)); return R.ok(page1); } return R.fail("请选择正确的角色"); } } ruoyi-system/src/main/java/com/ruoyi/system/dto/DetailProcurementSendDto.java
New file @@ -0,0 +1,19 @@ package com.ruoyi.system.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; @Data @ApiModel("仓库发货dto") public class DetailProcurementSendDto { @ApiModelProperty("id") @NotBlank(message = "id不能为空") private String id; @ApiModelProperty("物流单号") @NotBlank(message = "物流单号不能为空") private String logisticsNumber; } ruoyi-system/src/main/java/com/ruoyi/system/model/TErpSupplierOutboundGoods.java
@@ -51,5 +51,8 @@ @TableField("total_price") private BigDecimal totalPrice; @ApiModelProperty(value = "采购商品id") @TableField("procurement_goods_id") private String procurementGoodsId; } ruoyi-system/src/main/java/com/ruoyi/system/model/TSysGoodsExchange.java
@@ -63,4 +63,8 @@ @TableField("logistics_number") private String logisticsNumber; @ApiModelProperty(value = "诊所id") @TableField("clinic_id") private String clinicId; } ruoyi-system/src/main/java/com/ruoyi/system/query/ExchangeGoodsRecordQuery.java
New file @@ -0,0 +1,11 @@ package com.ruoyi.system.query; import com.ruoyi.common.core.domain.BasePage; import io.swagger.annotations.ApiModel; import lombok.Data; @Data @ApiModel("诊所兑换记录Query") public class ExchangeGoodsRecordQuery extends BasePage { private String name; } ruoyi-system/src/main/java/com/ruoyi/system/service/TErpProcurementService.java
@@ -43,5 +43,5 @@ DetailProcurementVO detailProcurement(String clinicSupplierId, SysUser user, String id); void detailProcurementSend(String clinicSupplierId, SysUser user, String id); void detailProcurementSend(String clinicSupplierId, SysUser user, String id,String logisticsNumber); } ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpClinicWarehousingServiceImpl.java
@@ -101,7 +101,6 @@ } List<String> collect = list.stream().map(PageInventoryListVo::getId).collect(Collectors.toList()); List<TErpClinicInventoryGoods> tErpSupplierInventoryGoods = erpClinicInventoryGoodsMapper.selectList(new LambdaQueryWrapper<TErpClinicInventoryGoods>().in(TErpClinicInventoryGoods::getInventoryId,collect)); for (PageInventoryListVo pageInventoryListVo : list) { @@ -256,7 +255,6 @@ } @Override public PageInfo<ValidityPeriodWarningVo> validityPeriodWarning(ValidityPeriodWarningQuery query, SysUser user) { Integer roleType = user.getRoleType(); @@ -272,7 +270,6 @@ LocalDateTime nineMonthLater = LocalDateTime.now().plusMonths(9); PageInfo<ValidityPeriodWarningVo> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); return this.baseMapper.validityPeriodWarning(pageInfo,query,user,nineMonthLater,supplierClinicId); @@ -298,6 +295,7 @@ pageInfo.setRecords(list); return pageInfo; } @Override public List<TErpGoodsVO> pageList1(TErpGoodsQuery query, SysUser user) { List<TErpGoodsVO> list = this.baseMapper.pageList1(query,user); @@ -376,6 +374,7 @@ this.save(tErpClinicWarehousing); BigDecimal totalPrice = new BigDecimal(0); ArrayList<String> names = new ArrayList<>(); for (clinicWarehouseGoodsDto dto : dtos.getDtos()) { TErpClinicWarehousingBatch tErpClinicWarehousingBatch = new TErpClinicWarehousingBatch(); tErpClinicWarehousingBatch.setWarehousingId(tErpClinicWarehousing.getId()); @@ -385,6 +384,8 @@ tErpClinicWarehousingBatch.setExpiryDate(dto.getExpiryDate().atStartOfDay()); tErpClinicWarehousingBatch.setGoodsId(dto.getId()); TErpGoods goods = erpGoodsMapper.selectById(dto.getId()); String supplierName = goods.getSupplierName(); names.add(supplierName); tErpClinicWarehousingBatch.setGoodsName(goods.getGoodsName()); tErpClinicWarehousingBatch.setQuasiNumber(goods.getQuasiNumber()); tErpClinicWarehousingBatch.setUnitAmount(dto.getUnitAmount()); @@ -412,6 +413,8 @@ totalPrice = totalPrice.add(dto.getSalesAmount().multiply(new BigDecimal(dto.getPurchaseCount()))); } tErpClinicWarehousing.setTotalPrice(totalPrice); String name = names.stream().collect(Collectors.joining(",")); tErpClinicWarehousing.setSupplierName(name); this.updateById(tErpClinicWarehousing); // } ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpProcurementServiceImpl.java
@@ -44,6 +44,7 @@ import java.math.RoundingMode; import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -99,6 +100,8 @@ @Resource private TErpSupplierOutboundGoodsMapper erpSupplierOutboundGoodsMapper; @Resource private TCrmWarehouseMapper crmWarehouseMapper; @Override public PageInfo<TErpProcurementVo> pageList(TErpProcurementQuery query, SysUser user) { @@ -170,9 +173,13 @@ Integer roleType = user.getRoleType(); String supplierClinicId = null; if (roleType == 6) { TCrmWarehouse warehouse = crmWarehouseMapper.selectOne(Wrappers.lambdaQuery(TCrmWarehouse.class) .eq(TCrmWarehouse::getUserId, user.getUserId()) .last("LIMIT 1")); // 供应商 TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) .eq(TCrmSupplier::getUserId, user.getUserId()) .eq(TCrmSupplier::getWarehouseId, warehouse.getId()) .last("LIMIT 1")); supplierClinicId = crmSupplier.getId(); @@ -377,7 +384,7 @@ BigDecimal all = BigDecimal.ZERO; for (AddProcurementDto addProcurementDto : value) { BigDecimal multiply = addProcurementDto.getSalesAmount().multiply(BigDecimal.valueOf(addProcurementDto.getPurchaseCount())); BigDecimal multiply = addProcurementDto.getGoodsSalesAmount().multiply(BigDecimal.valueOf(addProcurementDto.getPurchaseCount())); all = all.add(multiply); } tErpProcurement.setPayMoney(all); @@ -404,7 +411,9 @@ tErpProcurementGoods.setQuasiNumber(goods.getQuasiNumber()); TErpGoodsUnit tErpGoodsUnit = erpGoodsUnitMapper.selectById(goods.getPackingUnitId()); if(tErpGoodsUnit!=null){ tErpProcurementGoods.setUnitName(tErpGoodsUnit.getUnitName()); } tErpProcurementGoods.setPurchasePrice(dto.getGoodsSalesAmount()); tErpProcurementGoods.setSalesAmount(dto.getSalesAmount()); tErpProcurementGoods.setTotalPrice(dto.getGoodsSalesAmount().multiply(new BigDecimal(dto.getPurchaseCount()))); @@ -460,6 +469,25 @@ detailProcurementNextVO.setTotalPrice(tErpProcurement.getPayMoney()); detailProcurementNextVO.setId(tErpProcurementGoods.getId()); detailProcurementNextVO.setPurchasePrice(tErpProcurementGoods.getPurchasePrice()); List<TErpSupplierOutboundGoods> tErpSupplierOutboundGoods = erpSupplierOutboundGoodsMapper.selectList(new LambdaQueryWrapper<TErpSupplierOutboundGoods>().eq(TErpSupplierOutboundGoods::getProcurementGoodsId, tErpProcurementGoods.getId())); if(!tErpSupplierOutboundGoods.isEmpty()){ ArrayList<DetailProcurementNextThreeVO> detailProcurementNextThreeVOS = new ArrayList<>(); List<String> collect = tErpSupplierOutboundGoods.stream().map(TErpSupplierOutboundGoods::getWarehousingBatchId).collect(Collectors.toList()); List<TErpSupplierWarehousingBatch> tErpSupplierWarehousingBatches = erpSupplierWarehousingBatchMapper.selectBatchIds(collect); for (TErpSupplierOutboundGoods tErpSupplierOutboundGood : tErpSupplierOutboundGoods) { List<TErpSupplierWarehousingBatch> collect1 = tErpSupplierWarehousingBatches.stream().filter(e -> e.getId().equals(tErpSupplierOutboundGood.getWarehousingBatchId())).collect(Collectors.toList()); for (TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch : collect1) { DetailProcurementNextThreeVO detailProcurementNextThreeVO = new DetailProcurementNextThreeVO(); detailProcurementNextThreeVO.setBatchNumber(tErpSupplierWarehousingBatch.getBatchNumber()); detailProcurementNextThreeVO.setProductionDate(tErpSupplierWarehousingBatch.getProductionDate()); detailProcurementNextThreeVO.setExpirationDate(tErpSupplierWarehousingBatch.getExpiryDate()); detailProcurementNextThreeVO.setNum(tErpSupplierOutboundGood.getOutboundCount()); detailProcurementNextThreeVOS.add(detailProcurementNextThreeVO); } } detailProcurementNextVO.setDetailProcurementNextThreeVOS(detailProcurementNextThreeVOS); } detailProcurementNextVOS.add(detailProcurementNextVO); } detailProcurementVO.setList(detailProcurementNextVOS); @@ -468,7 +496,7 @@ @Override @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) public void detailProcurementSend(String clinicSupplierId, SysUser user, String id) { public void detailProcurementSend(String clinicSupplierId, SysUser user, String id,String logisticsNumber) { // 查出这个采购的下级商品 List<TErpProcurementGoods> list = erpProcurementGoodsService.list(new QueryWrapper<TErpProcurementGoods>().eq("procurement_id", id)); List<TErpSupplierWarehousing> tErpSupplierWarehousings = erpSupplierWarehousingMapper.selectList(new LambdaQueryWrapper<TErpSupplierWarehousing>() @@ -530,6 +558,7 @@ tErpSupplierOutboundGoods.setWarehousingBatchId(warehousingBatch.getId()); tErpSupplierOutboundGoods.setOutboundCount(purchaseCount); tErpSupplierOutboundGoods.setTotalPrice(tErpProcurementGoods.getPurchasePrice().multiply(new BigDecimal(purchaseCount))); tErpSupplierOutboundGoods.setProcurementGoodsId(tErpProcurementGoods.getId()); erpSupplierOutboundGoodsMapper.insert(tErpSupplierOutboundGoods); continue outer; } @@ -552,6 +581,7 @@ tErpSupplierOutboundGoods.setWarehousingBatchId(warehousingBatch.getId()); tErpSupplierOutboundGoods.setOutboundCount(purchaseCount); tErpSupplierOutboundGoods.setTotalPrice(tErpProcurementGoods.getPurchasePrice().multiply(new BigDecimal(purchaseCount))); tErpSupplierOutboundGoods.setProcurementGoodsId(tErpProcurementGoods.getId()); erpSupplierOutboundGoodsMapper.insert(tErpSupplierOutboundGoods); } @@ -564,6 +594,11 @@ } TErpProcurement byId = this.getById(id); byId.setStatus(4); byId.setSendTime(LocalDateTime.now()); byId.setLogisticsNumber(logisticsNumber); this.updateById(byId); } ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSysGoodsServiceImpl.java
@@ -84,6 +84,7 @@ exchange.setGoodsCount(dto.getCount()); exchange.setUsePoints(tSysGoods.getRequiredPoints().intValue() * dto.getCount()); exchange.setExchangeTime(LocalDateTime.now()); exchange.setClinicId(crmClinic.getId()); sysGoodsExchangeMapper.insert(exchange); // 记录 ruoyi-system/src/main/java/com/ruoyi/system/vo/DetailProcurementNextThreeVO.java
New file @@ -0,0 +1,33 @@ package com.ruoyi.system.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDateTime; @Data @ApiModel(value = "诊所采购详情三级Vo") public class DetailProcurementNextThreeVO { @ApiModelProperty(value = "批次号") private String batchNumber; @ApiModelProperty(value = "生产日期") private LocalDateTime productionDate; @ApiModelProperty(value = "有效期") private LocalDateTime expirationDate; @ApiModelProperty(value = "入库数量") private Integer num; } ruoyi-system/src/main/java/com/ruoyi/system/vo/DetailProcurementNextVO.java
@@ -8,6 +8,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @Data @ApiModel(value = "诊所采购详情二级Vo") @@ -25,14 +26,14 @@ @ApiModelProperty(value = "国药准字号") private String quasiNumber; @ApiModelProperty(value = "数量") private Integer num; @ApiModelProperty(value = "单位") private String packingUnitName; @ApiModelProperty(value = "售价") private BigDecimal salesAmount; @ApiModelProperty(value = "数量") private Integer num; @ApiModelProperty(value = "状态") private BigDecimal totalPrice=BigDecimal.ZERO; @@ -47,6 +48,10 @@ private BigDecimal purchasePrice; @ApiModelProperty(value = "采购三级") private List<DetailProcurementNextThreeVO> detailProcurementNextThreeVOS; ruoyi-system/src/main/java/com/ruoyi/system/vo/ExchangeGoodsRecordDetailVo.java
New file @@ -0,0 +1,54 @@ package com.ruoyi.system.vo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDateTime; @Data @ApiModel("兑换记录详情") public class ExchangeGoodsRecordDetailVo { @TableId(value = "id", type = IdType.ASSIGN_ID) private String id; @ApiModelProperty(value = "诊所名称") private String clinicName; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "商品id") private String goodsId; @ApiModelProperty(value = "商品数量") private Integer goodsCount; @ApiModelProperty(value = "使用积分") private Integer usePoints; @ApiModelProperty(value = "兑换时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime exchangeTime; @ApiModelProperty(value = "状态 1=未发货 2=已发货") private Integer status; @ApiModelProperty(value = "物流单号") private String logisticsNumber; @ApiModelProperty(value = "诊所id") private String clinicId; @ApiModelProperty(value = "封面") private String goodsCover; @ApiModelProperty(value = "商品详情") private String goodsDetail; } ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml
@@ -123,19 +123,20 @@ <select id="warehousePageList" resultType="com.ruoyi.system.vo.TErpClinicWarehousePageListVO"> select t1.id,t1.warehouse_no, case when t1.type =1 then t2.supplier_name else t4.supplier_name end as supplierName, case when t1.type =1 then t2.supplier_name else t1.supplier_name end as supplierName, t3.procurement_code, case when t1.type =1 then t3.pay_money else t1.total_price end as allTotalPrice, t1.create_time warehouseTime,t1.type from t_erp_clinic_warehousing t1 left join t_erp_procurement t3 on t1.procurement_id = t3.id from t_erp_clinic_warehousing t1 left join t_erp_procurement t3 on t1.procurement_id = t3.id left join t_crm_supplier t2 on t3.supplier_id = t2.id and t1.type =1 left join t_crm_supplier t4 on t1.supplier_id = t4.id and t1.type !=1 where t1.disabled = 0 and t1.clinic_id = #{supplierClinicId} where t1.disabled = 0 and t1.clinic_id = #{supplierClinicId} and t1.status =2 <if test="query.warehouseNo != null and query.warehouseNo != ''"> and t1.warehouse_no like concat('%',#{query.warehouseNo},'%') </if> <if test="query.supplierName != null and query.supplierName != ''"> and (t2.supplier_name like concat('%',#{query.supplierName},'%') or t4.supplier_name like concat('%',#{query.supplierName},'%')) and (t2.supplier_name like concat('%',#{query.supplierName},'%') or t1.supplier_name like concat('%',#{query.supplierName},'%')) </if> <if test="sTime != null"> and t1.create_time between #{sTime} and #{eTime} ruoyi-system/src/main/resources/mapper/system/TErpProcurementMapper.xml
@@ -61,6 +61,7 @@ and t1.create_time between #{sTime} and #{eTime} </if> group by t1.id order by t1.create_time desc </select> <select id="inventoryNotEnoughList" resultType="com.ruoyi.system.vo.TErpGoodsVO">