bug
This commit is contained in:
@@ -25,6 +25,8 @@ public class ShopProductToMedicineMarket implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ public class ShopProductToSociologyMarket implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ public class SociologyLabelAndMarketController {
|
|||||||
if (params.containsKey("sociologyMarketId")&&!"".equals(params.get("sociologyMarketId").toString())){
|
if (params.containsKey("sociologyMarketId")&&!"".equals(params.get("sociologyMarketId").toString())){
|
||||||
wrapper.eq(ShopProductToSociologyMarket::getSociologyMarketId,params.get("sociologyMarketId").toString());
|
wrapper.eq(ShopProductToSociologyMarket::getSociologyMarketId,params.get("sociologyMarketId").toString());
|
||||||
}
|
}
|
||||||
|
wrapper.orderByAsc(ShopProductToSociologyMarket::getSort);
|
||||||
Page<ShopProductToSociologyMarket> page = toMarketService.page(new Page<>(
|
Page<ShopProductToSociologyMarket> page = toMarketService.page(new Page<>(
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
List<ShopProductToSociologyMarket> res = page.getRecords();
|
List<ShopProductToSociologyMarket> res = page.getRecords();
|
||||||
@@ -292,6 +293,12 @@ public class SociologyLabelAndMarketController {
|
|||||||
return R.ok().put("result", page);
|
return R.ok().put("result", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/editToMarketSort")
|
||||||
|
public R editToMarketSort(@RequestBody Map<String,Integer> map){
|
||||||
|
toMarketService.editToMarketSort(map);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/saveToLabel")
|
@RequestMapping(path = "/saveToLabel")
|
||||||
public R saveToLabel(@RequestBody Map params) {
|
public R saveToLabel(@RequestBody Map params) {
|
||||||
if (!StringUtils.isEmpty(params.get("productId").toString())){
|
if (!StringUtils.isEmpty(params.get("productId").toString())){
|
||||||
|
|||||||
@@ -3,5 +3,9 @@ package com.peanut.modules.master.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
|
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface ShopProductToSociologyMarketService extends IService<ShopProductToSociologyMarket> {
|
public interface ShopProductToSociologyMarketService extends IService<ShopProductToSociologyMarket> {
|
||||||
|
|
||||||
|
void editToMarketSort(Map<String,Integer> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,16 @@ import com.peanut.modules.master.service.ShopProductToSociologyMarketService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("masterShopProductToSociologyMarketService")
|
@Service("masterShopProductToSociologyMarketService")
|
||||||
public class ShopProductToSociologyMarketServiceImpl extends ServiceImpl<ShopProductToSociologyMarketDao, ShopProductToSociologyMarket> implements ShopProductToSociologyMarketService {
|
public class ShopProductToSociologyMarketServiceImpl extends ServiceImpl<ShopProductToSociologyMarketDao, ShopProductToSociologyMarket> implements ShopProductToSociologyMarketService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void editToMarketSort(Map<String, Integer> map) {
|
||||||
|
ShopProductToSociologyMarket info = this.getById(map.get("id"));
|
||||||
|
info.setSort(map.get("sort"));
|
||||||
|
this.updateById(info);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
|||||||
wrapper.selectAll(ShopProduct.class);
|
wrapper.selectAll(ShopProduct.class);
|
||||||
wrapper.leftJoin(ShopProductToSociologyMarket.class,ShopProductToSociologyMarket::getProductId,ShopProduct::getProductId);
|
wrapper.leftJoin(ShopProductToSociologyMarket.class,ShopProductToSociologyMarket::getProductId,ShopProduct::getProductId);
|
||||||
wrapper.eq(ShopProductToSociologyMarket::getSociologyMarketId,param.getId());
|
wrapper.eq(ShopProductToSociologyMarket::getSociologyMarketId,param.getId());
|
||||||
|
wrapper.orderByAsc(ShopProductToSociologyMarket::getSort);
|
||||||
Page<ShopProduct> shopProductPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), ShopProduct.class, wrapper);
|
Page<ShopProduct> shopProductPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), ShopProduct.class, wrapper);
|
||||||
return shopProductPage;
|
return shopProductPage;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user