dev
This commit is contained in:
parent
a8b65a9285
commit
d9f0155f08
|
|
@ -92,7 +92,6 @@ public class GoodsController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping("searchDetail")
|
@RequestMapping("searchDetail")
|
||||||
public Result<Page<GoodsDetailVo>> searchGoodeDetail() {
|
public Result<Page<GoodsDetailVo>> searchGoodeDetail() {
|
||||||
QueryWrapper<GoodsView> queryWrapper = new QueryWrapper<>();
|
|
||||||
GoodsQuery goodsQuery = parmsUtil.getObject("query", GoodsQuery.class);
|
GoodsQuery goodsQuery = parmsUtil.getObject("query", GoodsQuery.class);
|
||||||
Page<GoodsDetailVo> result = goodsService.searchGoodeDetail(goodsQuery);
|
Page<GoodsDetailVo> result = goodsService.searchGoodeDetail(goodsQuery);
|
||||||
return success(result);
|
return success(result);
|
||||||
|
|
|
||||||
|
|
@ -25,19 +25,7 @@ public class InventorySupplierController extends BaseController {
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
public Result<Page> list() {
|
public Result<Page> list() {
|
||||||
SupplierQuery query= parmsUtil.getObject("query", SupplierQuery.class);
|
SupplierQuery query= parmsUtil.getObject("query", SupplierQuery.class);
|
||||||
if (query == null){
|
|
||||||
return error("没有带查询条件");
|
|
||||||
}
|
|
||||||
QueryWrapper<InventorySupplier> queryWrapper = new QueryWrapper();
|
|
||||||
if(query.getTurn() != null){
|
|
||||||
queryWrapper.eq("turn",1);
|
|
||||||
}
|
|
||||||
if(query.getPageNum() == null || query.getPageNum() == 0){
|
|
||||||
query.setPageNum(1);
|
|
||||||
}
|
|
||||||
if (query.getPageSize() == null || query.getPageSize() == 0){
|
|
||||||
query.setPageSize(Constants.DetailPageSize);
|
|
||||||
}
|
|
||||||
return success(inventorySupplierService.listPage(query));
|
return success(inventorySupplierService.listPage(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,4 +39,6 @@ public class InventorySupplierController extends BaseController {
|
||||||
inventorySupplierService.saveOrUpdate(inventorySupplier);
|
inventorySupplierService.saveOrUpdate(inventorySupplier);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ public class GoodsQuery {
|
||||||
private Integer minInterestRate;
|
private Integer minInterestRate;
|
||||||
private Integer maxInterestRate;
|
private Integer maxInterestRate;
|
||||||
private Integer inventoryNumber;
|
private Integer inventoryNumber;
|
||||||
private boolean status;
|
private Boolean saleStatus;
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
private List<interestRateInterval> interestRateIntervalList;
|
private List<interestRateInterval> interestRateIntervalList;
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ public class GoodsDetailVo {
|
||||||
private Integer pricingModel;
|
private Integer pricingModel;
|
||||||
|
|
||||||
private Integer makeUp;
|
private Integer makeUp;
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
private String cateName;
|
private String cateName;
|
||||||
private Boolean saleStatus;
|
private Boolean saleStatus;
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,5 @@ public class SupplierQuery {
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
private Integer turn;
|
private Integer turn;
|
||||||
|
private String keyword;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,9 +206,9 @@ public class GoodsService {
|
||||||
if (goodsQuery.getCateId() != null) {
|
if (goodsQuery.getCateId() != null) {
|
||||||
queryWrapper.eq("cate_id", goodsQuery.getCateId());
|
queryWrapper.eq("cate_id", goodsQuery.getCateId());
|
||||||
}
|
}
|
||||||
if (goodsQuery.isStatus()) {
|
if (goodsQuery.getSaleStatus() != null) {
|
||||||
//是否只查询可售商品
|
//是否只查询可售商品
|
||||||
queryWrapper.eq("status", goodsQuery.isStatus());
|
queryWrapper.eq("sale_status", goodsQuery.getSaleStatus());
|
||||||
}
|
}
|
||||||
if (goodsQuery.getInventoryNumber() != null) {
|
if (goodsQuery.getInventoryNumber() != null) {
|
||||||
queryWrapper.and(wrapper -> {
|
queryWrapper.and(wrapper -> {
|
||||||
|
|
@ -294,24 +294,24 @@ public class GoodsService {
|
||||||
*/
|
*/
|
||||||
public List<GoodsSearchVo> search(String keyword) {
|
public List<GoodsSearchVo> search(String keyword) {
|
||||||
QueryWrapper<Goods> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Goods> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("sale_status",true);
|
||||||
if (keyword != null && !keyword.isEmpty()) {
|
if (keyword != null && !keyword.isEmpty()) {
|
||||||
keyword = keyword.toUpperCase();
|
String finalKeyword = keyword.toUpperCase();
|
||||||
queryWrapper.like("name", keyword);
|
queryWrapper.and(wrapper -> {
|
||||||
queryWrapper.or();
|
wrapper.like("name", finalKeyword);
|
||||||
queryWrapper.like("common_name", keyword);
|
wrapper.or();
|
||||||
queryWrapper.or();
|
wrapper.like("common_name", finalKeyword);
|
||||||
queryWrapper.like("barcode", keyword);
|
wrapper.or();
|
||||||
queryWrapper.or();
|
wrapper.like("barcode", finalKeyword);
|
||||||
queryWrapper.like("hilist_code", keyword);
|
wrapper.or();
|
||||||
queryWrapper.or();
|
wrapper.like("hilist_code", finalKeyword);
|
||||||
queryWrapper.like("producer", keyword);
|
wrapper.or();
|
||||||
queryWrapper.or().like("pinyin_full", keyword);
|
wrapper.like("producer", finalKeyword);
|
||||||
queryWrapper.or().like("pinyin_first", keyword);
|
wrapper.or().like("pinyin_full", finalKeyword);
|
||||||
|
wrapper.or().like("pinyin_first", finalKeyword);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
queryWrapper.orderByDesc("use_num");
|
queryWrapper.orderByDesc("use_num");
|
||||||
|
|
||||||
|
|
||||||
queryWrapper.last("limit 20");
|
queryWrapper.last("limit 20");
|
||||||
|
|
||||||
List<Goods> list = goodsMapper.selectList(queryWrapper);
|
List<Goods> list = goodsMapper.selectList(queryWrapper);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.syjiaer.clinic.server.service.inventory;
|
package com.syjiaer.clinic.server.service.inventory;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.entity.inventory.InventorySupplier;
|
import com.syjiaer.clinic.server.entity.inventory.InventorySupplier;
|
||||||
import com.syjiaer.clinic.server.entity.inventory.dto.SupplierQuery;
|
import com.syjiaer.clinic.server.entity.inventory.dto.SupplierQuery;
|
||||||
|
|
@ -21,6 +23,30 @@ public class InventorySupplierService extends BaseService {
|
||||||
*/
|
*/
|
||||||
public Page<InventorySupplier> listPage(SupplierQuery query) {
|
public Page<InventorySupplier> listPage(SupplierQuery query) {
|
||||||
QueryWrapper<InventorySupplier> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<InventorySupplier> queryWrapper = new QueryWrapper<>();
|
||||||
|
if (query == null){
|
||||||
|
throw new MessageException("没有带查询条件");
|
||||||
|
}
|
||||||
|
if(query.getTurn() != null){
|
||||||
|
queryWrapper.eq("turn",1);
|
||||||
|
}
|
||||||
|
if (query.getKeyword() != null && !query.getKeyword().isEmpty()){
|
||||||
|
String finalKeyword = query.getKeyword();
|
||||||
|
queryWrapper.and(wrapper -> {
|
||||||
|
wrapper.like("name", finalKeyword);
|
||||||
|
wrapper.or();
|
||||||
|
wrapper.like("contact_name", finalKeyword);
|
||||||
|
wrapper.or();
|
||||||
|
wrapper.like("contact_tel", finalKeyword);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(query.getPageNum() == null || query.getPageNum() == 0){
|
||||||
|
query.setPageNum(1);
|
||||||
|
}
|
||||||
|
if (query.getPageSize() == null || query.getPageSize() == 0){
|
||||||
|
query.setPageSize(Constants.DetailPageSize);
|
||||||
|
}
|
||||||
if(query.getTurn() != null){
|
if(query.getTurn() != null){
|
||||||
queryWrapper.eq("turn",1);
|
queryWrapper.eq("turn",1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue