8 changed files with 270 additions and 20 deletions
@ -0,0 +1,15 @@
|
||||
package com.logpm.distribution.vo.app; |
||||
|
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
@Data |
||||
public class DistributionMerchantStockListVO { |
||||
|
||||
private String allocation; |
||||
|
||||
private String trayName; |
||||
|
||||
private Integer num; |
||||
} |
@ -0,0 +1,69 @@
|
||||
package com.logpm.basic.app; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import com.logpm.basic.service.IBasicMaterialService; |
||||
import com.logpm.basic.service.impl.BasicMaterialServiceImpl; |
||||
import com.logpm.basic.vo.BasicMaterialVO; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.List; |
||||
|
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/app/materiel") |
||||
@Api(value = "配送管理", tags = "增值服务App接口") |
||||
public class BasicMaterielPDAlController { |
||||
|
||||
private IBasicMaterialService basicMaterialService; |
||||
|
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO") |
||||
public R<List<BasicMaterialEntity>> list(@RequestParam String materielStr,@RequestParam Integer type) { |
||||
String tenantId = AuthUtil.getTenantId(); |
||||
if (Func.isEmpty(tenantId)){ |
||||
return null; |
||||
} |
||||
LambdaQueryWrapper<BasicMaterialEntity> apply = Wrappers.<BasicMaterialEntity>query().lambda() |
||||
.eq(BasicMaterialEntity::getTenantId, tenantId); |
||||
|
||||
switch (type){ |
||||
case 1: |
||||
if (Func.isNotEmpty(materielStr)){ |
||||
apply.like(BasicMaterialEntity::getName, materielStr); |
||||
} |
||||
break; |
||||
case 2: |
||||
if (Func.isNotEmpty(materielStr)){ |
||||
apply.like(BasicMaterialEntity::getProductCode, materielStr); |
||||
} |
||||
break; |
||||
} |
||||
|
||||
List<BasicMaterialEntity> materialEntities = basicMaterialService.list(apply.last("limit 20")); |
||||
return R.data(materialEntities); |
||||
} |
||||
|
||||
@PostMapping("/updateMateriel") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "PDA维护物料信息", notes = "DistributionStockListVO") |
||||
private R updateMateriel(@Valid @RequestBody BasicMaterialEntity basicMaterial){ |
||||
boolean flag = basicMaterialService.updateById(basicMaterial); |
||||
return R.status(flag); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,42 @@
|
||||
package com.logpm.distribution.appcontroller; |
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.logpm.distribution.service.IDistributionStockListService; |
||||
import com.logpm.distribution.vo.app.DistributionMerchantStockListVO; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.SpringUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.boot.ApplicationContextFactory; |
||||
import org.springframework.boot.web.servlet.context.XmlServletWebServerApplicationContext; |
||||
import org.springframework.context.annotation.Lazy; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
|
||||
@RestController |
||||
@RequestMapping("/app/stocklist") |
||||
@AllArgsConstructor |
||||
@Api(value = "商家查看库存品", tags = "商家查看库存品") |
||||
public class DistributionStockListPDAController { |
||||
|
||||
|
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "PDA查询库存品列表", notes = "DistributionStockListVO") |
||||
private R<List<DistributionMerchantStockListVO>> getMerchantStockList(@RequestParam String materielCode){ |
||||
IDistributionStockListService distributionStockListService = SpringUtil.getBean(IDistributionStockListService.class); |
||||
List<DistributionMerchantStockListVO> stockListEntityList =distributionStockListService.getMerchantStockList(materielCode); |
||||
return R.data(stockListEntityList); |
||||
}; |
||||
|
||||
|
||||
|
||||
} |
Loading…
Reference in new issue