## 专区包邮不走国际化;
This commit is contained in:
parent
970bba1555
commit
6edb91e788
|
|
@ -1,10 +1,11 @@
|
|||
package com.hzs.system.config.controller.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.hzs.common.core.constant.msg.CommonMsgConstants;
|
||||
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.domain.AjaxResult;
|
||||
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 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
|
||||
@RequestMapping("/manage/ares-free-postage")
|
||||
|
|
@ -38,10 +36,16 @@ public class BdAreaFreePostageController extends BaseController {
|
|||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list() {
|
||||
QueryWrapper<BdAreaFreePostage> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, SecurityUtils.getPkCountry());
|
||||
queryWrapper.orderByAsc("SPECIAL_AREA");
|
||||
return getDataTable(iBdAreaFreePostageService.list(queryWrapper));
|
||||
LambdaQueryWrapper<BdAreaFreePostage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdAreaFreePostage::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.orderByAsc(BdAreaFreePostage::getSpecialArea);
|
||||
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));
|
||||
}
|
||||
|
||||
QueryWrapper<BdAreaFreePostage> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, SecurityUtils.getPkCountry());
|
||||
queryWrapper.eq("SPECIAL_AREA", param.getSpecialArea());
|
||||
LambdaQueryWrapper<BdAreaFreePostage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdAreaFreePostage::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.eq(BdAreaFreePostage::getSpecialArea, param.getSpecialArea());
|
||||
BdAreaFreePostage bdAreaFreePostage = iBdAreaFreePostageService.getOne(queryWrapper);
|
||||
if (null != bdAreaFreePostage) {
|
||||
return AjaxResult.error("专区配置已存在");
|
||||
|
|
@ -109,11 +113,11 @@ public class BdAreaFreePostageController extends BaseController {
|
|||
*/
|
||||
@DeleteMapping("/delete/{pkId}")
|
||||
public AjaxResult delete(@PathVariable("pkId") Integer pkId) {
|
||||
UpdateWrapper<BdAreaFreePostage> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
|
||||
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EDelFlag.DELETE.getValue());
|
||||
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, SecurityUtils.getUserId());
|
||||
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, new Date());
|
||||
LambdaUpdateWrapper<BdAreaFreePostage> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(BdAreaFreePostage::getPkId, pkId);
|
||||
updateWrapper.set(BdAreaFreePostage::getDelFlag, EDelFlag.DELETE.getValue());
|
||||
updateWrapper.set(BdAreaFreePostage::getPkModified, SecurityUtils.getUserId());
|
||||
updateWrapper.set(BdAreaFreePostage::getModifiedTime, new Date());
|
||||
return toAjax(iBdAreaFreePostageService.update(updateWrapper));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ import lombok.experimental.Accessors;
|
|||
|
||||
/**
|
||||
* 专区包邮配置
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-11-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
@ -37,7 +34,6 @@ public class BdAreaFreePostage extends BaseEntity {
|
|||
/**
|
||||
* 所属专区(专区枚举)
|
||||
*/
|
||||
@Transaction(transactionKey = EnumsPrefixConstants.SPECIAL_AREA)
|
||||
@TableField("SPECIAL_AREA")
|
||||
private Integer specialArea;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue