## 专区包邮不走国际化;
This commit is contained in:
parent
6f4fe029f5
commit
2f140346b1
|
|
@ -1,10 +1,11 @@
|
||||||
package com.hzs.system.config.controller.manage;
|
package com.hzs.system.config.controller.manage;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.hzs.common.core.constant.msg.CommonMsgConstants;
|
import com.hzs.common.core.constant.msg.CommonMsgConstants;
|
||||||
import com.hzs.common.core.enums.EDelFlag;
|
import com.hzs.common.core.enums.EDelFlag;
|
||||||
|
import com.hzs.common.core.enums.ESpecialArea;
|
||||||
import com.hzs.common.core.web.controller.BaseController;
|
import com.hzs.common.core.web.controller.BaseController;
|
||||||
import com.hzs.common.core.web.domain.AjaxResult;
|
import com.hzs.common.core.web.domain.AjaxResult;
|
||||||
import com.hzs.common.core.web.page.TableDataInfo;
|
import com.hzs.common.core.web.page.TableDataInfo;
|
||||||
|
|
@ -16,13 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 专区免邮控制器
|
* 专区免邮控制器
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2023/11/30 15:44
|
|
||||||
* @Classname: BdAreaFreePostageController
|
|
||||||
* @PackageName: com.hzs.system.config.controller.manage
|
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/manage/ares-free-postage")
|
@RequestMapping("/manage/ares-free-postage")
|
||||||
|
|
@ -38,10 +36,16 @@ public class BdAreaFreePostageController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list() {
|
public TableDataInfo list() {
|
||||||
QueryWrapper<BdAreaFreePostage> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAreaFreePostage> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, SecurityUtils.getPkCountry());
|
queryWrapper.eq(BdAreaFreePostage::getPkCountry, SecurityUtils.getPkCountry());
|
||||||
queryWrapper.orderByAsc("SPECIAL_AREA");
|
queryWrapper.orderByAsc(BdAreaFreePostage::getSpecialArea);
|
||||||
return getDataTable(iBdAreaFreePostageService.list(queryWrapper));
|
List<BdAreaFreePostage> list = iBdAreaFreePostageService.list(queryWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
for (BdAreaFreePostage bdAreaFreePostage : list) {
|
||||||
|
bdAreaFreePostage.setSpecialAreaVal(ESpecialArea.getLabelByValue(bdAreaFreePostage.getSpecialArea()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,9 +61,9 @@ public class BdAreaFreePostageController extends BaseController {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(CommonMsgConstants.MISSING_PARAM));
|
return AjaxResult.error(TransactionUtils.getContent(CommonMsgConstants.MISSING_PARAM));
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<BdAreaFreePostage> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAreaFreePostage> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, SecurityUtils.getPkCountry());
|
queryWrapper.eq(BdAreaFreePostage::getPkCountry, SecurityUtils.getPkCountry());
|
||||||
queryWrapper.eq("SPECIAL_AREA", param.getSpecialArea());
|
queryWrapper.eq(BdAreaFreePostage::getSpecialArea, param.getSpecialArea());
|
||||||
BdAreaFreePostage bdAreaFreePostage = iBdAreaFreePostageService.getOne(queryWrapper);
|
BdAreaFreePostage bdAreaFreePostage = iBdAreaFreePostageService.getOne(queryWrapper);
|
||||||
if (null != bdAreaFreePostage) {
|
if (null != bdAreaFreePostage) {
|
||||||
return AjaxResult.error("专区配置已存在");
|
return AjaxResult.error("专区配置已存在");
|
||||||
|
|
@ -109,11 +113,11 @@ public class BdAreaFreePostageController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/delete/{pkId}")
|
@DeleteMapping("/delete/{pkId}")
|
||||||
public AjaxResult delete(@PathVariable("pkId") Integer pkId) {
|
public AjaxResult delete(@PathVariable("pkId") Integer pkId) {
|
||||||
UpdateWrapper<BdAreaFreePostage> updateWrapper = new UpdateWrapper<>();
|
LambdaUpdateWrapper<BdAreaFreePostage> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
|
updateWrapper.eq(BdAreaFreePostage::getPkId, pkId);
|
||||||
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EDelFlag.DELETE.getValue());
|
updateWrapper.set(BdAreaFreePostage::getDelFlag, EDelFlag.DELETE.getValue());
|
||||||
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, SecurityUtils.getUserId());
|
updateWrapper.set(BdAreaFreePostage::getPkModified, SecurityUtils.getUserId());
|
||||||
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, new Date());
|
updateWrapper.set(BdAreaFreePostage::getModifiedTime, new Date());
|
||||||
return toAjax(iBdAreaFreePostageService.update(updateWrapper));
|
return toAjax(iBdAreaFreePostageService.update(updateWrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,6 @@ import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专区包邮配置
|
* 专区包邮配置
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-11-30
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|
@ -37,7 +34,6 @@ public class BdAreaFreePostage extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 所属专区(专区枚举)
|
* 所属专区(专区枚举)
|
||||||
*/
|
*/
|
||||||
@Transaction(transactionKey = EnumsPrefixConstants.SPECIAL_AREA)
|
|
||||||
@TableField("SPECIAL_AREA")
|
@TableField("SPECIAL_AREA")
|
||||||
private Integer specialArea;
|
private Integer specialArea;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue