4.30推送

master
L14\huangyilong 2 years ago
parent 92811c515a
commit fe6a5d3c8b

@ -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 = "同步用户积分";
}

@ -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();
}
}

@ -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;
}
}

@ -69,6 +69,11 @@ public class WxNursingLog extends BaseEntity {
@Excel(name = "模式名称")
private String modeName;
/**
* key(使)
*/
private String modeNameKey;
/**
*
*/

@ -266,6 +266,16 @@ public class WxInstrumentSaveReq {
*/
private List<WxLining> 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<WxLining> 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;
}
}

@ -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<Integer> wecomTags, List<Integer> miniProgramTags, Integer clock, Integer activity, Date updateTime) {
public WxUserMemberReq(Long id, String nickname, String mobile, Long provinceId, Long cityId, Long areaId, List<Integer> wecomTags, List<Integer> 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;
}
}

@ -95,10 +95,6 @@ public class WxUserMemberVm extends BaseEntity {
*/
private Integer deviceNumEnd;
/**
*
*/
/**
*
*/
@ -119,6 +115,11 @@ public class WxUserMemberVm extends BaseEntity {
*/
List<Integer> miniProgramTags;
/**
* ()
*/
private Integer instrumentOrderBy;
/**
*
*/
@ -311,4 +312,12 @@ public class WxUserMemberVm extends BaseEntity {
public void setBirthdayRange(List<Date> birthdayRange) {
this.birthdayRange = birthdayRange;
}
public Integer getInstrumentOrderBy() {
return instrumentOrderBy;
}
public void setInstrumentOrderBy(Integer instrumentOrderBy) {
this.instrumentOrderBy = instrumentOrderBy;
}
}

@ -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;
}
}

@ -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<WxClockInstrumentLog> selectWxClockInstrumentLogList(WxClockInstrumentLog wxClockInstrumentLog);
public List<WxClockInstrumentLog> selectWxClockInstrumentLogList(@Param("item") WxClockInstrumentLog wxClockInstrumentLog, @Param("params") Map<String, Object> params);
/**
* 使

@ -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<WxDailyCareProducts> 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);
}

@ -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<WxFindTag> selectWxFindTagByIdList(@Param("tagIdList")List<Long> tagIdList);
}

@ -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<WxInstrument> selectBindingInstrumentListByUserId(Long userId);
List<WxInstrument> selectUnbindingInstrumentListByUserId(Long userId);
/**
* id
* @return id
*/
List<WxInstrumentVO> selectIdAndName();
/**
* id
* @param instrumentIdList id
* @return
*/
Integer selctBindingCreditTotal(@Param("instrumentIdList") List<Long> instrumentIdList);
}

@ -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<String> feelingType;
/**
*
*/
private Double pullingSeconds;
/**
*
*/
private Double moisturizeSeconds;
/**
*
*/
private Double eyeSculptSeconds;
public PartitionConfigResponse() {
}
public PartitionConfigResponse(List<String> feelingType, Double pullingSeconds, Double moisturizeSeconds, Double eyeSculptSeconds) {
this.feelingType = feelingType;
this.pullingSeconds = pullingSeconds;
this.moisturizeSeconds = moisturizeSeconds;
this.eyeSculptSeconds = eyeSculptSeconds;
}
public List<String> getFeelingType() {
return feelingType;
}
public void setFeelingType(List<String> 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;
}
}

@ -30,6 +30,11 @@ public class WxAnswerResponse {
*/
private List<EyeNursingElectricFormulaResponse> electricFormulaList;
/**
*
*/
private List<PartitionConfigResponse> partitionConfigArray;
public List<EyeNursingElectricFormulaResponse> getElectricFormulaList() {
return electricFormulaList;
}
@ -61,4 +66,12 @@ public class WxAnswerResponse {
public void setRedarScoreList(List<RedarScoreResponse> redarScoreList) {
this.redarScoreList = redarScoreList;
}
public List<PartitionConfigResponse> getPartitionConfigArray() {
return partitionConfigArray;
}
public void setPartitionConfigArray(List<PartitionConfigResponse> partitionConfigArray) {
this.partitionConfigArray = partitionConfigArray;
}
}

@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by d.parent_id, d.order_num
order by d.parent_id, d.order_num desc
</select>
<select id="selectDeptListByRoleId" resultType="Long">

@ -21,10 +21,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWxClockInstrumentLogList" parameterType="com.flossom.common.core.domain.entity.WxClockInstrumentLog" resultMap="WxClockInstrumentLogResult">
<include refid="selectWxClockInstrumentLogVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="item.userId != null "> and user_id = #{item.userId}</if>
<if test="item.instrumentId != null "> and instrument_id = #{item.instrumentId}</if>
<if test="item.instrumentName != null and item.instrumentName != ''"> and instrument_name like concat('%', #{item.instrumentName}, '%')</if>
<if test="item.status != null "> and status = #{item.status}</if>
<if test="params != null and params.beginTime != null">
and create_time &gt;= #{params.beginTime}
</if>

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flossom.common.core.mapper.WxDailyCareProductsMapper">
<resultMap type="com.flossom.common.core.domain.entity.WxDailyCareProducts" id="WxDailyCareProductsResult">
<result property="id" column="id" />
<result property="productName" column="product_name" />
<result property="productImg" column="product_img" />
<result property="introduce" column="introduce" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWxDailyCareProductsVo">
select id, product_name, product_img, introduce, create_by, create_time, update_by, update_time from wx_daily_care_products
</sql>
<select id="selectWxDailyCareProductsList" parameterType="com.flossom.common.core.domain.entity.WxDailyCareProducts" resultMap="WxDailyCareProductsResult">
<include refid="selectWxDailyCareProductsVo"/>
<where>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productImg != null and productImg != ''"> and product_img = #{productImg}</if>
<if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
</where>
order by update_time desc
</select>
<select id="selectWxDailyCareProductsById" parameterType="java.lang.Long" resultMap="WxDailyCareProductsResult">
<include refid="selectWxDailyCareProductsVo"/>
where id = #{id}
</select>
<insert id="insertWxDailyCareProducts" parameterType="com.flossom.common.core.domain.entity.WxDailyCareProducts" useGeneratedKeys="true" keyProperty="id">
insert into wx_daily_care_products
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productName != null and productName != ''">product_name,</if>
<if test="productImg != null and productImg != ''">product_img,</if>
<if test="introduce != null and introduce != ''">introduce,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productName != null and productName != ''">#{productName},</if>
<if test="productImg != null and productImg != ''">#{productImg},</if>
<if test="introduce != null and introduce != ''">#{introduce},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWxDailyCareProducts" parameterType="com.flossom.common.core.domain.entity.WxDailyCareProducts">
update wx_daily_care_products
<trim prefix="SET" suffixOverrides=",">
<if test="productName != null and productName != ''">product_name = #{productName},</if>
<if test="productImg != null and productImg != ''">product_img = #{productImg},</if>
<if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxDailyCareProductsById" parameterType="java.lang.Long">
delete from wx_daily_care_products where id = #{id}
</delete>
<delete id="deleteWxDailyCareProductsByIds" parameterType="java.lang.String">
delete from wx_daily_care_products where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -153,10 +153,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="title != null">title = #{title},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="siteStartTime != null">site_start_time = #{siteStartTime},</if>
<if test="siteEndTime != null">site_end_time = #{siteEndTime},</if>
<if test="userRegisterStartTime != null">user_register_start_time = #{userRegisterStartTime},</if>
<if test="userRegisterEndTime != null">user_register_end_time = #{userRegisterEndTime},</if>
site_start_time = #{siteStartTime},
site_end_time = #{siteEndTime},
user_register_start_time = #{userRegisterStartTime},
user_register_end_time = #{userRegisterEndTime},
<if test="showWechatTagId != null">show_wechat_tag_id = #{showWechatTagId},</if>
<if test="showCompanyTagId != null">show_company_tag_id = #{showCompanyTagId},</if>
<if test="forbidWechatTagId != null">forbid_wechat_tag_id = #{forbidWechatTagId},</if>

@ -153,10 +153,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="title != null">title = #{title},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="siteStartTime != null">site_start_time = #{siteStartTime},</if>
<if test="siteEndTime != null">site_end_time = #{siteEndTime},</if>
<if test="userRegisterStartTime != null">user_register_start_time = #{userRegisterStartTime},</if>
<if test="userRegisterEndTime != null">user_register_end_time = #{userRegisterEndTime},</if>
site_start_time = #{siteStartTime},
site_end_time = #{siteEndTime},
user_register_start_time = #{userRegisterStartTime},
user_register_end_time = #{userRegisterEndTime},
<if test="showWechatTagId != null">show_wechat_tag_id = #{showWechatTagId},</if>
<if test="showCompanyTagId != null">show_company_tag_id = #{showCompanyTagId},</if>
<if test="forbidWechatTagId != null">forbid_wechat_tag_id = #{forbidWechatTagId},</if>

@ -34,6 +34,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxFindTagByIdList" resultType="com.flossom.common.core.domain.entity.WxFindTag">
<include refid="selectWxFindTagVo"/>
where id IN
<foreach collection="tagIdList" item="id" separator="," open="(" close=")">
#{id}
</foreach>
and del_flag = 0
</select>
<select id="selectWxFindTagById" parameterType="Long" resultMap="WxFindTagResult">
<include refid="selectWxFindTagVo"/>

@ -55,10 +55,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="we200BluetoothConnectingTitle" column="we200_bluetooth_connecting_title" />
<result property="we200BluetoothConnectingContent" column="we200_bluetooth_connecting_content" />
<result property="we200BluetoothConnecting" column="we200_bluetooth_connecting" />
<result property="iotVersionName" column="iot_version_name" />
<result property="we200IotVersionName" column="we200_iot_version_name" />
</resultMap>
<sql id="selectWxInstrumentVo">
select id, name, type, model, banner, logo, serial, guarantee, daily_clock_credit, is_extra_clock, binding_credit, extra_clock_credit, start_time, end_time, mini_tag_ids, mini_tag_names, wecom_tag_ids, wecom_tag_names, nursing_time, iot_version, iot_upgrade_data, is_scan_code, is_purchase, shopping_appid, shopping_path, bluetooth_connecting_title, bluetooth_connecting_content,bluetooth_connecting, bluetooth_closed_title, bluetooth_closed_content, bluetooth_closed, bluetooth_connect_fail_title, bluetooth_connect_fail_content, bluetooth_connect_fail, iot_version_upgrade, sort_no, status, manual_code_binding, scan_code_binding, create_by, create_time, update_by, update_time, remark, we200_iot_version, we200_iot_upgrade_data, we200_iot_version_upgrade, we200_bluetooth_connecting_title, we200_bluetooth_connecting_content, we200_bluetooth_connecting from wx_instrument
select id, name, type, model, banner, logo, serial, guarantee, daily_clock_credit, is_extra_clock, binding_credit, extra_clock_credit, start_time,
end_time, mini_tag_ids, mini_tag_names, wecom_tag_ids, wecom_tag_names, nursing_time, iot_version, iot_upgrade_data, is_scan_code, is_purchase,
shopping_appid, shopping_path, bluetooth_connecting_title, bluetooth_connecting_content,bluetooth_connecting, bluetooth_closed_title, bluetooth_closed_content,
bluetooth_closed, bluetooth_connect_fail_title, bluetooth_connect_fail_content, bluetooth_connect_fail, iot_version_upgrade, sort_no, status, manual_code_binding,
scan_code_binding, create_by, create_time, update_by, update_time, remark, we200_iot_version, we200_iot_upgrade_data, we200_iot_version_upgrade,
we200_bluetooth_connecting_title, we200_bluetooth_connecting_content, we200_bluetooth_connecting,iot_version_name,we200_iot_version_name from wx_instrument
</sql>
<select id="selectWxInstrumentList" parameterType="com.flossom.common.core.domain.entity.WxInstrument" resultMap="WxInstrumentResult">
@ -108,6 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200BluetoothConnectingTitle != null and we200BluetoothConnectingTitle != ''"> and we200_bluetooth_connecting_title = #{we200BluetoothConnectingTitle}</if>
<if test="we200BluetoothConnectingContent != null and we200BluetoothConnectingContent != ''"> and we200_bluetooth_connecting_content = #{we200BluetoothConnectingContent}</if>
<if test="we200BluetoothConnecting != null and we200BluetoothConnecting != ''"> and we200_bluetooth_connecting = #{we200BluetoothConnecting}</if>
<if test="iotVersionName != null and iotVersionName != ''"> and iot_version_name = #{iotVersionName}</if>
<if test="we200IotVersionName != null and we200IotVersionName != ''"> and we200_iot_version_name = #{we200IotVersionName}</if>
</where>
order by create_time desc
</select>
@ -119,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="type != null "> and type = #{type}</if>
</where>
order by create_time desc
order by sort_no desc, coalesce(update_time, create_time) desc
</select>
<select id="selectWxInstrumentById" parameterType="Long" resultMap="WxInstrumentResult">
@ -161,6 +170,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY ins.sort_no DESC
</select>
<select id="selectIdAndName" resultType="com.flossom.common.core.domain.vo.WxInstrumentVO">
SELECT id, name FROM wx_instrument
</select>
<select id="selctBindingCreditTotal" resultType="int">
SELECT sum(binding_credit) FROM wx_instrument
WHERE id IN
<foreach item="id" collection="instrumentIdList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertWxInstrument" parameterType="com.flossom.common.core.domain.entity.WxInstrument" useGeneratedKeys="true" keyProperty="id">
<selectKey keyProperty="id" resultType="Long" order="AFTER">
SELECT LAST_INSERT_ID()
@ -216,6 +238,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200BluetoothConnectingTitle != null">we200_bluetooth_connecting_title,</if>
<if test="we200BluetoothConnectingContent != null">we200_bluetooth_connecting_Content,</if>
<if test="we200BluetoothConnecting != null">we200_bluetooth_connecting,</if>
<if test="iotVersionName != null">iot_version_name,</if>
<if test="we200IotVersionName != null">we200_iot_version_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
@ -267,6 +291,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200BluetoothConnectingTitle != null">#{we200BluetoothConnectingTitle},</if>
<if test="we200BluetoothConnectingContent != null">#{we200BluetoothConnectingContent},</if>
<if test="we200BluetoothConnecting != null">#{we200BluetoothConnecting},</if>
<if test="iotVersionName != null">#{iotVersionName},</if>
<if test="we200IotVersionName != null">#{we200IotVersionName},</if>
</trim>
</insert>
@ -322,6 +348,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="we200BluetoothConnectingTitle != null">we200_bluetooth_connecting_title = #{we200BluetoothConnectingTitle},</if>
<if test="we200BluetoothConnectingContent != null">we200_bluetooth_connecting_content = #{we200BluetoothConnectingContent},</if>
<if test="we200BluetoothConnecting != null">we200_bluetooth_connecting = #{we200BluetoothConnecting},</if>
<if test="iotVersionName != null">iot_version_name = #{iotVersionName},</if>
<if test="we200IotVersionName != null">we200_iot_version_name = #{we200IotVersionName},</if>
</trim>
where id = #{id}
</update>

@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWxNursingLogList" parameterType="com.flossom.common.core.domain.entity.WxNursingLog" resultMap="WxNursingLogResult">
<include refid="selectWxNursingLogVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="instrumentName != null "> and instrument_name = #{instrumentName}</if>

@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="serial != null and serial != ''"> and serial like concat('%', #{serial}, '%')</if>
<if test="bindingStatus != null "> and binding_status = #{bindingStatus}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="instrumentIds != null">
and instrument_id in
<foreach item="instrumentId" collection="instrumentIds.split(',')" open="(" separator="," close=")">
@ -197,6 +198,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectInstrumentIdListByUserId" resultType="long">
select id from wx_user_instrument where user_id = #{userId}
select instrument_id from wx_user_instrument where user_id = #{userId}
</select>
</mapper>

@ -467,7 +467,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
and member.status = 0
</where>
order by member.id desc
<if test="null != instrumentOrderBy and instrumentOrderBy == 1">
ORDER BY devices_num
</if>
<if test="null != instrumentOrderBy and instrumentOrderBy == 2">
ORDER BY devices_num desc
</if>
<if test="null == instrumentOrderBy or instrumentOrderBy == 0">
order by member.devices_num desc, member.id desc
</if>
</select>

@ -22,13 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectWxUserTagList" parameterType="com.flossom.common.core.domain.entity.WxUserTag" resultMap="WxUserTagResult">
<include refid="selectWxUserTagVo"/>
select wut.id, wut.user_id, t.tag_name, wut.tag_id, wut.type, wut.status, wut.create_by, wut.create_time, wut.update_by, wut.update_time
from sys_tag t left join wx_user_tag wut on t.id=wut.tag_id
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="tagName != null and tagName != ''"> and tag_name like concat('%', #{tagName}, '%')</if>
<if test="tagId != null "> and tag_id = #{tagId}</if>
<if test="type != null "> and type = #{type}</if>
<if test="status != null "> and status = #{status}</if>
<if test="userId != null "> and wut.user_id = #{userId}</if>
<if test="tagName != null and tagName != ''"> and t.tag_name like concat('%', #{tagName}, '%')</if>
<if test="tagId != null "> and wut.tag_id = #{tagId}</if>
<if test="type != null "> and wut.type = #{type}</if>
<if test="status != null "> and wut.status = #{status}</if>
</where>
</select>

@ -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;

@ -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<WxFindTag> addMiniTagList = wxFindTagMapper.selectWxFindTagList(wxFindTag);
if (addMiniTagList != null && addMiniTagList.size() > 0) {
List<Long> 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<WxFindTag> addWecomTagList = wxFindTagMapper.selectWxFindTagList(wxFindTag);
if (addWecomTagList != null && addWecomTagList.size() > 0) {
List<Long> 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<Long> tagIdList, Long userId, Integer code) {
// 对单个标签操作
List<SysTag> sysTagList = sysTagMapper.selectDataListByIds(tagIdList);
Map<Long, SysTag> sysTagMap = sysTagList.stream().collect(Collectors.toMap(SysTag::getId, Function.identity(), (v1, v2) -> v1));
// 2、添加用户与标签的关联
List<WxUserTag> list = new ArrayList<>();
for (Long tagId : tagIdList) {
SysTag sysTag = sysTagMap.get(tagId);
if (sysTag != null) {
// 1、查询该标签下有那些用户关联
List<Integer> 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: 对接数赢:批量添加小程序标签
}
}

@ -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();
}
}

@ -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<WxFindProductStrategy> 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();
}
}

@ -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 -------------------*/
/**

@ -37,4 +37,13 @@ public interface IWxNursingLogService {
List<WxNursingLog> fr200MoistureTestRecord(Long instrumentId, Date queryDate);
List<WxNursingLog> fr200RecordOther(Long nursingLogId);
/**
* id
* @param id id
* @param nursingTimeStr
* @param modeId id
* @return
*/
Integer getNursingTimePercentage(Long id, String nursingTimeStr, Long modeId);
}

@ -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<WxClockLog> 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<WxClockInstrumentLog> wxClockInstrumentLogList = wxClockInstrumentLogMapper.selectWxClockInstrumentLogList(queryInstrumentLog);
List<WxClockInstrumentLog> 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<WxClockLogRet> selectWxClockLogList(WxClockLog queryClockLog) {
List<WxClockLogRet> list = wxClockLogMapper.selectWxClockImgRetList(queryClockLog);
if (list != null && list.size() > 0) {
Map<Long,String> 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<WxClockImg> wxClockImgs = wxClockImgMapper.selectWxClockImgList(wxClockImg);

@ -50,7 +50,7 @@ public class WxFindCarouselServiceMiniImpl implements IWxFindCarouselMiniService
if (CollectionUtils.isNotEmpty(wxFindCarousels)) {
return filterWxFindCarousel(wxFindCarousels);
}
return null;
return new ArrayList<>();
}
/**

@ -50,7 +50,7 @@ public class WxFindProductStrategyMiniServiceImpl implements IWxFindProductStrat
if (CollectionUtils.isNotEmpty(wxFindProductStrategyList)) {
return fileData(wxFindProductStrategyList);
}
return null;
return new ArrayList<>();
}
/**

@ -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<String, List<EyeNursingElectricFormulaVo>> formulaVoMap = JSONObject.parseArray(eyeNursingElectricFormulaJson, EyeNursingElectricFormulaVo.class)
.stream().collect(Collectors.groupingBy(EyeNursingElectricFormulaVo::getRequirementSelection));
// 获取制定配置数据
List<EyeNursingElectricFormulaResponse> 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<EyeNursingElectricFormulaVo> eyeNursingElectricFormulaVos = formulaVoMap.get(ordCode.toString());
if (CollectionUtils.isNotEmpty(eyeNursingElectricFormulaVos)) {
List<EyeNursingElectricFormulaResponse> eyeNursingElectricFormulaResponseList = new ArrayList<>();
List<PartitionConfigResponse> partitionConfigResponses = new ArrayList<>();
// 额取时间
Double pullingSeconds = new Double("0");
// 左右眼周时间
Double eyePullingSeconds = new Double("0");
List<String> 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;

@ -110,6 +110,23 @@ public class WxLiningServiceImpl implements IWxLiningService {
moisturizing = jsonArray.get(5);
customizationElectricFormulaVo.setFeelingType("Moisturize");
}
// 第二题为左右脸, 需要添加两次
if (i == 1) {
if (quest1 == 2) {// 全选时,对应 jsonArray 下标 01
promote = jsonArray.get(0);
moisturizing = jsonArray.get(1);
customizationElectricFormulaVo.setFeelingType("Mix");
} else if (quest1 == 0) {// 提拉时,对应 jsonArray 下标 23
promote = jsonArray.get(2);
moisturizing = jsonArray.get(3);
customizationElectricFormulaVo.setFeelingType("Pulling");
} else {// 滋润时,对应 jsonArray 下标 45
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);

@ -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<WxNursingLog> 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<Integer> 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<WxNursingLog> 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());

@ -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);

@ -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: 调用数云接口获取即将过期的积分值(已完成)

@ -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<WxDailyCareProducts> 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<WxDailyCareProducts> list = wxDailyCareProductsService.selectWxDailyCareProductsList(wxDailyCareProducts);
ExcelUtil<WxDailyCareProducts> util = new ExcelUtil<WxDailyCareProducts>(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));
}
}

@ -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());

@ -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();
}
/**
*
*/

@ -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);

@ -137,4 +137,5 @@ public interface ISysTagService
List<Map<String, Object>> getMiniProgramTags();
List<Map<String, Object>> getWecomTags();
}

@ -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<WxDailyCareProducts> 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);
}

@ -112,4 +112,16 @@ IWxUserMemberService
void syncShuYunUserTag(List<ShuYunBatchTagOperation> shuYunBatchTagOperationList);
void syncShuYunIntegral(List<ShuYunPointChange> shuYunPointChangeList);
/**
*
* @param memberId id
*/
void syncPointToShuYun(Long memberId);
/**
*
* @param memberId id
*/
void syncMemberInfoToShuYun(Long memberId);
}

@ -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) {

@ -149,15 +149,15 @@ public class SiteInfoServiceImpl implements ISiteInfoService
*/
@Override
public List<SiteInfo> selectSiteInfoList(SiteInfo siteInfo) {
return siteInfoMapper.selectSiteInfoList(siteInfo).stream()
.map(item-> {
List<SiteInfo> siteInfos = siteInfoMapper.selectSiteInfoList(siteInfo);
siteInfos.forEach(item-> {
String instrumentId = item.getInstrumentId();
if (StringUtils.isNotEmpty(instrumentId)) {
List<Long> machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList());
item.setMachineArray(machineArray);
}
return item;
}).collect(Collectors.toList());
});
return siteInfos;
}
/**

@ -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<SysTag> buildDeptTree(List<SysTag> tags) {
List<SysTag> returnList = new ArrayList<SysTag>();
List<Long> tempList = tags.stream().map(SysTag::getId).collect(Collectors.toList());
List<Long> 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<TreeSelect> buildDeptTreeSelect(List<SysTag> tags) {
List<SysTag> 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<SysTag> list, SysTag t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}

@ -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<WxDailyCareProducts> 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);
}
}

@ -142,15 +142,14 @@ public class WxFindCarouselServiceImpl implements IWxFindCarouselService {
*/
@Override
public List<WxFindCarousel> selectWxFindCarouselList(WxFindCarousel wxFindCarousel) {
return wxFindCarouselMapper.selectWxFindCarouselList(wxFindCarousel).stream()
.map(item-> {
String instrumentId = item.getInstrumentId();
if (StringUtils.isNotEmpty(instrumentId)) {
List<Long> machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList());
item.setMachineArray(machineArray);
}
return item;
}).collect(Collectors.toList());
List<WxFindCarousel> wxFindCarousels = wxFindCarouselMapper.selectWxFindCarouselList(wxFindCarousel);
wxFindCarousels.forEach(item-> {
String instrumentId = item.getInstrumentId();
if (StringUtils.isNotEmpty(instrumentId)) {
List<Long> machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList());
item.setMachineArray(machineArray);
}});
return wxFindCarousels;
}
/**

@ -144,7 +144,14 @@ public class WxFindProductStrategyServiceImpl implements IWxFindProductStrategyS
*/
@Override
public List<WxFindProductStrategy> selectWxFindProductStrategyList(WxFindProductStrategy wxFindProductStrategy) {
return wxFindProductStrategyMapper.selectWxFindProductStrategyList(wxFindProductStrategy);
List<WxFindProductStrategy> wxFindProductStrategyList = wxFindProductStrategyMapper.selectWxFindProductStrategyList(wxFindProductStrategy);
wxFindProductStrategyList.forEach(item-> {
String instrumentId = item.getInstrumentId();
if (StringUtils.isNotEmpty(instrumentId)) {
List<Long> machineArray = Arrays.stream(instrumentId.split(",")).map(Long::parseLong).collect(Collectors.toList());
item.setMachineArray(machineArray);
}});
return wxFindProductStrategyList;
}
/**

@ -94,8 +94,8 @@ public class WxInstrumentTagServiceImpl implements IWxInstrumentTagService {
@Override
public int addInstrumentTag(WxInstrumentTagReq wxInstrumentTagReq) {
List<Long> 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;
}
}

@ -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<Integer> needAddTagIdList = new ArrayList<>();
// 计算要删除的元素
List<Integer> needDelTagIdList = new ArrayList<>();
List<Integer> miniTagIdList = wxUserMemberReq.getMiniProgramTags();
List<Integer> wecomTagIdList = wxUserMemberReq.getWecomTags();
List<Integer> miniTagIdList = Optional.ofNullable(wxUserMemberReq.getMiniProgramTags()).orElse(new ArrayList<>());
List<Integer> 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<WxUserTag> 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<Long> 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<WxUserTag> list = new ArrayList<>();
@ -533,7 +649,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
wxUserMemberMapper.updateWxUserMember(update);
}
@Override
// @Override
public List<WxUserMemberRet> selectWxUserMemberRetList(WxUserMemberVm wxUserMemberVm) {
if (wxUserMemberVm.getWecomTags() != null) {
wxUserMemberVm.setWecomTagNum(wxUserMemberVm.getWecomTags().size());

@ -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({

@ -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'
})
}

@ -6,7 +6,7 @@
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
label-width="82px"
>
<el-form-item label="轮播图状态" prop="operate">
<el-select v-model="queryParams.operate" placeholder="请选择轮播图状态" :style="{ width: '100%' }" clearable>
@ -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 @@
<el-row>
<el-col :span="24">
<el-form-item label="跳转类型" prop="type">
<el-select v-model="form.type">
<el-select v-model="form.type" @change="goTypes">
<el-option label="无跳转" :value="0" :key="0"></el-option>
<el-option label="跳转内部链接" :value="1" :key="1"></el-option>
<el-option label="跳转小程序" :value="4" :key="4"></el-option>
@ -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("修改成功");

@ -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("修改成功");

@ -128,6 +128,10 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 图片或视频预览 -->
<el-dialog width="500rpx" :visible.sync="innerVisible" append-to-body>
<el-image :src="innerImg"></el-image>
</el-dialog>
<!-- 添加或修改仪器列对话框 -->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="180px">
@ -156,7 +160,9 @@
</span>
</span>
</div>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件, 建议主图尺寸195px*160px</div>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件, 建议主图尺寸195px*160px
</div>
</el-upload>
<!-- 预览窗口 -->
<el-dialog :visible.sync="bannerFile.dialogVisible" append-to-body>
@ -185,7 +191,9 @@
</span>
</span>
</div>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件, 建议主图尺寸195px*160px</div>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件, 建议主图尺寸195px*160px
</div>
</el-upload>
<!-- 预览窗口 -->
<el-dialog :visible.sync="logoFile.dialogVisible" append-to-body>
@ -214,7 +222,9 @@
</span>
</span>
</div>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件, 建议主图尺寸195px*160px</div>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件, 建议主图尺寸195px*160px
</div>
</el-upload>
<!-- 预览窗口 -->
<el-dialog :visible.sync="serialFile.dialogVisible" append-to-body>
@ -225,7 +235,8 @@
<el-form-item label="手写绑定介绍视频/图片" prop="manualCodeBinding">
<el-upload class="upload-demo" :action="uploadUrl" :headers="headers" :limit="1"
:on-exceed="manualUploadExceed" :on-success="manualUploadSuccess" :on-error="uploadError"
:file-list="manualFile.fileList" :before-upload="handleBeforeUpload">
:file-list="manualFile.fileList" :before-upload="handleBeforeUpload"
:on-preview="writePreviewFile">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
只能上传一个文件且视频不超过10M图片不超过1M
@ -302,8 +313,8 @@
<el-option label="IOT仪器" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="form.type === 2" label="仪器型号" prop="model">
<el-select v-model="form.model" @change="modelChange" style="width: 50%" >
<el-form-item v-if="form.type === 2" label="仪器ID" prop="model">
<el-select v-model="form.model" @change="modelChange" style="width: 50%">
<el-option v-for="dict in dict.type.instrument_model" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
@ -317,25 +328,27 @@
<div v-for="(item, index) in wxLiningList" :key="index">
<el-form-item label="膜布组">
<el-button v-show="wxLiningList.length > 1" type="primary"
@click="delCloth(index)">删除膜布</el-button>
</el-form-item>
<el-form-item label="膜布名称" :prop="`liningName${index}`">
<el-form-item label="膜布名称" :prop="`liningName${index}`" class="is-required">
<el-select v-model="item.id" placeholder="请选择">
<el-option v-for="e in ClothOptions" :key="e.value" :label="e.label"
:value="e.value">
<el-option v-for="e in ClothOptions" :key="e.value" :label="e.label" :value="e.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="模式名称" :prop="`liningMode${index}`">
<el-form-item label="模式名称" :prop="`liningMode${index}`" class="is-required">
<el-select v-model="item.modeList" multiple placeholder="请选择"
@change="clothmodeIdsValueChang(item)">
<el-option v-for="item1 in Modetions" :key="item1.id":label="item1.modeName" :value="item1.id">
<el-option v-for="item1 in Modetions" :key="item1.id" :label="item1.modeName"
:value="item1.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="带NEW标识模式名称" :prop="`liningNewMode${index}`">
<el-select v-model="item.newModeIdList" multiple placeholder="请选择">
<el-option v-for="(item2, index) in NewOptions" :key="item2.id" :label="item2.modeName" :value="item2.id">
<el-option v-for="(item2, index) in NewOptions" :key="item2.id" :label="item2.modeName"
:value="item2.id">
</el-option>
</el-select>
</el-form-item>
@ -481,10 +494,12 @@
</el-upload>
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙连接中标题" prop="bluetoothConnectingTitle">
<el-input v-model="form.bluetoothConnectingTitle" placeholder="请输入蓝牙连接中标题" maxlength="20" show-word-limit/>
<el-input v-model="form.bluetoothConnectingTitle" placeholder="请输入蓝牙连接中标题" maxlength="20"
show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙连接中文案" prop="bluetoothConnectingContent">
<el-input v-model="form.bluetoothConnectingContent" placeholder="请输入蓝牙连接中文案" maxlength="50" show-word-limit/>
<el-input v-model="form.bluetoothConnectingContent" placeholder="请输入蓝牙连接中文案" maxlength="50"
show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙连接失败图片" prop="bluetoothConnectFail">
<el-upload class="upload-demo" :action="uploadUrl" :headers="headers" :limit="1"
@ -496,10 +511,12 @@
</el-upload>
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙连接失败标题" prop="bluetoothConnectFailTitle">
<el-input v-model="form.bluetoothConnectFailTitle" placeholder="请输入蓝牙连接失败标题" maxlength="20" show-word-limit/>
<el-input v-model="form.bluetoothConnectFailTitle" placeholder="请输入蓝牙连接失败标题" maxlength="20"
show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙连接失败文案" prop="bluetoothConnectFailContent">
<el-input v-model="form.bluetoothConnectFailContent" placeholder="请输入蓝牙连接失败文案" maxlength="50" show-word-limit/>
<el-input v-model="form.bluetoothConnectFailContent" placeholder="请输入蓝牙连接失败文案" maxlength="50"
show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙断开连接图片" prop="bluetoothClosed">
<el-upload class="upload-demo" :action="uploadUrl" :headers="headers" :limit="1"
@ -511,10 +528,12 @@
</el-upload>
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙断开连接标题" prop="bluetoothClosedTitle">
<el-input v-model="form.bluetoothClosedTitle" placeholder="请输入蓝牙断开连接标题" maxlength="20" show-word-limit/>
<el-input v-model="form.bluetoothClosedTitle" placeholder="请输入蓝牙断开连接标题" maxlength="20"
show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2" label="蓝牙断开连接文案" prop="bluetoothClosedContent">
<el-input v-model="form.bluetoothClosedContent" placeholder="请输入蓝牙断开连接文案" maxlength="50" show-word-limit/>
<el-input v-model="form.bluetoothClosedContent" placeholder="请输入蓝牙断开连接文案" maxlength="50"
show-word-limit />
</el-form-item>
<!-- we200蓝牙链接图片 -->
<el-form-item v-if="form.type == 2 && form.model === 'WL200'" label="we200蓝牙连接中图片"
@ -529,11 +548,13 @@
</el-form-item>
<el-form-item v-if="form.type == 2 && form.model === 'WL200'" label="we200蓝牙连接中标题"
prop="we200BluetoothConnectingTitle">
<el-input v-model="form.we200BluetoothConnectingTitle" placeholder="请输入we200蓝牙连接中标题" maxlength="20" show-word-limit/>
<el-input v-model="form.we200BluetoothConnectingTitle" placeholder="请输入we200蓝牙连接中标题" maxlength="20"
show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2 && form.model === 'WL200'" label="we200蓝牙连接中文案"
prop="we200BluetoothConnectingContent">
<el-input v-model="form.we200BluetoothConnectingContent" placeholder="请输入we200蓝牙连接中文案" maxlength="50" show-word-limit/>
<el-input v-model="form.we200BluetoothConnectingContent" placeholder="请输入we200蓝牙连接中文案"
maxlength="50" show-word-limit />
</el-form-item>
<el-form-item v-if="form.type == 2" label="IOT版本" prop="iotVersion">
<div style="position: relative">
@ -678,14 +699,15 @@
<template slot-scope="scope">
<el-upload ref="bookUpload" class="upload-demo" :action="uploadUrl" :headers="headers"
:limit="1" :on-exceed="instructionUploadExceed" :on-success="(response, file, fileList) => {
return instructionUploadSuccess(
response,
file,
fileList,
scope.$index
)
}
" :on-error="uploadError" :file-list="scope.row.fileList" accept=".pdf,.PDF" :before-upload="pdfHandleBeforeUpload">
return instructionUploadSuccess(
response,
file,
fileList,
scope.$index
)
}
" :on-error="uploadError" :file-list="scope.row.fileList" accept=".pdf,.PDF"
:before-upload="pdfHandleBeforeUpload">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</template>
@ -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);
}
},
}

@ -1,293 +1,381 @@
<template>
<div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
<el-tab-pane :label="item.code" :name="item.code" v-for="(item, index) of liningList">
<div style="width: 200px; float: left;">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<!-- 左侧表单项 -->
<div class="form-top">
<div class="form-top--left">
<el-form-item label="膜布名称" prop="name" style="width: 500px">
<el-input v-model="item.name" placeholder="请输入膜布名称"/>
</el-form-item>
<el-form-item label="购买入口是否显示" label-width="150px" prop="name" style="width: 500px">
<el-switch
v-model="item.isShowBuy == 1"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item label="购买商城appid" label-width="150px" prop="skipAppid" style="width: 500px">
<el-input v-model="item.skipAppid" placeholder="请输入购买商城appid"/>
</el-form-item>
<el-form-item label="膜布图标" prop="icon" width="150px">
<template>
<!-- 膜布图标 -->
<el-upload
ref="upload"
:action="uploadUrl"
:headers="headers"
:file-list="item.fileList"
list-type="picture-card"
accept=".jpg,.png"
:limit="1"
:class="{ hide: item.uploadHide }"
:on-remove="iconUploadRemove"
:on-success="iconUploadSuccess"
:on-error="uploadError"
:before-upload="handleBeforeUploadImage"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{ file }">
<img :src="file.url" class="el-upload-list__item-thumbnail" alt=""/>
<span class="el-upload-list__item-actions">
<span @click="iconPicturePreview(file)" class="el-upload-list__item-preview">
<i class="el-icon-zoom-in"></i>
</span>
<span v-if="!disabled" @click="iconUploadRemove(file)" class="el-upload-list__item-delete">
<i class="el-icon-delete"></i>
</span>
</span>
</div>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload>
<!-- 预览窗口 -->
<el-dialog :visible.sync="dialogVisible" append-to-body>
<img width="100%" :src="dialogImageUrl" alt=""/>
</el-dialog>
</template>
</el-form-item>
</div>
<!-- 右侧表单项 -->
<div class="form-top--right">
<el-form-item label="膜布描述" prop="desc" style="width: 500px">
<el-input v-model="item.desc" placeholder="请输入膜布描述"/>
</el-form-item>
<el-form-item style="height: 36px"/>
<el-form-item label="购买商城PATH" label-width="150px" prop="skipPath" style="width: 500px">
<el-input v-model="item.skipPath" placeholder="请输入购买商城PATH"/>
</el-form-item>
</div>
</div>
</el-form>
<div slot="footer" class="dialog-footer" style="margin-left: 90%;">
<el-button type="primary" @click="submitForm(item)"> </el-button>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
<el-tab-pane
:label="item.code"
:name="item.code"
:key="item.code"
v-for="(item, index) of liningList"
>
<div style="width: 200px; float: left">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<!-- 左侧表单项 -->
<div class="form-top">
<div class="form-top--left">
<el-form-item
label="膜布名称"
prop="name"
style="width: 500px"
class="is-required"
>
<el-input v-model="item.name" placeholder="请输入膜布名称" />
</el-form-item>
<el-form-item
class="is-required"
label="购买入口是否显示"
label-width="150px"
prop="name"
style="width: 500px"
>
<el-switch
v-model="item.isShowBuyOpen"
active-color="#13ce66"
inactive-color="#ff4949"
>
</el-switch>
</el-form-item>
<el-form-item
v-show="item.isShowBuyOpen"
class="is-required"
label="购买商城appid"
label-width="150px"
prop="skipAppid"
style="width: 500px"
>
<el-input
v-model="item.skipAppid"
placeholder="请输入购买商城appid"
/>
</el-form-item>
<el-form-item
class="is-required"
label="膜布图标"
prop="icon"
width="150px"
>
<template>
<!-- 膜布图标 -->
<el-upload
ref="upload"
:action="uploadUrl"
:headers="headers"
:file-list="item.fileList"
list-type="picture-card"
accept=".jpg,.png"
:limit="1"
:class="{ hide: item.uploadHide }"
:on-remove="iconUploadRemove"
:on-success="iconUploadSuccess"
:on-error="uploadError"
:before-upload="handleBeforeUploadImage"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{ file }">
<img
:src="file.url"
class="el-upload-list__item-thumbnail"
alt=""
/>
<span class="el-upload-list__item-actions">
<span
@click="iconPicturePreview(file)"
class="el-upload-list__item-preview"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
@click="iconUploadRemove(file)"
class="el-upload-list__item-delete"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件
</div>
</el-upload>
<!-- 预览窗口 -->
<el-dialog :visible.sync="dialogVisible" append-to-body>
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</template>
</el-form-item>
</div>
<!-- 右侧表单项 -->
<div class="form-top--right">
<el-form-item label="膜布描述" prop="desc" style="width: 500px">
<el-input v-model="item.desc" placeholder="请输入膜布描述" />
</el-form-item>
<el-form-item style="height: 36px" />
<el-form-item
v-show="item.isShowBuyOpen"
class="is-required"
label="购买商城PATH"
label-width="150px"
prop="skipPath"
style="width: 500px"
>
<el-input
v-model="item.skipPath"
placeholder="请输入购买商城PATH"
/>
</el-form-item>
</div>
</div>
</el-form>
<div slot="footer" class="dialog-footer" style="margin-left: 90%">
<el-button type="primary" @click="submitForm(item)"
> </el-button
>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {listLining, getLining, delLining, addLining, updateLining} from "@/api/system/lining";
import {getToken} from "@/utils/auth";
import {
listLining,
getLining,
delLining,
addLining,
updateLining,
} from '@/api/system/lining'
import { getToken } from '@/utils/auth'
export default {
name: "Lining",
data() {
return {
//
activeName: "M01",
/* 文件上传地址 */
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload',
headers: {
Authorization: 'Bearer ' + getToken(),
},
fileList: [
[], []
],
//
// uploadHide: false,
disabled: false,
dialogImageUrl: '',
dialogVisible: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
liningList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
desc: null,
isShowBuy: null,
skipAppid: null,
skipPath: null,
icon: null,
status: null,
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询膜布列表 */
getList() {
this.loading = true;
listLining().then(response => {
response?.rows?.forEach(item => {
this.liningList.push({
...item,
//
uploadHide: item?.icon != null,
fileList: [{
name: item?.icon,
url: item?.icon
}]
})
})
console.log(this.liningList);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
code: null,
name: null,
desc: null,
isShowBuy: null,
skipAppid: null,
skipPath: null,
icon: null,
status: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getLining(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改膜布";
});
},
/** 提交按钮 */
submitForm(item) {
this.form = item;
this.form.icon = item.fileList[0].url;
if (this.form.id != null) {
updateLining(this.form).then(response => {
if (response.code == 200) {
this.$modal.msgSuccess("修改成功");
} else {
this.$modal.msgError("修改失败");
}
});
} else {
addLining(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
},
iconUploadRemove(file, fileList) {
this.liningList.forEach(e => {
if (this.activeName === e.code) {
e.fileList = [];
e.uploadHide = false;
}
})
},
iconUploadSuccess(response, file) {
if (response.code == 200) {
this.form.banner = response.data.url
this.liningList.forEach(e => {
if (this.activeName === e.code) {
e.fileList = [{
name: response.data.url,
url: response.data.url
}];
e.uploadHide = true;
}
})
} else {
this.$message.error('图片插入失败')
}
},
handleBeforeUploadImage(file) {
let fileType = ['jpg', 'png', 'JPG', 'PNG']
const fileName = file.name.split('.')
const fileExt = fileName[fileName.length - 1]
const isTypeOk = fileType.indexOf(fileExt) >= 0
if (!isTypeOk) {
this.$modal.msgError(`文件类型只能为jpg格式/png格式`)
return false
}
return true
},
iconPicturePreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
/* 文件上传失败 */
uploadError() {
this.$message.error('文件上传失败')
},
handleClick(tab, event) {
console.log(tab, event);
},
}
};
name: 'Lining',
data() {
return {
//
activeName: 'M01',
/* 文件上传地址 */
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload',
headers: {
Authorization: 'Bearer ' + getToken(),
},
fileList: [[], []],
//
// uploadHide: false,
disabled: false,
dialogImageUrl: '',
dialogVisible: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
liningList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
desc: null,
isShowBuy: null,
skipAppid: null,
skipPath: null,
icon: null,
status: null,
},
//
form: {},
//
rules: {},
}
},
created() {
this.getList()
},
methods: {
/** 查询膜布列表 */
getList() {
this.loading = true
listLining().then((response) => {
response?.rows?.forEach((item) => {
this.liningList.push({
...item,
//
isShowBuyOpen: item?.isShowBuy == 1,
uploadHide: item?.icon != null,
fileList: [
{
name: item?.icon,
url: item?.icon,
},
],
})
})
console.log(this.liningList)
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
code: null,
name: null,
desc: null,
isShowBuy: null,
isShowBuyOpen: false,
skipAppid: null,
skipPath: null,
icon: null,
status: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
}
this.resetForm('form')
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getLining(id).then((response) => {
this.form = response.data
this.open = true
this.title = '修改膜布'
})
},
/** 提交按钮 */
submitForm(item) {
this.form = item
this.form.icon = item.fileList[0].url
this.form.isShowBuy = item.isShowBuyOpen ? 1 : 0
if (this.form.name == '') {
this.$modal.msgError('请输入膜布名称')
return
}
if (this.form.name.length > 15) {
this.$modal.msgError('膜布名称的长度不能超出15个字符')
return
}
if (this.form.desc != '' && this.form.desc.length > 30) {
this.$modal.msgError('膜布描述的长度不能超出30个字符')
return
}
if (this.form.isShowBuyOpen && this.form.skipAppid == '') {
this.$modal.msgError('请输入购买商城appid')
return
}
if (this.form.isShowBuyOpen && this.form.skipPath == '') {
this.$modal.msgError('请输入购买商城PATH')
return
}
if (this.form.id != null) {
updateLining(this.form).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('修改成功')
} else {
this.$modal.msgError('修改失败')
}
})
} else {
addLining(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
},
iconUploadRemove(file, fileList) {
this.liningList.forEach((e) => {
if (this.activeName === e.code) {
e.fileList = []
e.uploadHide = false
}
})
},
iconUploadSuccess(response, file) {
if (response.code == 200) {
this.form.banner = response.data.url
this.liningList.forEach((e) => {
if (this.activeName === e.code) {
e.fileList = [
{
name: response.data.url,
url: response.data.url,
},
]
e.uploadHide = true
}
})
} else {
this.$message.error('图片插入失败')
}
},
handleBeforeUploadImage(file) {
let fileType = ['jpg', 'png', 'JPG', 'PNG']
const fileName = file.name.split('.')
const fileExt = fileName[fileName.length - 1]
const isTypeOk = fileType.indexOf(fileExt) >= 0
if (!isTypeOk) {
this.$modal.msgError(`文件类型只能为jpg格式/png格式`)
return false
}
return true
},
iconPicturePreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
/* 文件上传失败 */
uploadError() {
this.$message.error('文件上传失败')
},
handleClick(tab, event) {
console.log(tab, event)
},
},
}
</script>
<style lang="scss" scoped>
.app-container {
.form-top {
display: flex;
justify-content: space-between;
.form-top {
display: flex;
justify-content: space-between;
.form-top--right {
flex: 1;
}
}
.form-top--right {
flex: 1;
}
}
.form-bottom {
display: flex;
justify-content: flex-end;
}
.form-bottom {
display: flex;
justify-content: flex-end;
}
::v-deep .hide .el-upload--picture-card {
display: none;
}
::v-deep .hide .el-upload--picture-card {
display: none;
}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,381 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="日化产品名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入日化产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:products:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:products:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:products:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:products:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="productsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="日化产品名称" align="center" prop="productName" />
<el-table-column label="日化产品图片" align="center" prop="productImg" width="150px">
<template slot-scope="scope">
<el-image :src="scope.row.productImg" style="width: 100px; height: 100px"
:preview-src-list="[scope.row.productImg]">
<div slot="placeholder" class="image-slot">
<span class="dot"></span>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="介绍文案" align="center" prop="introduce" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:products:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:products:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改日化产品信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="日化产品名称" prop="productName">
<el-input v-model="form.productName" placeholder="请输入日化产品名称" />
</el-form-item>
<el-form-item label="日化产品图片" prop="productImg">
<el-upload
ref="uplodProductImg"
:action="upload.url"
:headers="upload.headers"
:file-list="bannerFile.fileList"
list-type="picture-card"
:on-preview="handlePreviewFile"
:on-exceed="handleExceed"
:on-success="handleBannerFileSuccess"
:before-upload="limitImageFileType"
:on-remove="handleRemoveBanner"
accept=".jpeg,.jpg,.png"
:limit="1"
>
<i class="el-icon-plus"></i>
<div slot="tip" class="el-upload__tip">只能上传jpg/png图片</div>
</el-upload>
<!-- 预览窗口 -->
<el-dialog :visible.sync="bannerFile.dialogVisible" append-to-body>
<img width="100%" :src="bannerFile.dialogImageUrl" alt="" />
</el-dialog>
</el-form-item>
<el-form-item label="介绍文案" prop="introduce">
<el-input v-model="form.introduce" placeholder="请输入介绍文案" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProducts, getProducts, delProducts, addProducts, updateProducts } from "@/api/system/products";
import { getToken } from '@/utils/auth'
export default {
name: "Products",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
productsList: [],
//
title: "",
//
open: false,
bannerList: [],
dialogImageUrl: '',
dialogVisible: false,
//
upload: {
//
open: false,
//
title: '',
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/file/upload',
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
productName: null,
productImg: null,
introduce: null,
},
bannerFile: {
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
},
//
form: {},
//
rules: {
productName: [
{ required: true, message: "日化产品名称不能为空", trigger: "blur" },
{ min: 0, max: 20, message: "日化产品名称最多不能超出20个字符", trigger: "change"}
],
productImg: [
{ required: true, message: "日化产品图片不能为空", trigger: "blur" }
],
introduce: [
{ required: true, message: "介绍文案不能为空", trigger: "blur" },
{ min: 0, max: 50, message: "介绍文案最多不能超出50个字符", trigger: "change"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询日化产品信息列表 */
getList() {
this.loading = true;
listProducts(this.queryParams).then(response => {
this.productsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
productName: null,
productImg: null,
introduce: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.bannerFile={
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加日化产品信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getProducts(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改日化产品信息";
//
this.bannerFile = {
uploadHide: true,
dialogImageUrl: this.form.productImg,
dialogVisible: false,
disabled: false,
fileList: [{ name: '', url: this.form.productImg }],
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateProducts(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProducts(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除日化产品信息编号为"' + ids + '"的数据项?').then(function() {
return delProducts(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/products/export', {
...this.queryParams
}, `products_${new Date().getTime()}.xlsx`)
},
limitImageFileType(file) {
const imageType = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg']
let isVideo = imageType.includes(file.type)
//
if (!isVideo) {
this.$message.error(`图片格式错误!`)
return false
}
//
let fileSize = 5
if (fileSize) {
let isLt = file.size / 1024 / 1024 < fileSize
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${fileSize} MB!`)
return false
}
}
return true
},
handlePreviewFile(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
handleExceed(files){
this.$refs['uplodProductImg'].clearFiles();
this.$refs['uplodProductImg'].handleStart(files[0]);
this.$refs['uplodProductImg'].submit();
},
//
handleBannerFileSuccess(response, file, fileList, item) {
console.log('上传后的结果==>', JSON.stringify(response))
if (response.code == '200') {
this.form.productImg = response.data.url
}
},
handleRemoveBanner(file, fileList) {
this.bannerFile.fileList = []
this.form.productImg = ""
},
}
};
</script>

@ -581,7 +581,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="clickReset"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>

@ -573,7 +573,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="clickReset"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>

@ -11,14 +11,6 @@ const name = process.env.VUE_APP_TITLE || "花至管理系统"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80; // 端口
function getTargetUrl() {
if (process.env.NODE_ENV === "local") {
return "http://110.41.134.131:8080"; // 纯前端代理地址
} else {
return `http://localhost:8080`;
}
}
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档

Loading…
Cancel
Save