From fe6a5d3c8b490dbd6d73dc01d19e88b05a7f8d86 Mon Sep 17 00:00:00 2001 From: "L14\\huangyilong" <809440505@qq.com> Date: Tue, 30 Apr 2024 18:48:48 +0800 Subject: [PATCH] =?UTF-8?q?4.30=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/IntegralChangTextConstants.java | 15 +- .../domain/entity/WxDailyCareProducts.java | 84 + .../core/domain/entity/WxInstrument.java | 25 + .../core/domain/entity/WxNursingLog.java | 5 + .../core/domain/req/WxInstrumentSaveReq.java | 26 + .../core/domain/req/WxUserMemberReq.java | 19 +- .../core/domain/req/WxUserMemberVm.java | 17 +- .../common/core/domain/vo/WxInstrumentVO.java | 37 + .../mapper/WxClockInstrumentLogMapper.java | 4 +- .../mapper/WxDailyCareProductsMapper.java | 63 + .../common/core/mapper/WxFindTagMapper.java | 7 + .../core/mapper/WxInstrumentMapper.java | 17 +- .../miniProgram/PartitionConfigResponse.java | 75 + .../miniProgram/WxAnswerResponse.java | 13 + .../main/resources/mapper/SysTagMapper.xml | 2 +- .../mapper/WxClockInstrumentLogMapper.xml | 8 +- .../mapper/WxDailyCareProductsMapper.xml | 83 + .../resources/mapper/WxFindCarouselMapper.xml | 8 +- .../mapper/WxFindProductStrategyMapper.xml | 8 +- .../main/resources/mapper/WxFindTagMapper.xml | 10 + .../resources/mapper/WxInstrumentMapper.xml | 32 +- .../resources/mapper/WxNursingLogMapper.xml | 1 + .../mapper/WxUserInstrumentMapper.xml | 3 +- .../resources/mapper/WxUserMemberMapper.xml | 11 +- .../main/resources/mapper/WxUserTagMapper.xml | 13 +- .../security/utils/shuyun/ShuYunApiUtils.java | 2 - .../miniProgram/component/TagComponent.java | 100 + .../WxFindCarouselMiniController.java | 19 +- .../WxFindProductStrategyMiniController.java | 21 +- .../controller/WxNursingLogController.java | 18 +- .../service/IWxNursingLogService.java | 9 + .../service/impl/WxClockLogServiceImpl.java | 30 +- .../impl/WxFindCarouselServiceMiniImpl.java | 2 +- .../WxFindProductStrategyMiniServiceImpl.java | 2 +- .../service/impl/WxInstrumentServiceImpl.java | 48 +- .../service/impl/WxLiningServiceImpl.java | 17 + .../service/impl/WxNursingLogServiceImpl.java | 68 +- .../impl/WxUserIntegralServiceImpl.java | 2 +- .../service/impl/WxUserMemberServiceImpl.java | 5 +- .../WxDailyCareProductsController.java | 106 + .../WxUserInstrumentController.java | 1 + .../controller/WxUserMemberController.java | 22 +- .../service/IBatchOperationService.java | 3 - .../system/service/ISysTagService.java | 1 + .../service/IWxDailyCareProductsService.java | 62 + .../system/service/IWxUserMemberService.java | 12 + .../impl/BatchOperationServiceImpl.java | 3 +- .../service/impl/SiteInfoServiceImpl.java | 8 +- .../service/impl/SysTagServiceImpl.java | 7 +- .../impl/WxDailyCareProductsServiceImpl.java | 98 + .../impl/WxFindCarouselServiceImpl.java | 17 +- .../WxFindProductStrategyServiceImpl.java | 9 +- .../impl/WxInstrumentTagServiceImpl.java | 4 +- .../service/impl/WxUserMemberServiceImpl.java | 172 +- flossom-ui/src/api/system/member.js | 16 + flossom-ui/src/api/system/products.js | 44 + .../views/system/findCarouselImage/index.vue | 24 +- .../system/findProductStrategy/index.vue | 6 +- .../src/views/system/instrument/index.vue | 299 +- flossom-ui/src/views/system/lining/index.vue | 646 +- flossom-ui/src/views/system/member/index.vue | 1189 +- flossom-ui/src/views/system/mode/index.vue | 15950 ++++++++-------- .../src/views/system/products/index.vue | 381 + .../views/system/siteCarouselInfo/index.vue | 2 +- .../src/views/system/siteInfo/index.vue | 2 +- flossom-ui/vue.config.js | 8 - 66 files changed, 10614 insertions(+), 9407 deletions(-) create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxDailyCareProducts.java create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxInstrumentVO.java create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxDailyCareProductsMapper.java create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/PartitionConfigResponse.java create mode 100644 flossom-common/flossom-common-core/src/main/resources/mapper/WxDailyCareProductsMapper.xml create mode 100644 flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/component/TagComponent.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxDailyCareProductsController.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxDailyCareProductsService.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxDailyCareProductsServiceImpl.java create mode 100644 flossom-ui/src/api/system/products.js create mode 100644 flossom-ui/src/views/system/products/index.vue diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/IntegralChangTextConstants.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/IntegralChangTextConstants.java index 172e552..449ec11 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/IntegralChangTextConstants.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/constant/IntegralChangTextConstants.java @@ -18,12 +18,21 @@ public class IntegralChangTextConstants { public static final String CLOCK_ACTIVITY_CLOCK = "完成,获得奖励积分"; // 问卷活动打卡 - public static final String QUESTIONNAIRE_ACTIVITY_CLOCK = "完成,获得奖励积分"; + public static final String QUESTIONNAIRE_ACTIVITY_CLOCK = "问卷活动打卡"; // 共创活动打卡 - public static final String TOGETHER_ACTIVITY_CLOCK = "完成,获得奖励积分"; + public static final String TOGETHER_ACTIVITY_CLOCK = "共创活动打卡"; // 护理计划 - public static final String NURSING_ACTIVITY_CLOCK = "完成,获得奖励积分"; + public static final String NURSING_ACTIVITY_CLOCK = "护理计划"; + + // 注销用户 -- 扣减完善信息积分 + public static final String OFF_USER_IMPROVE_INFORMATION = "注销用户,扣减完善资料积分"; + + // 注销用户 -- 扣减绑定仪器积分 + public static final String OFF_USER_INSTRUMENT = "注销用户,扣减绑定设备获得积分"; + + // 同步用户积分 + public static final String SYNC_MEMBER_POINT = "同步用户积分"; } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxDailyCareProducts.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxDailyCareProducts.java new file mode 100644 index 0000000..0ad981d --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxDailyCareProducts.java @@ -0,0 +1,84 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + + +/** + * 日化产品信息对象 wx_daily_care_products + * + * @author flossom + * @date 2024-04-28 + */ +public class WxDailyCareProducts extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 日化产品名称 */ + @Excel(name = "日化产品名称") + private String productName; + + /** 日化产品图片 */ + @Excel(name = "日化产品图片") + private String productImg; + + /** 介绍文案 */ + @Excel(name = "介绍文案") + private String introduce; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setProductImg(String productImg) + { + this.productImg = productImg; + } + + public String getProductImg() + { + return productImg; + } + public void setIntroduce(String introduce) + { + this.introduce = introduce; + } + + public String getIntroduce() + { + return introduce; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("productName", getProductName()) + .append("productImg", getProductImg()) + .append("introduce", getIntroduce()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java index 63e1531..6d91948 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java @@ -246,6 +246,15 @@ public class WxInstrument extends BaseEntity { * 蓝牙连接中文案 */ private String we200BluetoothConnectingContent; + /** + * iot版本名称 + */ + private String iotVersionName; + + /** + * we200iot版本名称 + */ + private String we200IotVersionName; public void setId(Long id) { this.id = id; @@ -614,4 +623,20 @@ public class WxInstrument extends BaseEntity { public void setWe200BluetoothConnectingContent(String we200BluetoothConnectingContent) { this.we200BluetoothConnectingContent = we200BluetoothConnectingContent; } + + public String getIotVersionName() { + return iotVersionName; + } + + public void setIotVersionName(String iotVersionName) { + this.iotVersionName = iotVersionName; + } + + public String getWe200IotVersionName() { + return we200IotVersionName; + } + + public void setWe200IotVersionName(String we200IotVersionName) { + this.we200IotVersionName = we200IotVersionName; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java index 5a2850e..1433567 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxNursingLog.java @@ -69,6 +69,11 @@ public class WxNursingLog extends BaseEntity { @Excel(name = "模式名称") private String modeName; + /** + * 模式类型key(前端使用) + */ + private String modeNameKey; + /** * 护理时长 */ diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java index 4c59a6a..33c1ca6 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java @@ -266,6 +266,16 @@ public class WxInstrumentSaveReq { */ private List wxLiningList; + /** + * iot版本名称 + */ + private String iotVersionName; + + /** + * we200iot版本名称 + */ + private String we200IotVersionName; + public Long getId() { return id; } @@ -633,4 +643,20 @@ public class WxInstrumentSaveReq { public void setWxLiningList(List wxLiningList) { this.wxLiningList = wxLiningList; } + + public String getIotVersionName() { + return iotVersionName; + } + + public void setIotVersionName(String iotVersionName) { + this.iotVersionName = iotVersionName; + } + + public String getWe200IotVersionName() { + return we200IotVersionName; + } + + public void setWe200IotVersionName(String we200IotVersionName) { + this.we200IotVersionName = we200IotVersionName; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberReq.java index 38966d0..f18195a 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberReq.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberReq.java @@ -1,8 +1,6 @@ package com.flossom.common.core.domain.req; import com.fasterxml.jackson.annotation.JsonFormat; -import com.flossom.common.core.annotation.Excel; -import com.flossom.common.core.web.domain.BaseEntity; import java.util.Date; import java.util.List; @@ -71,14 +69,18 @@ public class WxUserMemberReq { */ private Integer activity; - /** 更新时间 */ + /** + * 更新时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; + private String unionid; + public WxUserMemberReq() { } - public WxUserMemberReq(Long id, String nickname, String mobile, Long provinceId, Long cityId, Long areaId, Date birthday, List wecomTags, List miniProgramTags, Integer clock, Integer activity, Date updateTime) { + public WxUserMemberReq(Long id, String nickname, String mobile, Long provinceId, Long cityId, Long areaId, List wecomTags, List miniProgramTags, Date birthday, Integer clock, Integer activity, Date updateTime, String unionid) { this.id = id; this.nickname = nickname; this.mobile = mobile; @@ -91,6 +93,7 @@ public class WxUserMemberReq { this.clock = clock; this.activity = activity; this.updateTime = updateTime; + this.unionid = unionid; } public Long getId() { @@ -188,4 +191,12 @@ public class WxUserMemberReq { public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } + + public String getUnionid() { + return unionid; + } + + public void setUnionid(String unionid) { + this.unionid = unionid; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberVm.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberVm.java index be5e161..622dc3c 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberVm.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxUserMemberVm.java @@ -95,10 +95,6 @@ public class WxUserMemberVm extends BaseEntity { */ private Integer deviceNumEnd; - /** - * 仪器绑定标签 - */ - /** * 购买渠道 */ @@ -119,6 +115,11 @@ public class WxUserMemberVm extends BaseEntity { */ List miniProgramTags; + /** + * 仪器数量排序(前端排序用) + */ + private Integer instrumentOrderBy; + /** * 小程序标签 */ @@ -311,4 +312,12 @@ public class WxUserMemberVm extends BaseEntity { public void setBirthdayRange(List birthdayRange) { this.birthdayRange = birthdayRange; } + + public Integer getInstrumentOrderBy() { + return instrumentOrderBy; + } + + public void setInstrumentOrderBy(Integer instrumentOrderBy) { + this.instrumentOrderBy = instrumentOrderBy; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxInstrumentVO.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxInstrumentVO.java new file mode 100644 index 0000000..547307a --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/WxInstrumentVO.java @@ -0,0 +1,37 @@ +package com.flossom.common.core.domain.vo; + +/** + * 仪器数据库操作实体 + * + * @author CGLiang + * @version 2.0.0 + * @date 2024/4/26 + */ +public class WxInstrumentVO { + + /** + * 仪器ID + */ + private Long id; + + /** + * 仪器名称 + */ + private String name; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java index 8afdaca..e370b98 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxClockInstrumentLogMapper.java @@ -1,8 +1,10 @@ package com.flossom.common.core.mapper; import com.flossom.common.core.domain.entity.WxClockInstrumentLog; +import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** @@ -26,7 +28,7 @@ public interface WxClockInstrumentLogMapper { * @param wxClockInstrumentLog 微信用户使用仪器记录 * @return 微信用户使用仪器记录集合 */ - public List selectWxClockInstrumentLogList(WxClockInstrumentLog wxClockInstrumentLog); + public List selectWxClockInstrumentLogList(@Param("item") WxClockInstrumentLog wxClockInstrumentLog, @Param("params") Map params); /** * 新增微信用户使用仪器记录 diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxDailyCareProductsMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxDailyCareProductsMapper.java new file mode 100644 index 0000000..7ef5224 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxDailyCareProductsMapper.java @@ -0,0 +1,63 @@ +package com.flossom.common.core.mapper; + + +import com.flossom.common.core.domain.entity.WxDailyCareProducts; + +import java.util.List; + +/** + * 日化产品信息Mapper接口 + * + * @author flossom + * @date 2024-04-28 + */ +public interface WxDailyCareProductsMapper +{ + /** + * 查询日化产品信息 + * + * @param id 日化产品信息主键 + * @return 日化产品信息 + */ + public WxDailyCareProducts selectWxDailyCareProductsById(Long id); + + /** + * 查询日化产品信息列表 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 日化产品信息集合 + */ + public List selectWxDailyCareProductsList(WxDailyCareProducts wxDailyCareProducts); + + /** + * 新增日化产品信息 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 结果 + */ + public int insertWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts); + + /** + * 修改日化产品信息 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 结果 + */ + public int updateWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts); + + /** + * 删除日化产品信息 + * + * @param id 日化产品信息主键 + * @return 结果 + */ + public int deleteWxDailyCareProductsById(Long id); + + /** + * 批量删除日化产品信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxDailyCareProductsByIds(Long[] ids); +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxFindTagMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxFindTagMapper.java index 4c1e361..a2a4d2c 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxFindTagMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxFindTagMapper.java @@ -76,4 +76,11 @@ public interface WxFindTagMapper { * @param updateName 修改人名称 */ void deleteWxFindTagByWxFindId(@Param("wxFindId")Long wxFindId, @Param("updateDate")Date updateDate, @Param("updateName")String updateName, @Param("wxFindType")Integer wxFindType); + + /** + * 根据标签id列表获取标签 + * @param tagIdList + * @return + */ + List selectWxFindTagByIdList(@Param("tagIdList")List tagIdList); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java index d95e50f..15f2e52 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java @@ -2,6 +2,8 @@ package com.flossom.common.core.mapper; import com.flossom.common.core.domain.entity.WxInstrument; import com.flossom.common.core.domain.req.WxInstrumentReq; +import com.flossom.common.core.domain.vo.WxInstrumentVO; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -57,7 +59,7 @@ public interface WxInstrumentMapper { /** * 批量删除仪器列 * - * @param ids 需要删除的数据主键集合 + * @param id 需要删除的数据主键集合 * @return 结果 */ public int deleteWxInstrumentByIds(Long id); @@ -70,4 +72,17 @@ public interface WxInstrumentMapper { List selectBindingInstrumentListByUserId(Long userId); List selectUnbindingInstrumentListByUserId(Long userId); + + /** + * 查询仪器id和名称 + * @return 仪器id和名称 + */ + List selectIdAndName(); + + /** + * 根据仪器id列表获取仪器绑定获得积分总数 + * @param instrumentIdList 仪器id列表 + * @return 仪器绑定获得积分总数 + */ + Integer selctBindingCreditTotal(@Param("instrumentIdList") List instrumentIdList); } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/PartitionConfigResponse.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/PartitionConfigResponse.java new file mode 100644 index 0000000..d64a521 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/PartitionConfigResponse.java @@ -0,0 +1,75 @@ +package com.flossom.common.core.response.miniProgram; + +import java.util.List; + +/** + * 眼雕大师模式定制电流配置响模型 + * @author CGLiang + * @version 2.0.0 + * @date 2024/4/16 + */ +public class PartitionConfigResponse { + + /** + * 眼周需求选择分组编号 + */ + private List feelingType; + + /** + * 部位 + */ + private Double pullingSeconds; + + /** + * 电流种类 + */ + private Double moisturizeSeconds; + + /** + * 电流种类等级分值 + */ + private Double eyeSculptSeconds; + + + public PartitionConfigResponse() { + } + + public PartitionConfigResponse(List feelingType, Double pullingSeconds, Double moisturizeSeconds, Double eyeSculptSeconds) { + this.feelingType = feelingType; + this.pullingSeconds = pullingSeconds; + this.moisturizeSeconds = moisturizeSeconds; + this.eyeSculptSeconds = eyeSculptSeconds; + } + + public List getFeelingType() { + return feelingType; + } + + public void setFeelingType(List feelingType) { + this.feelingType = feelingType; + } + + public Double getPullingSeconds() { + return pullingSeconds; + } + + public void setPullingSeconds(Double pullingSeconds) { + this.pullingSeconds = pullingSeconds; + } + + public Double getMoisturizeSeconds() { + return moisturizeSeconds; + } + + public void setMoisturizeSeconds(Double moisturizeSeconds) { + this.moisturizeSeconds = moisturizeSeconds; + } + + public Double getEyeSculptSeconds() { + return eyeSculptSeconds; + } + + public void setEyeSculptSeconds(Double eyeSculptSeconds) { + this.eyeSculptSeconds = eyeSculptSeconds; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/WxAnswerResponse.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/WxAnswerResponse.java index 479928d..fa6be5d 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/WxAnswerResponse.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/response/miniProgram/WxAnswerResponse.java @@ -30,6 +30,11 @@ public class WxAnswerResponse { */ private List electricFormulaList; + /** + * 定制电流配置 + */ + private List partitionConfigArray; + public List getElectricFormulaList() { return electricFormulaList; } @@ -61,4 +66,12 @@ public class WxAnswerResponse { public void setRedarScoreList(List redarScoreList) { this.redarScoreList = redarScoreList; } + + public List getPartitionConfigArray() { + return partitionConfigArray; + } + + public void setPartitionConfigArray(List partitionConfigArray) { + this.partitionConfigArray = partitionConfigArray; + } } diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml index 9770af8..e24a3f0 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml @@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ${params.dataScope} - order by d.parent_id, d.order_num + order by d.parent_id, d.order_num desc - and user_id = #{userId} - and instrument_id = #{instrumentId} - and instrument_name like concat('%', #{instrumentName}, '%') - and status = #{status} + and user_id = #{item.userId} + and instrument_id = #{item.instrumentId} + and instrument_name like concat('%', #{item.instrumentName}, '%') + and status = #{item.status} and create_time >= #{params.beginTime} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxDailyCareProductsMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxDailyCareProductsMapper.xml new file mode 100644 index 0000000..4adb0ea --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxDailyCareProductsMapper.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + select id, product_name, product_img, introduce, create_by, create_time, update_by, update_time from wx_daily_care_products + + + + + + + + insert into wx_daily_care_products + + product_name, + product_img, + introduce, + create_by, + create_time, + update_by, + update_time, + + + #{productName}, + #{productImg}, + #{introduce}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wx_daily_care_products + + product_name = #{productName}, + product_img = #{productImg}, + introduce = #{introduce}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from wx_daily_care_products where id = #{id} + + + + delete from wx_daily_care_products where id in + + #{id} + + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindCarouselMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindCarouselMapper.xml index 07be7f4..ad805cc 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindCarouselMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindCarouselMapper.xml @@ -153,10 +153,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" title = #{title}, file_url = #{fileUrl}, - site_start_time = #{siteStartTime}, - site_end_time = #{siteEndTime}, - user_register_start_time = #{userRegisterStartTime}, - user_register_end_time = #{userRegisterEndTime}, + site_start_time = #{siteStartTime}, + site_end_time = #{siteEndTime}, + user_register_start_time = #{userRegisterStartTime}, + user_register_end_time = #{userRegisterEndTime}, show_wechat_tag_id = #{showWechatTagId}, show_company_tag_id = #{showCompanyTagId}, forbid_wechat_tag_id = #{forbidWechatTagId}, diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindProductStrategyMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindProductStrategyMapper.xml index 19babb8..d533438 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindProductStrategyMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindProductStrategyMapper.xml @@ -153,10 +153,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" title = #{title}, file_url = #{fileUrl}, - site_start_time = #{siteStartTime}, - site_end_time = #{siteEndTime}, - user_register_start_time = #{userRegisterStartTime}, - user_register_end_time = #{userRegisterEndTime}, + site_start_time = #{siteStartTime}, + site_end_time = #{siteEndTime}, + user_register_start_time = #{userRegisterStartTime}, + user_register_end_time = #{userRegisterEndTime}, show_wechat_tag_id = #{showWechatTagId}, show_company_tag_id = #{showCompanyTagId}, forbid_wechat_tag_id = #{forbidWechatTagId}, diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindTagMapper.xml index 63ab0de..2e64e23 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxFindTagMapper.xml @@ -34,6 +34,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and status = #{status} + + + @@ -108,6 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and we200_bluetooth_connecting_title = #{we200BluetoothConnectingTitle} and we200_bluetooth_connecting_content = #{we200BluetoothConnectingContent} and we200_bluetooth_connecting = #{we200BluetoothConnecting} + and iot_version_name = #{iotVersionName} + and we200_iot_version_name = #{we200IotVersionName} order by create_time desc @@ -119,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and name like concat('%', #{name}, '%') and type = #{type} - order by create_time desc + order by sort_no desc, coalesce(update_time, create_time) desc + + + + + SELECT LAST_INSERT_ID() @@ -216,6 +238,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" we200_bluetooth_connecting_title, we200_bluetooth_connecting_Content, we200_bluetooth_connecting, + iot_version_name, + we200_iot_version_name, #{name}, @@ -267,6 +291,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{we200BluetoothConnectingTitle}, #{we200BluetoothConnectingContent}, #{we200BluetoothConnecting}, + #{iotVersionName}, + #{we200IotVersionName}, @@ -322,6 +348,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" we200_bluetooth_connecting_title = #{we200BluetoothConnectingTitle}, we200_bluetooth_connecting_content = #{we200BluetoothConnectingContent}, we200_bluetooth_connecting = #{we200BluetoothConnecting}, + iot_version_name = #{iotVersionName}, + we200_iot_version_name = #{we200IotVersionName}, where id = #{id} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml index 0030321..9444397 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxNursingLogMapper.xml @@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id from wx_user_instrument where user_id = #{userId} + select instrument_id from wx_user_instrument where user_id = #{userId} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml index fb6d094..7cf9a9c 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserMemberMapper.xml @@ -467,7 +467,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and member.status = 0 - order by member.id desc + + ORDER BY devices_num + + + ORDER BY devices_num desc + + + order by member.devices_num desc, member.id desc + + diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserTagMapper.xml index 936183c..e82d6ac 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserTagMapper.xml @@ -22,13 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/flossom-common/flossom-common-security/src/main/java/com/flossom/common/security/utils/shuyun/ShuYunApiUtils.java b/flossom-common/flossom-common-security/src/main/java/com/flossom/common/security/utils/shuyun/ShuYunApiUtils.java index 5747e9b..ab99437 100644 --- a/flossom-common/flossom-common-security/src/main/java/com/flossom/common/security/utils/shuyun/ShuYunApiUtils.java +++ b/flossom-common/flossom-common-security/src/main/java/com/flossom/common/security/utils/shuyun/ShuYunApiUtils.java @@ -21,10 +21,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.stereotype.Component; import java.time.Duration; import java.time.LocalDateTime; diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/component/TagComponent.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/component/TagComponent.java new file mode 100644 index 0000000..9f1f62a --- /dev/null +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/component/TagComponent.java @@ -0,0 +1,100 @@ +package com.flossom.miniProgram.component; + +import com.flossom.common.core.domain.entity.SysTag; +import com.flossom.common.core.domain.entity.WxFindTag; +import com.flossom.common.core.domain.entity.WxUserTag; +import com.flossom.common.core.enums.TagTypeStatusEnum; +import com.flossom.common.core.mapper.SysTagMapper; +import com.flossom.common.core.mapper.WxFindTagMapper; +import com.flossom.common.core.mapper.WxUserTagMapper; +import com.flossom.common.core.utils.CollectionUtils; +import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 标签操作组件 + * + * @author CGLiang + * @version 2.0.0 + * @date 2024/4/25 + */ +@Component +public class TagComponent { + + @Autowired + private WxFindTagMapper wxFindTagMapper; + @Autowired + private SysTagMapper sysTagMapper; + @Autowired + private WxUserTagMapper wxUserTagMapper; + + /** + * 点击获取标签 + * @param id 数据id + * @param dataType 操作类型 + */ + @Transactional(rollbackFor = Exception.class) + public void addTag(Long id, Integer dataType){ + WxFindTag wxFindTag = new WxFindTag(); + // 是否为轮播图获取标签 + wxFindTag.setWxFindType(dataType); + wxFindTag.setWxFindId(id); + // 小程序标签 + wxFindTag.setTagType(TagTypeStatusEnum.MINI_PROGRAM.getCode()); + wxFindTag.setStatus(2L); + List addMiniTagList = wxFindTagMapper.selectWxFindTagList(wxFindTag); + if (addMiniTagList != null && addMiniTagList.size() > 0) { + List tagIdList = addMiniTagList.stream().map(WxFindTag::getTagId).collect(Collectors.toList()); + batchAddTag(tagIdList, SecurityUtils.getLoginUser().getWxUserMember().getId(), TagTypeStatusEnum.MINI_PROGRAM.getCode()); + } + // 外部标签 + wxFindTag.setTagType(TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode()); + wxFindTag.setStatus(2L); + List addWecomTagList = wxFindTagMapper.selectWxFindTagList(wxFindTag); + if (addWecomTagList != null && addWecomTagList.size() > 0) { + List tagIdList = addWecomTagList.stream().map(WxFindTag::getTagId).collect(Collectors.toList()); + batchAddTag(tagIdList, SecurityUtils.getLoginUser().getWxUserMember().getId(), TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode()); + } + } + + /** + * 批量添加标签 + * + * @param tagIdList 标签id + * @param userId 用户id + */ + public void batchAddTag(List tagIdList, Long userId, Integer code) { + // 对单个标签操作 + List sysTagList = sysTagMapper.selectDataListByIds(tagIdList); + Map sysTagMap = sysTagList.stream().collect(Collectors.toMap(SysTag::getId, Function.identity(), (v1, v2) -> v1)); + // 2、添加用户与标签的关联 + List list = new ArrayList<>(); + for (Long tagId : tagIdList) { + SysTag sysTag = sysTagMap.get(tagId); + if (sysTag != null) { + // 1、查询该标签下,有那些用户关联 + List existedUserList = wxUserTagMapper.selectWxUserTagByTagId(tagId.intValue(), code); + if (existedUserList.contains(userId.intValue())) { + continue; + } + WxUserTag wxUserTag = new WxUserTag(null, userId, null, tagId, code, null); + wxUserTag.setCreateTime(DateUtils.getNowDate()); + list.add(wxUserTag); + } + } + if (CollectionUtils.isNotEmpty(list)) { + wxUserTagMapper.insertBatch(list); + } + // TODO: 对接数赢:批量添加小程序标签 + } +} diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindCarouselMiniController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindCarouselMiniController.java index 0428021..41f47cc 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindCarouselMiniController.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindCarouselMiniController.java @@ -1,13 +1,14 @@ package com.flossom.miniProgram.controller; +import com.flossom.common.core.enums.WxFindEnum; import com.flossom.common.core.response.WxFindCarouselListResponse; import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.domain.AjaxResult; import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.miniProgram.component.TagComponent; import com.flossom.miniProgram.service.IWxFindCarouselMiniService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -22,6 +23,8 @@ import java.util.List; public class WxFindCarouselMiniController extends BaseController { @Autowired private IWxFindCarouselMiniService wxFindCarouselMiniService; + @Autowired + private TagComponent tagComponent; /** * 查询发现轮播图列表 @@ -32,4 +35,14 @@ public class WxFindCarouselMiniController extends BaseController { return getDataTable(list); } + /** + * 点击轮播图时保存用户标签 + * @param id 轮播图id + * @return 操作结果 + */ + @PostMapping("/addTag/{id}") + public AjaxResult addTag(@PathVariable("id") Long id) { + tagComponent.addTag(id, WxFindEnum.CAROUSEL_IMAGE.getType()); + return AjaxResult.success(); + } } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindProductStrategyMiniController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindProductStrategyMiniController.java index 5abb625..52553c9 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindProductStrategyMiniController.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxFindProductStrategyMiniController.java @@ -1,13 +1,14 @@ package com.flossom.miniProgram.controller; import com.flossom.common.core.domain.entity.WxFindProductStrategy; +import com.flossom.common.core.enums.WxFindEnum; import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.domain.AjaxResult; import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.miniProgram.component.TagComponent; import com.flossom.miniProgram.service.IWxFindProductStrategyMiniService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -22,6 +23,8 @@ import java.util.List; public class WxFindProductStrategyMiniController extends BaseController { @Autowired private IWxFindProductStrategyMiniService wxFindProductStrategyMiniService; + @Autowired + private TagComponent tagComponent; /** * 查询产品攻略列表 @@ -31,4 +34,16 @@ public class WxFindProductStrategyMiniController extends BaseController { List list = wxFindProductStrategyMiniService.selectWxFindProductStrategyList(); return getDataTable(list); } + + /** + * 点击轮播图时保存用户标签 + * + * @param id 轮播图id + * @return 操作结果 + */ + @PostMapping("/addTag/{id}") + public AjaxResult addTag(@PathVariable("id") Long id) { + tagComponent.addTag(id, WxFindEnum.PRODUCT_STARTEGY.getType()); + return AjaxResult.success(); + } } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java index fbdda8a..8e7546d 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/controller/WxNursingLogController.java @@ -1,8 +1,5 @@ package com.flossom.miniProgram.controller; -import java.util.Date; -import java.util.List; - import com.flossom.common.core.domain.R; import com.flossom.common.core.domain.entity.WxNursingLog; import com.flossom.common.core.domain.req.WxNursingLogReq; @@ -13,6 +10,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.Date; +import java.util.List; + /** * 用户护理日志Controller @@ -48,6 +48,18 @@ public class WxNursingLogController extends BaseController { return R.ok(nursingLogId); } + /** + * 根据护理记录id获取时间百分比 + * @param id 护理记录id + * @param nursingTime 护理时间 + * @param modeId 模式id + * @return 护理时间百分比 + */ + @GetMapping(value = "/percentage") + public R getNursingTimePercentage(Long id, String nursingTime, Long modeId){ + return R.ok(wxNursingLogService.getNursingTimePercentage(id, nursingTime, modeId)); + } + /* ---------- WL200 -------------------*/ /** diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java index fd411fa..06f4274 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/IWxNursingLogService.java @@ -37,4 +37,13 @@ public interface IWxNursingLogService { List fr200MoistureTestRecord(Long instrumentId, Date queryDate); List fr200RecordOther(Long nursingLogId); + + /** + * 根据护理记录id获取时间百分比 + * @param id 护理记录id + * @param nursingTimeStr 护理时间 + * @param modeId 模式id + * @return 护理时间百分比 + */ + Integer getNursingTimePercentage(Long id, String nursingTimeStr, Long modeId); } diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java index 3e404a0..8b84233 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxClockLogServiceImpl.java @@ -6,15 +6,16 @@ import com.flossom.common.core.domain.req.WxClockLogReq; import com.flossom.common.core.domain.ret.WxClockLogRet; import com.flossom.common.core.domain.shuyun.ShuYunPointChange; import com.flossom.common.core.domain.shuyun.ShuYunUserTagReq; +import com.flossom.common.core.domain.vo.WxInstrumentVO; import com.flossom.common.core.enums.IntegralChangeTypeEnum; import com.flossom.common.core.enums.ShuYunPointSourceEnum; import com.flossom.common.core.enums.Status; import com.flossom.common.core.mapper.*; import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.utils.uuid.IdUtils; import com.flossom.common.security.utils.SecurityUtils; import com.flossom.common.security.utils.shuyun.ClockTag; -import com.flossom.common.security.utils.shuyun.MemberInfoTag; import com.flossom.common.security.utils.shuyun.ShuYunApiUtils; import com.flossom.common.security.utils.shuyun.ShuYunConfig; import com.flossom.miniProgram.service.IWxClockLogService; @@ -36,10 +37,7 @@ import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -87,11 +85,12 @@ public class WxClockLogServiceImpl implements IWxClockLogService { @Transactional public Integer insertWxClockLog(WxClockLogReq wxClockLogReq) { WxUserMember wxUserMember = SecurityUtils.getLoginUser().getWxUserMember(); + wxUserMember.setId(wxUserMember.getId()); LocalDateTime now = LocalDateTime.now(); /* 查询当天是否有打卡 */ WxClockLog queryClockLog = new WxClockLog(); - queryClockLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId()); + queryClockLog.setUserId(wxUserMember.getId()); queryClockLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); queryClockLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); List wxClockLogList = wxClockLogMapper.selectWxClockLogList(queryClockLog); @@ -133,7 +132,7 @@ public class WxClockLogServiceImpl implements IWxClockLogService { wxUserIntegralLog.setSource(IntegralChangeTypeEnum.INCREASE.getCode()); wxUserIntegralLog.setFloatScore(credit); wxUserIntegralLog.setRemarkContent("打卡积分奖励"); - wxUserIntegralLog.setCreateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxUserIntegralLog.setCreateBy(wxUserMember.getNickname()); wxUserIntegralLog.setCreateTime(DateUtils.getNowDate()); wxUserIntegralLogMapper.insertWxUserIntegralLog(wxUserIntegralLog); } @@ -146,7 +145,7 @@ public class WxClockLogServiceImpl implements IWxClockLogService { wxClockLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN)); wxClockLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX)); queryInstrumentLog.setStatus(Status.OK.getCode().longValue()); - List wxClockInstrumentLogList = wxClockInstrumentLogMapper.selectWxClockInstrumentLogList(queryInstrumentLog); + List wxClockInstrumentLogList = wxClockInstrumentLogMapper.selectWxClockInstrumentLogList(queryInstrumentLog, wxClockLog.getParams()); if (wxClockInstrumentLogList != null && wxClockInstrumentLogList.size() > 0) { String instrumentIdList = wxClockInstrumentLogList.stream() .map(WxClockInstrumentLog::getInstrumentId) @@ -163,14 +162,14 @@ public class WxClockLogServiceImpl implements IWxClockLogService { } if (wxClockLog.getId() != null) { - wxClockLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxClockLog.setUpdateBy(wxUserMember.getNickname()); wxClockLog.setUpdateTime(DateUtils.getNowDate()); wxClockLogMapper.updateWxClockLog(wxClockLog); } else { // 当天第一次打卡 wxClockLog.setCreateBy(wxUserMember.getNickname()); wxClockLog.setCreateTime(DateUtils.getNowDate()); - wxClockLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname()); + wxClockLog.setUpdateBy(wxUserMember.getNickname()); wxClockLog.setUpdateTime(DateUtils.getNowDate()); wxClockLogMapper.insertWxClockLog(wxClockLog); @@ -358,7 +357,18 @@ public class WxClockLogServiceImpl implements IWxClockLogService { public List selectWxClockLogList(WxClockLog queryClockLog) { List list = wxClockLogMapper.selectWxClockImgRetList(queryClockLog); if (list != null && list.size() > 0) { + Map wxInstrumentMap = wxInstrumentMapper.selectIdAndName().stream() + .collect(Collectors.toMap(WxInstrumentVO::getId, WxInstrumentVO::getName)); for (WxClockLogRet wxClockLogRet : list) { + if (StringUtils.isNotEmpty(wxClockLogRet.getInstrumentId())) { + String[] ids = wxClockLogRet.getInstrumentId().split(","); + String[] names = wxClockLogRet.getInstrumentName().split(","); + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < ids.length; i++) { + stringBuilder.append(wxInstrumentMap.getOrDefault(Long.parseLong(ids[i]), names[i])).append(","); + } + wxClockLogRet.setInstrumentName(stringBuilder.substring(0, stringBuilder.length() - 1)); + } WxClockImg wxClockImg = new WxClockImg(); wxClockImg.setUserClockId(wxClockLogRet.getId()); List wxClockImgs = wxClockImgMapper.selectWxClockImgList(wxClockImg); diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindCarouselServiceMiniImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindCarouselServiceMiniImpl.java index 88ffd25..4e28bde 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindCarouselServiceMiniImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindCarouselServiceMiniImpl.java @@ -50,7 +50,7 @@ public class WxFindCarouselServiceMiniImpl implements IWxFindCarouselMiniService if (CollectionUtils.isNotEmpty(wxFindCarousels)) { return filterWxFindCarousel(wxFindCarousels); } - return null; + return new ArrayList<>(); } /** diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindProductStrategyMiniServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindProductStrategyMiniServiceImpl.java index d1ed656..2b1a1ec 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindProductStrategyMiniServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxFindProductStrategyMiniServiceImpl.java @@ -50,7 +50,7 @@ public class WxFindProductStrategyMiniServiceImpl implements IWxFindProductStrat if (CollectionUtils.isNotEmpty(wxFindProductStrategyList)) { return fileData(wxFindProductStrategyList); } - return null; + return new ArrayList<>(); } /** diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java index 452a45c..113ccd0 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java @@ -17,8 +17,10 @@ import com.flossom.common.core.exception.ServiceReturnCodeException; import com.flossom.common.core.mapper.*; import com.flossom.common.core.request.miniProgram.AnswerResultRequest; import com.flossom.common.core.response.miniProgram.EyeNursingElectricFormulaResponse; +import com.flossom.common.core.response.miniProgram.PartitionConfigResponse; import com.flossom.common.core.response.miniProgram.RedarScoreResponse; import com.flossom.common.core.response.miniProgram.WxAnswerResponse; +import com.flossom.common.core.utils.CollectionUtils; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.utils.uuid.IdUtils; @@ -172,6 +174,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { } WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxInstrumentSerial.getInstrumentId()); if (wxInstrument != null) { + wxInstrumentSerial.setStatus(wxInstrument.getStatus()); wxInstrumentSerial.setInstrumentName(wxInstrument.getName()); } return wxInstrumentSerial; @@ -682,7 +685,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { public WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId) { /* 1、获取序列号信息 */ WxInstrumentSerial wxInstrumentSerial = getInstrumentInfoBySerial(serial); - if (wxInstrumentSerial.getInstrumentId() != instrumentId) { + if (!Objects.equals(wxInstrumentSerial.getInstrumentId(), instrumentId)) { logger.info("用户选择的仪器与序列号对应的仪器不一致,序列号:{}, 仪器ID:{}", serial, instrumentId); throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FOUR.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FOUR.getCode()); } @@ -802,7 +805,6 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { if (isRedarFlag) { Integer redarValue = radarChartVoMap.get(eyeDimensionOptions); redarValue += value.getEyeNumber(); - redarValue = redarValue >= 5 ? 5 : redarValue; redarValue = redarValue <= min ? min : redarValue; radarChartVoMap.put(eyeDimensionOptions, redarValue); } @@ -836,12 +838,42 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { Map> formulaVoMap = JSONObject.parseArray(eyeNursingElectricFormulaJson, EyeNursingElectricFormulaVo.class) .stream().collect(Collectors.groupingBy(EyeNursingElectricFormulaVo::getRequirementSelection)); // 获取制定配置数据 - List electricFormulaResponses = formulaVoMap.get(ordCode.toString()).stream() - .map(item -> { - Integer levelScore = getEyeNursingTime(level, item); - return new EyeNursingElectricFormulaResponse(item.getRequirementSelection(), item.getPart(), item.getCurrentType(), levelScore); - }).collect(Collectors.toList()); - wxAnswerResponse.setElectricFormulaList(electricFormulaResponses); + List eyeNursingElectricFormulaVos = formulaVoMap.get(ordCode.toString()); + if (CollectionUtils.isNotEmpty(eyeNursingElectricFormulaVos)) { + List eyeNursingElectricFormulaResponseList = new ArrayList<>(); + List partitionConfigResponses = new ArrayList<>(); + // 额取时间 + Double pullingSeconds = new Double("0"); + // 左右眼周时间 + Double eyePullingSeconds = new Double("0"); + List feelingType = new ArrayList<>(); + // i<2是左右眼周的数据, >=2 是额区的数据 + for (int i = 0; i < eyeNursingElectricFormulaVos.size(); i++) { + EyeNursingElectricFormulaVo item = eyeNursingElectricFormulaVos.get(i); + Integer levelScore = getEyeNursingTime(level, item); + // i == 0,1 依然取左右眼周数据, i == 2,3 时候需要取额区的数据 + if (i == 0) { + eyePullingSeconds = new Double(levelScore); + feelingType = Arrays.asList("Moisturize", "EyeSculpt"); + } + if (i == 2) { + eyePullingSeconds = new Double("0"); + pullingSeconds = new Double(levelScore); + feelingType = Arrays.asList("Pulling", "Moisturize"); + } + eyeNursingElectricFormulaResponseList.add(new EyeNursingElectricFormulaResponse(item.getRequirementSelection(), item.getPart(), item.getCurrentType(), levelScore)); + if (i == 3) { + partitionConfigResponses.get(2).setMoisturizeSeconds(new Double(levelScore)); + continue; + } + partitionConfigResponses.add(new PartitionConfigResponse(feelingType, pullingSeconds, new Double(levelScore), eyePullingSeconds)); + } + eyeNursingElectricFormulaVos.forEach(item -> { + + }); + wxAnswerResponse.setElectricFormulaList(eyeNursingElectricFormulaResponseList); + wxAnswerResponse.setPartitionConfigArray(partitionConfigResponses); + } } } return wxAnswerResponse; diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxLiningServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxLiningServiceImpl.java index 48aa8a9..a91a4eb 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxLiningServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxLiningServiceImpl.java @@ -110,6 +110,23 @@ public class WxLiningServiceImpl implements IWxLiningService { moisturizing = jsonArray.get(5); customizationElectricFormulaVo.setFeelingType("Moisturize"); } + // 第二题为左右脸, 需要添加两次 + if (i == 1) { + if (quest1 == 2) {// 全选时,对应 jsonArray 下标 0,1 + promote = jsonArray.get(0); + moisturizing = jsonArray.get(1); + customizationElectricFormulaVo.setFeelingType("Mix"); + } else if (quest1 == 0) {// 提拉时,对应 jsonArray 下标 2,3 + promote = jsonArray.get(2); + moisturizing = jsonArray.get(3); + customizationElectricFormulaVo.setFeelingType("Pulling"); + } else {// 滋润时,对应 jsonArray 下标 4,5 + promote = jsonArray.get(4); + moisturizing = jsonArray.get(5); + customizationElectricFormulaVo.setFeelingType("Moisturize"); + } + list.add(customizationElectricFormulaVo); + } Double promoteForeheadGrade = Double.valueOf((Integer) promote.get("L" + quest2)); Double moisturizingForeheadGrade = Double.valueOf((Integer) moisturizing.get("L" + quest2)); customizationElectricFormulaVo.setPullingSeconds(promoteForeheadGrade); diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java index 036f128..0e4c54e 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxNursingLogServiceImpl.java @@ -121,6 +121,7 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { if (wxInstrument != null) { nursingLog.setInstrumentType(wxInstrument.getType()); nursingLog.setInstrumentName(wxInstrument.getName()); + nursingLog.setInstrumentModel(wxInstrument.getModel()); } // 由于每个模式的护理报告页都不同,加个字段控制页面跳转 @@ -158,6 +159,17 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { if (nursingLog != null) { WxMode wxMode = wxModeMapper.selectWxModeById(nursingLog.getModeId()); if (wxMode != null) { + // 处理完成度 + Optional.ofNullable(nursingLog.getNursingTime()).ifPresent(nursingTime -> { + // 护理时间s + int second = nursingTime.toSecondOfDay(); + // 模式护理时长s + Integer modeTime = wxMode.getModeTime(); + // 计算护理时间占模式护理时长的比例,四舍五入保留两位小数 + double percentage = (double) second / modeTime; + double roundedPercentage = Math.round(percentage * 100.0) / 100.0; + nursingLog.setCompletionPercentage(roundedPercentage); + }); nursingLog.setModeImage(wxMode.getModeBanner()); } WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(nursingLog.getInstrumentId()); @@ -305,6 +317,50 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { return wxNursingLogList; } + /** + * 根据护理记录id获取时间百分比 + * @param id 护理记录id + * @param nursingTimeStr 护理时间 + * @param modeId 模式id + * @return 护理时间百分比 + */ + @Override + public Integer getNursingTimePercentage(Long id, String nursingTimeStr, Long modeId) { + LocalTime nursingTime; + // 护理时间不为空是仪器接口调用, 为空是护理记录调用 + if (StringUtils.isEmpty(nursingTimeStr)) { + WxNursingLog queryNursingLog = new WxNursingLog(); + queryNursingLog.setId(id); + List wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog); + if (CollectionUtils.isEmpty(wxNursingLogList)) { + throw new ServiceException("请求数据有误"); + } + WxNursingLog wxNursingLog = wxNursingLogList.get(0); + nursingTime = wxNursingLog.getNursingTime(); + modeId = wxNursingLog.getModeId(); + }else { + nursingTime = LocalTime.parse(nursingTimeStr); + } + + // 将护理时间转换为分钟 + int nursingSeconds = nursingTime.toSecondOfDay(); + + // 获取模式时间 + WxMode wxMode = wxModeMapper.selectWxModeById(modeId); + int modeSeconds = wxMode.getModeTime(); + + // 计算护理时间与模式时间的比例 + // 将比例转换为百分比 + double value = (double) nursingSeconds / modeSeconds; + // 四舍五入并保留两位小数 + int hundred = 100; + double roundedValue = Math.round(value * 100.0) / 100.0; + int percentage = (int) (roundedValue * hundred); + + // 最大取100 + return Math.min(percentage, hundred); + } + /** * 新增用户护理日志 */ @@ -312,11 +368,18 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { public Long insertWxNursingLog(WxNursingLogReq wxNursingLogReq) { Integer energyValue = wxNursingLogReq.getEnergyValue(); List gearPositionList = wxNursingLogReq.getGearPositionList(); + // 是否为水分测试 + boolean isWaterTest = Objects.equals(wxNursingLogReq.getWaterTest(), Boolean.TRUE); /* 查询 同一仪器,同一模式 下,是否有相同的记录,如果有合并护理时间 */ WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxNursingLogReq.getInstrumentId()); if (wxInstrument == null) { throw new ServiceException("保存失败"); } + + if (!isWaterTest && Objects.nonNull(wxInstrument.getNursingTime()) && wxInstrument.getNursingTime().compareTo(wxNursingLogReq.getNursingTime()) > 0) { + throw new ServiceException("您的本次护理时间不足, 请重新护理"); + } + Long userId = SecurityUtils.getLoginUser().getWxUserMember().getId(); String nickname = SecurityUtils.getLoginUser().getWxUserMember().getNickname(); WxNursingLog queryNursingLog = new WxNursingLog(); @@ -329,7 +392,7 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { List wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog); // 非水分测试需要合并测试 - if (!Objects.equals(wxNursingLogReq.getWaterTest(), Boolean.TRUE) && wxNursingLogList != null && wxNursingLogList.size() > 0) { + if (!isWaterTest && wxNursingLogList != null && wxNursingLogList.size() > 0) { // 存在,修改 WxNursingLog updateNursingLog = new WxNursingLog(); WxNursingLog wxNursingLog = wxNursingLogList.get(0); @@ -429,6 +492,9 @@ public class WxNursingLogServiceImpl implements IWxNursingLogService { // 其他模式取最新的 updateNursingLog.setNursingData(wxNursingLogReq.getNursingData()); } + } else { + // 其他模式取最新的 + updateNursingLog.setNursingData(wxNursingLogReq.getNursingData()); } updateNursingLog.setId(wxNursingLog.getId()); diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserIntegralServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserIntegralServiceImpl.java index 838f73c..4d1b540 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserIntegralServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserIntegralServiceImpl.java @@ -65,8 +65,8 @@ public class WxUserIntegralServiceImpl implements IWxUserIntegralService { userIntegralLog.setFloatScore(Math.abs(Long.valueOf(shuYunPointChangeLog.getChangePoint()))); // 变更时间 userIntegralLog.setCreateTime(DateUtils.parseDate(shuYunPointChangeLog.getCreated())); + userIntegralLogList.add(userIntegralLog); } - userIntegralLogList.add(userIntegralLog); } TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserMemberServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserMemberServiceImpl.java index 17fa400..6f14745 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserMemberServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxUserMemberServiceImpl.java @@ -379,6 +379,8 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { BeanUtils.copyProperties(wxUserMember, loginUserVo); loginUserVo.setToken(null); loginUserVo.setIntegralText(null); + // 请求失败默认0 + loginUserVo.setCredit(0); if (wxUserMember.getUserType() != null && wxUserMember.getUserType() == 1) { // TODO: 调用数云接口获取最新的积分值(已完成) try { @@ -386,9 +388,6 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { loginUserVo.setCredit(Integer.valueOf(shuYunMember.getPoint())); } catch (Exception exception) { logger.error(exception.getMessage()); - } finally { - // 请求失败默认0 - loginUserVo.setCredit(0); } try { // TODO: 调用数云接口获取即将过期的积分值(已完成) diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxDailyCareProductsController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxDailyCareProductsController.java new file mode 100644 index 0000000..8821e4d --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxDailyCareProductsController.java @@ -0,0 +1,106 @@ +package com.flossom.system.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.flossom.common.core.domain.entity.WxDailyCareProducts; +import com.flossom.common.core.utils.poi.ExcelUtil; +import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.domain.AjaxResult; +import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.common.log.annotation.Log; +import com.flossom.common.log.enums.BusinessType; +import com.flossom.common.security.annotation.RequiresPermissions; +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 com.flossom.system.service.IWxDailyCareProductsService; + +/** + * 日化产品信息Controller + * + * @author flossom + * @date 2024-04-28 + */ +@RestController +@RequestMapping("/products") +public class WxDailyCareProductsController extends BaseController +{ + @Autowired + private IWxDailyCareProductsService wxDailyCareProductsService; + + /** + * 查询日化产品信息列表 + */ + @RequiresPermissions("system:products:list") + @GetMapping("/list") + public TableDataInfo list(WxDailyCareProducts wxDailyCareProducts) + { + startPage(); + List list = wxDailyCareProductsService.selectWxDailyCareProductsList(wxDailyCareProducts); + return getDataTable(list); + } + + /** + * 导出日化产品信息列表 + */ + @RequiresPermissions("system:products:export") + @Log(title = "日化产品信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WxDailyCareProducts wxDailyCareProducts) + { + List list = wxDailyCareProductsService.selectWxDailyCareProductsList(wxDailyCareProducts); + ExcelUtil util = new ExcelUtil(WxDailyCareProducts.class); + util.exportExcel(response, list, "日化产品信息数据"); + } + + /** + * 获取日化产品信息详细信息 + */ + @RequiresPermissions("system:products:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(wxDailyCareProductsService.selectWxDailyCareProductsById(id)); + } + + /** + * 新增日化产品信息 + */ + @RequiresPermissions("system:products:add") + @Log(title = "日化产品信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WxDailyCareProducts wxDailyCareProducts) + { + return toAjax(wxDailyCareProductsService.insertWxDailyCareProducts(wxDailyCareProducts)); + } + + /** + * 修改日化产品信息 + */ + @RequiresPermissions("system:products:edit") + @Log(title = "日化产品信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WxDailyCareProducts wxDailyCareProducts) + { + return toAjax(wxDailyCareProductsService.updateWxDailyCareProducts(wxDailyCareProducts)); + } + + /** + * 删除日化产品信息 + */ + @RequiresPermissions("system:products:remove") + @Log(title = "日化产品信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(wxDailyCareProductsService.deleteWxDailyCareProductsByIds(ids)); + } +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserInstrumentController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserInstrumentController.java index 528427d..831f1c6 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserInstrumentController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserInstrumentController.java @@ -81,6 +81,7 @@ public class WxUserInstrumentController extends BaseController if (Objects.nonNull(userInstrument.getInstrumentId())) { WxInstrument wxInstrument = wxInstrumentService.selectWxInstrumentById(userInstrument.getInstrumentId()); userInstrument.setWxInstrument(wxInstrument); + userInstrument.setInstrumentName(wxInstrument.getName()); } if (Objects.nonNull(userInstrument.getUserId())) { WxUserMember wxUserMember = wxUserMemberService.selectWxUserMemberByIdInit(userInstrument.getUserId()); diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserMemberController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserMemberController.java index 91a4ede..ee85e3a 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserMemberController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxUserMemberController.java @@ -1,7 +1,5 @@ package com.flossom.system.controller; -import javax.servlet.http.HttpServletResponse; - import com.flossom.common.core.domain.R; import com.flossom.common.core.domain.entity.WxUserInstrument; import com.flossom.common.core.domain.entity.WxUserMember; @@ -10,7 +8,6 @@ import com.flossom.common.core.domain.export.WxUserMemberExport; import com.flossom.common.core.domain.req.*; import com.flossom.common.core.domain.ret.WxUserMemberRet; import com.flossom.common.core.domain.shuyun.ShuYunBatchTagOperation; -import com.flossom.common.core.domain.shuyun.ShuYunPointChange; import com.flossom.common.core.enums.IntegralChangeTypeEnum; import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.utils.poi.ExcelUtil; @@ -26,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -257,6 +255,24 @@ public class WxUserMemberController extends BaseController { return R.ok(); } + /** + * 同步积分到数云 + */ + @PostMapping("/sync/point/{memberId}") + public R syncPointToShuYun(@PathVariable Long memberId) { + wxUserMemberService.syncPointToShuYun(memberId); + return R.ok(); + } + + /** + * 同步会员信息到数云 + */ + @PostMapping("/sync/info/{memberId}") + public R syncMemberInfoToShuYun(@PathVariable Long memberId) { + wxUserMemberService.syncMemberInfoToShuYun(memberId); + return R.ok(); + } + /** * 开启或者禁止打卡 */ diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IBatchOperationService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IBatchOperationService.java index 391afcf..de20c38 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IBatchOperationService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IBatchOperationService.java @@ -1,11 +1,8 @@ package com.flossom.system.service; -import com.flossom.common.core.domain.shuyun.ShuYunBatchIntegralOperation; import com.flossom.common.core.domain.shuyun.ShuYunBatchTagOperation; import com.flossom.common.core.domain.shuyun.ShuYunPointChange; -import java.util.List; - public interface IBatchOperationService { public void syncShuYunUserTag(ShuYunBatchTagOperation shuYunBatchTagOperation); diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java index 3a84967..b4817b4 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/ISysTagService.java @@ -137,4 +137,5 @@ public interface ISysTagService List> getMiniProgramTags(); List> getWecomTags(); + } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxDailyCareProductsService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxDailyCareProductsService.java new file mode 100644 index 0000000..212d28e --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxDailyCareProductsService.java @@ -0,0 +1,62 @@ +package com.flossom.system.service; + +import com.flossom.common.core.domain.entity.WxDailyCareProducts; + +import java.util.List; + +/** + * 日化产品信息Service接口 + * + * @author flossom + * @date 2024-04-28 + */ +public interface IWxDailyCareProductsService +{ + /** + * 查询日化产品信息 + * + * @param id 日化产品信息主键 + * @return 日化产品信息 + */ + public WxDailyCareProducts selectWxDailyCareProductsById(Long id); + + /** + * 查询日化产品信息列表 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 日化产品信息集合 + */ + public List selectWxDailyCareProductsList(WxDailyCareProducts wxDailyCareProducts); + + /** + * 新增日化产品信息 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 结果 + */ + public int insertWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts); + + /** + * 修改日化产品信息 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 结果 + */ + public int updateWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts); + + /** + * 批量删除日化产品信息 + * + * @param ids 需要删除的日化产品信息主键集合 + * @return 结果 + */ + public int deleteWxDailyCareProductsByIds(Long[] ids); + + /** + * 删除日化产品信息信息 + * + * @param id 日化产品信息主键 + * @return 结果 + */ + public int deleteWxDailyCareProductsById(Long id); +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxUserMemberService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxUserMemberService.java index 55f4141..7b64959 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxUserMemberService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxUserMemberService.java @@ -112,4 +112,16 @@ IWxUserMemberService void syncShuYunUserTag(List shuYunBatchTagOperationList); void syncShuYunIntegral(List shuYunPointChangeList); + + /** + * 同步积分到数云 + * @param memberId 用户id + */ + void syncPointToShuYun(Long memberId); + + /** + * 同步会员信息到数云 + * @param memberId 用户id + */ + void syncMemberInfoToShuYun(Long memberId); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/BatchOperationServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/BatchOperationServiceImpl.java index d68fafe..bc51f93 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/BatchOperationServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/BatchOperationServiceImpl.java @@ -50,7 +50,8 @@ public class BatchOperationServiceImpl implements IBatchOperationService { if (shuYunBatchTagOperation.getNeedAddTagIdList() != null && shuYunBatchTagOperation.getNeedAddTagIdList().size() > 0) { for (Integer tagId : shuYunBatchTagOperation.getNeedAddTagIdList()) { SysTag sysTag = sysTagMapper.selectDeptById(tagId.longValue()); - shuYunUserTagList.add(new ShuYunUserTagReq<>(sysTag.getShuyunTagId(), Arrays.asList("1"))); + if(sysTag.getShuyunTagId() != null) + shuYunUserTagList.add(new ShuYunUserTagReq<>(sysTag.getShuyunTagId(), Arrays.asList("1"))); } } if (shuYunUserTagList != null && shuYunUserTagList.size() > 0) { diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java index 75335ce..d150739 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java @@ -149,15 +149,15 @@ public class SiteInfoServiceImpl implements ISiteInfoService */ @Override public List selectSiteInfoList(SiteInfo siteInfo) { - return siteInfoMapper.selectSiteInfoList(siteInfo).stream() - .map(item-> { + List siteInfos = siteInfoMapper.selectSiteInfoList(siteInfo); + siteInfos.forEach(item-> { String instrumentId = item.getInstrumentId(); if (StringUtils.isNotEmpty(instrumentId)) { List machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList()); item.setMachineArray(machineArray); } - return item; - }).collect(Collectors.toList()); + }); + return siteInfos; } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java index 2d802f2..ff4d43d 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysTagServiceImpl.java @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -75,7 +76,7 @@ public class SysTagServiceImpl implements ISysTagService { @Override public List buildDeptTree(List tags) { List returnList = new ArrayList(); - List tempList = tags.stream().map(SysTag::getId).collect(Collectors.toList()); + List tempList = tags.stream().sorted(Comparator.comparing(SysTag::getOrderNum).reversed()).map(SysTag::getId).collect(Collectors.toList()); for (SysTag tag : tags) { // 如果是顶级节点, 遍历该父节点的所有子节点 if (!tempList.contains(tag.getParentId())) { @@ -98,7 +99,7 @@ public class SysTagServiceImpl implements ISysTagService { @Override public List buildDeptTreeSelect(List tags) { List deptTrees = buildDeptTree(tags); - return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + return deptTrees.stream().sorted(Comparator.comparing(SysTag::getOrderNum).reversed()).map(TreeSelect::new).collect(Collectors.toList()); } /** @@ -391,4 +392,6 @@ public class SysTagServiceImpl implements ISysTagService { private boolean hasChild(List list, SysTag t) { return getChildList(list, t).size() > 0 ? true : false; } + + } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxDailyCareProductsServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxDailyCareProductsServiceImpl.java new file mode 100644 index 0000000..3c9ffd6 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxDailyCareProductsServiceImpl.java @@ -0,0 +1,98 @@ +package com.flossom.system.service.impl; + +import java.util.List; + +import com.flossom.common.core.domain.entity.WxDailyCareProducts; +import com.flossom.common.core.mapper.WxDailyCareProductsMapper; +import com.flossom.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.flossom.system.service.IWxDailyCareProductsService; + +/** + * 日化产品信息Service业务层处理 + * + * @author flossom + * @date 2024-04-28 + */ +@Service +public class WxDailyCareProductsServiceImpl implements IWxDailyCareProductsService +{ + @Autowired + private WxDailyCareProductsMapper wxDailyCareProductsMapper; + + /** + * 查询日化产品信息 + * + * @param id 日化产品信息主键 + * @return 日化产品信息 + */ + @Override + public WxDailyCareProducts selectWxDailyCareProductsById(Long id) + { + return wxDailyCareProductsMapper.selectWxDailyCareProductsById(id); + } + + /** + * 查询日化产品信息列表 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 日化产品信息 + */ + @Override + public List selectWxDailyCareProductsList(WxDailyCareProducts wxDailyCareProducts) + { + return wxDailyCareProductsMapper.selectWxDailyCareProductsList(wxDailyCareProducts); + } + + /** + * 新增日化产品信息 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 结果 + */ + @Override + public int insertWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts) + { + wxDailyCareProducts.setCreateTime(DateUtils.getNowDate()); + wxDailyCareProducts.setUpdateTime(DateUtils.getNowDate()); + return wxDailyCareProductsMapper.insertWxDailyCareProducts(wxDailyCareProducts); + } + + /** + * 修改日化产品信息 + * + * @param wxDailyCareProducts 日化产品信息 + * @return 结果 + */ + @Override + public int updateWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts) + { + wxDailyCareProducts.setUpdateTime(DateUtils.getNowDate()); + return wxDailyCareProductsMapper.updateWxDailyCareProducts(wxDailyCareProducts); + } + + /** + * 批量删除日化产品信息 + * + * @param ids 需要删除的日化产品信息主键 + * @return 结果 + */ + @Override + public int deleteWxDailyCareProductsByIds(Long[] ids) + { + return wxDailyCareProductsMapper.deleteWxDailyCareProductsByIds(ids); + } + + /** + * 删除日化产品信息信息 + * + * @param id 日化产品信息主键 + * @return 结果 + */ + @Override + public int deleteWxDailyCareProductsById(Long id) + { + return wxDailyCareProductsMapper.deleteWxDailyCareProductsById(id); + } +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindCarouselServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindCarouselServiceImpl.java index 63042f4..b390e1e 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindCarouselServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindCarouselServiceImpl.java @@ -142,15 +142,14 @@ public class WxFindCarouselServiceImpl implements IWxFindCarouselService { */ @Override public List selectWxFindCarouselList(WxFindCarousel wxFindCarousel) { - return wxFindCarouselMapper.selectWxFindCarouselList(wxFindCarousel).stream() - .map(item-> { - String instrumentId = item.getInstrumentId(); - if (StringUtils.isNotEmpty(instrumentId)) { - List machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList()); - item.setMachineArray(machineArray); - } - return item; - }).collect(Collectors.toList()); + List wxFindCarousels = wxFindCarouselMapper.selectWxFindCarouselList(wxFindCarousel); + wxFindCarousels.forEach(item-> { + String instrumentId = item.getInstrumentId(); + if (StringUtils.isNotEmpty(instrumentId)) { + List machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList()); + item.setMachineArray(machineArray); + }}); + return wxFindCarousels; } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindProductStrategyServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindProductStrategyServiceImpl.java index dcfeff5..a3c3ed3 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindProductStrategyServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxFindProductStrategyServiceImpl.java @@ -144,7 +144,14 @@ public class WxFindProductStrategyServiceImpl implements IWxFindProductStrategyS */ @Override public List selectWxFindProductStrategyList(WxFindProductStrategy wxFindProductStrategy) { - return wxFindProductStrategyMapper.selectWxFindProductStrategyList(wxFindProductStrategy); + List wxFindProductStrategyList = wxFindProductStrategyMapper.selectWxFindProductStrategyList(wxFindProductStrategy); + wxFindProductStrategyList.forEach(item-> { + String instrumentId = item.getInstrumentId(); + if (StringUtils.isNotEmpty(instrumentId)) { + List machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList()); + item.setMachineArray(machineArray); + }}); + return wxFindProductStrategyList; } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentTagServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentTagServiceImpl.java index b51d504..649b912 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentTagServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentTagServiceImpl.java @@ -94,8 +94,8 @@ public class WxInstrumentTagServiceImpl implements IWxInstrumentTagService { @Override public int addInstrumentTag(WxInstrumentTagReq wxInstrumentTagReq) { List tagIdList = wxInstrumentTagReq.getTagIdList(); + int row = wxInstrumentTagMapper.deleteByInstrumentIdAndType(wxInstrumentTagReq.getInstrumentId(), wxInstrumentTagReq.getType()); if (tagIdList != null && tagIdList.size() > 0) { - wxInstrumentTagMapper.deleteByInstrumentIdAndType(wxInstrumentTagReq.getInstrumentId(), wxInstrumentTagReq.getType()); for (Long tagId : tagIdList) { WxInstrumentTag wxInstrumentTag = new WxInstrumentTag(); BeanUtils.copyBeanProp(wxInstrumentTag, wxInstrumentTagReq); @@ -105,6 +105,6 @@ public class WxInstrumentTagServiceImpl implements IWxInstrumentTagService { wxInstrumentTagMapper.insertWxInstrumentTag(wxInstrumentTag); } } - return tagIdList.size(); + return tagIdList.size() > 0 ? tagIdList.size() : row; } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java index 3851cd7..034a79a 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxUserMemberServiceImpl.java @@ -1,36 +1,41 @@ package com.flossom.system.service.impl; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; - +import com.flossom.common.core.constant.IntegralChangTextConstants; import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.req.WxUserIntegralVm; import com.flossom.common.core.domain.req.WxUserMemberReq; import com.flossom.common.core.domain.req.WxUserMemberVm; import com.flossom.common.core.domain.ret.WxUserMemberRet; import com.flossom.common.core.domain.shuyun.ShuYunBatchTagOperation; +import com.flossom.common.core.domain.shuyun.ShuYunMember; import com.flossom.common.core.domain.shuyun.ShuYunPointChange; import com.flossom.common.core.domain.vo.WxUserMemberVo; import com.flossom.common.core.enums.*; import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.mapper.*; +import com.flossom.common.core.utils.CollectionUtils; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.utils.uuid.IdUtils; import com.flossom.common.security.utils.SecurityUtils; +import com.flossom.common.security.utils.shuyun.ShuYunApiUtils; import com.flossom.common.security.utils.shuyun.ShuYunConfig; import com.flossom.system.service.IBatchOperationService; +import com.flossom.system.service.IIntegralGlobalService; import com.flossom.system.service.ISysUserService; +import com.flossom.system.service.IWxUserMemberService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.flossom.system.service.IWxUserMemberService; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + /** * 用户Service业务层处理 * @@ -39,6 +44,9 @@ import org.springframework.transaction.annotation.Transactional; */ @Service public class WxUserMemberServiceImpl implements IWxUserMemberService { + + protected final Logger logger = LoggerFactory.getLogger(WxUserMemberServiceImpl.class); + @Autowired private WxUserMemberMapper wxUserMemberMapper; @@ -81,6 +89,10 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { @Autowired private IBatchOperationService batchOperationService; + @Autowired + private IIntegralGlobalService integralGlobalService; + + /** * 查询用户 * @@ -189,33 +201,40 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { List needAddTagIdList = new ArrayList<>(); // 计算要删除的元素 List needDelTagIdList = new ArrayList<>(); - List miniTagIdList = wxUserMemberReq.getMiniProgramTags(); - List wecomTagIdList = wxUserMemberReq.getWecomTags(); + List miniTagIdList = Optional.ofNullable(wxUserMemberReq.getMiniProgramTags()).orElse(new ArrayList<>()); + List wecomTagIdList = Optional.ofNullable(wxUserMemberReq.getWecomTags()).orElse(new ArrayList<>()); if (existedTagIdList != null && existedTagIdList.size() > 0) { - if (miniTagIdList != null && miniTagIdList.size() > 0) { - needAddTagIdList.addAll(miniTagIdList.stream().filter(obj -> !existedTagIdList.contains(obj)).collect(Collectors.toList())); - needDelTagIdList.addAll(existedTagIdList.stream().filter(obj -> !miniTagIdList.contains(obj)).collect(Collectors.toList())); - } - if (wecomTagIdList != null && wecomTagIdList.size() > 0) { - needAddTagIdList.addAll(wecomTagIdList.stream().filter(obj -> !existedTagIdList.contains(obj)).collect(Collectors.toList())); - needDelTagIdList.addAll(existedTagIdList.stream().filter(obj -> !wecomTagIdList.contains(obj)).collect(Collectors.toList())); - } + needAddTagIdList.addAll(wecomTagIdList.stream().filter(obj -> !existedTagIdList.contains(obj)).distinct().collect(Collectors.toList())); + needAddTagIdList.addAll(miniTagIdList.stream().filter(obj -> !existedTagIdList.contains(obj)).distinct().collect(Collectors.toList())); + needDelTagIdList.addAll(existedTagIdList.stream().filter(obj -> !miniTagIdList.contains(obj) && !wecomTagIdList.contains(obj)).distinct().collect(Collectors.toList())); } else { - needAddTagIdList.addAll(miniTagIdList); - needAddTagIdList.addAll(wecomTagIdList); + if (CollectionUtils.isNotEmpty(miniTagIdList)) needAddTagIdList.addAll(miniTagIdList); + if (CollectionUtils.isNotEmpty(wecomTagIdList)) needAddTagIdList.addAll(wecomTagIdList); } // 2、删除被去除了标签 - wxUserTagMapper.deleteBatch(needDelTagIdList, wxUserMemberReq.getId().intValue(), null); + if (CollectionUtils.isNotEmpty(needDelTagIdList)) { + wxUserTagMapper.deleteBatch(needDelTagIdList, wxUserMemberReq.getId().intValue(), null); + } // 3、添加用户与标签的关联 List list = new ArrayList<>(); WxUserTag wxUserTag; - if (needAddTagIdList != null && needAddTagIdList.size() > 0) { - for (Integer addTagId : needAddTagIdList) { - wxUserTag = new WxUserTag(null, wxUserMember.getId().longValue(), null, addTagId.longValue(), TagTypeStatusEnum.MINI_PROGRAM.getCode(), null); - wxUserTag.setCreateTime(DateUtils.getNowDate()); - list.add(wxUserTag); + if (!needAddTagIdList.isEmpty()) { + if (miniTagIdList != null) { + for (Integer addTagId : miniTagIdList) { + wxUserTag = new WxUserTag(null, wxUserMember.getId(), null, addTagId.longValue(), TagTypeStatusEnum.MINI_PROGRAM.getCode(), null); + wxUserTag.setCreateTime(DateUtils.getNowDate()); + list.add(wxUserTag); + } + } + + if (wecomTagIdList != null) { + for(Integer addTagId : wecomTagIdList) { + wxUserTag = new WxUserTag(null, wxUserMember.getId(), null, addTagId.longValue(), TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode(), null); + wxUserTag.setCreateTime(DateUtils.getNowDate()); + list.add(wxUserTag); + } } wxUserTagMapper.insertBatch(list); } @@ -247,6 +266,67 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { } } + /** + * 同步积分到数云 + * @param memberId 用户id + */ + @Override + public void syncPointToShuYun(Long memberId) { + WxUserMember wxUserMember = Optional.ofNullable(wxUserMemberMapper.selectWxUserMemberById(memberId)).orElseThrow(() -> new ServiceException("用户信息不存在")); + Integer credit = wxUserMember.getCredit(); + Integer suYunPoint = null; + try { + // 获取数云积分 + ShuYunMember shuYunMember = ShuYunApiUtils.queryMember(wxUserMember.getUnionid(), shuYunConfig.getPlatCode(), shuYunConfig.getShopId()); + suYunPoint = Integer.valueOf(shuYunMember.getPoint()); + } catch (Exception exception) { + logger.error("【积分同步】-> 积分同步失败,用户id:{},错误原因:{}", memberId, exception.getLocalizedMessage(), exception); + throw new ServiceException("积分同步失败, 请重试"); + } + // 数云积分和现在积分一致 + if (Objects.equals(credit, suYunPoint)) { + return; + } + + // 积分不一致, 需要同步积分到数云 + if (Objects.nonNull(credit)) { + Integer syncPoint = credit - Optional.ofNullable(suYunPoint).orElse(0); + try { + // 同步积分差值到数云 + ShuYunPointChange shuYunPointChange = new ShuYunPointChange(wxUserMember.getUnionid(), + shuYunConfig.getPlatCode(), shuYunConfig.getShopId(), IdUtils.generateSequence(), + ShuYunPointSourceEnum.OTHER.getSource(), syncPoint, + LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.SYNC_MEMBER_POINT); + ShuYunApiUtils.pointChange(shuYunPointChange); + } catch (Exception exception) { + logger.error("【积分同步】-> 积分同步失败,用户id:{},错误原因:{}", memberId, exception.getLocalizedMessage(), exception); + throw new ServiceException("积分同步失败, 请重试"); + } + } + } + + /** + * 同步会员信息到数云 + * @param memberId 用户id + */ + @Override + public void syncMemberInfoToShuYun(Long memberId) { + try { + // 更新用户信息,同步到数云 + WxUserMember wxUserMember = Optional.ofNullable(wxUserMemberMapper.selectWxUserMemberById(memberId)).orElseThrow(() -> new ServiceException("用户信息不存在")); + ShuYunMember member = new ShuYunMember(); + member.setId(wxUserMember.getUnionid()); + member.setPlatCode(shuYunConfig.getPlatCode()); + member.setShopId(shuYunConfig.getShopId()); + member.setName(wxUserMember.getNickname()); + member.setBirthday(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, wxUserMember.getBirthday())); + ShuYunApiUtils.modifyMember(member); + } catch (Exception exception) { + logger.error("【个人信息同步】-> 个人信息同步失败,用户id:{},错误原因:{}", memberId, exception.getLocalizedMessage(), exception); + throw new ServiceException("个人信息同步失败, 请重试"); + } + } + /** * 批量删除用户 * @@ -258,12 +338,15 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { public int deleteWxUserMemberByIds(Long[] ids) { for (Long id : ids) { WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(id); + if (wxUserMember != null) { // sys_user 删除系统用户关联表 SysUser sysUser = sysUserService.selectUserByUserName(wxUserMember.getOpenid()); + if (sysUser != null) { sysUserService.deleteWxUserById(sysUser.getUserId()); } + // wx_user_integral_log 用户积分关联表 wxUserIntegralLogMapper.deleteWxUserIntegralLogByUserId(wxUserMember.getId()); // wx_no_remain_record 不提醒关联表 @@ -291,10 +374,43 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { wxInstrumentSerialMapper.updateBySerial(wxInstrumentSerial); } } + + // 扣减数云用户绑定仪器获得积分 + List instrumentIdList = wxUserInstrumentMapper.selectInstrumentIdListByUserId(id); + if (CollectionUtils.isNotEmpty(instrumentIdList)){ + Integer bindingCreditTotal = wxInstrumentMapper.selctBindingCreditTotal(instrumentIdList); + // 存在积分, 需要扣减 + if (bindingCreditTotal > 0) { + /** + * TODO: 修改操作日志状态(未完成) + */ + // 调用数云接口扣减 + ShuYunPointChange shuYunPointChange = new ShuYunPointChange(wxUserMember.getUnionid(), + shuYunConfig.getPlatCode(), shuYunConfig.getShopId(), IdUtils.generateSequence(), + ShuYunPointSourceEnum.OTHER.getSource(), bindingCreditTotal * -1, + LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.OFF_USER_INSTRUMENT); + ShuYunApiUtils.pointChange(shuYunPointChange); + } + } + // wx_user_instrument 用户仪器关联表 wxUserInstrumentMapper.deleteByUserId(wxUserMember.getId()); // wx_user_instrument_log 用户仪器关联表记录 wxUserInstrumentLogMapper.deleteByUserId(wxUserMember.getId()); + + // 是否已经完善用户信息, 扣减数云用户完善信息获得积分 + if (Objects.equals(wxUserMember.getIsCompleteInformation(), 1)) { + /** + * TODO: 修改操作日志状态(未完成) + */ + IntegralGlobal integralGlobal = integralGlobalService.selectIntegralGlobalList(new IntegralGlobal()).get(0); + + ShuYunPointChange shuYunPointChange = new ShuYunPointChange(wxUserMember.getUnionid(), + shuYunConfig.getPlatCode(), shuYunConfig.getShopId(), IdUtils.generateSequence(), + ShuYunPointSourceEnum.OTHER.getSource(), integralGlobal.getIntegral().intValue() * -1, + LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD_HH_MM_SS)), IntegralChangTextConstants.OFF_USER_IMPROVE_INFORMATION); + ShuYunApiUtils.pointChange(shuYunPointChange); + } } } // wx_user_member 微信用户表 @@ -359,7 +475,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { } } } else { - needAddTagIdList.containsAll(tagIdList); + needAddTagIdList.addAll(tagIdList); } // 2、添加用户与标签的关联 List list = new ArrayList<>(); @@ -533,7 +649,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService { wxUserMemberMapper.updateWxUserMember(update); } - @Override +// @Override public List selectWxUserMemberRetList(WxUserMemberVm wxUserMemberVm) { if (wxUserMemberVm.getWecomTags() != null) { wxUserMemberVm.setWecomTagNum(wxUserMemberVm.getWecomTags().size()); diff --git a/flossom-ui/src/api/system/member.js b/flossom-ui/src/api/system/member.js index aa58e8c..ad5fe9d 100644 --- a/flossom-ui/src/api/system/member.js +++ b/flossom-ui/src/api/system/member.js @@ -250,6 +250,22 @@ export function openOrCloseClock(id) { }) } +// 积分同步 +export function syncPointToShuYun(id) { + return request({ + url: '/system/member/sync/point/' + id, + method: 'post' + }) +} + +// 个人信息同步 +export function syncMemberInfoToShuYun(id) { + return request({ + url: '/system/member/sync/info/' + id, + method: 'post' + }) +} + // 开关活动 export function openOrCloseActivity(id) { return request({ diff --git a/flossom-ui/src/api/system/products.js b/flossom-ui/src/api/system/products.js new file mode 100644 index 0000000..9b5db34 --- /dev/null +++ b/flossom-ui/src/api/system/products.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询日化产品信息列表 +export function listProducts(query) { + return request({ + url: '/system/products/list', + method: 'get', + params: query + }) +} + +// 查询日化产品信息详细 +export function getProducts(id) { + return request({ + url: '/system/products/' + id, + method: 'get' + }) +} + +// 新增日化产品信息 +export function addProducts(data) { + return request({ + url: '/system/products', + method: 'post', + data: data + }) +} + +// 修改日化产品信息 +export function updateProducts(data) { + return request({ + url: '/system/products', + method: 'put', + data: data + }) +} + +// 删除日化产品信息 +export function delProducts(id) { + return request({ + url: '/system/products/' + id, + method: 'delete' + }) +} diff --git a/flossom-ui/src/views/system/findCarouselImage/index.vue b/flossom-ui/src/views/system/findCarouselImage/index.vue index 7f3647e..86ea34f 100644 --- a/flossom-ui/src/views/system/findCarouselImage/index.vue +++ b/flossom-ui/src/views/system/findCarouselImage/index.vue @@ -6,7 +6,7 @@ size="small" :inline="true" v-show="showSearch" - label-width="68px" + label-width="82px" > @@ -212,6 +212,7 @@ :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" + :before-upload="handleBeforeUpload" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" drag @@ -289,7 +290,7 @@ - + @@ -479,7 +480,8 @@ export default { ], pushTimerArray: [ {required: true, message: '自定义频次时间不能为空', trigger: 'blur',}, - ] + ], + signNumber: {type:'number', min:0,max:9999,message:'仅支持输入正整数,最多可输入4个字符', trigger: 'blur' } }, }; }, @@ -521,6 +523,7 @@ export default { // 取消按钮 cancel() { this.open = false; + this.$refs.upload.clearFiles(); this.reset(); }, // 图片上传 @@ -547,7 +550,7 @@ export default { channelId: null, instrumentId: null, operate: null, - signNumber: null, + signNumber: 0, userType: 2, orderNumber: 0, type: null, @@ -635,6 +638,16 @@ export default { this.getList() }) }, + goTypes(){ + console.log(1111); + this.form.link='' + this.form.linkParams='' + this.form.feedId='' + this.form.videoNo='' + this.form.redirectUrl='' + this.form.redirectAppid='' + // this.form.link='' + }, /** 提交按钮 */ submitForm() { this.$refs["form"].validate(valid => { @@ -663,6 +676,9 @@ export default { } else { this.form.operate = 2 } + this.form.siteType = 1 + this.form.startTime = [] + this.form.registerTime = [] if (this.form.id != null && this.operate == 'edit') { updateCarousel(this.form).then(response => { this.$modal.msgSuccess("修改成功"); diff --git a/flossom-ui/src/views/system/findProductStrategy/index.vue b/flossom-ui/src/views/system/findProductStrategy/index.vue index dcb0dcf..ced10e2 100644 --- a/flossom-ui/src/views/system/findProductStrategy/index.vue +++ b/flossom-ui/src/views/system/findProductStrategy/index.vue @@ -196,6 +196,7 @@ :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" + :before-upload="handleBeforeUpload" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" drag @@ -435,7 +436,7 @@ export default { fileUrl: [ { required: true, message: '轮播图片不能为空', trigger: 'blur' }, ], - siteName: [ + title: [ { required: true, message: '标题不能为空', trigger: 'blur' }, ], userType: [ @@ -510,6 +511,7 @@ export default { // 取消按钮 cancel() { this.open = false; + this.$refs.upload.clearFiles(); this.reset(); }, // 图片上传 @@ -653,6 +655,8 @@ export default { } else { this.form.operate = 2 } + this.form.startTime = [] + this.form.registerTime = [] if (this.form.id != null && this.operate == 'edit') { updateStrategy(this.form).then(response => { this.$modal.msgSuccess("修改成功"); diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index 9b6b8ff..9e6f2dd 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -128,6 +128,10 @@ + + + + @@ -156,7 +160,9 @@ -
只能上传jpg/png文件, 建议主图尺寸195px*160px
+
+ 只能上传jpg/png文件, 建议主图尺寸195px*160px +
@@ -185,7 +191,9 @@ -
只能上传jpg/png文件, 建议主图尺寸195px*160px
+
+ 只能上传jpg/png文件, 建议主图尺寸195px*160px +
@@ -214,7 +222,9 @@ -
只能上传jpg/png文件, 建议主图尺寸195px*160px
+
+ 只能上传jpg/png文件, 建议主图尺寸195px*160px +
@@ -225,7 +235,8 @@ + :file-list="manualFile.fileList" :before-upload="handleBeforeUpload" + :on-preview="writePreviewFile"> 点击上传
只能上传一个文件,且视频不超过10M,图片不超过1M @@ -302,8 +313,8 @@ - - + + @@ -317,25 +328,27 @@
- + 删除膜布 - + - + - + - + - + @@ -481,10 +494,12 @@ - + - + - + - + - + - + - + - +
@@ -678,14 +699,15 @@ @@ -752,17 +774,17 @@ import { import { getToken } from '@/utils/auth' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' -import { listLining } from "@/api/system/lining"; +import { listLining } from '@/api/system/lining' import { upload } from '@/api/upload' import draggable from 'vuedraggable' -import log from "@/views/monitor/job/log.vue"; +import log from '@/views/monitor/job/log.vue' let validateArrayNotEmpty = (rule, value, callback) => { - console.log(rule, value, callback, '查看'); + console.log(rule, value, callback, '查看') if (this.wxLiningList.length === 0) { - callback(new Error('数组不能为空')); + callback(new Error('数组不能为空')) } else { - callback(); + callback() } } export default { @@ -798,7 +820,6 @@ export default { }, data() { return { - // 遮罩层 loading: true, // 选中数组 @@ -1041,6 +1062,8 @@ export default { sortMode: [], }, newModeOptionList: [], + innerVisible:false, + innerImg:'' } }, created() { @@ -1067,6 +1090,7 @@ export default { }, // 表单重置 reset() { + this.WEClothShow = false this.nurseIndex = 0 this.nurseList = [ { @@ -1106,6 +1130,7 @@ export default { sceneNames: null, nursingTime: '00:00:00', iotVersion: null, + iotVersionName: null, iotUpgradeData: null, isScanCode: 0, isPurchase: 0, @@ -1130,6 +1155,7 @@ export default { modeIdsValue: [], newModeIdList: [], we200IotVersion: null, + we200IotVersionName: null, we200IotUpgradeData: null, we200IotVersionUpgrade: null, we200BluetoothConnecting: null, @@ -1247,21 +1273,20 @@ export default { if (response.data.length > 0) { response.data.map((item) => { if (item.modeDesc != null) { - item.modeName = item.modeName + "(" + item.modeDesc + ")"; + item.modeName = item.modeName + '(' + item.modeDesc + ')' } }) this.mode.modeIdsOptions = response.data - } }) - listLining().then(e => { - e.rows.forEach(item => { + listLining().then((e) => { + e.rows.forEach((item) => { this.ClothOptions.push({ value: item.id, - label: item.name + label: item.name, }) }) - console.log(this.ClothOptions, '111111'); + console.log(this.ClothOptions, '111111') }) }, /** 修改按钮操作 */ @@ -1270,11 +1295,11 @@ export default { this.Modetions = [] this.NewOptions = [] this.ClothOptions = [] + this.reset() const id = row.id || this.ids getInstrument(id).then((response) => { - - if (response.data.model === "WE200") { + if (response.data.model === 'WE200') { this.WEClothShow = true this.wxLiningList = response.data.wxLiningList @@ -1330,7 +1355,10 @@ export default { this.iotUpgradeFile = { uploadHide: true, fileList: [ - { name: 'iot升级数据文件', url: this.form.iotUpgradeData }, + { + name: this.form.iotVersionName || 'iot升级数据文件', + url: this.form.iotUpgradeData, + }, ], } } @@ -1339,7 +1367,10 @@ export default { this.we200IotUpgradeFile = { uploadHide: true, fileList: [ - { name: 'We200iot升级数据文件', url: this.form.we200IotUpgradeData }, + { + name: this.form.we200IotVersionName || 'We200iot升级数据文件', + url: this.form.we200IotUpgradeData, + }, ], } } @@ -1376,7 +1407,10 @@ export default { this.we200BluetoothConnectFile = { uploadHide: true, fileList: [ - { name: 'we200蓝牙连接文件', url: this.form.we200BluetoothConnecting }, + { + name: 'we200蓝牙连接文件', + url: this.form.we200BluetoothConnecting, + }, ], } } @@ -1405,18 +1439,17 @@ export default { instrumentType: this.form.type, instrumentModel: this.form.model, }).then((response) => { - if (response.code != 200) { this.$message.error('模式获取失败') } if (response.data.length > 0) { response.data.map((item) => { if (item.modeDesc != null) { - item.modeName = item.modeName + "(" + item.modeDesc + ")"; + item.modeName = item.modeName + '(' + item.modeDesc + ')' } }) this.mode.modeIdsOptions = response.data - this.Modetions = JSON.parse(JSON.stringify(response.data)); + this.Modetions = JSON.parse(JSON.stringify(response.data)) } /* 带new标识选项回显 */ @@ -1443,30 +1476,27 @@ export default { } /* 带new标识选项回显 */ - if ( - this.wxLiningList[0].modeList != null && - this.wxLiningList[0].modeList.length > 0 - ) { - let temp = [] - for (let i = 0; i < this.wxLiningList[0].modeList.length; i++) { - let filterModeArr = this.Modetions.filter( - (item) => - item !== undefined && this.wxLiningList[0].modeList[i] === item.id - ) - if (filterModeArr !== undefined && filterModeArr.length > 0) { - temp.push(filterModeArr[0]) + if (this.wxLiningList != null && this.wxLiningList.length > 0) { + let temp = [] + for (let j = 0; j < this.wxLiningList.length; j++) { + for (let i = 0; i < this.wxLiningList[j].modeList.length; i++) { + let filterModeArr = this.Modetions.filter( + (item) => + item !== undefined && + this.wxLiningList[j].modeList[i] === item.id + ) + if (filterModeArr !== undefined && filterModeArr.length > 0) { + temp.push(filterModeArr[0]) + } } } if (temp !== undefined && temp.length > 0) { // this.newModeOptionList = temp this.NewOptions = JSON.parse(JSON.stringify(temp)) - } } - - }) // IOT版本升级介绍 @@ -1478,18 +1508,16 @@ export default { this.form.we200IotVersionUpgrade ) - listLining().then(e => { - e.rows.forEach(item => { + listLining().then((e) => { + e.rows.forEach((item) => { this.ClothOptions.push({ value: item.id, - label: item.name + label: item.name, }) }) }) - console.log(this.ClothOptions,333333333333333); + console.log(this.ClothOptions, 333333333333333) }) - - }, /** 提交按钮 */ submitForm() { @@ -1527,16 +1555,26 @@ export default { if (this.form.model == 'WE200') { if (this.wxLiningList.length == 0) { - this.$modal.msgError('请添加膜布'); + this.$modal.msgError('请添加膜布') return } - console.log("wxLiningList => ", this.wxLiningList); + console.log('wxLiningList => ', this.wxLiningList) if (this.wxLiningList.length > 0) { - this.form.wxLiningList = this.wxLiningList; + for (let i = 0; i < this.wxLiningList.length; i++) { + if (this.wxLiningList[i].id == '') { + this.$modal.msgError('请选择第' + (i + 1) + '组膜布组的膜布名称') + return + } + if (this.wxLiningList[i].modeList.length == 0) { + this.$modal.msgError('请选择第' + (i + 1) + '组膜布组的模式名称') + return + } + } + this.form.wxLiningList = this.wxLiningList } } - console.log(this.form); + console.log(this.form) this.$refs['form'].validate((valid) => { if (valid) { if (this.form.id != null) { @@ -1607,7 +1645,7 @@ export default { this.logoFile.uploadHide = this.logoFile.fileList.length >= 1 }, logoUploadSuccess(response, file) { - console.log(111111111111111,response); + console.log(111111111111111, response) if (response.code == 200) { this.form.logo = response.data.url } else { @@ -1661,8 +1699,10 @@ export default { this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`) }, iotUpgradeUploadSuccess(response, file) { + console.log('iotUpgradeUploadSuccess file', file) if (response.code == 200) { this.form.iotUpgradeData = response.data.url + this.form.iotVersionName = file.name } else { this.$message.error('文件上传失败') } @@ -1674,6 +1714,7 @@ export default { we200IotUpgradeUploadSuccess(response, file) { if (response.code == 200) { this.form.we200IotUpgradeData = response.data.url + this.form.we200IotVersionName = file.name } else { this.$message.error('文件上传失败') } @@ -1767,19 +1808,18 @@ export default { // IOT仪器,模型默认 WL200 if (this.form.type == 2) { - console.log('进来了'); - this.form.model = 'WL200'; - - }else{ + console.log('进来了') + this.form.model = 'WL200' + } else { this.form.model = null } /* 模式选项 */ // 模式清空 - this.form.modeIdsValue = []; - this.modeIdsOptions = []; + this.form.modeIdsValue = [] + this.modeIdsOptions = [] // 带 new 标识模式清空 - this.form.newModeIdList = []; - this.newModeOptionList = []; + this.form.newModeIdList = [] + this.newModeOptionList = [] listAllMode({ instrumentType: this.form.type, instrumentModel: this.form.model, @@ -1803,43 +1843,49 @@ export default { this.form.bluetoothClosedTitle = null this.form.bluetoothClosedContent = null this.form.iotVersion = null + this.form.iotVersionName = null this.form.iotUpgradeData = null this.form.iotVersionUpgrade = null /* we200数据清空 */ - this.form.we200IotVersion = null; - this.form.we200IotUpgradeData = null; - this.form.we200IotVersionUpgrade = null; - this.we200BluetoothConnectFile = { - uploadHide: false, - fileList: [], - }, - this.form.we200BluetoothConnecting = null; - this.form.we200BluetoothConnectingTitle = null; - this.form.we200BluetoothConnectingContent = null; + this.form.we200IotVersion = null + this.form.we200IotVersionName = null + this.form.we200IotUpgradeData = null + this.form.we200IotVersionUpgrade = null + ; (this.we200BluetoothConnectFile = { + uploadHide: false, + fileList: [], + }), + (this.form.we200BluetoothConnecting = null) + this.form.we200BluetoothConnectingTitle = null + this.form.we200BluetoothConnectingContent = null // 仪器类型切换,关闭膜布选项 - this.WEClothShow = false; + this.WEClothShow = false // this.Modetions = []; // this.NewOptions = []; - this.wxLiningList = []; + this.wxLiningList = [] }, // 添加膜布 AddCloth() { this.wxLiningList.push({ id: '', modeList: '', - newModeIdList: '' + newModeIdList: '', }) }, + // 删除膜布 + delCloth(index) { + this.wxLiningList.splice(index, 1) + }, modelChange() { - console.log(this.form, '查看列表'); + console.log(this.form, '查看列表') if (this.form.model === 'WE200') { this.WEClothShow = true this.wxLiningList = [] listAllMode({ instrumentType: this.form.type, - instrumentModel: this.form.model + instrumentModel: this.form.model, }).then((response) => { if (response.code != 200) { this.$message.error('模式获取失败') @@ -1847,11 +1893,10 @@ export default { if (response.data.length > 0) { response.data.map((item) => { if (item.modeDesc != null) { - item.modeName = item.modeName + "(" + item.modeDesc + ")"; + item.modeName = item.modeName + '(' + item.modeDesc + ')' } }) this.Modetions = response.data - } }) } else { @@ -1866,11 +1911,11 @@ export default { this.mode.modeIdsOptions = [] // 清空模式和带new标识模式 // 模式清空 - this.form.modeIdsValue = []; - this.modeIdsOptions = []; + this.form.modeIdsValue = [] + this.modeIdsOptions = [] // 带 new 标识模式清空 - this.form.newModeIdList = []; - this.newModeOptionList = []; + this.form.newModeIdList = [] + this.newModeOptionList = [] // 获取对应模式 listAllMode({ instrumentType: this.form.type, @@ -1883,16 +1928,16 @@ export default { this.mode.modeIdsOptions = response.data }) /* 清空we200 对应的数据 */ - this.form.we200IotVersion = null; - this.form.we200IotUpgradeData = null; - this.form.we200IotVersionUpgrade = null; - this.we200BluetoothConnectFile = { - uploadHide: false, - fileList: [], - }, - this.form.we200BluetoothConnecting = null; - this.form.we200BluetoothConnectingTitle = null; - this.form.we200BluetoothConnectingContent = null; + this.form.we200IotVersion = null + this.form.we200IotUpgradeData = null + this.form.we200IotVersionUpgrade = null + ; (this.we200BluetoothConnectFile = { + uploadHide: false, + fileList: [], + }), + (this.form.we200BluetoothConnecting = null) + this.form.we200BluetoothConnectingTitle = null + this.form.we200BluetoothConnectingContent = null }, /* 是否购买切换 */ isPurchaseChang() { @@ -1950,13 +1995,6 @@ export default { }, /* 保存小程序标签 */ submitMiniProgramTagList() { - if ( - this.miniProgramTag.selectTagList == null || - this.miniProgramTag.selectTagList.length == 0 - ) { - this.$message.warning(`请选择小程序标签`) - return - } addInstrumentTag({ instrumentId: this.miniProgramTag.instrumentId, tagIdList: this.miniProgramTag.selectTagList, @@ -1969,13 +2007,6 @@ export default { }, /* 保存外部标签 */ submitWecomTagList() { - if ( - this.wecomTag.selectTagList == null || - this.wecomTag.selectTagList.length == 0 - ) { - this.$message.warning(`请选择外部标签`) - return - } addInstrumentTag({ instrumentId: this.wecomTag.instrumentId, tagIdList: this.wecomTag.selectTagList, @@ -2231,7 +2262,6 @@ export default { }, /* 模式 */ openModeIdDialog() { - this.mode.modeIdsValueTemp = [] this.mode.sortMode = [] if (this.form.modeIdsValue.length > 1) { @@ -2245,13 +2275,11 @@ export default { } }, handleCloseMode() { - this.mode.modeIdsValueTemp = [] this.mode.sortMode = [] this.mode.modeSortVisible = false }, handleSaveMode() { - let newSort = [] for (let i = 0; i < this.mode.modeIdsValueTemp.length; i++) { newSort.push(this.mode.modeIdsValueTemp[i].id) @@ -2260,7 +2288,6 @@ export default { this.handleCloseMode() }, modeIdsValueChang() { - let temp = [] if (this.form.modeIdsValue.length > 0) { for (let i = 0; i < this.form.modeIdsValue.length; i++) { @@ -2271,9 +2298,6 @@ export default { } } this.newModeOptionList = temp - - - }, clothmodeIdsValueChang(e) { let temp = [] @@ -2362,6 +2386,11 @@ export default { if (this.form.nursingTime == null) { this.form.nursingTime = '00:00:00' } + }, + writePreviewFile(file) { + this.innerVisible = true + this.innerImg = file.url + console.log(file); } }, } diff --git a/flossom-ui/src/views/system/lining/index.vue b/flossom-ui/src/views/system/lining/index.vue index bf2fc26..84bcaf0 100644 --- a/flossom-ui/src/views/system/lining/index.vue +++ b/flossom-ui/src/views/system/lining/index.vue @@ -1,293 +1,381 @@ diff --git a/flossom-ui/src/views/system/member/index.vue b/flossom-ui/src/views/system/member/index.vue index 2ac615d..efa4d8e 100644 --- a/flossom-ui/src/views/system/member/index.vue +++ b/flossom-ui/src/views/system/member/index.vue @@ -1,20 +1,13 @@