From e70bd4511dfa5b8c5d9c92a90dcd367fc427f082 Mon Sep 17 00:00:00 2001 From: gaowdong Date: Tue, 4 Mar 2025 17:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F/=E6=A1=A3=E5=8F=A3=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/common/houqin/utils/LeRequest.java | 75 ------------- .../allocation/api/AllocPayMetadataApi.java | 17 +++ .../allocation/api/GlobalMetadataApi.java | 24 +++- .../business/AllocCanteenBusiness.java | 6 +- .../impl/AllocCanteenBusinessImpl.java | 105 +++++++++--------- .../controller/AllocAreaController.java | 13 ++- .../controller/AllocCanteenController.java | 35 ++++-- .../controller/AllocLabelController.java | 4 - .../controller/AllocMealtimeController.java | 3 - .../dto/AllocCanteenDeliveryModel.java | 6 + .../canteen/mapper/AllocAreaMapper.java | 12 +- .../canteen/mapper/AllocStallMapper.java | 3 + .../canteen/service/AllocAreaService.java | 8 +- .../canteen/service/AllocCanteenService.java | 2 + .../canteen/service/AllocMealLineService.java | 2 +- .../canteen/service/AllocStallService.java | 2 + .../service/impl/AllocAreaServiceImpl.java | 23 ++-- .../service/impl/AllocCanteenServiceImpl.java | 1 + .../impl/AllocMealLineServiceImpl.java | 27 +++-- .../common/enums/AllocMobilePayConfEnum.java | 24 ++++ .../sysfile/controller/SysFileController.java | 3 - .../controller/CustInfoController.java | 1 - .../controller/CustJobController.java | 15 +-- .../controller/MenuNutritionController.java | 2 - .../impl/MenuNutritionServiceImpl.java | 4 +- .../service/impl/MenuRecipeServiceImpl.java | 2 +- .../v2/controller/AppletInformController.java | 1 - .../alloc/canteen/AllocCanteenMapper.xml | 39 +++++++ .../mapper/alloc/canteen/AllocLabelMapper.xml | 18 +++ 29 files changed, 265 insertions(+), 212 deletions(-) delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/utils/LeRequest.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/enums/AllocMobilePayConfEnum.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/canteen/AllocLabelMapper.xml diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/utils/LeRequest.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/utils/LeRequest.java deleted file mode 100644 index 0afc95bd..00000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/utils/LeRequest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.bonus.common.houqin.utils; - -import io.swagger.annotations.ApiModelProperty; - -import javax.validation.Valid; - -public class LeRequest { - @ApiModelProperty("版本控制") - private String version; - @ApiModelProperty("随机字符串") - private String nonceStr; - @ApiModelProperty("时间戳") - private String timestamp; - @ApiModelProperty("签名类型") - private String signType; - @ApiModelProperty("业务参数") - private @Valid T content; - @ApiModelProperty("签名") - private String sign; - - public String getVersion() { - return this.version; - } - - public String getNonceStr() { - return this.nonceStr; - } - - public String getTimestamp() { - return this.timestamp; - } - - public String getSignType() { - return this.signType; - } - - public T getContent() { - return this.content; - } - - public String getSign() { - return this.sign; - } - - public void setVersion(final String version) { - this.version = version; - } - - public void setNonceStr(final String nonceStr) { - this.nonceStr = nonceStr; - } - - public void setTimestamp(final String timestamp) { - this.timestamp = timestamp; - } - - public void setSignType(final String signType) { - this.signType = signType; - } - - public void setContent(final T content) { - this.content = content; - } - - public void setSign(final String sign) { - this.sign = sign; - } - - - - - - - -} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/AllocPayMetadataApi.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/AllocPayMetadataApi.java index 33b8136f..a7de2a91 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/AllocPayMetadataApi.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/AllocPayMetadataApi.java @@ -9,6 +9,7 @@ import com.bonus.canteen.core.allocation.alloc.model.MerchantLoginApp; import com.bonus.canteen.core.allocation.alloc.service.AllocMetadataService; import com.bonus.canteen.core.allocation.alloc.service.MerchantLoginAppService; import com.bonus.canteen.core.allocation.canteen.dto.AllocCanteenPayDTO; +import com.bonus.canteen.core.common.enums.AllocMobilePayConfEnum; import com.bonus.canteen.core.common.enums.MetadataModelTypeEnum; import com.bonus.canteen.core.common.redis.RedisUtil; import com.bonus.canteen.core.common.utils.TenantContextHolder; @@ -129,4 +130,20 @@ public class AllocPayMetadataApi { } } + + public AllocCanteenPayDTO getAllocCanteenPayDTO(Long canteenId) { + Map payMap = this.globalMetadataApi.getMap(MetadataModelTypeEnum.PAY, canteenId, (Long)null); + if (!payMap.containsKey("alipayMobilePayConf")) { + payMap.put("alipayMobilePayConf", AllocMobilePayConfEnum.ALLOW_RECHARGE_CONSUME.getKey()); + } + + if (!payMap.containsKey("wechatMobilePayConf")) { + payMap.put("wechatMobilePayConf", AllocMobilePayConfEnum.ALLOW_RECHARGE_CONSUME.getKey()); + } + +// AbcMerchantQueryVO abcVO = this.abcPayApi.queryAbcMerchantInfo(canteenId); +// Map abcMap = MetadataUtil.transferAbcPayToMap(abcVO); +// payMap.putAll(abcMap); 2025-03-04 dgw 注释 农行 + return new AllocCanteenPayDTO((String)payMap.get("ifEnablePay"), (String)payMap.get("payTypes"), payMap); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/GlobalMetadataApi.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/GlobalMetadataApi.java index 514495ad..b4a770a8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/GlobalMetadataApi.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/api/GlobalMetadataApi.java @@ -18,10 +18,7 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; @Component @@ -159,4 +156,23 @@ public class GlobalMetadataApi { public void delete(Long canteenId, Long stallId) { this.allocMetadataService.deletePayMetadataRelation(canteenId, stallId); } + + public Map getMap(MetadataModelTypeEnum modelTypeEnum, Long canteenId, Long stallId) { + List metadataList = this.getList(modelTypeEnum, canteenId, stallId); + return this.payMetadataListToMap(metadataList); + } + + private Map payMetadataListToMap(List metadataList) { + if (CollUtil.isEmpty(metadataList)) { + return new HashMap(); + } else { + Map resultMap = new HashMap(); + metadataList.forEach((metadata) -> { + String metadataValue = MetadataUtil.metadataPathFieldHandler(metadata.getModelKey(), metadata.getModelValue(), + true); + resultMap.put(metadata.getModelKey(), metadataValue); + }); + return resultMap; + } + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/AllocCanteenBusiness.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/AllocCanteenBusiness.java index 3172cd85..dbc6e11a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/AllocCanteenBusiness.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/AllocCanteenBusiness.java @@ -10,9 +10,9 @@ import com.bonus.canteen.core.allocation.canteen.model.AllocStallModifyModel; import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenNumParam; public interface AllocCanteenBusiness { -// String getCanteenNum(AllocCanteenNumParam param); -// -// AllocCanteenModifyModel getCanteenForModify(Long canteenId); + String getCanteenNum(AllocCanteenNumParam param); + + AllocCanteenModifyModel getCanteenForModify(Long canteenId); AllocStallModifyModel getStallForModify(Long stallId); // diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/impl/AllocCanteenBusinessImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/impl/AllocCanteenBusinessImpl.java index 90501ba3..a8a3807d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/impl/AllocCanteenBusinessImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/business/impl/AllocCanteenBusinessImpl.java @@ -91,9 +91,9 @@ public class AllocCanteenBusinessImpl implements AllocCanteenBusiness { @Autowired @Lazy private AllocStallService allocStallService; -// @Autowired -// @Lazy -// private AllocMealLineService allocMealLineService; + @Autowired + @Lazy + private AllocMealLineService allocMealLineService; @Autowired @Lazy private AllocLabelService allocLabelService; @@ -126,55 +126,56 @@ public class AllocCanteenBusinessImpl implements AllocCanteenBusiness { @Resource private AesEncryptUtil aesEncryptUtil; -// public String getCanteenNum(AllocCanteenNumParam param) { -// Long superId = param.getSuperId(); -// AllocCanteenTreeTypeEnum canteenTreeTypeEnum = AllocCanteenTreeTypeEnum.getTypeEnum(param.getCanteenTreeType()); -// switch (canteenTreeTypeEnum) { -// case MERCHANT: -// return this.allocAreaService.getLatestFirstAreaNum(); -// case AREA: -// return this.allocAreaService.getLatestAreaNum(superId); -// case CANTEEN: -// return this.allocCanteenService.getLatestCanteenNum(superId); -// case STALL: -// return this.allocStallService.getLatestStallNum(superId); -// case MEAL_LINE: -// return this.allocMealLineService.getLatestStallNum(superId); -// default: -// return ""; -// } -// } -// -// public AllocCanteenModifyModel getCanteenForModify(Long canteenId) { -// AllocCanteen allocCanteen = (AllocCanteen)this.allocCanteenService.getOne((Wrapper)Wrappers.lambdaQuery(AllocCanteen.class).eq(AllocCanteen::getCanteenId, canteenId)); -// allocCanteen.setContactTel(this.aesEncryptUtil.aesEncrypt(allocCanteen.getContactTel())); -// AllocCanteenSaveDTO canteenSaveDTO = new AllocCanteenSaveDTO(); -// BeanUtils.copyProperties(allocCanteen, canteenSaveDTO); -// if (ObjectUtil.isNotNull(canteenSaveDTO.getCustId())) { -// CustInfo custInfo = this.custInfoApi.getCustInfoByCustId(canteenSaveDTO.getCustId()); -// if (ObjectUtil.isNotNull(custInfo)) { -// canteenSaveDTO.setCustName(custInfo.getCustName()); -// } -// } -// -// List labelNameList = this.allocLabelMapper.listRelationLabelName(canteenId, (Long)null); -// canteenSaveDTO.setLabelNameList(labelNameList); -// AllocCanteenPayDTO payDTO = this.getAllocCanteenPayDTO(canteenId); -// List metadataList = this.globalMetadataApi.getList(MetadataModelTypeEnum.DELIVERY, canteenId, (Long)null); -// AllocCanteenDeliveryModel deliveryModel = MetadataUtil.meteDataListToDelivery(metadataList); -// AllocCanteenOrderDTO orderDTO = this.getAllocCanteenOrderDTO(canteenId, (Long)null); -// List mealtimeList = this.allocMealtimeApi.listMealtime(canteenId, (Long)null); -// if (CollUtil.isEmpty(mealtimeList)) { -// mealtimeList = this.allocMealtimeApi.listUseAvailableMealtime(canteenId, (Long)null, (Integer)null); -// } -// -// this.canteenCustomBusiness.canteenGroupQueryHandler(canteenId, canteenSaveDTO); -// return new AllocCanteenModifyModel(canteenId, canteenSaveDTO, payDTO, deliveryModel, orderDTO, mealtimeList); -// } -// -// private AllocCanteenPayDTO getAllocCanteenPayDTO(Long canteenId) { -// return this.allocPayMetadataApi.getAllocCanteenPayDTO(canteenId); -// } + public String getCanteenNum(AllocCanteenNumParam param) { + Long superId = param.getSuperId(); + AllocCanteenTreeTypeEnum canteenTreeTypeEnum = AllocCanteenTreeTypeEnum.getTypeEnum(param.getCanteenTreeType()); + switch (canteenTreeTypeEnum) { + case MERCHANT: + return this.allocAreaService.getLatestFirstAreaNum(); + case AREA: + return this.allocAreaService.getLatestAreaNum(superId); + case CANTEEN: + return this.allocCanteenService.getLatestCanteenNum(superId); + case STALL: + return this.allocStallService.getLatestStallNum(superId); + case MEAL_LINE: + return this.allocMealLineService.getLatestStallNum(superId); + default: + return ""; + } + } + + public AllocCanteenModifyModel getCanteenForModify(Long canteenId) { + AllocCanteen allocCanteen = this.allocCanteenService.getOne(Wrappers.lambdaQuery(AllocCanteen.class) + .eq(AllocCanteen::getCanteenId, canteenId)); + allocCanteen.setContactTel(this.aesEncryptUtil.aesEncrypt(allocCanteen.getContactTel())); + AllocCanteenSaveDTO canteenSaveDTO = new AllocCanteenSaveDTO(); + BeanUtils.copyProperties(allocCanteen, canteenSaveDTO); + if (ObjectUtil.isNotNull(canteenSaveDTO.getCustId())) { + CustInfo custInfo = this.custInfoApi.getCustInfoByCustId(canteenSaveDTO.getCustId()); + if (ObjectUtil.isNotNull(custInfo)) { + canteenSaveDTO.setCustName(custInfo.getCustName()); + } + } + + List labelNameList = this.allocLabelMapper.listRelationLabelName(canteenId, (Long)null); + canteenSaveDTO.setLabelNameList(labelNameList); + AllocCanteenPayDTO payDTO = this.getAllocCanteenPayDTO(canteenId); + List metadataList = this.globalMetadataApi.getList(MetadataModelTypeEnum.DELIVERY, canteenId, (Long)null); + AllocCanteenDeliveryModel deliveryModel = MetadataUtil.meteDataListToDelivery(metadataList); + AllocCanteenOrderDTO orderDTO = this.getAllocCanteenOrderDTO(canteenId, (Long)null); + List mealtimeList = this.allocMealtimeApi.listMealtime(canteenId, (Long)null); + if (CollUtil.isEmpty(mealtimeList)) { + mealtimeList = this.allocMealtimeApi.listUseAvailableMealtime(canteenId, (Long)null, (Integer)null); + } + + this.canteenCustomBusiness.canteenGroupQueryHandler(canteenId, canteenSaveDTO); + return new AllocCanteenModifyModel(canteenId, canteenSaveDTO, payDTO, deliveryModel, orderDTO, mealtimeList); + } + + private AllocCanteenPayDTO getAllocCanteenPayDTO(Long canteenId) { + return this.allocPayMetadataApi.getAllocCanteenPayDTO(canteenId); + } private AllocCanteenOrderDTO getAllocCanteenOrderDTO(Long canteenId, Long stallId) { return (AllocCanteenOrderDTO)this.globalMetadataApi.getModel(MetadataModelTypeEnum.ORDER_RESERVE, new AllocCanteenOrderDTO(), canteenId, stallId); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocAreaController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocAreaController.java index 1a0d802a..1cc1da58 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocAreaController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocAreaController.java @@ -9,7 +9,6 @@ import com.bonus.canteen.core.allocation.canteen.param.AllocAreaParam; import com.bonus.canteen.core.allocation.canteen.service.AllocAreaService; import com.bonus.canteen.core.allocation.canteen.vo.AllocAreaVO; import com.bonus.common.core.web.domain.AjaxResult; -import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -22,7 +21,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; +import javax.validation.constraints.NotNull; import java.util.List; +import java.util.Map; @RestController @RequestMapping({"/api/v2/alloc/area"}) @@ -60,8 +61,9 @@ public class AllocAreaController { @ApiOperation("根据区域id,查询区域名称") @PostMapping({"/get-area-name"}) // @RequiresGuest - public AjaxResult getAreaName(@RequestBody LeRequest request) { - return AjaxResult.success(this.allocAreaService.getAreaName((Long)request.getContent())); + public AjaxResult getAreaName(@RequestBody Map request) { + Long areaId = Long.valueOf((String) request.get("areaId")); + return AjaxResult.success(this.allocAreaService.getAreaName(areaId)); } @ApiOperation("新增区域") @@ -81,7 +83,8 @@ public class AllocAreaController { @ApiOperation("删除区域") @PostMapping({"/remove"}) // @RequiresGuest - public void removeArea(@RequestBody @Valid Long request) { - this.allocCanteenBusiness.removeArea(request); + public void removeArea(@RequestBody Map request) { + Long areaId = Long.valueOf((String) request.get("areaId")); + this.allocCanteenBusiness.removeArea(areaId); } } 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 eb042e47..12dac542 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 @@ -6,6 +6,7 @@ import com.bonus.canteen.core.allocation.canteen.dto.ModifyCanteenIfReserveDTO; import com.bonus.canteen.core.allocation.canteen.dto.ModifyCanteenStateDTO; import com.bonus.canteen.core.allocation.canteen.dto.ModifyStallIfReserveDTO; import com.bonus.canteen.core.allocation.canteen.model.*; +import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenNumParam; import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenStallPageParam; import com.bonus.canteen.core.allocation.canteen.vo.AllocCanteenVO; import com.bonus.canteen.core.allocation.canteen.vo.AllocStallVO; @@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.Map; @RestController @RequestMapping({"/api/v2/alloc/canteen"}) @@ -90,8 +92,9 @@ public class AllocCanteenController { @ApiOperation("删除食堂") @PostMapping({"/remove-canteen"}) - public void removeCanteen(@RequestBody @Valid Long request) { - this.allocCanteenBusiness.removeCanteen(request); + public void removeCanteen(@RequestBody Map request) { + Long canteenId = Long.valueOf((String) request.get("canteenId")); + this.allocCanteenBusiness.removeCanteen(canteenId); } @ApiOperation("修改食堂 是否支持预订餐") @@ -108,8 +111,9 @@ public class AllocCanteenController { @ApiOperation("校验食堂是否可以修改为休息状态") @PostMapping({"/check-canteen-rest"}) - public Integer checkCanteenRest(@RequestBody @Valid Long request) { - return this.allocCanteenService.checkCanteenRest(request); + public Integer checkCanteenRest(@RequestBody Map request) { + Long canteenId = Long.valueOf((String) request.get("canteenId")); + return this.allocCanteenService.checkCanteenRest(canteenId); } @ApiOperation("分页查询档口列表") @@ -120,8 +124,9 @@ public class AllocCanteenController { @ApiOperation("查询单个档口(聚合查询)") @PostMapping({"/get-stall-for-modify"}) - public AllocStallModifyModel getStallForModify(@RequestBody Long request) { - return this.allocCanteenBusiness.getStallForModify(request); + public AllocStallModifyModel getStallForModify(@RequestBody Map request) { + Long stallId = Long.valueOf((String) request.get("stallId")); + return this.allocCanteenBusiness.getStallForModify(stallId); } @ApiOperation("新增档口") @@ -138,8 +143,9 @@ public class AllocCanteenController { @ApiOperation("删除档口") @PostMapping({"/remove-stall"}) - public void removeStall(@RequestBody Long request) { - this.allocCanteenBusiness.removeStall(request); + public void removeStall(@RequestBody Map request) { + Long stallId = Long.valueOf((String) request.get("stallId")); + this.allocCanteenBusiness.removeStall(stallId); } @ApiOperation("修改档口 是否支持预订餐") @@ -148,4 +154,17 @@ public class AllocCanteenController { this.allocStallService.modifyStallIfReserve(request); } + @ApiOperation("查询区域食堂档口餐线编号") + @PostMapping({"/get-canteen-num"}) + public AjaxResult getCanteenNum(@RequestBody @Valid AllocCanteenNumParam request) { + return AjaxResult.success(this.allocCanteenBusiness.getCanteenNum(request)); + } + + @ApiOperation("查询单个食堂(聚合查询)") + @PostMapping({"/get-canteen-for-modify"}) + public AllocCanteenModifyModel getCanteenForModify(@RequestBody Map request) { + Long canteenId = Long.valueOf((String) request.get("canteenId")); + return this.allocCanteenBusiness.getCanteenForModify(canteenId); + } + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocLabelController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocLabelController.java index 035ad3f6..6de73c64 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocLabelController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocLabelController.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bonus.canteen.core.allocation.canteen.param.AllocOtherPageParam; import com.bonus.canteen.core.allocation.canteen.service.AllocLabelService; import com.bonus.canteen.core.allocation.canteen.vo.AllocLabelVO; -import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -16,9 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.validation.Valid; -import java.util.List; - @RestController @RequestMapping({"/api/v2/alloc/label"}) @Api( diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocMealtimeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocMealtimeController.java index 99c27de4..5c133983 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocMealtimeController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/controller/AllocMealtimeController.java @@ -3,9 +3,7 @@ package com.bonus.canteen.core.allocation.canteen.controller; import com.bonus.canteen.core.allocation.api.AllocMealtimeApi; import com.bonus.canteen.core.allocation.canteen.param.AllocCanteenStallParam; import com.bonus.canteen.core.menu.model.AllocMealtimeModel; -import com.bonus.common.houqin.constant.LeConstants; import com.bonus.common.houqin.framework.annotation.RequiresGuest; -import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.validation.Valid; import java.util.List; @RestController diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/dto/AllocCanteenDeliveryModel.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/dto/AllocCanteenDeliveryModel.java index 4d998605..42b2acb8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/dto/AllocCanteenDeliveryModel.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/dto/AllocCanteenDeliveryModel.java @@ -105,6 +105,12 @@ public class AllocCanteenDeliveryModel { this.deliveryList = deliveryList; } + public AllocCanteenDeliveryModel() { + this.minDeliveryFeeOnOff = AllocMinDeliveryFeeOnOffEnum.NONE.getKey(); + this.mealtimeMinDeliveryFeeList = CollUtil.newArrayList(new MealtimeMinDeliveryFeeDTO[0]); + this.deliveryList = CollUtil.newArrayList(new AllocCanteenDeliveryDTO[0]); + } + public AllocCanteenDeliveryDTO deliveryDetailByType(Integer type) { return CollUtil.isEmpty(this.deliveryList) ? new AllocCanteenDeliveryDTO() : this.deliveryList.stream().filter((s) -> { return s.getDeliveryType().equals(type); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocAreaMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocAreaMapper.java index 22a3a031..572963dc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocAreaMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocAreaMapper.java @@ -20,15 +20,15 @@ public interface AllocAreaMapper extends BaseMapper { permissionType = DataPermissionTypeEnum.PERMISSION_AREA ) Page pageArea(@Param("page") Page page, @Param("param") AllocAreaParam param); -// -// @Select({"SELECT MAX(area_num) FROM alloc_area WHERE if_del = 2 AND first_area_name IS NOT NULL AND second_area_name IS NULL"}) -// String getLatestFirstAreaNum(); + + @Select({"SELECT MAX(area_num) FROM alloc_area WHERE if_del = 2 AND first_area_name IS NOT NULL AND second_area_name IS NULL"}) + String getLatestFirstAreaNum(); @Select({"SELECT area_num FROM alloc_area WHERE area_id = #{areaId}"}) String getAreaNumById(Long areaId); -// -// @Select({"SELECT MAX(area_num) FROM alloc_area WHERE if_del = 2 AND super_id = #{superId}"}) -// String getLatestAreaNum(Long superId); + + @Select({"SELECT MAX(area_num) FROM alloc_area WHERE if_del = 2 AND super_id = #{superId}"}) + String getLatestAreaNum(Long superId); // // @Select({"SELECT area_id, area_name FROM alloc_area WHERE if_del = 2 AND area_name = #{areaName}"}) // AllocArea getAreaIdByName(String areaName); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocStallMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocStallMapper.java index 763fde52..345ee54e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocStallMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/mapper/AllocStallMapper.java @@ -46,4 +46,7 @@ public interface AllocStallMapper extends BaseMapper { Long getCanteenId(@Param("stallId") Long stallId); void updateByStallId(@Param("dto") AllocStallModifyDTO modifyDTO, @Param("stallId") Long stallId); + + @Select({"SELECT stall_num FROM alloc_stall WHERE stall_id = #{stallId}"}) + String getStallNumById(Long stallId); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocAreaService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocAreaService.java index af9fe65d..4009821d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocAreaService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocAreaService.java @@ -14,10 +14,10 @@ import java.util.List; public interface AllocAreaService extends IService { Page pageArea(AllocAreaParam param); -// -// String getLatestFirstAreaNum(); -// -// String getLatestAreaNum(Long superId); + + String getLatestFirstAreaNum(); + + String getLatestAreaNum(Long superId); String getAreaName(Long areaId); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocCanteenService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocCanteenService.java index 8be7d1d1..c0718a8b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocCanteenService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocCanteenService.java @@ -42,4 +42,6 @@ public interface AllocCanteenService extends IService { Integer checkCanteenRest(Long canteenId); AllocCanteen checkCanteenIdExist(Long canteenId); + + String getLatestCanteenNum(Long superId); } 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..ff9922ca 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 @@ -7,7 +7,7 @@ import com.bonus.canteen.core.allocation.canteen.model.AllocMealLine; import java.util.List; public interface AllocMealLineService extends IService { -// String getLatestStallNum(Long superId); + String getLatestStallNum(Long superId); // // List listMultipleMealLine(AllocCanteenStallParam param); // diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocStallService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocStallService.java index bc3ed9cd..b3351b60 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocStallService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/AllocStallService.java @@ -36,4 +36,6 @@ public interface AllocStallService extends IService { void deleteStall(Long stallId); void modifyStallIfReserve(ModifyStallIfReserveDTO reserveDTO); + + String getLatestStallNum(Long superId); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocAreaServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocAreaServiceImpl.java index 2e72d7ec..1472d55e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocAreaServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/allocation/canteen/service/impl/AllocAreaServiceImpl.java @@ -28,6 +28,7 @@ import com.bonus.canteen.core.common.utils.TenantContextHolder; import com.bonus.canteen.core.common.utils.TreeNodeUtil; import com.bonus.canteen.core.common.utils.BaseTreeNode; import com.bonus.canteen.core.order.mq.MqUtil; +import com.bonus.canteen.core.order.utils.LeNumUtil; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.houqin.constant.LeConstants; import com.bonus.common.houqin.i18n.I18n; @@ -96,17 +97,17 @@ public class AllocAreaServiceImpl extends ServiceImpl listMultipleMealLine(AllocCanteenStallParam param) { // return ((AllocMealLineMapper)this.baseMapper).listMultipleMealLine(param.getStallIdList()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/enums/AllocMobilePayConfEnum.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/enums/AllocMobilePayConfEnum.java new file mode 100644 index 00000000..81fdf76e --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/enums/AllocMobilePayConfEnum.java @@ -0,0 +1,24 @@ +package com.bonus.canteen.core.common.enums; + +public enum AllocMobilePayConfEnum { + ONLY_RECHARGE("1", "仅充值"), + ONLY_CONSUME("2", "仅消费"), + ALLOW_RECHARGE_CONSUME("3", "允许充值消费"); + + private final String key; + private final String desc; + + private AllocMobilePayConfEnum(String key, String desc) { + this.key = key; + this.desc = desc; + } + + public String getKey() { + return this.key; + } + + public String getDesc() { + return this.desc; + } + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/sysfile/controller/SysFileController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/sysfile/controller/SysFileController.java index 6ad2b2db..6d57997d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/sysfile/controller/SysFileController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/common/sysfile/controller/SysFileController.java @@ -1,6 +1,5 @@ package com.bonus.canteen.core.common.sysfile.controller; -import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.canteen.core.common.core.util.Base64DecodedMultipartFile; import com.bonus.canteen.core.common.enums.FileNameSuffixEnum; @@ -9,7 +8,6 @@ import com.bonus.canteen.core.common.sysfile.dto.SysFileUploadDTO; import com.bonus.canteen.core.common.sysfile.service.SysFileService; import com.bonus.canteen.core.common.sysfile.vo.SysFileUploadVO; import com.bonus.common.houqin.encrypt.RequiresGuest; -import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -17,7 +15,6 @@ import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.annotation.Resource; import javax.validation.Valid; import java.util.List; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java index 1c928236..f2ff9a01 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java @@ -10,7 +10,6 @@ import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.common.houqin.constant.SourceTypeEnum; import com.bonus.canteen.core.customer.model.CustInfo; import com.bonus.canteen.core.customer.vo.CustInfoVo; -import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import com.bonus.canteen.core.customer.service.CustInfoService; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustJobController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustJobController.java index d8cf52b6..c059ecb3 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustJobController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustJobController.java @@ -1,25 +1,17 @@ package com.bonus.canteen.core.customer.controller; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bonus.canteen.core.common.base.BaseController; import com.bonus.canteen.core.customer.model.CustJob; import com.bonus.canteen.core.customer.service.CustJobService; import com.bonus.common.core.web.domain.AjaxResult; -import com.bonus.common.houqin.i18n.I18n; -import com.bonus.common.houqin.utils.LeRequest; -import com.bonus.common.security.annotation.RequiresPermissions; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Collections; import java.util.List; import java.util.Map; @@ -35,11 +27,8 @@ public class CustJobController extends BaseController { // SyncCustJobAPI syncCustJobAPI; @ApiOperation("全量查询") - @GetMapping({"/queryAllCustJob"}) - public AjaxResult queryAllCustJob(LeRequest request) { - String content = (String)request.getContent(); - JSONObject jsonObject = JSONObject.parseObject(content); - CustJob record = (CustJob)jsonObject.getJSONObject("object").toJavaObject(CustJob.class); + @PostMapping({"/queryAllCustJob"}) + public AjaxResult queryAllCustJob(@RequestBody CustJob record) { List list = this.custJobService.list(Wrappers.query(record)); return AjaxResult.success(list); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionController.java index 8bd829ae..1d40584d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionController.java @@ -15,12 +15,10 @@ import com.bonus.canteen.core.secure.filter.annotation.RequiresAuthentication; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.houqin.encrypt.RequiresGuest; import com.bonus.common.houqin.utils.LeBeanUtil; -import com.bonus.common.houqin.utils.LeRequest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuNutritionServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuNutritionServiceImpl.java index 7affe531..292b632c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuNutritionServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuNutritionServiceImpl.java @@ -2,8 +2,6 @@ package com.bonus.canteen.core.menu.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -23,9 +21,9 @@ import com.bonus.canteen.core.menu.vo.MenuNutritionAllVO; import com.bonus.canteen.core.menu.vo.MenuNutritionPageVO; import com.bonus.canteen.core.menu.vo.NutritionTypeVO; import com.bonus.common.core.exception.ServiceException; -import com.bonus.common.core.utils.id.Id; import com.bonus.common.houqin.constant.DelFlagEnum; import com.bonus.common.houqin.utils.LeBeanUtil; +import com.bonus.common.houqin.utils.id.Id; import com.bonus.common.security.utils.SecurityUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java index 019bdf0a..d517ac38 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java @@ -134,7 +134,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl collect = (List) effectiveUserVOList.stream().filter((u) -> { + List collect = effectiveUserVOList.stream().filter((u) -> { boolean containsOrg = ObjectUtil.isNotEmpty(u.getOrgIdList()) && u.getOrgIdList().contains(orgId); boolean containsPsn = ObjectUtil.isNotEmpty(u.getPsnTypeList()) && u.getPsnTypeList().contains(psnType); return MktUserTypeEnum.INTERSECTION.key().equals(u.getUserType()) && containsOrg && containsPsn || MktUserTypeEnum.UNION_SET.key().equals(u.getUserType()) && (containsOrg || containsPsn); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/notice/notice/v2/controller/AppletInformController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/notice/notice/v2/controller/AppletInformController.java index 16fa7b43..39934bda 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/notice/notice/v2/controller/AppletInformController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/notice/notice/v2/controller/AppletInformController.java @@ -9,7 +9,6 @@ import com.bonus.canteen.core.notice.notice.v2.service.InformHistoryService; import com.bonus.canteen.core.notice.notice.v2.service.InformRangeService; import com.bonus.canteen.core.notice.notice.v2.vo.InformHistoryAppletPageVO; import com.bonus.common.houqin.encrypt.RequiresGuest; -import com.bonus.common.houqin.utils.LeRequest; import com.github.pagehelper.page.PageMethod; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/canteen/AllocCanteenMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/canteen/AllocCanteenMapper.xml index df735998..16aa0a21 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/canteen/AllocCanteenMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/canteen/AllocCanteenMapper.xml @@ -1,6 +1,45 @@ + + + + + SELECT label_name + FROM alloc_label + + + label_name LIKE #{labelName} + + + GROUP BY label_name + ORDER BY label_name DESC + + + \ No newline at end of file