diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxUserLogController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxUserLogController.java index 102f99f8b..867c51bb4 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxUserLogController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysWxUserLogController.java @@ -14,10 +14,7 @@ import com.stdiet.custom.domain.SysCustomer; import com.stdiet.custom.domain.SysWxUserInfo; import com.stdiet.custom.domain.SysWxUserLog; import com.stdiet.custom.page.WxLogInfo; -import com.stdiet.custom.service.ISysMessageNoticeService; -import com.stdiet.custom.service.ISysOrderService; -import com.stdiet.custom.service.ISysWxUserInfoService; -import com.stdiet.custom.service.ISysWxUserLogService; +import com.stdiet.custom.service.*; import org.aspectj.weaver.loadtime.Aj; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -48,6 +45,9 @@ public class SysWxUserLogController extends BaseController { @Autowired private ISysMessageNoticeService sysMessageNoticeService; + @Autowired + private ISysCustomerService sysCustomerService; + /** * 查询微信用户记录列表 */ @@ -164,40 +164,50 @@ public class SysWxUserLogController extends BaseController { /** * 获取微信用户记录详细信息 + * @param id 打卡记录ID + * @param nextFlag 0当前 -1上一条 1下一条 + * @return */ @PreAuthorize("@ss.hasPermi('custom:wxUserLog:query')") @GetMapping(value = "/getPunchLogDetail/{id}") - public AjaxResult getPunchLogDetail(@PathVariable("id") String id) { + public AjaxResult getPunchLogDetail(@PathVariable("id") String id, + @RequestParam(value = "cusId", required = false)Long cusId, + @RequestParam(value = "nextFlag", required = false, defaultValue = "0")int nextFlag) { SysWxUserLog sysWxUserLog = null; //根据ID查询 SysWxUserLog param = new SysWxUserLog(); param.setId(Long.parseLong(id)); - List sysWxUserLogList = sysWxUserLogService.selectSysWxUserLogList(param); - if(sysWxUserLogList != null && sysWxUserLogList.size() > 0){ - sysWxUserLog = sysWxUserLogList.get(0); + param.setNextFlag(nextFlag); + param.setCustomerId(cusId); + sysWxUserLog = sysWxUserLogService.getPunchLogDetail(param); + + if(sysWxUserLog != null){ + Map> imageUrlMap = new HashMap<>(); + List breakfastImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getBreakfastImages()) ? Arrays.asList(sysWxUserLog.getBreakfastImages().split("\\|")) : new ArrayList<>(); + imageUrlMap.put("breakfastImages", breakfastImagesUrlList); + + List lunchImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getLunchImages()) ? Arrays.asList(sysWxUserLog.getLunchImages().split("\\|")) : new ArrayList<>(); + imageUrlMap.put("lunchImages", lunchImagesUrlList); + + List dinnerImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getDinnerImages()) ? Arrays.asList(sysWxUserLog.getDinnerImages().split("\\|")) : new ArrayList<>(); + imageUrlMap.put("dinnerImages", dinnerImagesUrlList); + + List extraMealImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getExtraMealImages()) ? Arrays.asList(sysWxUserLog.getExtraMealImages().split("\\|")) : new ArrayList<>(); + imageUrlMap.put("extraMealImages", extraMealImagesUrlList); + + List bodyImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getBodyImages()) ? Arrays.asList(sysWxUserLog.getBodyImages().split("\\|")) : new ArrayList<>(); + imageUrlMap.put("bodyImages", bodyImagesUrlList ); + + //生成预览链接 + Map> downUrlList = AliyunOSSUtils.generatePresignedUrl(imageUrlMap); + sysWxUserLog.setImagesUrl(downUrlList); + + //查询对应对应客户性别 + if(sysWxUserLog.getCustomerId() != null){ + sysWxUserLog.setSex( sysCustomerService.getCustomerSex(sysWxUserLog.getCustomerId())); + } } - if(sysWxUserLog == null){ - return AjaxResult.error("打卡记录不存在"); - } - Map> imageUrlMap = new HashMap<>(); - List breakfastImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getBreakfastImages()) ? Arrays.asList(sysWxUserLog.getBreakfastImages().split("\\|")) : new ArrayList<>(); - imageUrlMap.put("breakfastImages", breakfastImagesUrlList); - List lunchImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getLunchImages()) ? Arrays.asList(sysWxUserLog.getLunchImages().split("\\|")) : new ArrayList<>(); - imageUrlMap.put("lunchImages", lunchImagesUrlList); - - List dinnerImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getDinnerImages()) ? Arrays.asList(sysWxUserLog.getDinnerImages().split("\\|")) : new ArrayList<>(); - imageUrlMap.put("dinnerImages", dinnerImagesUrlList); - - List extraMealImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getExtraMealImages()) ? Arrays.asList(sysWxUserLog.getExtraMealImages().split("\\|")) : new ArrayList<>(); - imageUrlMap.put("extraMealImages", extraMealImagesUrlList); - - List bodyImagesUrlList = StringUtils.isNotEmpty(sysWxUserLog.getBodyImages()) ? Arrays.asList(sysWxUserLog.getBodyImages().split("\\|")) : new ArrayList<>(); - imageUrlMap.put("bodyImages", bodyImagesUrlList ); - - //生成预览链接 - Map> downUrlList = AliyunOSSUtils.generatePresignedUrl(imageUrlMap); - sysWxUserLog.setImagesUrl(downUrlList); return AjaxResult.success(sysWxUserLog); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java index d22e270b1..be0f278c9 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysWxUserLog.java @@ -210,6 +210,12 @@ public class SysWxUserLog extends BaseEntity { private JSONArray scaleBodyData; + //获取详情标识 + private Integer nextFlag; + + //客户性别 + private Integer sex; + public void setDefecation(String defecation) { if (defecation.equals("Y") || defecation.equals("N")) { // this.defecation = defecation.equals("Y") ? "是" : "否"; diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java index 29acf80b2..bb00e0f94 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java @@ -88,4 +88,11 @@ public interface SysCustomerHealthyMapper * @return */ public List selectDictDataByTypeAndValue(SysDictData sysDictData); + + /** + * 查询客户性别 + * @param cusId + * @return + */ + Integer getCustomerSexByCusId(Long cusId); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java index 38a1a90c3..0b176bdff 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java @@ -73,4 +73,11 @@ public interface SysCustomerPhysicalSignsMapper * @return */ int delCustomerSignByCustomerId(@Param("customerId")Long customerId); + + /** + * 查询客户性别 + * @param cusId + * @return + */ + Integer getCustomerSexByCusId(Long cusId); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysWxUserLogMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysWxUserLogMapper.java index db01015a4..8c0435440 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysWxUserLogMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysWxUserLogMapper.java @@ -123,4 +123,11 @@ public interface SysWxUserLogMapper */ List selectNotPunchCustomerByDate(SysCustomer sysCustomer); + /** + * 查询打卡详情(下一条、上一条) + * @param sysWxUserLog + * @return + */ + SysWxUserLog getPunchLogDetail(SysWxUserLog sysWxUserLog); + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java index 65ded44e9..77d1e5687 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java @@ -94,4 +94,11 @@ public interface ISysCustomerHealthyService * @return */ public List selectDictDataByTypeAndValue(SysDictData sysDictData); + + /** + * 查询客户性别 + * @param cusId + * @return + */ + Integer getCustomerSexByCusId(Long cusId); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java index 368c82b55..6566c5fe9 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java @@ -92,4 +92,11 @@ public interface ISysCustomerPhysicalSignsService { */ int delCustomerSignByCustomerId(Long customerId); + /** + * 获取客户性别 + * @param cusId + * @return + */ + Integer getCustomerSexByCusId(Long cusId); + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java index 6a16b1990..94caefd76 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java @@ -88,4 +88,11 @@ public interface ISysCustomerService */ SysCustomer getCustomerByOpenId(String openid); + /** + * 根据客户ID查询性别 + * @param cusId 客户ID + * @return + */ + Integer getCustomerSex(Long cusId); + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysWxUserLogService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysWxUserLogService.java index 8df270c91..a2f09c4af 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysWxUserLogService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysWxUserLogService.java @@ -124,4 +124,11 @@ public interface ISysWxUserLogService */ List selectNotPunchCustomerByDate(SysCustomer sysCustomer); + /** + * 查询打卡详情(下一条、上一条) + * @param sysWxUserLog + * @return + */ + SysWxUserLog getPunchLogDetail(SysWxUserLog sysWxUserLog); + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java index b311864d1..9d682c7e2 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java @@ -272,4 +272,13 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService public List selectDictDataByTypeAndValue(SysDictData sysDictData){ return sysCustomerHealthyMapper.selectDictDataByTypeAndValue(sysDictData); } + + /** + * 查询客户性别 + * @param cusId + * @return + */ + public Integer getCustomerSexByCusId(Long cusId){ + return sysCustomerHealthyMapper.getCustomerSexByCusId(cusId); + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java index 5fa132119..d38d42c09 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java @@ -192,4 +192,14 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical public int delCustomerSignByCustomerId(Long customerId){ return sysCustomerPhysicalSignsMapper.delCustomerSignByCustomerId(customerId); } + + /** + * 查询客户性别 + * @param cusId + * @return + */ + @Override + public Integer getCustomerSexByCusId(Long cusId){ + return sysCustomerPhysicalSignsMapper.getCustomerSexByCusId(cusId); + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java index 447cb6d86..7117b37db 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java @@ -231,4 +231,17 @@ public class SysCustomerServiceImpl implements ISysCustomerService { } } } + + /** + * 根据客户ID查询性别 + * @param cusId 客户ID + * @return + */ + public Integer getCustomerSex(Long cusId){ + Integer sex = sysCustomerHealthyService.getCustomerSexByCusId(cusId); + if(sex == null){ + sex = sysCustomerPhysicalSignsService.getCustomerSexByCusId(cusId); + } + return sex; + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java index a00702d95..5311187bb 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java @@ -227,7 +227,6 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setMainOrderId(0L); sysOrder.setAfterSaleCommissOrder(0); sysOrder.setPreSaleId(null); - sysOrder.setOnSaleId(null); sysOrder.setPushPreSaleId(null); sysOrder.setPlannerId(null); sysOrder.setPlannerAssisId(null); @@ -327,7 +326,6 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setMainOrderId(0L); sysOrder.setAfterSaleCommissOrder(0); sysOrder.setPreSaleId(null); - sysOrder.setOnSaleId(null); sysOrder.setPushPreSaleId(null); sysOrder.setPlannerId(null); sysOrder.setPlannerAssisId(null); diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysWxUserLogServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysWxUserLogServiceImpl.java index eb8e1d202..ee36e7585 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysWxUserLogServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysWxUserLogServiceImpl.java @@ -182,4 +182,13 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService { return sysWxUserLogMapper.selectNotPunchCustomerByDate(sysCustomer); } + /** + * 查询打卡详情(下一条、上一条) + * @param sysWxUserLog + * @return + */ + public SysWxUserLog getPunchLogDetail(SysWxUserLog sysWxUserLog){ + return sysWxUserLogMapper.getPunchLogDetail(sysWxUserLog); + } + } \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml index 49bb1128b..176637f3f 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml @@ -44,7 +44,7 @@ - AND (order_type = 3 OR (order_type = 2 AND (pre_sale_id IS NULL || pre_sale_id = 0))) + AND (order_type = 3 OR order_type = 4 OR (order_type = 2 AND (pre_sale_id IS NULL || pre_sale_id = 0))) GROUP BY ${column} diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml index 91a78f0fe..a4ecfe1fc 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -583,4 +583,9 @@ from sys_customer_healthy_extended where del_flag = 0 and healthy_id = #{id} limit 1 + + + \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml index 316e4092d..007e1c2ee 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml @@ -222,4 +222,9 @@ update sys_customer_physical_signs set del_flag = 1 where customer_id = #{customerId} + + + \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml index 3bd622048..0a194a1d5 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysWxUserLogMapper.xml @@ -49,6 +49,7 @@ + @@ -500,5 +501,41 @@ order by plan.cus_id desc + + + \ No newline at end of file diff --git a/stdiet-ui/src/api/custom/wxUserLog.js b/stdiet-ui/src/api/custom/wxUserLog.js index 621eadc34..051adb7a3 100644 --- a/stdiet-ui/src/api/custom/wxUserLog.js +++ b/stdiet-ui/src/api/custom/wxUserLog.js @@ -53,11 +53,11 @@ export function exportWxUserLog(query) { } // 根据ID查询打卡日志详情 -export function getPunchLogDetail(id) { +export function getPunchLogDetail(id, cusId, nextFlag) { return request({ url: '/custom/wxUserLog/getPunchLogDetail/' + id, method: 'get', - params: {} + params: {'cusId': cusId ? cusId : null, 'nextFlag': nextFlag ? nextFlag : 0} }) } diff --git a/stdiet-ui/src/components/PunchLog/PunchLogDetail/index.vue b/stdiet-ui/src/components/PunchLog/PunchLogDetail/index.vue index 6d280bd59..0b02a88c2 100644 --- a/stdiet-ui/src/components/PunchLog/PunchLogDetail/index.vue +++ b/stdiet-ui/src/components/PunchLog/PunchLogDetail/index.vue @@ -12,7 +12,7 @@
-
+
打卡点评
+

一、基础信息

二、食物以及对比照信息

-
+

食物描述

@@ -115,6 +116,7 @@
+
+
+