|
@@ -11,7 +11,6 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
@@ -26,35 +25,34 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
@Service
|
|
|
@Api(tags = "算法平台商品库")
|
|
|
public class AlgorithmGoodsServiceImpl extends JoinServiceImpl<AlgorithmGoodsMapper, AlgorithmGoods> implements AlgorithmGoodsService {
|
|
|
- @PostMapping("page")
|
|
|
@ApiOperation("分页查询")
|
|
|
@Override
|
|
|
public R<PageBean<AlgorithmGoodsDto.Vo>> page(@RequestBody AlgorithmGoodsDto.Page page) {
|
|
|
PageBean pageBean = page.getPage();
|
|
|
- JoinLambdaWrapper<AlgorithmGoods> lambdaWrapper = new MybatisPlusQuery().eqWrapper(page,AlgorithmGoods.class)
|
|
|
- .ge(AlgorithmGoods::getCreateTime,page.getCreateTimeStart())
|
|
|
- .le(AlgorithmGoods::getCreateTime,page.getCreateTimeEnd())
|
|
|
+ JoinLambdaWrapper<AlgorithmGoods> lambdaWrapper = new MybatisPlusQuery().eqWrapper(page, AlgorithmGoods.class)
|
|
|
+ .ge(AlgorithmGoods::getCreateTime, page.getCreateTimeStart())
|
|
|
+ .le(AlgorithmGoods::getCreateTime, page.getCreateTimeEnd())
|
|
|
.buildJoin()
|
|
|
- .leftJoin(Algorithm.class,Algorithm::getId,AlgorithmGoods::getAlgorithmId)
|
|
|
+ .leftJoin(Algorithm.class, Algorithm::getId, AlgorithmGoods::getAlgorithmId)
|
|
|
.selectAs(Algorithm::getName, LambdaUtils.getProperty(AlgorithmGoodsDto.Vo::getAlgorithmName))
|
|
|
.end();
|
|
|
- return R.ok(joinPage(PlusBeans.toIPage(pageBean),lambdaWrapper,AlgorithmGoodsDto.Vo.class));
|
|
|
+ return R.ok(joinPage(PlusBeans.toIPage(pageBean), lambdaWrapper, AlgorithmGoodsDto.Vo.class));
|
|
|
}
|
|
|
|
|
|
- @PostMapping("save")
|
|
|
- @ApiOperation("添加")
|
|
|
+ @ApiOperation("新增")
|
|
|
+ @Override
|
|
|
public R save(@RequestBody @Validated AlgorithmGoodsDto.Save save) {
|
|
|
AlgorithmGoods saveInfo = PlusBeans.copy(AlgorithmGoods.class, save);
|
|
|
- saveInfo.createUserTime(1L).createId();
|
|
|
+ saveInfo.createUserTime(AuthorizeUtils.getLoginId(Long.class)).createId();
|
|
|
save(saveInfo);
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("update")
|
|
|
@ApiOperation("修改")
|
|
|
- public R save(@RequestBody @Validated AlgorithmGoodsDto.Update update) {
|
|
|
+ @Override
|
|
|
+ public R update(@RequestBody @Validated AlgorithmGoodsDto.Update update) {
|
|
|
AlgorithmGoods updateInfo = PlusBeans.copy(AlgorithmGoods.class, update);
|
|
|
- updateInfo.updateUserTime(1L);
|
|
|
+ updateInfo.updateUserTime(AuthorizeUtils.getLoginId(Long.class));
|
|
|
updateById(updateInfo);
|
|
|
return R.ok();
|
|
|
}
|