From b22aafd1a0e45acf9389b3509faede74c9fe8d31 Mon Sep 17 00:00:00 2001 From: lizhenhua <1075222162@qq.com> Date: Fri, 12 Sep 2025 18:14:45 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E9=A3=9F=E5=A0=82=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E8=A1=A5=E8=B4=B4=E9=92=B1=E5=8C=85=20=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/account/domain/AccountCard.java | 4 +- .../core/cook/domain/CookEvaluaDetail.java | 5 +- .../core/cook/mapper/CookRecipeH5Mapper.java | 3 ++ .../impl/CookEvaluaDetailServiceImpl.java | 16 +++--- .../service/impl/CookRecipeH5ServiceImpl.java | 10 +++- .../HealthPopularArticleController.java | 23 ++++----- .../impl/HealthPopularArticleServiceImpl.java | 1 + .../canteen/core/order/domain/OrderInfo.java | 10 +++- .../order/domain/param/OrderQueryParam.java | 6 ++- .../service/impl/OrderInfoServiceImpl.java | 50 ++++++++++++++++--- .../controller/ZhhqAccountInfoController.java | 4 +- .../zhhq/controller/ZhhqOrderController.java | 18 ++++++- .../ZhhqPhysicalExaminationController.java | 28 ++++++++++- .../canteen/core/zhhq/domain/OrderAddDTO.java | 14 ++++++ .../zhhq/domain/PhysicalExaminationDTO.java | 3 +- .../mapper/ZhhqPhysicalExaminationMapper.java | 4 ++ .../mapper/account/AccWalletInfoMapper.xml | 2 +- .../mapper/cook/CookEvaluaDetailMapper.xml | 11 ++-- .../mapper/cook/CookRecipeH5Mapper.xml | 20 ++++++++ .../health/HealthPopularArticleMapper.xml | 4 +- .../mapper/order/OrderInfoMapper.xml | 21 ++++++-- .../zhhq/ZhhqPhysicalExaminationMapper.xml | 27 ++++++++++ 22 files changed, 231 insertions(+), 53 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/AccountCard.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/AccountCard.java index 9da92c5..b4e6784 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/AccountCard.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/AccountCard.java @@ -11,7 +11,7 @@ import java.util.Date; /** * 人员卡片资料对象 acc_card - * + * * @author xsheng * @date 2025-04-20 */ @@ -61,7 +61,7 @@ public class AccountCard extends BaseEntity { /** 卡状态 1-正常 4-挂失 */ @Excel(name = "卡状态 1-正常 4-挂失") @ApiModelProperty(value = "卡状态 1-正常 4-挂失 5-发卡 6-退卡 7-已过期") - private Integer cardStatus; + private Integer cardStatus = 1; /** 押金 单位分 */ @Excel(name = "押金 单位分") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookEvaluaDetail.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookEvaluaDetail.java index 02e701e..01979ec 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookEvaluaDetail.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookEvaluaDetail.java @@ -10,7 +10,7 @@ import java.util.List; /** * 订单评价菜品对象 cook_evalua_detail - * + * * @author xsheng * @date 2025-05-25 */ @@ -55,6 +55,9 @@ public class CookEvaluaDetail extends BaseEntity { @ApiModelProperty("评价者昵称") private String evaluaNickName; + @ApiModelProperty("照片地址") + private String photoUrl; + @ApiModelProperty("评价图片") private List pictureList; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeH5Mapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeH5Mapper.java index 00b01ed..4a36067 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeH5Mapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeH5Mapper.java @@ -14,6 +14,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; import java.util.Set; @@ -43,4 +44,6 @@ public interface CookRecipeH5Mapper { List selectWeekRecipeIdHistory(@Param("recipeIdList") List recipeId, @Param("effIdSet") Set effIdSet, @Param("applyDate") LocalDate applyDate); List selectWeekRecipe(@Param("applyDate") LocalDate applyDate, @Param("recipeId") Long recipeId, @Param("recipeIdList") List recipeIdList); + + List selectMonthSalesStallInfo(@Param("stallIdList") List stallIdList); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookEvaluaDetailServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookEvaluaDetailServiceImpl.java index 6ffba8f..23884a0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookEvaluaDetailServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookEvaluaDetailServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.canteen.core.cook.service.impl; import java.util.List; import java.util.stream.Collectors; +import com.bonus.canteen.core.common.utils.FileUrlUtil; import com.bonus.canteen.core.cook.domain.CookEvaluaPicture; import com.bonus.canteen.core.cook.mapper.CookEvaluaPictureMapper; import com.bonus.common.core.exception.ServiceException; @@ -15,7 +16,7 @@ import com.bonus.canteen.core.cook.service.ICookEvaluaDetailService; /** * 订单评价菜品Service业务层处理 - * + * * @author xsheng * @date 2025-05-25 */ @@ -28,7 +29,7 @@ public class CookEvaluaDetailServiceImpl implements ICookEvaluaDetailService { /** * 查询订单评价菜品 - * + * * @param evaluaDetailId 订单评价菜品主键 * @return 订单评价菜品 */ @@ -39,7 +40,7 @@ public class CookEvaluaDetailServiceImpl implements ICookEvaluaDetailService { /** * 查询订单评价菜品列表 - * + * * @param cookEvaluaDetail 订单评价菜品 * @return 订单评价菜品 */ @@ -52,13 +53,14 @@ public class CookEvaluaDetailServiceImpl implements ICookEvaluaDetailService { List menuEvaluaPictures = cookEvaluaPictureMapper.selectCookEvaluaPictureList(menuEvaluaPicture); List pictures = menuEvaluaPictures.stream().map(CookEvaluaPicture::getImgUrl).collect(Collectors.toList()); detail.setPictureList(pictures); + detail.setPhotoUrl(FileUrlUtil.getFileUrl(detail.getPhotoUrl())); } return list; } /** * 新增订单评价菜品 - * + * * @param cookEvaluaDetail 订单评价菜品 * @return 结果 */ @@ -74,7 +76,7 @@ public class CookEvaluaDetailServiceImpl implements ICookEvaluaDetailService { /** * 修改订单评价菜品 - * + * * @param cookEvaluaDetail 订单评价菜品 * @return 结果 */ @@ -90,7 +92,7 @@ public class CookEvaluaDetailServiceImpl implements ICookEvaluaDetailService { /** * 批量删除订单评价菜品 - * + * * @param evaluaDetailIds 需要删除的订单评价菜品主键 * @return 结果 */ @@ -101,7 +103,7 @@ public class CookEvaluaDetailServiceImpl implements ICookEvaluaDetailService { /** * 删除订单评价菜品信息 - * + * * @param evaluaDetailId 订单评价菜品主键 * @return 结果 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeH5ServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeH5ServiceImpl.java index ab49df6..7f65eb4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeH5ServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeH5ServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.canteen.core.cook.service.impl; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import com.bonus.canteen.core.basic.domain.*; @@ -14,13 +15,15 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; /** * 菜品计划信息Service业务层处理 - * + * * @author xsheng * @date 2025-05-25 */ @@ -44,7 +47,9 @@ public class CookRecipeH5ServiceImpl implements ICookRecipeH5Service { return canteen.getStallList().stream().map(AppletReserveStallVO::getStallId); }).collect(Collectors.toList()); if (ObjectUtil.isNotEmpty(stallIdList)) { - List stallMonthSalesList = this.cookRecipeH5Mapper.selectMonthSalesStall(stallIdList); + // List stallMonthSalesList = this.cookRecipeH5Mapper.selectMonthSalesStall(stallIdList); + //重构之前逻辑代码有问题 重新根据档口去查询关联数据信息 + List stallMonthSalesList = this.cookRecipeH5Mapper.selectMonthSalesStallInfo(stallIdList); Map stallSaleMap = (Map)stallMonthSalesList.stream().collect(Collectors.toMap(CookStallSaleModel::getStallId, CookStallSaleModel::getMonthlySales)); resultList.forEach((canteen) -> { List stallList = canteen.getStallList(); @@ -54,6 +59,7 @@ public class CookRecipeH5ServiceImpl implements ICookRecipeH5Service { }); } }); + } return resultList; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPopularArticleController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPopularArticleController.java index 535c5f5..ce95d6b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPopularArticleController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPopularArticleController.java @@ -2,21 +2,15 @@ package com.bonus.canteen.core.health.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + import com.bonus.common.log.enums.OperaType; -//import com.bonus.canteen.core.health.common.annotation.PreventRepeatSubmit; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.mybatis.logging.Logger; +import org.mybatis.logging.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.bonus.common.log.annotation.SysLog; -import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.canteen.core.health.domain.HealthPopularArticle; import com.bonus.canteen.core.health.service.IHealthPopularArticleService; import com.bonus.common.core.web.controller.BaseController; @@ -34,6 +28,9 @@ import com.bonus.common.core.web.page.TableDataInfo; @RestController @RequestMapping("/health_popular_article") public class HealthPopularArticleController extends BaseController { + + private static final Logger logger = LoggerFactory.getLogger(HealthPopularArticleController.class); + @Autowired private IHealthPopularArticleService healthPopularArticleService; @@ -83,7 +80,7 @@ public class HealthPopularArticleController extends BaseController { //@RequiresPermissions("health:article:add") @SysLog(title = "营养科普", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增营养科普") @PostMapping - public AjaxResult add(@RequestBody HealthPopularArticle healthPopularArticle) { + public AjaxResult add(HealthPopularArticle healthPopularArticle) { try { return toAjax(healthPopularArticleService.insertHealthPopularArticle(healthPopularArticle)); } catch (Exception e) { @@ -99,9 +96,9 @@ public class HealthPopularArticleController extends BaseController { //@RequiresPermissions("health:article:edit") @SysLog(title = "营养科普", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改营养科普") @PostMapping("/edit") - public AjaxResult edit(@RequestBody HealthPopularArticle healthPopularArticle) { + public AjaxResult edit(HealthPopularArticle article) { try { - return toAjax(healthPopularArticleService.updateHealthPopularArticle(healthPopularArticle)); + return toAjax(healthPopularArticleService.updateHealthPopularArticle(article)); } catch (Exception e) { return error(e.getMessage()); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPopularArticleServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPopularArticleServiceImpl.java index db1a946..594c30f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPopularArticleServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPopularArticleServiceImpl.java @@ -58,6 +58,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer @Override public int insertHealthPopularArticle(HealthPopularArticle healthPopularArticle) { healthPopularArticle.setCreateTime(DateUtils.getNowDate()); + healthPopularArticle.setPushTime(DateUtils.getNowDate()); try { healthPopularArticleMapper.insertHealthPopularArticle(healthPopularArticle); HealthPersonInfo chronicVo=new HealthPersonInfo(); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java index 8256aa2..6ec65a4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java @@ -23,7 +23,7 @@ import java.util.Objects; /** * 订单对象 order_info - * + * * @author ruoyi * @date 2025-04-14 */ @@ -189,7 +189,14 @@ public class OrderInfo extends BaseEntity private String areaName; + private String yrorderDetails; + + private String yrcanteenName; + + private String yrstallName; + private String remark; + private String orderDetails; List orderDetailList; @@ -387,4 +394,5 @@ public class OrderInfo extends BaseEntity orderDetail.setUpdateTime(DateUtils.getNowDate()); return orderDetail; } + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java index 6e37f6f..256411f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java @@ -14,7 +14,7 @@ import java.util.List; /** * 订单对象 order_info - * + * * @author ruoyi * @date 2025-04-14 */ @@ -134,6 +134,10 @@ public class OrderQueryParam implements Serializable private String encryptedCustSearchValue; + private String yrstallName; + private String yrcanteenName; + private String yrorderDetails; + public OrderQueryParam() { this.endDateTime = LocalDateTime.now().plusDays(7); this.startDateTime = LocalDateTime.now().minusDays(7); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java index e4061ed..68623f2 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java @@ -2,6 +2,7 @@ package com.bonus.canteen.core.order.service.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.crypto.digest.DigestUtil; +import cn.hutool.json.JSONUtil; import com.bonus.canteen.core.account.constants.AccTradeTypeEnum; import com.bonus.canteen.core.account.constants.AccWalletTypeEnum; import com.bonus.canteen.core.account.domain.WalletUpdateDTO; @@ -53,12 +54,13 @@ import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; /** * 订单Service业务层处理 - * + * * @author ruoyi * @date 2025-04-14 */ @@ -84,7 +86,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 查询订单 - * + * * @param orderId 订单主键 * @return 订单 */ @@ -132,13 +134,14 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 查询订单列表 - * + * * @return 订单 */ @Override public List selectOrderInfoList(OrderQueryParam orderQueryParam) { - List orderInfoList = orderInfoMapper.selectOrderInfoList(orderQueryParam); + /* List orderInfoList = orderInfoMapper.selectOrderInfoList(orderQueryParam); + if(CollUtil.isNotEmpty(orderInfoList)) { orderInfoList.forEach(order -> { OrderDetail orderDetail = new OrderDetail(); @@ -150,7 +153,40 @@ public class OrderInfoServiceImpl implements IOrderInfoService order.setDeliveryTypeName(DeliveryTypeEnum.getDescByKey(order.getDeliveryType())); }); } + return orderInfoList;*/ + List orderInfoList = orderInfoMapper.selectOrderInfoList(orderQueryParam); + + if (CollUtil.isNotEmpty(orderInfoList)) { + orderInfoList.forEach(order -> { + // 判断 yrorder_details 是否有值 + if (StringUtils.isNotBlank(order.getYrorderDetails())) { + OrderDetail virtualDetail = new OrderDetail(); + virtualDetail.setGoodsName(order.getYrorderDetails()); // 把字符串放进 goodsName + virtualDetail.setQuantity(1); // 给个默认值,避免前端渲染出错 + order.setOrderDetailList(Collections.singletonList(virtualDetail)); + order.setMealtimeName(order.getYrstallName()); + order.setCanteenName(order.getYrcanteenName()); + order.setStallName(order.getYrstallName()); + } else { + // 没有值就走原来的查询 + OrderDetail orderDetail = new OrderDetail(); + orderDetail.setOrderId(order.getOrderId()); + List orderDetailList = orderDetailService.selectOrderDetailList(orderDetail); + order.setOrderDetailList(orderDetailList); + order.setPhoneNumber(order.getPhoneNumber()); + } + + // 手机号保持一致(目前是明文) + // 如果后续要解密就放开上面注释 + order.setPhoneNumber(order.getPhoneNumber()); + + // 设置配送方式描述 + order.setDeliveryTypeName(DeliveryTypeEnum.getDescByKey(order.getDeliveryType())); + }); + } + return orderInfoList; + } @Override @@ -381,7 +417,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 修改订单 - * + * * @param orderInfo 订单 * @return 结果 */ @@ -394,7 +430,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 批量删除订单 - * + * * @param orderIds 需要删除的订单主键 * @return 结果 */ @@ -406,7 +442,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 删除订单信息 - * + * * @param orderId 订单主键 * @return 结果 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqAccountInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqAccountInfoController.java index f4e5eef..ab25307 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqAccountInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqAccountInfoController.java @@ -45,9 +45,9 @@ public class ZhhqAccountInfoController extends BaseController { @ApiOperation("获取员工账户信息") @PostMapping({"/getBalance"}) public AjaxResult getBalance(@RequestHeader Map requestHeader, @RequestBody @Valid AccountInfoDTO dto) { - /* if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) { + if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) { throw new ServiceException("访问缺少认证信息"); - }*/ + } try { AccountInfoQueryParam param = new AccountInfoQueryParam(); param.setUserCode(dto.getEmpCode()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqOrderController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqOrderController.java index 06b41a3..5664721 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqOrderController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqOrderController.java @@ -37,9 +37,23 @@ public class ZhhqOrderController extends BaseController { @ApiOperation("消费扣款") @PostMapping({"/payment"}) public AjaxResult payment(@RequestHeader Map requestHeader, @RequestBody @Valid OrderAddDTO dto) { - /* if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) { + if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) { throw new ServiceException("访问缺少认证信息"); - }*/ + } + try { + orderInfoService.insertZhhqOrderInfo(dto); + return AjaxResult.success(); + } catch (Exception e) { + log.error(e.toString(), e); + return AjaxResult.error(e.getMessage()); + } + } + @ApiOperation("外卖消费扣款") + @PostMapping({"/wmpayment"}) + public AjaxResult wmpayment(@RequestHeader Map requestHeader, @RequestBody @Valid OrderAddDTO dto) { + if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) { + throw new ServiceException("访问缺少认证信息"); + } try { orderInfoService.insertZhhqOrderInfo(dto); return AjaxResult.success(); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqPhysicalExaminationController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqPhysicalExaminationController.java index 7d02b30..5500f7d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqPhysicalExaminationController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqPhysicalExaminationController.java @@ -32,7 +32,7 @@ import static com.bonus.canteen.core.common.utils.DateUtil.getCurrentDateStr; /** * 体检信息Controller - * + * * @author tqzhang * @date 2025-09-02 */ @@ -62,4 +62,30 @@ public class ZhhqPhysicalExaminationController extends BaseController { return AjaxResult.error(null); } } + @ApiOperation("根据手机号获取体检数据") + @PostMapping({"/recordByPhoneSingle"}) + public AjaxResult recordByPhoneSingle(@RequestHeader Map requestHeader, @RequestBody @Valid PhysicalExaminationDTO dto) { + if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) { + throw new ServiceException("访问缺少认证信息"); + } + try { + //通过员工号 查询对应的电话号码 + String phone = this.mapper.ByempCode(dto); + if (phone == null) { + return AjaxResult.error("员工账号未做关联"); + } + dto.setSelectPhone(phone); + // dto.setSelectPhone(SM4EncryptUtils.sm4Encrypt(dto.getPhone())); + PhysicalExaminationVO physingle = this.mapper.selectRecordByPhoneSingle(dto); + //判断是否为空 + if (physingle == null) { + return AjaxResult.error("暂无相关体检数据"); + } + return AjaxResult.success("体检数据查询成功", physingle); + } catch (Exception e) { + log.error(e.toString(), e); + return AjaxResult.error(null); + } + } + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/OrderAddDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/OrderAddDTO.java index 965787c..c33c221 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/OrderAddDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/OrderAddDTO.java @@ -68,10 +68,24 @@ public class OrderAddDTO implements Serializable { orderInfo.setDiscountsAmount(BigDecimal.ZERO); orderInfo.setRealAmount(param.getAmount()); orderInfo.setAccountPayAmount(param.getAmount()); + //以下优尔提供,暂用 + orderInfo.setCanteenName(param.getCanteenName()); + orderInfo.setStallName(param.getStallName()); + orderInfo.setOrderDetails(param.getOrderDetails()); + orderInfo.setCanteenId(-1L); orderInfo.setStallId(-1L); orderInfo.setMealtimeType(-1L); orderInfoList.add(orderInfo); return orderInfoList; } + //根据优尔提供的进行添加字段 + // @NotNull(message = "食堂名称不能为空") + private String canteenName; + + // @NotNull(message = "订单详情不能为空") + @ApiModelProperty(value = "订单详情") + private String orderDetails; + @ApiModelProperty(value = "餐次") + private String stallName; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/PhysicalExaminationDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/PhysicalExaminationDTO.java index d3a3592..d6a704a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/PhysicalExaminationDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/PhysicalExaminationDTO.java @@ -13,7 +13,8 @@ import javax.validation.constraints.NotNull; @Data public class PhysicalExaminationDTO { @ApiModelProperty(value = "手机号") - @NotNull(message = "手机号不能为空") + //@NotNull(message = "手机号不能为空") private String phone; private String selectPhone; + private String empCode; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqPhysicalExaminationMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqPhysicalExaminationMapper.java index 1d1399b..88ea0d7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqPhysicalExaminationMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqPhysicalExaminationMapper.java @@ -22,4 +22,8 @@ public interface ZhhqPhysicalExaminationMapper { * @return 体检记录集合 */ List selectRecordByPhone(PhysicalExaminationDTO dto); + + PhysicalExaminationVO selectRecordByPhoneSingle(PhysicalExaminationDTO dto); + + String ByempCode(PhysicalExaminationDTO dto); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccWalletInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccWalletInfoMapper.xml index c4109d9..e6e898c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccWalletInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccWalletInfoMapper.xml @@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into cook_evalua_detail @@ -93,9 +94,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from cook_evalua_detail where evalua_detail_id in + delete from cook_evalua_detail where evalua_detail_id in #{evaluaDetailId} - \ No newline at end of file + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeH5Mapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeH5Mapper.xml index 207c3a3..ff6a281 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeH5Mapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeH5Mapper.xml @@ -289,5 +289,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by md.dishes_id asc + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPopularArticleMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPopularArticleMapper.xml index c50851e..2e8d5fc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPopularArticleMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPopularArticleMapper.xml @@ -105,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, - + #{articleTitle}, #{coverPhoto}, @@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml index 4ecc793..8e27eea 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -59,7 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" oi.deduction_type, oi.pay_time, oi.pay_type, oi.pay_channel, oi.pay_state, oi.pay_param, oi.delivery_amount, oi.packing_amount, oi.delivery_type, oi.comment_state, di.device_name, su.nick_name, oi.create_by, oi.create_time, oi.update_by, oi.update_time, - su.phonenumber as phoneNumber, sd.dept_full_name, ba.area_name, oi.remark, oi.zhhq_order_id + su.phonenumber as phoneNumber, sd.dept_full_name, ba.area_name, oi.remark, oi.zhhq_order_id, + oi.yrorder_details as yrorderDetails,oi.yrcanteen_name AS yrcanteenName,oi.yrstall_name as yrstallName from order_info oi left join basic_canteen bc on bc.canteen_id = oi.canteen_id left join basic_stall bs on bs.stall_id = oi.stall_id @@ -170,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by oi.create_time desc - + - \ No newline at end of file + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqPhysicalExaminationMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqPhysicalExaminationMapper.xml index a29dae6..bd8e5f9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqPhysicalExaminationMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqPhysicalExaminationMapper.xml @@ -25,5 +25,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where phone = #{selectPhone} order by create_time desc + +