fhx
2023-12-18 3edb86cc566b063d36575223548f0af08cb11c32
Merge remote-tracking branch 'origin/master-prod-new' into master-prod-new
2个文件已添加
14个文件已修改
453 ■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/MicroRecordMapper.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/tool/AppealTypeTool.java 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/platform/MicroRecordMapper.xml 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/platform/OrderItemMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/consultation/ConsultationRecordController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/deduction/DeductionController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/micro/MicroRecordController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/deduction/impl/DeductionSingleServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/mirco/impl/MircoRecordServiceImpl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/order/impl/OrderRefundServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/NewOrderPayUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderPayMoneyUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderPayUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/UserProjectUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/MicroRecordMapper.java
New file
@@ -0,0 +1,37 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.micro.MicroRecord;
public interface MicroRecordMapper {
    /**新增,返回主键*/
    int insert(MicroRecord microRecord);
    /**新增,返回主键*/
    int insertById(MicroRecord microRecord);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<MicroRecord> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    MicroRecord selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    MicroRecord selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    MicroRecord selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(MicroRecord microRecord);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/tool/AppealTypeTool.java
@@ -2,7 +2,6 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hx.common.service.CommonService;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.appeal.AppealType;
@@ -22,14 +21,10 @@
 */
public class AppealTypeTool {
    public static void orderProjectInsert(String orderId, String orderItemId, List<String> appealTypeIdList, CommonService commonService){
        if(appealTypeIdList == null || appealTypeIdList.size() < 1){
    public static void orderProjectInsert(String orderId, String orderItemId, List<AppealTypeVo> appealTypeVoList, CommonService commonService){
        if(appealTypeVoList == null || appealTypeVoList.size() < 1){
            return;
        }
        List<AppealTypeVo> appealTypeVoList = getAppealTypeListByIdList(appealTypeIdList, commonService);
        OrderAppealType orderAppeelType;
        for(AppealTypeVo appealTypeVo : appealTypeVoList){
            orderAppeelType = new OrderAppealType();
@@ -57,23 +52,24 @@
        AppealTypeVo appealTypeVo;
        //获取子类所有分类,包含自己转载对象
        List<AppealType> appealTypeList;
        for(String appealTypeId : appealTypeIdList){
            if(StringUtils.isEmpty(appealTypeId)){
                continue;
            }
            ////获取子类所有分类,包含自己
            values.clear();
            values.put("sonTypeId", appealTypeId);
            appealTypeList = commonService.selectList(AppealTypeMapper.class,sqlSentence);
            for(AppealType appealType2:appealTypeList){
                appealTypeVo = new AppealTypeVo();
                appealTypeVo.setId(appealType2.getId());
                appealTypeVo.setName(appealType2.getName());
                appealTypeVo.setParentId(appealType2.getFatherId());
                appealTypeVoList.add(appealTypeVo);
        if (appealTypeIdList != null && appealTypeIdList.size() > 0){
            for(String appealTypeId : appealTypeIdList){
                if(StringUtils.isEmpty(appealTypeId)){
                    continue;
                }
                ////获取子类所有分类,包含自己
                values.clear();
                values.put("sonTypeId", appealTypeId);
                appealTypeList = commonService.selectList(AppealTypeMapper.class,sqlSentence);
                for(AppealType appealType2:appealTypeList){
                    appealTypeVo = new AppealTypeVo();
                    appealTypeVo.setId(appealType2.getId());
                    appealTypeVo.setName(appealType2.getName());
                    appealTypeVo.setParentId(appealType2.getFatherId());
                    appealTypeVoList.add(appealTypeVo);
                }
            }
        }
        return appealTypeVoList;
    }
@@ -99,6 +95,51 @@
        return arr;
    }
    /**
     * 拼接诉求分类名称
     * 此方法只支持一二三级都只是一个的
     * */
    public static String getStr(List<AppealTypeVo> appealTypeVoList) {
        //父级标识
        String parenId = "";
        //二级名称拼接
        StringBuilder towName = new StringBuilder();
        //三级名称拼接
        StringBuilder threeName = new StringBuilder();
        //父级标识,当前数据
        Map<String,AppealTypeVo> parentMap = new HashMap<>();
        //循环
        for (AppealTypeVo appealTypeVo : appealTypeVoList) {
            if (StringUtils.isEmpty(appealTypeVo.getParentId())){
                parenId = appealTypeVo.getId();
                towName.append(appealTypeVo.getName());
                threeName.append(appealTypeVo.getName());
            }else {
                parentMap.put(appealTypeVo.getParentId(),appealTypeVo);
            }
        }
        //二级
        AppealTypeVo secondVo = parentMap.get(parenId);
        if (secondVo != null){
            if (towName.length() > 0){
                towName.append("/").append(secondVo.getName());
            }
            if (threeName.length() > 0){
                threeName.append("/").append(secondVo.getName());
            }
            //三级
            AppealTypeVo thirdVo = parentMap.get(secondVo.getId());
            if (thirdVo != null){
                if (threeName.length() > 0){
                    threeName.append("/").append(thirdVo.getName());
                }
            }
        }
        return towName.append("-").append(threeName).toString();
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////
phi_platform_common/src/main/resources/mapper/platform/MicroRecordMapper.xml
New file
@@ -0,0 +1,90 @@
<?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">
<!-- namespace:该mapper.xml映射文件的 唯一标识 -->
<mapper namespace="com.hx.phip.dao.mapper.MicroRecordMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,userId = #{userId},userName = #{userName},CIQ = #{CIQ},userLevel = #{userLevel},userStatus = #{userStatus},userConsultantId = #{userConsultantId},userConsultantName = #{userConsultantName},userShopId = #{userShopId},userShopName = #{userShopName},platformType = #{platformType},opId = #{opId},opName = #{opName},opShopId = #{opShopId},opRoleId = #{opRoleId},opRoleStr = #{opRoleStr},visitOrderId = #{visitOrderId},isView = #{isView},isDraft = #{isDraft},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.micro.MicroRecord">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into micro_record (id,userId,userName,CIQ,userLevel,userStatus,userConsultantId,userConsultantName,userShopId,userShopName,platformType,opId,opName,opShopId,opRoleId,opRoleStr,visitOrderId,isView,isDraft,isDel,createTime,editTime)  values (#{id},#{userId},#{userName},#{CIQ},#{userLevel},#{userStatus},#{userConsultantId},#{userConsultantName},#{userShopId},#{userShopName},#{platformType},#{opId},#{opName},#{opShopId},#{opRoleId},#{opRoleStr},#{visitOrderId},#{isView},#{isDraft},#{isDel},#{createTime},#{editTime})
    </insert>
    <insert id="insertById" parameterType="com.hx.phiappt.model.micro.MicroRecord">
        insert into micro_record (id,userId,userName,CIQ,userLevel,userStatus,userConsultantId,userConsultantName,userShopId,userShopName,platformType,opId,opName,opShopId,opRoleId,opRoleStr,visitOrderId,isView,isDraft,isDel,createTime,editTime)  values (#{id},#{userId},#{userName},#{CIQ},#{userLevel},#{userStatus},#{userConsultantId},#{userConsultantName},#{userShopId},#{userShopName},#{platformType},#{opId},#{opName},#{opShopId},#{opRoleId},#{opRoleStr},#{visitOrderId},#{isView},#{isDraft},#{isDel},#{createTime},#{editTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.micro.MicroRecord" parameterType="com.hx.mybatisTool.SqlSentence" >
        ${sqlSentence}
    </select>
    <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
    </select>
    <select id="selectOne" resultType="com.hx.phiappt.model.micro.MicroRecord" parameterType="com.hx.mybatisTool.SqlSentence" >
        ${sqlSentence}
    </select>
    <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
    </select>
    <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            select
                COUNT(*)
            from micro_record
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.micro.MicroRecord" parameterType="java.lang.Object" >
        select
            id,userId,userName,CIQ,userLevel,userStatus,userConsultantId,userConsultantName,userShopId,userShopName,platformType,opId,opName,opShopId,opRoleId,opRoleStr,visitOrderId,isView,isDraft,isDel,createTime,editTime
        from micro_record
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.micro.MicroRecord" parameterType="java.lang.Object" >
        select
            id,userId,userName,CIQ,userLevel,userStatus,userConsultantId,userConsultantName,userShopId,userShopName,platformType,opId,opName,opShopId,opRoleId,opRoleStr,visitOrderId,isView,isDraft,isDel,createTime,editTime
        from micro_record
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            micro_record
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.micro.MicroRecord">
        update micro_record
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from micro_record WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from micro_record WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/platform/OrderItemMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,orderNo = #{orderNo},performId = #{performId},orderId = #{orderId},commonItemId = #{commonItemId},remarks = #{remarks},userCardId = #{userCardId},commonId = #{commonId},platformType = #{platformType},platformTypeId = #{platformTypeId},platformTypeName = #{platformTypeName},type = #{type},goodsNo = #{goodsNo},goodsName = #{goodsName},goodsImage = #{goodsImage},specs = #{specs},single = #{single},isLimitBug = #{isLimitBug},bodyPartsId = #{bodyPartsId},bodyPartsName = #{bodyPartsName},specsName = #{specsName},aptitudeNo = #{aptitudeNo},aptitudeName = #{aptitudeName},doctorQualification = #{doctorQualification},oriPrice = #{oriPrice},proPrice = #{proPrice},discount = #{discount},curPrice = #{curPrice},buyNum = #{buyNum},total = #{total},actualTotal = #{actualTotal},userPaidTotal = #{userPaidTotal},noDeductionAmount = #{noDeductionAmount},payTotal = #{payTotal},payRecharge = #{payRecharge},payIncrement = #{payIncrement},snapPayTotal = #{snapPayTotal},discountPrice = #{discountPrice},activityPrice = #{activityPrice},discountOrderPrice = #{discountOrderPrice},discountIntegral = #{discountIntegral},originalIntegral = #{originalIntegral},proIntegral = #{proIntegral},sellPoints = #{sellPoints},oriIntegralTotal = #{oriIntegralTotal},proIntegralTotal = #{proIntegralTotal},totalPoints = #{totalPoints},shouldTotalPoints = #{shouldTotalPoints},actualTotalPoints = #{actualTotalPoints},hasReNum = #{hasReNum},reTotal = #{reTotal},reIntegralTotal = #{reIntegralTotal},reCashTotal = #{reCashTotal},reCashPurenessTotal = #{reCashPurenessTotal},reRechargeTotal = #{reRechargeTotal},reIncrementTotal = #{reIncrementTotal},usedTotal = #{usedTotal},payStatus = #{payStatus},refundStatus = #{refundStatus},isSpa = #{isSpa},transferIntoShopId = #{transferIntoShopId},transferIntoShopName = #{transferIntoShopName},isTransfer = #{isTransfer},isTurn = #{isTurn},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
            ,orderNo = #{orderNo},performId = #{performId},orderId = #{orderId},commonItemId = #{commonItemId},remarks = #{remarks},userCardId = #{userCardId},commonId = #{commonId},platformType = #{platformType},platformTypeId = #{platformTypeId},platformTypeName = #{platformTypeName},type = #{type},goodsNo = #{goodsNo},goodsName = #{goodsName},goodsImage = #{goodsImage},specs = #{specs},single = #{single},isLimitBug = #{isLimitBug},bodyPartsId = #{bodyPartsId},bodyPartsName = #{bodyPartsName},specsName = #{specsName},aptitudeNo = #{aptitudeNo},aptitudeName = #{aptitudeName},doctorQualification = #{doctorQualification},oriPrice = #{oriPrice},proPrice = #{proPrice},discount = #{discount},curPrice = #{curPrice},buyNum = #{buyNum},total = #{total},actualTotal = #{actualTotal},userPaidTotal = #{userPaidTotal},noDeductionAmount = #{noDeductionAmount},payTotal = #{payTotal},payRecharge = #{payRecharge},payIncrement = #{payIncrement},snapPayTotal = #{snapPayTotal},discountPrice = #{discountPrice},activityPrice = #{activityPrice},discountOrderPrice = #{discountOrderPrice},discountIntegral = #{discountIntegral},originalIntegral = #{originalIntegral},proIntegral = #{proIntegral},sellPoints = #{sellPoints},oriIntegralTotal = #{oriIntegralTotal},proIntegralTotal = #{proIntegralTotal},totalPoints = #{totalPoints},shouldTotalPoints = #{shouldTotalPoints},actualTotalPoints = #{actualTotalPoints},hasReNum = #{hasReNum},reTotal = #{reTotal},reIntegralTotal = #{reIntegralTotal},reCashTotal = #{reCashTotal},reCashPurenessTotal = #{reCashPurenessTotal},reRechargeTotal = #{reRechargeTotal},reIncrementTotal = #{reIncrementTotal},usedTotal = #{usedTotal},payStatus = #{payStatus},refundStatus = #{refundStatus},isSpa = #{isSpa},appealSecond = #{appealSecond},appealThird = #{appealThird},transferIntoShopId = #{transferIntoShopId},transferIntoShopName = #{transferIntoShopName},isTransfer = #{isTransfer},isTurn = #{isTurn},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
        </trim>
    </sql>
     
@@ -19,11 +19,11 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into order_item (id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime)  values (#{id},#{orderNo},#{performId},#{orderId},#{commonItemId},#{remarks},#{userCardId},#{commonId},#{platformType},#{platformTypeId},#{platformTypeName},#{type},#{goodsNo},#{goodsName},#{goodsImage},#{specs},#{single},#{isLimitBug},#{bodyPartsId},#{bodyPartsName},#{specsName},#{aptitudeNo},#{aptitudeName},#{doctorQualification},#{oriPrice},#{proPrice},#{discount},#{curPrice},#{buyNum},#{total},#{actualTotal},#{userPaidTotal},#{noDeductionAmount},#{payTotal},#{payRecharge},#{payIncrement},#{snapPayTotal},#{discountPrice},#{activityPrice},#{discountOrderPrice},#{discountIntegral},#{originalIntegral},#{proIntegral},#{sellPoints},#{oriIntegralTotal},#{proIntegralTotal},#{totalPoints},#{shouldTotalPoints},#{actualTotalPoints},#{hasReNum},#{reTotal},#{reIntegralTotal},#{reCashTotal},#{reCashPurenessTotal},#{reRechargeTotal},#{reIncrementTotal},#{usedTotal},#{payStatus},#{refundStatus},#{isSpa},#{transferIntoShopId},#{transferIntoShopName},#{isTransfer},#{isTurn},#{isDel},#{createTime},#{editTime})
        insert into order_item (id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,appealSecond,appealThird,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime)  values (#{id},#{orderNo},#{performId},#{orderId},#{commonItemId},#{remarks},#{userCardId},#{commonId},#{platformType},#{platformTypeId},#{platformTypeName},#{type},#{goodsNo},#{goodsName},#{goodsImage},#{specs},#{single},#{isLimitBug},#{bodyPartsId},#{bodyPartsName},#{specsName},#{aptitudeNo},#{aptitudeName},#{doctorQualification},#{oriPrice},#{proPrice},#{discount},#{curPrice},#{buyNum},#{total},#{actualTotal},#{userPaidTotal},#{noDeductionAmount},#{payTotal},#{payRecharge},#{payIncrement},#{snapPayTotal},#{discountPrice},#{activityPrice},#{discountOrderPrice},#{discountIntegral},#{originalIntegral},#{proIntegral},#{sellPoints},#{oriIntegralTotal},#{proIntegralTotal},#{totalPoints},#{shouldTotalPoints},#{actualTotalPoints},#{hasReNum},#{reTotal},#{reIntegralTotal},#{reCashTotal},#{reCashPurenessTotal},#{reRechargeTotal},#{reIncrementTotal},#{usedTotal},#{payStatus},#{refundStatus},#{isSpa},#{appealSecond},#{appealThird},#{transferIntoShopId},#{transferIntoShopName},#{isTransfer},#{isTurn},#{isDel},#{createTime},#{editTime})
    </insert>
    <insert id="insertById" parameterType="com.hx.phiappt.model.order.OrderItem">
        insert into order_item (id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime)  values (#{id},#{orderNo},#{performId},#{orderId},#{commonItemId},#{remarks},#{userCardId},#{commonId},#{platformType},#{platformTypeId},#{platformTypeName},#{type},#{goodsNo},#{goodsName},#{goodsImage},#{specs},#{single},#{isLimitBug},#{bodyPartsId},#{bodyPartsName},#{specsName},#{aptitudeNo},#{aptitudeName},#{doctorQualification},#{oriPrice},#{proPrice},#{discount},#{curPrice},#{buyNum},#{total},#{actualTotal},#{userPaidTotal},#{noDeductionAmount},#{payTotal},#{payRecharge},#{payIncrement},#{snapPayTotal},#{discountPrice},#{activityPrice},#{discountOrderPrice},#{discountIntegral},#{originalIntegral},#{proIntegral},#{sellPoints},#{oriIntegralTotal},#{proIntegralTotal},#{totalPoints},#{shouldTotalPoints},#{actualTotalPoints},#{hasReNum},#{reTotal},#{reIntegralTotal},#{reCashTotal},#{reCashPurenessTotal},#{reRechargeTotal},#{reIncrementTotal},#{usedTotal},#{payStatus},#{refundStatus},#{isSpa},#{transferIntoShopId},#{transferIntoShopName},#{isTransfer},#{isTurn},#{isDel},#{createTime},#{editTime})
        insert into order_item (id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,appealSecond,appealThird,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime)  values (#{id},#{orderNo},#{performId},#{orderId},#{commonItemId},#{remarks},#{userCardId},#{commonId},#{platformType},#{platformTypeId},#{platformTypeName},#{type},#{goodsNo},#{goodsName},#{goodsImage},#{specs},#{single},#{isLimitBug},#{bodyPartsId},#{bodyPartsName},#{specsName},#{aptitudeNo},#{aptitudeName},#{doctorQualification},#{oriPrice},#{proPrice},#{discount},#{curPrice},#{buyNum},#{total},#{actualTotal},#{userPaidTotal},#{noDeductionAmount},#{payTotal},#{payRecharge},#{payIncrement},#{snapPayTotal},#{discountPrice},#{activityPrice},#{discountOrderPrice},#{discountIntegral},#{originalIntegral},#{proIntegral},#{sellPoints},#{oriIntegralTotal},#{proIntegralTotal},#{totalPoints},#{shouldTotalPoints},#{actualTotalPoints},#{hasReNum},#{reTotal},#{reIntegralTotal},#{reCashTotal},#{reCashPurenessTotal},#{reRechargeTotal},#{reIncrementTotal},#{usedTotal},#{payStatus},#{refundStatus},#{isSpa},#{appealSecond},#{appealThird},#{transferIntoShopId},#{transferIntoShopName},#{isTransfer},#{isTurn},#{isDel},#{createTime},#{editTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.order.OrderItem" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -55,14 +55,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrderItem" parameterType="java.lang.Object" >
        select 
            id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime
            id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,appealSecond,appealThird,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime
        from order_item
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrderItem" parameterType="java.lang.Object" >
        select 
            id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime
            id,orderNo,performId,orderId,commonItemId,remarks,userCardId,commonId,platformType,platformTypeId,platformTypeName,type,goodsNo,goodsName,goodsImage,specs,single,isLimitBug,bodyPartsId,bodyPartsName,specsName,aptitudeNo,aptitudeName,doctorQualification,oriPrice,proPrice,discount,curPrice,buyNum,total,actualTotal,userPaidTotal,noDeductionAmount,payTotal,payRecharge,payIncrement,snapPayTotal,discountPrice,activityPrice,discountOrderPrice,discountIntegral,originalIntegral,proIntegral,sellPoints,oriIntegralTotal,proIntegralTotal,totalPoints,shouldTotalPoints,actualTotalPoints,hasReNum,reTotal,reIntegralTotal,reCashTotal,reCashPurenessTotal,reRechargeTotal,reIncrementTotal,usedTotal,payStatus,refundStatus,isSpa,appealSecond,appealThird,transferIntoShopId,transferIntoShopName,isTransfer,isTurn,isDel,createTime,editTime
        from order_item
        WHERE id = #{value}
    </select>
phi_platform_user/src/main/java/com/hx/phip/controller/consultation/ConsultationRecordController.java
@@ -293,12 +293,12 @@
        //时间搜索
        if (!StringUtils.isEmpty(consultRecordDto.getStartTime())) {
            values.put("startTime", consultRecordDto.getStartTime() + "00:00:00");
            sql.append(" and cr.createTime >= #{m.startTime} ");
            values.put("startTime", consultRecordDto.getStartTime());
            sql.append(" and cr.createTime >= #{m.startTime}");
        }
        if (!StringUtils.isEmpty(consultRecordDto.getEndTime())) {
            sql.append(" and cr.createTime <= #{m.endTime} ");
            values.put("endTime", consultRecordDto.getEndTime() + "23:59:59");
            sql.append(" and cr.createTime <= #{m.endTime}");
            values.put("endTime", consultRecordDto.getEndTime());
        }
        // 用户名查找
@@ -725,15 +725,14 @@
        }
        sql.append(" FROM user_project_item upi ");
        sql.append(" LEFT JOIN user_project up ON up.id = upi.userProjectId ");
        sql.append(" LEFT JOIN USER us ON us.id = upi.userId ");
        sql.append(" LEFT JOIN deduction_project dp ON upi.id = dp.userProjectItemId ");
        sql.append(" LEFT JOIN project p on up.goodsId = p.id  ");
        sql.append(" LEFT JOIN project p on upi.goodsId = p.id  ");
        sql.append(" WHERE 1 = 1 AND upi.userId = #{m.userId} ");
        sql.append(" AND ( upi.effectiveStatus = 3 OR ( upi.effectiveStatus = 1 AND upi.notUsedNum = 0 AND upi.usedNum > 0 ) ");
        sql.append(" OR ( upi.effectiveStatus = 1 AND upi.usedNum > 0 AND upi.notUsedNum > 0 ) ");
        sql.append(" OR ( upi.effectiveStatus = 1 AND upi.usedNum <= 0 AND upi.cancelNum < upi.usedTotal AND upi.notUsedNum > 0 )) ");
        sql.append(" AND up.isDel = 0 AND upi.isDel = 0 ");
        sql.append(" AND upi.isDel = 0 ");
        if (!StringUtils.isEmpty(keyWord)) {
            sql.append(" and ( p.name like #{m.keyWord} or p.coding like #{m.keyWord} )");
phi_platform_user/src/main/java/com/hx/phip/controller/deduction/DeductionController.java
@@ -210,7 +210,7 @@
    /**
     * 新增划扣记录(Phitab数据划扣)
     */
    @RequestMapping(value = "/add/phitab", method = RequestMethod.POST)
    //@RequestMapping(value = "/add/phitab", method = RequestMethod.POST)
    public Result addPhitabData(@RequestBody DeductionDto deductionDto) {
        logger.info("新增划扣记录(Phitab)打印入参数据:"+ JSONObject.toJSONString(deductionDto));
        // 校验参数
phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java
@@ -13,6 +13,7 @@
import com.hx.phiappt.model.coupon.Coupon;
import com.hx.phiappt.model.coupon.CouponNumber;
import com.hx.phiappt.model.deduction.DeductionProject;
import com.hx.phiappt.model.deduction.DeductionSingle;
import com.hx.phiappt.model.questionnaire.InvestigateData;
import com.hx.phiappt.model.report.DailySummary;
import com.hx.phiappt.model.user.UserCard;
@@ -552,7 +553,7 @@
                    String suggest = UserInfoTool.getUserQuestionnaireSuggest(investigateData.getData());
                    if (!StringUtils.isEmpty(suggest)) {
                        // 判断长度是否太长了
                        if (suggest.length() >= 30){
                        if (suggest.length() >= 30) {
                            suggest = suggest.substring(0, 26);
                            suggest += "...";
                        }
@@ -561,6 +562,34 @@
                        contentItem902.put("value", "-");
                    }
                    jsonArray.add(contentItem902);
                    // 划扣门店
                    String shopName = "";
                    // 所属咨询师名称
                    String belongConsultantName = "";
                    // 划扣单信息
                    if (!StringUtils.isEmpty(investigateData.getDeductionSingleId())) {
                        DeductionSingle deductionSingle = commonService.selectOneByKey(DeductionSingleMapper.class, investigateData.getDeductionSingleId());
                        if (deductionSingle != null) {
                            // 划扣门店
                            if (!StringUtils.isEmpty(deductionSingle.getShopName())) {
                                shopName = deductionSingle.getShopName();
                            }
                            // 所属咨询师名称
                            if (!StringUtils.isEmpty(deductionSingle.getBelongConsultantName())) {
                                belongConsultantName = deductionSingle.getBelongConsultantName();
                            }
                        }
                    }
                    // 所属顾问
                    net.sf.json.JSONObject contentItem903 = new net.sf.json.JSONObject();
                    contentItem903.put("key", "所属顾问");
                    contentItem903.put("value", belongConsultantName);
                    jsonArray.add(contentItem903);
                    // 划扣门店
                    net.sf.json.JSONObject contentItem904 = new net.sf.json.JSONObject();
                    contentItem904.put("key", "划扣门店");
                    contentItem904.put("value", shopName);
                    jsonArray.add(contentItem904);
                    // 提示消息
                    tipInfo = "请打开小程序查看详情信息!";
                    break;
phi_platform_user/src/main/java/com/hx/phip/controller/micro/MicroRecordController.java
@@ -82,7 +82,7 @@
        values.put("userId", dto.getUserId());
        StringBuffer sql = new StringBuffer();
        sql.append("  select id, userName, opName, createTime, editTime,isView  ")
        sql.append("  select id, userName, opName, createTime, editTime,isView,isDraft  ")
                .append(" from micro_record where isDel = 0 and userId = #{m.userId} ");
        if(StringUtils.noNull(dto.getStartTime())){
@@ -93,6 +93,12 @@
        if(StringUtils.noNull(dto.getEndTime())){
            values.put("endTime", DateUtil.dayToEnd(DateUtil.parseString_2(dto.getEndTime())));
            sql.append(" and createTime <= #{m.endTime} ");
        }
        // 是否草稿
        if (dto.getIsDraft() != null){
            values.put("isDraft", dto.getIsDraft());
            sql.append(" and isDraft <= #{m.isDraft} ");
        }
        sqlSentence.setSqlSentence(sql.toString());
@@ -124,7 +130,7 @@
        sqlSentence.setM(values);
        values.put("microRecordId", dto.getId());
        sqlSentence.setSqlSentence(" select id, userId, userName, createTime from micro_record where id = #{m.microRecordId} ");
        sqlSentence.setSqlSentence(" select id, userId, userName, createTime,isDraft from micro_record where id = #{m.microRecordId} ");
        Map<String, Object> infoMap = commonService.selectOneMap(MicroRecordMapper.class, sqlSentence);
        if(infoMap == null || infoMap.size() < 1){
@@ -328,7 +334,10 @@
        microRecord.setUserConsultantName(EmployeeTool.getCnName(microRecord.getUserConsultantId(), commonService));
        microRecord.setUserShopId(user.getShopId());
        microRecord.setUserShopName(ShopTool.getShopName(microRecord.getUserShopId(), commonService));
        // 草稿
        if (dto.getIsDraft() != null){
            microRecord.setIsDraft(dto.getIsDraft());
        }
        //新增
        mircoRecordService.add(microRecord);
phi_platform_user/src/main/java/com/hx/phip/service/deduction/impl/DeductionSingleServiceImpl.java
@@ -365,8 +365,9 @@
                sqlMap.put("isDel", BaseEntity.NO);
                sqlMap.put("itemId", deductionDto.getUserProjectId());
                sqlMap.put("type", OrderGoodsConstants.TYPE_PROJECT);
                String sql = "SELECT upi.* FROM user_project_item AS upi INNER JOIN user_project AS up ON up.id=upi.userProjectId WHERE upi.itemId=#{m.itemId} " +
                        " AND up.type=#{m.type} AND upi.isDel=#{m.isDel} AND up.isDel=#{m.isDel} ORDER BY createTime DESC LIMIT 1";
                String sql = "SELECT upi.* FROM user_project_item AS upi" +
                        " WHERE upi.itemId=#{m.itemId} " +
                        " AND upi.goodsType=#{m.type} AND upi.isDel=#{m.isDel} ORDER BY createTime DESC LIMIT 1";
                sqlSentence.sqlSentence(sql, sqlMap);
                userProjectItem = userProjectItemMapper.selectOne(sqlSentence);
                if (userProjectItem == null) {
@@ -406,10 +407,13 @@
            }
            // 新增判断项目可划扣次数是否充足
            if (userProjectItem.getNotUsedNum() <= 0 || userProjectItem.getNotUsedNum() < deductionDto.getDeductionNum()) {
                String info = String.format("项目的可划扣次数不足!当前项目子项可划扣数量:%s ,当前要划扣的数量:%s ,划扣用户项目子项id:%s", userProjectItem.getNotUsedNum(), deductionDto.getDeductionNum(), userProjectItem.getId());
                // 获取订单编号
                String orderNo = StringUtils.isEmpty(userProjectItem.getOrdersTotalNumber()) ? "" : userProjectItem.getOrdersTotalNumber();
                // 添加判断日志
                String info = String.format("项目的可划扣次数不足!当前项目子项可划扣数量:%s ,当前要划扣的数量:%s ,划扣用户项目子项id:%s ,所属订单编号:%s", userProjectItem.getNotUsedNum(), deductionDto.getDeductionNum(), userProjectItem.getId(), orderNo);
                Project project = getProjectByUserProjectItemId(userProjectItem.getId());
                if (project != null && !StringUtils.isEmpty(project.getName())) {
                    info = String.format("项目(%s)的可划扣次数不足!当前项目子项可划扣数量:%s ,当前要划扣的数量:%s ,划扣用户项目子项id:%s", project.getName(), userProjectItem.getNotUsedNum(), deductionDto.getDeductionNum(), userProjectItem.getId());
                    info = String.format("项目(%s)的可划扣次数不足!当前项目子项可划扣数量:%s ,当前要划扣的数量:%s ,划扣用户项目子项id:%s ,所属订单编号:%s", project.getName(), userProjectItem.getNotUsedNum(), deductionDto.getDeductionNum(), userProjectItem.getId(), orderNo);
                }
                throw new PlatTipsException(PlatformCode.ERROR_TIPS, info);
            }
@@ -454,12 +458,6 @@
        } else {
            throw new PlatTipsException(PlatformCode.ERROR_TIPS, "操作人不能为空!");
        }
        // 获取用户项目 划扣user_project表脱钩
        /*UserProject userProject = commonService.selectOneByKey(UserProjectMapper.class, userProjectItem.getUserProjectId());
        if (userProject == null) {
            throw new PlatTipsException(PlatformCode.ERROR_TIPS, "未找到你的项目信息!");
        }*/
        // 新增判断是不是有效状态
        if (BaseEntity.YES.equals(type)) {
@@ -3133,9 +3131,9 @@
        Map<String, Object> sqlValues = new HashMap<>();
        sqlValues.put("isDel", BaseEntity.NO);
        sqlValues.put("userProjectItemId", userProjectItemId);
        String sql = "SELECT pro.* FROM user_project_item AS upi LEFT JOIN user_project AS up ON up.id=upi.userProjectId " +
                "LEFT JOIN project AS pro ON pro.id = up.goodsId WHERE upi.id=#{m.userProjectItemId} " +
                "AND upi.isDel=#{m.isDel} AND up.isDel=#{m.isDel} AND pro.isDel=#{m.isDel}";
        String sql = "SELECT pro.* FROM user_project_item AS upi" +
                "LEFT JOIN project AS pro ON pro.id = upi.goodsId WHERE upi.id=#{m.userProjectItemId} " +
                "AND upi.isDel=#{m.isDel} AND pro.isDel=#{m.isDel}";
        sqlSentence.sqlSentence(sql, sqlValues);
        return projectMapper.selectOne(sqlSentence);
    }
@@ -3443,11 +3441,8 @@
        if (userProjectItem == null) {
            throw new TipsException("用户项目子项信息没有找到!");
        }
        // 判断用户项目userProject脱离
        /*UserProject userProject = userProjectMapper.selectOneByKey(userProjectItem.getUserProjectId());
        if (userProject == null) {
            throw new TipsException("用户项目信息没有找到!");
        }*/
        data.put("projectId", null);
        data.put("projectName", null);
        data.put("specification", null);
phi_platform_user/src/main/java/com/hx/phip/service/mirco/impl/MircoRecordServiceImpl.java
@@ -9,6 +9,7 @@
import com.hx.phiappt.dao.mapper.MicroPlanItemMapper;
import com.hx.phiappt.dao.mapper.MicroPlanMapper;
import com.hx.phiappt.dao.mapper.MicroRecordMapper;
import com.hx.phiappt.model.BaseEntity;
import com.hx.phiappt.model.micro.MicroPlan;
import com.hx.phiappt.model.micro.MicroPlanIndication;
import com.hx.phiappt.model.micro.MicroPlanItem;
@@ -50,7 +51,49 @@
        //新增规划数据
        addPlanData(microRecord);
        //不是草稿就发送通知
        if (BaseEntity.NO.equals(microRecord.getIsDraft())){
            this.sentGZHNotice(microRecord);
        }
    }
    /** 编辑 */
    @Override
    public void edit(MicroRecord microRecord) {
        // 获取下之前的数据
        MicroRecord checkMicroRecord = commonDao.selectOneByKey(MicroRecordMapper.class, microRecord.getId());
        if (checkMicroRecord == null){
            throw new TipsException("更新微整规划记录信息不存在!");
        }
        // 处理数据
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> values = new HashMap<>();
        sqlSentence.setM(values);
        values.put("id", microRecord.getId());
        values.put("isDraft", microRecord.getIsDraft());
        sqlSentence.setSqlSentence(" isDraft = #{m.isDraft},editTime = now() where id = #{m.id} ");
        if(commonDao.updateWhere(MicroRecordMapper.class, sqlSentence) != 1){
            throw new TipsException("更新微整规划记录信息失败!");
        }
        //删除旧的颜值规划
        delPlanData(microRecord.getId(), sqlSentence, values);
        //再重新新增
        addPlanData(microRecord);
        //之前是草稿现在不是草稿就发送通知
        if (BaseEntity.YES.equals(checkMicroRecord.getIsDraft()) && BaseEntity.NO.equals(microRecord.getIsDraft())){
            this.sentGZHNotice(microRecord);
        }
    }
    /**
     * 发送公众号通知
     * @param microRecord 微整规划记录
     */
    private void sentGZHNotice(MicroRecord microRecord) {
        //查询有美际记录才发送通知
        Date now = new Date();
        SqlSentence sqlSentence = new SqlSentence();
@@ -64,27 +107,6 @@
            //发送通知用户
            GzhNoticeSendTool.createSendTimeItem(commonService, GzhNoticeSendTool.SEND_TYPE_YZ_GH, microRecord.getId(), microRecord.getUserId());
        }
    }
    /** 编辑 */
    @Override
    public void edit(MicroRecord microRecord) {
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> values = new HashMap<>();
        sqlSentence.setM(values);
        values.put("id", microRecord.getId());
        sqlSentence.setSqlSentence(" editTime = now() where id = #{m.id} ");
        if(commonDao.updateWhere(MicroRecordMapper.class, sqlSentence) != 1){
            throw new TipsException("更新微整规划记录信息失败!");
        }
        //删除旧的颜值规划
        delPlanData(microRecord.getId(), sqlSentence, values);
        //再重新新增
        addPlanData(microRecord);
    }
    /** 删除 */
phi_platform_user/src/main/java/com/hx/phip/service/order/impl/OrderRefundServiceImpl.java
@@ -2011,7 +2011,7 @@
        }
        result.checkTips();
        RefundReturnDto refundReturnDto=JSON.parseObject(JSONObject.toJSONString(result.getData()),RefundReturnDto.class);
        if ( RefundReturnDto.REFUND_STATUS_FAIL != refundReturnDto.getRefundStatus()){
        if ( RefundReturnDto.REFUND_STATUS_SUECCESS == refundReturnDto.getRefundStatus()){
            orderNodeBuilder.append("-调用CRM退款金额:"+crmAmount+",返回成功返回流水号:"+refundReturnDto.getRefundNo()+",json:"+result);
            logger.info("crm退款成功进行下面操作");
        }else {
@@ -2619,7 +2619,7 @@
        }
        //CRM平台的,不许作废退款
        if(PlatformConstants.TYPE_PLATFORM_CRM.equals(thirtApplication.getAppIdCode())){
        if(PlatformConstants.TYPE_PLATFORM_CRM.equals(ordersTotal.getAppIdCode())){
            throw new TipsException("艾芯荟订单退款不能作废!");
        }
phi_platform_user/src/main/java/com/hx/phip/util/api/NewOrderPayUtil.java
@@ -718,7 +718,7 @@
        Map<String,Object> map=new HashMap<>();
        sqlSentence.setM(map);
        map.put("userId",ordersTotal.getUserId());
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0");
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0 LIMIT 1");
        List<String> typeList = Arrays.asList(OrderItemConstants.TYPE_CARD, OrderItemConstants.TYPE_PROMOTION);
        if(typeList.contains(type)){
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java
@@ -71,6 +71,7 @@
import com.hx.phip.tool.AppealTypeTool;
import com.hx.phip.tool.CreateNo;
import com.hx.phip.tool.user.UserCardTool;
import com.hx.phip.vo.AppealTypeVo;
import com.hx.phip.vo.user.UserCardItemInfoVo;
import com.hx.resultTool.Result;
import com.hx.util.DateUtil;
@@ -1530,6 +1531,24 @@
        String activityName = "";
        OrderInfo orderInfo = ordersTotal.getOrderInfo();
        logger.info("接收的orderInfo:"+JSON.toJSONString(orderInfo));
        BigDecimal defaultDiscount = new BigDecimal(100);
        if (ordersTotal.getOrderInfo() == null) {
            orderInfo = new OrderInfo();
            orderInfo.setIsWholeDiscount(0);
            orderInfo.setIsEmployeeDiscount(0);
            orderInfo.setDiscount(defaultDiscount);
        } else {
            orderInfo.setIsEmployeeDiscount(StringUtils.noNull(ordersTotal.getKoapOrderId()) ? BaseEntity.NO : ordersTotal.getOrderInfo().getIsEmployeeDiscount());
            orderInfo.setIsWholeDiscount(StringUtils.noNull(ordersTotal.getKoapOrderId()) ? BaseEntity.NO : ordersTotal.getOrderInfo().getIsWholeDiscount());
            if (StringUtils.noNull(ordersTotal.getKoapOrderId())) {
                orderInfo.setDiscount(defaultDiscount);
            } else {
//                if (ordersTotal.getOrderInfo().getDiscount() == null) {
//                    throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "整单折扣/员工折扣参数为空,默认为100!");
//                }
                orderInfo.setDiscount(ordersTotal.getOrderInfo().getDiscount()==null?new BigDecimal(100):ordersTotal.getOrderInfo().getDiscount());
            }
        }
        orderInfo.setOrderId(ordersTotal.getId());
        //如果有用活动规则将活动规则保存在orderInfo
        if (ordersTotal.getActivityIds() != null && ordersTotal.getActivityIds().size() > 0) {
@@ -1539,23 +1558,6 @@
                orderInfo.setActivityId(activityRule.getId());
                orderInfo.setActivityName(activityRule.getName());
                activityName = activityRule.getName();
            }
        }
        BigDecimal defaultDiscount = new BigDecimal(100);
        if (ordersTotal.getOrderInfo() == null) {
            orderInfo.setIsWholeDiscount(0);
            orderInfo.setIsEmployeeDiscount(0);
            orderInfo.setDiscount(defaultDiscount);
        } else {
            orderInfo.setIsEmployeeDiscount(StringUtils.noNull(ordersTotal.getKoapOrderId()) ? 0 : ordersTotal.getOrderInfo().getIsEmployeeDiscount());
            orderInfo.setIsWholeDiscount(StringUtils.noNull(ordersTotal.getKoapOrderId()) ? 0 : ordersTotal.getOrderInfo().getIsWholeDiscount());
            if (StringUtils.noNull(ordersTotal.getKoapOrderId())) {
                orderInfo.setDiscount(defaultDiscount);
            } else {
//                if (ordersTotal.getOrderInfo().getDiscount() == null) {
//                    throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "整单折扣/员工折扣参数为空,默认为100!");
//                }
                orderInfo.setDiscount(ordersTotal.getOrderInfo().getDiscount()==null?new BigDecimal(100):ordersTotal.getOrderInfo().getDiscount());
            }
        }
        //用户推荐人处理
@@ -1768,11 +1770,32 @@
            //计算折扣金额
            vo.setDiscountOrderPrice(vo.getProPrice().multiply(BigDecimal.valueOf(vo.getBuyNum()).setScale(2,RoundingMode.HALF_UP)).subtract(vo.getTotal()));
            vo.setOrderId(ordersTotal.getId());
            commonService.insert(OrderItemMapper.class, vo);
            //述求分类生成,目前项目
            //诉求分类
            List<AppealTypeVo> appealTypeVoList = null;
            if (OrderItemConstants.TYPE_PROJECT.equals(vo.getType())) {
                AppealTypeTool.orderProjectInsert(ordersTotal.getId(), vo.getId(), vo.getAppealTypeIdList() ,commonService);
                //获取诉求分类列表
                appealTypeVoList = AppealTypeTool.getAppealTypeListByIdList(vo.getAppealTypeIdList(), commonService);
            }
            if (appealTypeVoList != null && appealTypeVoList.size() > 0) {
                String str = AppealTypeTool.getStr(appealTypeVoList);
                logger.info("拼接的诉求分类:"+str);
                if (StringUtils.noNull(str)) {
                    String[] split = str.split("-");
                    for (int i = 0; i < split.length; i++) {
                        if (i == 0) {
                            vo.setAppealSecond(split[i]);
                        } else if (i == 1) {
                            vo.setAppealThird(split[i]);
                        }
                    }
                }
            }
            commonService.insert(OrderItemMapper.class, vo);
            //述求分类生成,目前项目
            if (appealTypeVoList != null && appealTypeVoList.size() > 0){
                //生成关联关系
                AppealTypeTool.orderProjectInsert(ordersTotal.getId(), vo.getId(), appealTypeVoList, commonService);
            }
            map.put("commonId", vo.getCommonId());
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderPayMoneyUtil.java
@@ -1829,7 +1829,7 @@
        Map<String,Object> map=new HashMap<>();
        sqlSentence.setM(map);
        map.put("userId",ordersTotal.getUserId());
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0");
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0 LIMIT 1");
        List<String> typeList = Arrays.asList(OrderItemConstants.TYPE_CARD, OrderItemConstants.TYPE_PROMOTION);
        //查询spa下面所有分类
        Set<String> spaIds = AppointmentTool.getSpaProjectTypeId("PHISPA", commonService);
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderPayUtil.java
@@ -840,7 +840,7 @@
        Map<String,Object> map=new HashMap<>();
        sqlSentence.setM(map);
        map.put("userId",ordersTotal.getUserId());
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0");
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0 LIMIT 1");
        List<String> typeList = Arrays.asList(OrderItemConstants.TYPE_CARD, OrderItemConstants.TYPE_PROMOTION);
        if(typeList.contains(type)){
phi_platform_user/src/main/java/com/hx/phip/util/api/UserProjectUtil.java
@@ -114,7 +114,7 @@
        map.put("commonId",orderItem.getCommonId());
        map.put("userId",userId);
        map.put("orderItemId",orderItemId);
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0");
        sqlSentence.setSqlSentence("select * from user_project where goodsId=#{m.commonId} and userId =#{m.userId} and isDel=0 LIMIT 1");
        UserProject userProject=commonService.selectOne(UserProjectMapper.class,sqlSentence);
        if(userProject==null && type ==1){
            if(userProject==null){