From 46af1f9e0904c3b88249a7eceb9f1b1d07b99eb8 Mon Sep 17 00:00:00 2001 From: zhangtq <2452618307@qq.com> Date: Wed, 5 Mar 2025 09:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0-=E5=88=86=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A4=90=E7=BA=BF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AllocCanteenController.java | 14 +- .../canteen/mapper/AllocMealLineMapper.java | 14 +- .../param/AllocCanteenStallPageParam.java | 130 +++++++++++++++ .../canteen/service/AllocMealLineService.java | 4 +- .../impl/AllocMealLineServiceImpl.java | 59 +++---- .../canteen/vo/AllocMealLineVO.java | 153 ++++++++++++++++++ .../mapper/allocation/AllocMealLineMapper.xml | 53 ++++++ 7 files changed, 385 insertions(+), 42 deletions(-) create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/param/AllocCanteenStallPageParam.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/vo/AllocMealLineVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/resources/mapper/allocation/AllocMealLineMapper.xml diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocCanteenController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocCanteenController.java index 3fbfcf67..1fd3a1fe 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocCanteenController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocCanteenController.java @@ -1,10 +1,13 @@ package com.bonus.canteen.core.allocation.canteen.controller; +import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenStallPageParam; +import com.bonus.canteen.core.allocation.canteen.service.AllocMealLineService; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.canteen.core.allocation.canteen.dto.AllocMobileCanteenQueryDTO; import com.bonus.canteen.core.allocation.canteen.model.AllocCanteen; import com.bonus.canteen.core.allocation.canteen.service.AllocCanteenService; import com.bonus.canteen.core.allocation.canteen.service.AllocStallService; +import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -29,10 +32,13 @@ public class AllocCanteenController { @Lazy private AllocCanteenService allocCanteenService; - @Autowired + @Resource @Lazy private AllocStallService allocStallService; + @Resource + @Lazy + private AllocMealLineService allocMealLineService; @ApiOperation("查询食堂所有开启的支付方式") @PostMapping({"/list-avail-pay-type"}) public AjaxResult listAvailPayTypeForApp(@RequestBody AllocCanteen bean) { @@ -54,4 +60,10 @@ public class AllocCanteenController { public AjaxResult listReserveDate(@RequestBody AllocMobileCanteenQueryDTO bean) { return AjaxResult.success(this.allocStallService.listReserveDate(bean)); } + + @ApiOperation("分页查询餐线列表") + @PostMapping({"/page-meal-line"}) + public AjaxResult pageMealLine(@RequestBody AllocCanteenStallPageParam dto) { + return AjaxResult.success(this.allocMealLineService.pageMealLine(dto)); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocMealLineMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocMealLineMapper.java index 31fa9667..81d652b5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocMealLineMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocMealLineMapper.java @@ -3,6 +3,10 @@ package com.bonus.canteen.core.allocation.canteen.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bonus.canteen.core.allocation.canteen.model.AllocMealLine; +import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenStallPageParam; +import com.bonus.canteen.core.allocation.canteen.vo.AllocMealLineVO; +import com.bonus.canteen.core.autth.config.LeNiuDataPermission; +import com.bonus.canteen.core.autth.enums.DataPermissionTypeEnum; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -14,11 +18,11 @@ public interface AllocMealLineMapper extends BaseMapper { @Select({"SELECT MAX(meal_line_num) FROM alloc_meal_line WHERE if_del = 2 AND stall_id = #{stallId}"}) String getLatestMealLineNum(Long stallId); -// @LeNiuDataPermission( -// alias = "t1", -// permissionType = DataPermissionTypeEnum.PERMISSION_STALL -// ) -// Page pageMealLine(@Param("page") Page page, @Param("param") AllocCanteenStallPageParam param); + @LeNiuDataPermission( + alias = "t1", + permissionType = DataPermissionTypeEnum.PERMISSION_STALL + ) + Page pageMealLine(@Param("page") Page page, @Param("param") AllocCanteenStallPageParam param); // // List listMultipleMealLine(@Param("stallIdList") List stallIdList); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/param/AllocCanteenStallPageParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/param/AllocCanteenStallPageParam.java new file mode 100644 index 00000000..6c8d022b --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/param/AllocCanteenStallPageParam.java @@ -0,0 +1,130 @@ +package com.bonus.canteen.core.allocation.canteen.param; + +import com.bonus.canteen.core.common.page.PageDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +@ApiModel("食堂档口 param") +public class AllocCanteenStallPageParam extends PageDTO { + @ApiModelProperty("区域id") + private Long areaId; + private List areaIdList; + @ApiModelProperty("食堂id") + private Long canteenId; + @ApiModelProperty("食堂名称") + private String canteenName; + @ApiModelProperty("档口id") + private Long stallId; + @ApiModelProperty("档口名称") + private String stallName; + @ApiModelProperty("档口业务类型") + private Integer stallType; + @ApiModelProperty("餐线名称") + private String mealLineName; + @ApiModelProperty("是否删除") + private Integer ifDel; + @ApiModelProperty("食堂/档口 id") + private Long commonId; + @ApiModelProperty("食堂业务类型") + private Integer canteenType; + @ApiModelProperty("食堂树类型") + private Integer canteenTreeType; + + public Long getAreaId() { + return this.areaId; + } + + public List getAreaIdList() { + return this.areaIdList; + } + + public Long getCanteenId() { + return this.canteenId; + } + + public String getCanteenName() { + return this.canteenName; + } + + public Long getStallId() { + return this.stallId; + } + + public String getStallName() { + return this.stallName; + } + + public Integer getStallType() { + return this.stallType; + } + + public String getMealLineName() { + return this.mealLineName; + } + + public Integer getIfDel() { + return this.ifDel; + } + + public Long getCommonId() { + return this.commonId; + } + + public Integer getCanteenType() { + return this.canteenType; + } + + public Integer getCanteenTreeType() { + return this.canteenTreeType; + } + + public void setAreaId(final Long areaId) { + this.areaId = areaId; + } + + public void setAreaIdList(final List areaIdList) { + this.areaIdList = areaIdList; + } + + public void setCanteenId(final Long canteenId) { + this.canteenId = canteenId; + } + + public void setCanteenName(final String canteenName) { + this.canteenName = canteenName; + } + + public void setStallId(final Long stallId) { + this.stallId = stallId; + } + + public void setStallName(final String stallName) { + this.stallName = stallName; + } + + public void setStallType(final Integer stallType) { + this.stallType = stallType; + } + + public void setMealLineName(final String mealLineName) { + this.mealLineName = mealLineName; + } + + public void setIfDel(final Integer ifDel) { + this.ifDel = ifDel; + } + + public void setCommonId(final Long commonId) { + this.commonId = commonId; + } + + public void setCanteenType(final Integer canteenType) { + this.canteenType = canteenType; + } + + public void setCanteenTreeType(final Integer canteenTreeType) { + this.canteenTreeType = canteenTreeType; + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocMealLineService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocMealLineService.java index 212457d9..b257fe13 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocMealLineService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocMealLineService.java @@ -3,6 +3,8 @@ package com.bonus.canteen.core.allocation.canteen.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.bonus.canteen.core.allocation.canteen.model.AllocMealLine; +import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenStallPageParam; +import com.bonus.canteen.core.allocation.canteen.vo.AllocMealLineVO; import java.util.List; @@ -11,7 +13,7 @@ public interface AllocMealLineService extends IService { // // List listMultipleMealLine(AllocCanteenStallParam param); // -// Page pageMealLine(AllocCanteenStallPageParam param); + Page pageMealLine(AllocCanteenStallPageParam param); // // void addMealLine(AllocMealLineAddDTO addDTO); // diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocMealLineServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocMealLineServiceImpl.java index 0f6d281f..e33b927f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocMealLineServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocMealLineServiceImpl.java @@ -1,35 +1,28 @@ package com.bonus.canteen.core.allocation.canteen.service.impl; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bonus.canteen.core.allocation.canteen.mapper.AllocMealLineMapper; import com.bonus.canteen.core.allocation.canteen.model.AllocMealLine; +import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenStallPageParam; +import com.bonus.canteen.core.allocation.canteen.service.AllocAreaService; import com.bonus.canteen.core.allocation.canteen.service.AllocMealLineService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; +import com.bonus.canteen.core.allocation.canteen.vo.AllocMealLineVO; +import com.bonus.common.houqin.constant.LeConstants; +import com.bonus.common.houqin.utils.AesEncryptUtil; +import com.bonus.common.houqin.utils.LeBeanUtil; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; -import java.lang.invoke.SerializedLambda; -import java.util.Iterator; -import java.util.List; +import javax.annotation.Resource; @Service public class AllocMealLineServiceImpl extends ServiceImpl implements AllocMealLineService { // private static final Logger log = LoggerFactory.getLogger(AllocMealLineServiceImpl.class); -// @Autowired -// @Lazy -// private AllocAreaService allocAreaService; -// @Resource -// private AesEncryptUtil aesEncryptUtil; + @Resource + @Lazy + private AllocAreaService allocAreaService; // @Resource // private AllocStallMapper allocStallMapper; // @Autowired @@ -53,24 +46,20 @@ public class AllocMealLineServiceImpl extends ServiceImpl pageMealLine(AllocCanteenStallPageParam param) { -// param.setMealLineName(LeBeanUtil.fieldLikeHandle(param.getMealLineName())); -// param.setIfDel(LeConstants.COMMON_NO); -// Page page = new Page(param.getCurrent(), param.getSize()); -// if (ObjectUtil.isNotNull(param.getAreaId())) { -// param.setAreaIdList(this.allocAreaService.getAllChildrenId(param.getAreaId())); -// } -// -// page = ((AllocMealLineMapper)this.baseMapper).pageMealLine(page, param); -// Iterator var3 = page.getRecords().iterator(); -// -// while(var3.hasNext()) { -// AllocMealLineVO mealLine = (AllocMealLineVO)var3.next(); -// mealLine.setContactTel(this.aesEncryptUtil.aesEncrypt(mealLine.getContactTel())); -// } -// -// return page; -// } + @Override + public Page pageMealLine(AllocCanteenStallPageParam param) { + param.setMealLineName(LeBeanUtil.fieldLikeHandle(param.getMealLineName())); + param.setIfDel(LeConstants.COMMON_NO); + Page page = new Page(param.getCurrent(), param.getSize()); + if (ObjectUtil.isNotNull(param.getAreaId())) { + param.setAreaIdList(this.allocAreaService.getAllChildrenId(param.getAreaId())); + } + page = this.baseMapper.pageMealLine(page, param); + for (AllocMealLineVO mealLine : page.getRecords()) { + mealLine.setContactTel(AesEncryptUtil.aesEncrypt(mealLine.getContactTel())); + } + return page; + } // // public void addMealLine(AllocMealLineAddDTO addDTO) { // this.checkMealLineNameExist(addDTO.getMealLineName(), (Long)null); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/vo/AllocMealLineVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/vo/AllocMealLineVO.java new file mode 100644 index 00000000..4a2ed02c --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/vo/AllocMealLineVO.java @@ -0,0 +1,153 @@ +package com.bonus.canteen.core.allocation.canteen.vo; + +import com.bonus.canteen.core.common.encrypt.LeNiuDecryptDataProcess; +import com.bonus.canteen.core.common.encrypt.LeNiuDecryptField; +import com.bonus.canteen.core.common.utils.SysUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel("餐线VO") +@LeNiuDecryptDataProcess +public class AllocMealLineVO { + @ApiModelProperty("餐线id") + private Long mealLineId; + @ApiModelProperty("餐线编号") + private String mealLineNum; + @ApiModelProperty("餐线名称") + private String mealLineName; + @ApiModelProperty("餐线图片链接") + private String imgUrl; + @ApiModelProperty("餐线类型") + private Integer mealLineType; + @ApiModelProperty("区域id") + private Long areaId; + @ApiModelProperty("当前区域名称") + private String areaName; + @ApiModelProperty("食堂id") + private Long canteenId; + @ApiModelProperty("食堂名称") + private String canteenName; + @ApiModelProperty("档口id") + private Long stallId; + @ApiModelProperty("档口名称") + private String stallName; + @ApiModelProperty("人员id") + private Long custId; + @ApiModelProperty("人员姓名") + @LeNiuDecryptField + private String custName; + @ApiModelProperty("联系电话") + private String contactTel; + + public String getImgUrl() { + return SysUtil.getCutFileUrl(this.imgUrl); + } + + public Long getMealLineId() { + return this.mealLineId; + } + + public String getMealLineNum() { + return this.mealLineNum; + } + + public String getMealLineName() { + return this.mealLineName; + } + + public Integer getMealLineType() { + return this.mealLineType; + } + + public Long getAreaId() { + return this.areaId; + } + + public String getAreaName() { + return this.areaName; + } + + public Long getCanteenId() { + return this.canteenId; + } + + public String getCanteenName() { + return this.canteenName; + } + + public Long getStallId() { + return this.stallId; + } + + public String getStallName() { + return this.stallName; + } + + public Long getCustId() { + return this.custId; + } + + public String getCustName() { + return this.custName; + } + + public String getContactTel() { + return this.contactTel; + } + + public void setMealLineId(final Long mealLineId) { + this.mealLineId = mealLineId; + } + + public void setMealLineNum(final String mealLineNum) { + this.mealLineNum = mealLineNum; + } + + public void setMealLineName(final String mealLineName) { + this.mealLineName = mealLineName; + } + + public void setImgUrl(final String imgUrl) { + this.imgUrl = imgUrl; + } + + public void setMealLineType(final Integer mealLineType) { + this.mealLineType = mealLineType; + } + + public void setAreaId(final Long areaId) { + this.areaId = areaId; + } + + public void setAreaName(final String areaName) { + this.areaName = areaName; + } + + public void setCanteenId(final Long canteenId) { + this.canteenId = canteenId; + } + + public void setCanteenName(final String canteenName) { + this.canteenName = canteenName; + } + + public void setStallId(final Long stallId) { + this.stallId = stallId; + } + + public void setStallName(final String stallName) { + this.stallName = stallName; + } + + public void setCustId(final Long custId) { + this.custId = custId; + } + + public void setCustName(final String custName) { + this.custName = custName; + } + + public void setContactTel(final String contactTel) { + this.contactTel = contactTel; + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/allocation/AllocMealLineMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/allocation/AllocMealLineMapper.xml new file mode 100644 index 00000000..7d73bd35 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/allocation/AllocMealLineMapper.xml @@ -0,0 +1,53 @@ + + + + + + + + + + +