Merge remote-tracking branch 'origin/lx_dev' into lx_dev
This commit is contained in:
commit
21573b1a26
|
@ -664,7 +664,7 @@ public class BdWaresController extends BaseController {
|
||||||
if (!isPutOn) {
|
if (!isPutOn) {
|
||||||
return AjaxResult.error("产品规格至少有一个上架");
|
return AjaxResult.error("产品规格至少有一个上架");
|
||||||
}
|
}
|
||||||
wares.setSort(0);
|
// wares.setSort(0);
|
||||||
waresService.saveWares(wares, userTokenService.getLoginUser());
|
waresService.saveWares(wares, userTokenService.getLoginUser());
|
||||||
return AjaxResult.success(wares.getWaresCode());
|
return AjaxResult.success(wares.getWaresCode());
|
||||||
}
|
}
|
||||||
|
@ -805,7 +805,7 @@ public class BdWaresController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
waresParams.setSort(0);
|
// waresParams.setSort(0);
|
||||||
waresService.updateWares(waresParams, userTokenService.getLoginUser());
|
waresService.updateWares(waresParams, userTokenService.getLoginUser());
|
||||||
// waresService.saveWaresModifyRecord(waresParams, userTokenService.getLoginUser(),EModifyRecordType.WARES_UPDATE.getValue());
|
// waresService.saveWaresModifyRecord(waresParams, userTokenService.getLoginUser(),EModifyRecordType.WARES_UPDATE.getValue());
|
||||||
return AjaxResult.success(waresParams.getWaresCode());
|
return AjaxResult.success(waresParams.getWaresCode());
|
||||||
|
@ -1181,6 +1181,10 @@ public class BdWaresController extends BaseController {
|
||||||
String waresCode = CreateNormsCodeUtils.createWaresCode(waresService.getLastWaresCode());
|
String waresCode = CreateNormsCodeUtils.createWaresCode(waresService.getLastWaresCode());
|
||||||
return AjaxResult.success(waresCode);
|
return AjaxResult.success(waresCode);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/getMaxSortNum")
|
||||||
|
public AjaxResult getMaxSortNum() {
|
||||||
|
return AjaxResult.success("请求成功!", waresService.getMaxSortNum());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品序号创建
|
* 商品序号创建
|
||||||
|
|
|
@ -23,6 +23,11 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public interface IBdWaresService extends IService<BdWares> {
|
public interface IBdWaresService extends IService<BdWares> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最大排序值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getMaxSortNum();
|
||||||
/**
|
/**
|
||||||
* 新增商品基础信息
|
* 新增商品基础信息
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.hzs.sale.wares.service.impl;
|
package com.hzs.sale.wares.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -108,6 +109,15 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
||||||
@DubboReference
|
@DubboReference
|
||||||
ITransactionServiceApi iTransactionServiceApi;
|
ITransactionServiceApi iTransactionServiceApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxSortNum() {
|
||||||
|
Integer maxSort = this.getMaxSort(SecurityUtils.getPkCountry());
|
||||||
|
if(ObjectUtil.isNotEmpty(maxSort)){
|
||||||
|
return maxSort + 1;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public BdWares saveWares(WaresParams waresParams, LoginUser user) {
|
public BdWares saveWares(WaresParams waresParams, LoginUser user) {
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
order by bw.SORT_STATUS desc , bw.WARES_PRICE ,bw.CREATION_TIME desc
|
order by bw.SORT desc, bw.CREATION_TIME desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLastWaresCode" resultType="string">
|
<select id="getLastWaresCode" resultType="string">
|
||||||
|
@ -226,7 +226,7 @@
|
||||||
<if test="waresStatus != null">
|
<if test="waresStatus != null">
|
||||||
and bw.WARES_STATUS <= #{waresStatus}
|
and bw.WARES_STATUS <= #{waresStatus}
|
||||||
</if>
|
</if>
|
||||||
order by bw.SORT_STATUS desc , bw.WARES_PRICE ,bw.CREATION_TIME desc
|
order by bw.sort desc, bw.CREATION_TIME desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByMoveUpSort" resultType="integer">
|
<select id="selectByMoveUpSort" resultType="integer">
|
||||||
|
|
Loading…
Reference in New Issue