zhouxiang
2021-12-10 98dd19d5dd54e702dc4100deafd296a7f30b54d5
添加结账接口
19个文件已添加
13个文件已修改
1942 ■■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrderItemMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrdersTotalMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/PaymentMethodMapper.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/PaymentMethodTypeMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserMoneyLogMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserMoneyMapper.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserProjectItemMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserProjectMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrderItemMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrdersTotalMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/PaymentMethodMapper.xml 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/PaymentMethodTypeMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/ShopMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/UserMoneyLogMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/UserMoneyMapper.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/UserProjectItemMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/UserProjectMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/controller/OrderController.java 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/OrderService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/OrderItemService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/OrdersTotalService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrderItemServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrdersTotalServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/PaymentMethodServiceImpl.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/PaymentMethodTypeServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/ShopServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserMoneyLogServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserMoneyServiceImpl.java 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserProjectItemServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserProjectServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/resources/application-local.properties 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrderItemMapper.java
@@ -4,6 +4,7 @@
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.order.OrderItem;
import org.apache.ibatis.annotations.Param;
public interface OrderItemMapper {
    /**新增,返回主键*/
@@ -32,4 +33,8 @@
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
    /*根据总订单获取子订单*/
    List<OrderItem> selectItemList(@Param("id") String id);
    /*根据子订单id来修改支付状态*/
    void updatePayStatus(@Param("payStatus") Integer payStatus,@Param("id") String id);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrdersTotalMapper.java
@@ -1,9 +1,12 @@
package com.hx.phip.dao.mapper;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.order.OrdersTotal;
import org.apache.ibatis.annotations.Param;
public interface OrdersTotalMapper {
    /**新增,返回主键*/
@@ -32,4 +35,7 @@
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
    /*更新总订单 支付信息*/
    void updatePay(@Param("payRecharge")BigDecimal payRecharge,@Param("payIncrement") BigDecimal payIncrement,
                   @Param("payTotal") BigDecimal payTotal,@Param("status") Integer status, @Param("id")String id,@Param("payTime") Date payTime);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/PaymentMethodMapper.java
New file
@@ -0,0 +1,38 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.PaymentMethod;
import org.apache.ibatis.annotations.Param;
public interface PaymentMethodMapper {
    /**新增,返回主键*/
    int insert(PaymentMethod paymentMethod);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<PaymentMethod> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    PaymentMethod selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    PaymentMethod selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    PaymentMethod selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(PaymentMethod paymentMethod);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
    /*根据支付方式编码获取支付方式信息*/
    PaymentMethod selectNumberNo(@Param("method") String method);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/PaymentMethodTypeMapper.java
New file
@@ -0,0 +1,35 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.PaymentMethodType;
public interface PaymentMethodTypeMapper {
    /**新增,返回主键*/
    int insert(PaymentMethodType paymentMethodType);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<PaymentMethodType> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    PaymentMethodType selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    PaymentMethodType selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    PaymentMethodType selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(PaymentMethodType paymentMethodType);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserMoneyLogMapper.java
New file
@@ -0,0 +1,35 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.UserMoneyLog;
public interface UserMoneyLogMapper {
    /**新增,返回主键*/
    int insert(UserMoneyLog userMoneyLog);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<UserMoneyLog> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    UserMoneyLog selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    UserMoneyLog selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    UserMoneyLog selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(UserMoneyLog userMoneyLog);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserMoneyMapper.java
New file
@@ -0,0 +1,42 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.UserMoney;
import org.apache.ibatis.annotations.Param;
public interface UserMoneyMapper {
    /**新增,返回主键*/
    int insert(UserMoney userMoney);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<UserMoney> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    UserMoney selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    UserMoney selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    UserMoney selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(UserMoney userMoney);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
    UserMoney selectUserId(@Param("userId") String userId);
    /*更新用户的增值金和储值金*/
    void updateStoredValueFund(@Param("storedValueFund") String storedValueFund,@Param("id") String id);
    void updateValueAddedFund(@Param("valueAddedFund")String valueAddedFund,@Param("id") String id);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserProjectItemMapper.java
New file
@@ -0,0 +1,35 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.user.UserProjectItem;
public interface UserProjectItemMapper {
    /**新增,返回主键*/
    int insert(UserProjectItem userProjectItem);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<UserProjectItem> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    UserProjectItem selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    UserProjectItem selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    UserProjectItem selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(UserProjectItem userProjectItem);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/UserProjectMapper.java
New file
@@ -0,0 +1,35 @@
package com.hx.phip.dao.mapper;
import java.util.List;
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.user.UserProject;
public interface UserProjectMapper {
    /**新增,返回主键*/
    int insert(UserProject userProject);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<UserProject> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    UserProject selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    UserProject selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    UserProject selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(UserProject userProject);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/resources/mapper/OrderItemMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,orderNo = #{orderNo},type = #{type},goodsNo = #{goodsNo},goodsName = #{goodsName},goodsImage = #{goodsImage},specs = #{specs},total = #{total},actualTotal = #{actualTotal},oriPrice = #{oriPrice},curPrice = #{curPrice},single = #{single},discount = #{discount},usedTotal = #{usedTotal},buyNum = #{buyNum},commonId = #{commonId},orderId = #{orderId},isDel = #{isDel},createTime = #{createTime}
            ,orderNo = #{orderNo},type = #{type},goodsNo = #{goodsNo},goodsName = #{goodsName},goodsImage = #{goodsImage},specs = #{specs},payStatus = #{payStatus},refundStatus = #{refundStatus},total = #{total},actualTotal = #{actualTotal},oriPrice = #{oriPrice},curPrice = #{curPrice},single = #{single},discount = #{discount},usedTotal = #{usedTotal},buyNum = #{buyNum},commonId = #{commonId},orderId = #{orderId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
     
@@ -19,7 +19,7 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into order_item (id,orderNo,type,goodsNo,goodsName,goodsImage,specs,total,actualTotal,oriPrice,curPrice,single,discount,usedTotal,buyNum,commonId,orderId,isDel,createTime)  values (#{id},#{orderNo},#{type},#{goodsNo},#{goodsName},#{goodsImage},#{specs},#{total},#{actualTotal},#{oriPrice},#{curPrice},#{single},#{discount},#{usedTotal},#{buyNum},#{commonId},#{orderId},#{isDel},#{createTime})
        insert into order_item (id,orderNo,type,goodsNo,goodsName,goodsImage,specs,payStatus,refundStatus,total,actualTotal,oriPrice,curPrice,single,discount,usedTotal,buyNum,commonId,orderId,isDel,createTime)  values (#{id},#{orderNo},#{type},#{goodsNo},#{goodsName},#{goodsImage},#{specs},#{payStatus},#{refundStatus},#{total},#{actualTotal},#{oriPrice},#{curPrice},#{single},#{discount},#{usedTotal},#{buyNum},#{commonId},#{orderId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.order.OrderItem" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrderItem" parameterType="java.lang.Object" >
        select 
            id,orderNo,type,goodsNo,goodsName,goodsImage,specs,total,actualTotal,oriPrice,curPrice,single,discount,usedTotal,buyNum,commonId,orderId,isDel,createTime
            id,orderNo,type,goodsNo,goodsName,goodsImage,specs,payStatus,refundStatus,total,actualTotal,oriPrice,curPrice,single,discount,usedTotal,buyNum,commonId,orderId,isDel,createTime
        from order_item
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrderItem" parameterType="java.lang.Object" >
        select 
            id,orderNo,type,goodsNo,goodsName,goodsImage,specs,total,actualTotal,oriPrice,curPrice,single,discount,usedTotal,buyNum,commonId,orderId,isDel,createTime
            id,orderNo,type,goodsNo,goodsName,goodsImage,specs,payStatus,refundStatus,total,actualTotal,oriPrice,curPrice,single,discount,usedTotal,buyNum,commonId,orderId,isDel,createTime
        from order_item
        WHERE id = #{value}
    </select>
@@ -74,6 +74,11 @@
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <update id="updatePayStatus">
        update
            order_item
        SET payStatus=#{payStatus} WHERE id=#{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from order_item WHERE ${sqlSentence}
@@ -83,4 +88,7 @@
        delete from order_item WHERE id = #{value}
    </delete>
    
    <select id="selectItemList" resultType="com.hx.phiappt.model.order.OrderItem">
        select * from order_item where isDel=0 and orderId=#{id}
    </select>
</mapper>
phi_platform_common/src/main/resources/mapper/OrdersTotalMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,orderNo = #{orderNo},type = #{type},status = #{status},payStatus = #{payStatus},payTime = #{payTime},refundStatus = #{refundStatus},cancelTime = #{cancelTime},total = #{total},actualTotal = #{actualTotal},payTotal = #{payTotal},payRecharge = #{payRecharge},payIncrement = #{payIncrement},discountTotal = #{discountTotal},shopId = #{shopId},shopName = #{shopName},operatorType = #{operatorType},operatorId = #{operatorId},operatorName = #{operatorName},developerShopId = #{developerShopId},developerShopName = #{developerShopName},sourceType = #{sourceType},appId = #{appId},sourceCode = #{sourceCode},sourceName = #{sourceName},sourceOrderNo = #{sourceOrderNo},hisSynStatus = #{hisSynStatus},hisOrderId = #{hisOrderId},remarks = #{remarks},userId = #{userId},isDel = #{isDel},createTime = #{createTime}
            ,orderNo = #{orderNo},type = #{type},status = #{status},payStatus = #{payStatus},payTime = #{payTime},refundStatus = #{refundStatus},cancelTime = #{cancelTime},total = #{total},shouldTotal = #{shouldTotal},actualTotal = #{actualTotal},payTotal = #{payTotal},payRecharge = #{payRecharge},payIncrement = #{payIncrement},discountTotal = #{discountTotal},shopId = #{shopId},shopName = #{shopName},operatorType = #{operatorType},operatorId = #{operatorId},operatorName = #{operatorName},developerShopId = #{developerShopId},developerShopName = #{developerShopName},appId = #{appId},sourceCode = #{sourceCode},sourceName = #{sourceName},sourceOrderNo = #{sourceOrderNo},conversionCode = #{conversionCode},channelType = #{channelType},commonId = #{commonId},commonName = #{commonName},departmentCode = #{departmentCode},departmentName = #{departmentName},hisSynStatus = #{hisSynStatus},hisOrderId = #{hisOrderId},remarks = #{remarks},userId = #{userId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
     
@@ -19,7 +19,7 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into orders_total (id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,sourceType,appId,sourceCode,sourceName,sourceOrderNo,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime)  values (#{id},#{orderNo},#{type},#{status},#{payStatus},#{payTime},#{refundStatus},#{cancelTime},#{total},#{actualTotal},#{payTotal},#{payRecharge},#{payIncrement},#{discountTotal},#{shopId},#{shopName},#{operatorType},#{operatorId},#{operatorName},#{developerShopId},#{developerShopName},#{sourceType},#{appId},#{sourceCode},#{sourceName},#{sourceOrderNo},#{hisSynStatus},#{hisOrderId},#{remarks},#{userId},#{isDel},#{createTime})
        insert into orders_total (id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime)  values (#{id},#{orderNo},#{type},#{status},#{payStatus},#{payTime},#{refundStatus},#{cancelTime},#{total},#{shouldTotal},#{actualTotal},#{payTotal},#{payRecharge},#{payIncrement},#{discountTotal},#{shopId},#{shopName},#{operatorType},#{operatorId},#{operatorName},#{developerShopId},#{developerShopName},#{appId},#{sourceCode},#{sourceName},#{sourceOrderNo},#{conversionCode},#{channelType},#{commonId},#{commonName},#{departmentCode},#{departmentName},#{hisSynStatus},#{hisOrderId},#{remarks},#{userId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" >
        select 
            id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,sourceType,appId,sourceCode,sourceName,sourceOrderNo,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime
            id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime
        from orders_total
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" >
        select 
            id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,sourceType,appId,sourceCode,sourceName,sourceOrderNo,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime
            id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime
        from orders_total
        WHERE id = #{value}
    </select>
@@ -83,4 +83,10 @@
        delete from orders_total WHERE id = #{value}
    </delete>
    
    <update id="updatePay">
        update
            orders_total
        SET payTotal=#{payTotal},payRecharge=#{payRecharge},payIncrement=#{payIncrement},status=#{status},payStatus=#{payStatus},payTime=#{payTime}
        where id =#{id}
    </update>
</mapper>
phi_platform_common/src/main/resources/mapper/PaymentMethodMapper.xml
New file
@@ -0,0 +1,89 @@
<?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.PaymentMethodMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,numberNo = #{numberNo},name = #{name},isUp = #{isUp},usedCashier = #{usedCashier},usedThird = #{usedThird},remarks = #{remarks},sortNum = #{sortNum},methodTypeId = #{methodTypeId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.PaymentMethod">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into payment_method (id,numberNo,name,isUp,usedCashier,usedThird,remarks,sortNum,methodTypeId,isDel,createTime)  values (#{id},#{numberNo},#{name},#{isUp},#{usedCashier},#{usedThird},#{remarks},#{sortNum},#{methodTypeId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.PaymentMethod" 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.PaymentMethod" 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 payment_method
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.PaymentMethod" parameterType="java.lang.Object" >
        select
            id,numberNo,name,isUp,usedCashier,usedThird,remarks,sortNum,methodTypeId,isDel,createTime
        from payment_method
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.PaymentMethod" parameterType="java.lang.Object" >
        select
            id,numberNo,name,isUp,usedCashier,usedThird,remarks,sortNum,methodTypeId,isDel,createTime
        from payment_method
        WHERE id = #{value}
    </select>
    <select id="selectNumberNo" resultType="com.hx.phiappt.model.PaymentMethod">
        select * from payment_method where numberNo=#{method} and isDel=0 and isUp=1
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            payment_method
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.PaymentMethod">
        update payment_method
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from payment_method WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from payment_method WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/PaymentMethodTypeMapper.xml
New file
@@ -0,0 +1,86 @@
<?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.PaymentMethodTypeMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,name = #{name},isUp = #{isUp},remarks = #{remarks},sortNum = #{sortNum},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.PaymentMethodType">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into payment_method_type (id,name,isUp,remarks,sortNum,isDel,createTime)  values (#{id},#{name},#{isUp},#{remarks},#{sortNum},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.PaymentMethodType" 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.PaymentMethodType" 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 payment_method_type
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.PaymentMethodType" parameterType="java.lang.Object" >
        select
            id,name,isUp,remarks,sortNum,isDel,createTime
        from payment_method_type
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.PaymentMethodType" parameterType="java.lang.Object" >
        select
            id,name,isUp,remarks,sortNum,isDel,createTime
        from payment_method_type
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            payment_method_type
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.PaymentMethodType">
        update payment_method_type
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from payment_method_type WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from payment_method_type WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/ShopMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,name = #{name},corpMpDepId = #{corpMpDepId},maxAppNum = #{maxAppNum},maxSwitchNum = #{maxSwitchNum},isUp = #{isUp},workTime = #{workTime},province = #{province},city = #{city},area = #{area},addr = #{addr},colorStr = #{colorStr},doctorRelaxTime = #{doctorRelaxTime},carWay = #{carWay},subWay = #{subWay},apiId = #{apiId},isDel = #{isDel},createTime = #{createTime}
            ,name = #{name},corpMpDepId = #{corpMpDepId},maxAppNum = #{maxAppNum},maxSwitchNum = #{maxSwitchNum},isUp = #{isUp},workTime = #{workTime},province = #{province},city = #{city},area = #{area},addr = #{addr},colorStr = #{colorStr},doctorRelaxTime = #{doctorRelaxTime},carWay = #{carWay},subWay = #{subWay},apiId = #{apiId},shengMeiNum = #{shengMeiNum},sameTimeCustomerNum = #{sameTimeCustomerNum},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
     
@@ -19,7 +19,7 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into shop (id,name,corpMpDepId,maxAppNum,maxSwitchNum,isUp,workTime,province,city,area,addr,colorStr,doctorRelaxTime,carWay,subWay,apiId,isDel,createTime)  values (#{id},#{name},#{corpMpDepId},#{maxAppNum},#{maxSwitchNum},#{isUp},#{workTime},#{province},#{city},#{area},#{addr},#{colorStr},#{doctorRelaxTime},#{carWay},#{subWay},#{apiId},#{isDel},#{createTime})
        insert into shop (id,name,corpMpDepId,maxAppNum,maxSwitchNum,isUp,workTime,province,city,area,addr,colorStr,doctorRelaxTime,carWay,subWay,apiId,shengMeiNum,sameTimeCustomerNum,isDel,createTime)  values (#{id},#{name},#{corpMpDepId},#{maxAppNum},#{maxSwitchNum},#{isUp},#{workTime},#{province},#{city},#{area},#{addr},#{colorStr},#{doctorRelaxTime},#{carWay},#{subWay},#{apiId},#{shengMeiNum},#{sameTimeCustomerNum},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.Shop" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.Shop" parameterType="java.lang.Object" >
        select 
            id,name,corpMpDepId,maxAppNum,maxSwitchNum,isUp,workTime,province,city,area,addr,colorStr,doctorRelaxTime,carWay,subWay,apiId,isDel,createTime
            id,name,corpMpDepId,maxAppNum,maxSwitchNum,isUp,workTime,province,city,area,addr,colorStr,doctorRelaxTime,carWay,subWay,apiId,shengMeiNum,sameTimeCustomerNum,isDel,createTime
        from shop
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.Shop" parameterType="java.lang.Object" >
        select 
            id,name,corpMpDepId,maxAppNum,maxSwitchNum,isUp,workTime,province,city,area,addr,colorStr,doctorRelaxTime,carWay,subWay,apiId,isDel,createTime
            id,name,corpMpDepId,maxAppNum,maxSwitchNum,isUp,workTime,province,city,area,addr,colorStr,doctorRelaxTime,carWay,subWay,apiId,shengMeiNum,sameTimeCustomerNum,isDel,createTime
        from shop
        WHERE id = #{value}
    </select>
phi_platform_common/src/main/resources/mapper/UserMoneyLogMapper.xml
New file
@@ -0,0 +1,86 @@
<?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.UserMoneyLogMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,userId = #{userId},type = #{type},opType = #{opType},opNumber = #{opNumber},opBeforeNumber = #{opBeforeNumber},opAfterNumber = #{opAfterNumber},opAdminId = #{opAdminId},opAdminName = #{opAdminName},remarks = #{remarks},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.UserMoneyLog">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_money_log (id,userId,type,opType,opNumber,opBeforeNumber,opAfterNumber,opAdminId,opAdminName,remarks,isDel,createTime)  values (#{id},#{userId},#{type},#{opType},#{opNumber},#{opBeforeNumber},#{opAfterNumber},#{opAdminId},#{opAdminName},#{remarks},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.UserMoneyLog" 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.UserMoneyLog" 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 user_money_log
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.UserMoneyLog" parameterType="java.lang.Object" >
        select
            id,userId,type,opType,opNumber,opBeforeNumber,opAfterNumber,opAdminId,opAdminName,remarks,isDel,createTime
        from user_money_log
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.UserMoneyLog" parameterType="java.lang.Object" >
        select
            id,userId,type,opType,opNumber,opBeforeNumber,opAfterNumber,opAdminId,opAdminName,remarks,isDel,createTime
        from user_money_log
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            user_money_log
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.UserMoneyLog">
        update user_money_log
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from user_money_log WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from user_money_log WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/UserMoneyMapper.xml
New file
@@ -0,0 +1,99 @@
<?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.UserMoneyMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,userId = #{userId},storedValueFund = #{storedValueFund},valueAddedFund = #{valueAddedFund},integral = #{integral},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.UserMoney">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_money (id,userId,storedValueFund,valueAddedFund,integral,isDel,createTime)  values (#{id},#{userId},#{storedValueFund},#{valueAddedFund},#{integral},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.UserMoney" 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.UserMoney" 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 user_money
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.UserMoney" parameterType="java.lang.Object" >
        select
            id,userId,storedValueFund,valueAddedFund,integral,isDel,createTime
        from user_money
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.UserMoney" parameterType="java.lang.Object" >
        select
            id,userId,storedValueFund,valueAddedFund,integral,isDel,createTime
        from user_money
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            user_money
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.UserMoney">
        update user_money
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from user_money WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from user_money WHERE id = #{value}
    </delete>
    <select id="selectUserId" resultType="com.hx.phiappt.model.UserMoney">
        select * from user_money WHERE  userId=#{userId}
    </select>
    <update id="updateStoredValueFund">
        update user_money
        SET storedValueFund=#{storedValueFund}
        WHERE id = #{id}
    </update>
    <update id="updateValueAddedFund">
        update user_money
        SET valueAddedFund=#{valueAddedFund}
        WHERE id = #{id}
    </update>
</mapper>
phi_platform_common/src/main/resources/mapper/UserProjectItemMapper.xml
New file
@@ -0,0 +1,86 @@
<?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.UserProjectItemMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,total = #{total},actualTotal = #{actualTotal},oriPrice = #{oriPrice},curPrice = #{curPrice},buyNum = #{buyNum},usedTotal = #{usedTotal},notUsedNum = #{notUsedNum},usedNum = #{usedNum},effectiveStatus = #{effectiveStatus},timeLimit = #{timeLimit},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},commonType = #{commonType},commonId = #{commonId},usedOne = #{usedOne},userProjectId = #{userProjectId},userId = #{userId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.user.UserProjectItem">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_project_item (id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,isDel,createTime)  values (#{id},#{total},#{actualTotal},#{oriPrice},#{curPrice},#{buyNum},#{usedTotal},#{notUsedNum},#{usedNum},#{effectiveStatus},#{timeLimit},#{limitStartTime},#{limitEndTime},#{commonType},#{commonId},#{usedOne},#{userProjectId},#{userId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.user.UserProjectItem" 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.user.UserProjectItem" 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 user_project_item
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.user.UserProjectItem" parameterType="java.lang.Object" >
        select
            id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,isDel,createTime
        from user_project_item
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.user.UserProjectItem" parameterType="java.lang.Object" >
        select
            id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,isDel,createTime
        from user_project_item
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            user_project_item
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.user.UserProjectItem">
        update user_project_item
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from user_project_item WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from user_project_item WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/UserProjectMapper.xml
New file
@@ -0,0 +1,86 @@
<?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.UserProjectMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,type = #{type},goodsNo = #{goodsNo},goodsId = #{goodsId},effectiveStatus = #{effectiveStatus},usedTotal = #{usedTotal},notUsedNum = #{notUsedNum},usedNum = #{usedNum},overdueNum = #{overdueNum},transferNum = #{transferNum},userId = #{userId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.user.UserProject">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_project (id,type,goodsNo,goodsId,effectiveStatus,usedTotal,notUsedNum,usedNum,overdueNum,transferNum,userId,isDel,createTime)  values (#{id},#{type},#{goodsNo},#{goodsId},#{effectiveStatus},#{usedTotal},#{notUsedNum},#{usedNum},#{overdueNum},#{transferNum},#{userId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.user.UserProject" 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.user.UserProject" 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 user_project
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.user.UserProject" parameterType="java.lang.Object" >
        select
            id,type,goodsNo,goodsId,effectiveStatus,usedTotal,notUsedNum,usedNum,overdueNum,transferNum,userId,isDel,createTime
        from user_project
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.user.UserProject" parameterType="java.lang.Object" >
        select
            id,type,goodsNo,goodsId,effectiveStatus,usedTotal,notUsedNum,usedNum,overdueNum,transferNum,userId,isDel,createTime
        from user_project
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            user_project
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.user.UserProject">
        update user_project
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from user_project WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from user_project WHERE id = #{value}
    </delete>
</mapper>
phi_platform_user/src/main/java/com/hx/phip/order/controller/OrderController.java
@@ -1,8 +1,10 @@
package com.hx.phip.order.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hx.common.BaseController;
import com.hx.exception.TipsException;
import com.hx.phiappt.common.OrderButtonConstants;
import com.hx.phiappt.common.OrderTotalConstants;
import com.hx.phiappt.model.SysAdmin;
import com.hx.phiappt.model.order.OrderDeveloper;
@@ -16,6 +18,8 @@
import com.hx.util.StringUtils;
import com.platform.constants.LoginConstant;
import com.platform.entity.ThirtApplication;
import com.platform.exception.PlatTipsException;
import com.platform.resultTool.PlatformCode;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -44,7 +48,7 @@
    public void orderAdd(@RequestBody String param) {
        if(StringUtils.isEmpty(param)){
            throwParamException("请传订单参数");
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"请传订单参数");
        }
        ThirtApplication thirtApplication= (ThirtApplication) getRequestAttribute(LoginConstant.LOGIN_APPLY);
        JSONObject object = JSONObject.parseObject(param);
@@ -53,76 +57,117 @@
        OrdersTotal orderTotal = JSONObject.parseObject(object.getString("orderTotal"), OrdersTotal.class);
        //校验参数成功的订单
        orderTotal = checkOrderTotalParam(orderTotal);
        orderTotal.setAppId(thirtApplication.getAppId());
        orderTotal.setAppId(thirtApplication==null ?"":thirtApplication.getAppId());
        //获取订单的子订单
        List<OrderItem> orderItem = JSONObject.parseArray(object.getString("orderItem"), OrderItem.class);
        if(orderItem==null || orderItem.size()==0){
            throwParamException("订单的子订单不能为空");
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单的子订单不能为空");
        }
        orderItem=checkOrderItem(orderItem);
        //获取开发人员集合
        List<OrderDeveloper> orderDeveloperList = JSONObject.parseArray(object.getString("orderDeveloper"), OrderDeveloper.class);
//        if(orderDeveloperList ==null || orderDeveloperList.size()==0){
//            throwParamException("开发人员不能为空,默认是用户绑定的所属顾问");
//        }
        Integer type = object.getInteger("type");//用于判断前端点了什么按钮
        Integer type = object.getInteger("type");//用于判断前端点了什么按钮,目前有草稿,提交,结账
        String operatorId = object.getString("operatorId");//操作人id
        String shopId = object.getString("shopId");//操作人的门店id
        orderService.add(orderTotal,orderItem,type,orderDeveloperList,operatorId);
        orderService.add(orderTotal,orderItem,type,orderDeveloperList,operatorId,shopId);
    }
    /**
     * 结账
     * @param object
     * @param param
     */
    @RequestMapping(value = "/pay",method = RequestMethod.POST)
    public void orderPay(@RequestBody JSONObject object){
    public void orderPay(@RequestBody String param) throws Exception {
        if(StringUtils.isEmpty(param)){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"请传订单参数");
        }
        JSONObject object = JSONObject.parseObject(param);
        Integer type = object.getInteger("type");//是否是按项目付款,0:否,1:是
//        if(type == null){
//            throw new TipsException("请传结账类型");
//        }
        String orderId = object.getString("orderId");//订单id
        if(StringUtils.isEmpty(orderId)){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"请传订单id");
        }
        String total = object.getString("total");//应付的总金额
        if(StringUtils.isEmpty(total)){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"请传应付的总金额");
        }
        JSONArray amountList = object.getJSONArray("amount");//用户真正支付的金额集合
        if(amountList ==null || amountList.size()==0){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"请传用户真实付款金额");
        }
        String operatorId = object.getString("operatorId");//操作人员id
        if(StringUtils.isEmpty(operatorId)){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"请传用户操作人标识");
        }
        orderService.orderPay(type,orderId,total,amountList,operatorId);
    }
    /**
     * 测试充值储值金
     *
     */
    @RequestMapping(value = "/test",method = RequestMethod.POST)
    public void test(String value,String storeValue,String userId)  {
        orderService.test(value,storeValue,userId);
    }
    /*子订单参数校验*/
    private List<OrderItem> checkOrderItem(List<OrderItem> orderItem) {
        orderItem.forEach(o->{
            if(StringUtils.isEmpty(o.getType())){
                throwParamException("订单的子订单商品类型为空");
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单的子订单商品类型为空");
            }
            if(o.getBuyNum()==null){
                throwParamException("订单的子订单购买数量为空");
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单的子订单购买数量为空");
            }
            if(StringUtils.isEmpty(o.getCommonId())){
                throwParamException("订单的子订单项目id/商品id为空");
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单的子订单项目id/商品id为空");
            }
            if(o.getDiscount()==null){
                throwParamException("折扣为空,默认:100");
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"折扣为空,默认:100");
            }
        });
        return orderItem;
    }
    /*总订单参数校验*/
    private OrdersTotal checkOrderTotalParam(OrdersTotal orderTotal){
        if(StringUtils.isEmpty(orderTotal.getType())){
            throwParamException("订单类型为空");
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单类型为空");
        }
        if(StringUtils.isEmpty(orderTotal.getSourceType())){
            orderTotal.setSourceType(OrderTotalConstants.SOURCE_TYPE_APPLICATION);
        }
        if(StringUtils.isEmpty(orderTotal.getAppId())){
            throwParamException("来源应用appId为空");
        }
        if(StringUtils.isEmpty(orderTotal.getSourceType())){
            throwParamException("订单来源代码为空");
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"来源应用appId为空");
        }
        if(StringUtils.isEmpty(orderTotal.getSourceName())){
            throwParamException("订单来源名称为空");
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单来源名称为空");
        }
        if(StringUtils.isEmpty(orderTotal.getUserId())){
            throwParamException("用户Id为空");
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"用户Id为空");
        }
//        if(StringUtils.isEmpty(orderTotal.getChannelType())){
//            throwParamException("渠道类型不能为空");
//        }
        if(StringUtils.isEmpty(orderTotal.getCommonId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"渠道标识不能为空");
        }
        if(StringUtils.isEmpty(orderTotal.getCommonName())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"渠道名称不能为空");
        }
        if(StringUtils.isEmpty(orderTotal.getDepartmentCode())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"科室编码不能为空");
        }
        if(StringUtils.isEmpty(orderTotal.getDepartmentName())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"科室名称不能为空");
        }
        return orderTotal;
    }
}
phi_platform_user/src/main/java/com/hx/phip/order/service/OrderService.java
@@ -1,5 +1,6 @@
package com.hx.phip.order.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hx.common.service.CommonService;
import com.hx.phiappt.model.SysAdmin;
@@ -11,6 +12,9 @@
public interface OrderService {
    /*创建订单*/
    void add(OrdersTotal ordersTotal, List<OrderItem> items, Integer type, List<OrderDeveloper> orderDeveloperList,String operatorId);
    void add(OrdersTotal ordersTotal, List<OrderItem> items, Integer type, List<OrderDeveloper> orderDeveloperList,String operatorId,String shopId);
    void orderPay(Integer type, String orderId, String total, JSONArray amountList,String operatorId) throws Exception;
    /*测试充值金额*/
    void test(String value,String storeValue,String userId);
}
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java
@@ -4,17 +4,22 @@
import com.alibaba.fastjson.JSONObject;
import com.hx.common.service.CommonService;
import com.hx.exception.TipsException;
import com.hx.phiappt.common.OrderItemConstants;
import com.hx.phiappt.common.OrderTotalConstants;
import com.hx.phiappt.common.*;
import com.hx.phiappt.model.*;
import com.hx.phiappt.model.order.OrderDeveloper;
import com.hx.phiappt.model.order.OrderItem;
import com.hx.phiappt.model.order.OrdersTotal;
import com.hx.phiappt.model.user.UserProject;
import com.hx.phiappt.model.user.UserProjectItem;
import com.hx.phip.dao.mapper.*;
import com.hx.phip.order.service.OrderService;
import com.hx.phip.service.*;
import com.hx.phip.tool.CreateNo;
import com.hx.util.SimpleEncrypt;
import com.hx.util.StringUtils;
import com.platform.exception.PlatServiceException;
import com.platform.exception.PlatTipsException;
import com.platform.resultTool.PlatformCode;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -45,20 +50,37 @@
    private OrderDeveloperService orderDeveloperService;
    @Resource
    private SysAdminService sysAdminService;
    @Resource
    private PaymentMethodTypeService paymentMethodTypeService;
    @Resource
    private  PaymentMethodService paymentMethodService;
    @Resource
    private UserMoneyService userMoneyService;
    @Resource
    private UserMoneyLogService userMoneyLogService;
    @Resource
    private UserProjectService userProjectService;
    @Resource
    private UserProjectItemService userProjectItemService;
    @Resource
    private ShopService shopService;
    @Override
    public void add(OrdersTotal ordersTotal, List<OrderItem> items, Integer type, List<OrderDeveloper> orderDeveloperList,String operatorId) {
    public void add(OrdersTotal ordersTotal, List<OrderItem> items, Integer type, List<OrderDeveloper> orderDeveloperList,String operatorId,String shopId) {
        SysAdmin sysAdmin = sysAdminService.selectOneByKey(operatorId);
        if(sysAdmin==null){
            throw new TipsException("未找到操作人的信息"+operatorId);
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未找到操作人的信息"+operatorId);
        }
        Shop shop = shopService.selectOneByKey(shopId);//查询门店,创建订单人的门店
        if(shop==null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未找到门店信息"+shopId);
        }
        List<String> packageTypes = Arrays.asList("meal", "card");//套餐和卡项类型集合
        //type:0:草稿 1:提交 2:结账
        if(type==0){
        if(type== 0){
            ordersTotal.setStatus(OrderTotalConstants.STATUS_DRAFT);//订单状态:草稿
        }
        BigDecimal totalPrice=BigDecimal.ZERO;//订单总金额
        BigDecimal actualOrderTotal=BigDecimal.ZERO;//支付总金额
        BigDecimal shouldOrderTotal=BigDecimal.ZERO;//订单应付支付总金额
        BigDecimal buyNum=BigDecimal.ZERO;//购买数量
        BigDecimal actualTotal =BigDecimal.ZERO;//子订单实付金额
        BigDecimal sonTotalPrice =BigDecimal.ZERO;//子订单订单总额
@@ -78,12 +100,15 @@
            if(vo.getType().equals(OrderItemConstants.TYPE_PROJECT)){
                Project project = projectService.selectOneByKey(vo.getCommonId());
                if(project==null){
                    throw new TipsException("找不到项目:"+vo.getCommonId());
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"找不到项目:"+vo.getCommonId());
                }
                if(project.getPrice()==null){
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"项目:"+project.getName()+",没有销售价格,请填写销售单价在进行创建订单");
                }
                //项目实付金额=项目的销售价格*购买数量*折扣
                 actualTotal = project.getPrice().multiply(buyNum).multiply(vo.getDiscount().divide(new BigDecimal(100)));
                //项目订单总额=项目原价*购买数量,如果项目没有原价就用现价
                sonTotalPrice=sonTotalPrice.add(project.getOriginalPrice()==null?project.getOriginalPrice().multiply(buyNum):project.getPrice().multiply(buyNum));
                sonTotalPrice=sonTotalPrice.add(project.getOriginalPrice()==null?project.getPrice().multiply(buyNum):project.getOriginalPrice().multiply(buyNum));
                vo.setSingle(project.getTreatmentItemsNum()==null?1:project.getTreatmentItemsNum());//单次疗程数量
                vo.setUsedTotal(vo.getSingle()*vo.getBuyNum()); //总次疗程次数,单次疗程次数*购买的总量
                vo.setOriPrice(project.getOriginalPrice());//原价,项目的原价
@@ -99,7 +124,10 @@
            }else if(vo.getType().equals(OrderItemConstants.TYPE_RETAIL)){
                Consumables consumables = consumablesService.selectOneByKey(vo.getCommonId());
                if(consumables==null){
                    throw new TipsException("找不到项目:"+vo.getCommonId());
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"找不到项目:"+vo.getCommonId());
                }
                if(consumables.getPrice()==null){
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"商品:"+consumables.getName()+",没有销售价格,请填写销售单价在进行创建订单");
                }
                //商品实付金额=商品的销售价格*购买数量*折扣
                actualTotal = consumables.getPrice().multiply(buyNum).multiply(vo.getDiscount().divide(new BigDecimal(100)));
@@ -129,14 +157,13 @@
            vo.setTotal(sonTotalPrice);
            totalPrice=totalPrice.add(vo.getTotal());//订单总金额
            actualOrderTotal=actualOrderTotal.add(vo.getActualTotal());//支付总金额
            shouldOrderTotal=shouldOrderTotal.add(vo.getActualTotal());//订单应付支付总金额
            sonTotalPrice=BigDecimal.ZERO;
        }
        //如果开发人集合为空,那么默认用户的所属顾问
        if(orderDeveloperList==null || orderDeveloperList.size()==0){
            User user = userService.selectOneByKey(ordersTotal.getUserId());
            String shopId="";
            String shopName="";
            if(StringUtils.noNull(user.getHisCorpUserId())){
                Employee employee = employeeMapper.selectOneByKey(user.getHisCorpUserId());
@@ -158,11 +185,11 @@
        ordersTotal.setPayRecharge(BigDecimal.ZERO);//支付储值金金额
        ordersTotal.setPayIncrement(BigDecimal.ZERO);//支付增值金金额
        ordersTotal.setTotal(totalPrice);//订单总金额
        ordersTotal.setActualTotal(actualOrderTotal);//订单支付总金额
        ordersTotal.setDiscountTotal(totalPrice.subtract(actualOrderTotal));//优惠金额,以元为存储
        Employee employee = employeeMapper.selectOneByKey(operatorId);
        ordersTotal.setShopId(employee==null?"":employee.getShopId());//操作人门店标识
        ordersTotal.setShopName(employee==null?"":employee.getShopName());//操作人门店名称
        ordersTotal.setShouldTotal(shouldOrderTotal);//订单应付支付总金额
        ordersTotal.setDiscountTotal(totalPrice.subtract(shouldOrderTotal));//优惠金额,以元为存储
        ordersTotal.setShopId(shop.getId());//操作人门店标识
        ordersTotal.setShopName(shop.getName());//操作人门店名称
        ordersTotal.setActualTotal(BigDecimal.ZERO);//用户实际支付的总金额
        //创建总订单
        ordersTotalService.insert(ordersTotal);
@@ -189,7 +216,217 @@
    }
    private void pay(){
    @Override
    public void orderPay(Integer type, String orderId, String total, JSONArray amountList,String operatorId) throws Exception {
        SysAdmin sysAdmin = sysAdminService.selectOneByKey(operatorId);
        if(sysAdmin==null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未找到操作人的信息"+operatorId);
        }
        OrdersTotal ordersTotal = ordersTotalService.selectOneByKey(orderId);
        if(ordersTotal==null ){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"订单不存在");
        }
        if(ordersTotal.getShouldTotal().compareTo(new BigDecimal(total)) != 0){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"后台应付金额和传进参数不符合请检查");
        }
        UserMoney userMoney=userMoneyService.selectUserId(ordersTotal.getUserId());
        BigDecimal money = null;//用户真实支付的金额
        BigDecimal valueAddedFundBig = null;//增值金,用来转换类型
        BigDecimal storedValueFundBig = null;//增值金,用来转换类型
        UserMoneyLog userMoneyLog=null;//用户资金日志
        Integer isAccount=0;//等于0没有任何变化,1:代表增值金变动,2:代表储值金额有变动
        BigDecimal actualTotal=BigDecimal.ZERO;//订单的已支付总金额
        BigDecimal payTotal=BigDecimal.ZERO;//订单的已支付现金金额(微信/支付宝支付/其他)
        BigDecimal payRecharge=BigDecimal.ZERO;//订单的已支付储值金金额
        BigDecimal payIncrement=BigDecimal.ZERO;//订单的已支付增值金金额
        Map<String,String> itemMap=new HashMap<>();//用于存一级子订单商品对应的金额集合
        for(int i=0;i<amountList.size();i++){
            userMoneyLog=new UserMoneyLog();
            JSONObject jsonObject = amountList.getJSONObject(i);
            String amount = jsonObject.getString("amount");//用户实际支付金额
            String method = jsonObject.getString("method");//用户支付编码
            String commonId = jsonObject.getString("commonId");//用户支付的商品/项目/套餐/卡项的标识
            itemMap.put(commonId,amount);
            money = new BigDecimal(amount);
            PaymentMethod paymentMethod=paymentMethodService.selectNumberNo(method);
            if(paymentMethod==null){
                throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未找到支付方式");
            }
            PaymentMethodType paymentMethodType =paymentMethodTypeService.selectOneByKey(paymentMethod.getMethodTypeId());
            if(paymentMethodType.getName().equals("增值金") && paymentMethod.getUsedCashier()==1){
                isAccount=1;
                if(userMoney==null){
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未找到该用户的资金信息");
                }
                String valueAddedFund = SimpleEncrypt.simpleDeCode(userMoney.getValueAddedFund());//增值金
                valueAddedFundBig=new BigDecimal(valueAddedFund);
                if(valueAddedFundBig.compareTo(money)==-1){//判断用户的增值金是否能支付该金额
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"用户的增值金不足");
                }
                BigDecimal leftMoney = valueAddedFundBig.subtract(money);//支付完成的增值金额
                valueAddedFund = SimpleEncrypt.simpleEnCode(leftMoney.toString());//剩下之后并且加密的增值金
                userMoney.setValueAddedFund(valueAddedFund);
                //记录储值金用户资金变动日志
                setUserLog(sysAdmin, ordersTotal.getUserId(), money, valueAddedFundBig, userMoneyLog, leftMoney,UserMoneyLog.TYPE_VALUE_ADDED_FUND,UserMoneyLog.OP_TYPE_REDUCE);
                userMoneyLogService.insert(userMoneyLog);
                payIncrement=payIncrement.add(money);//累加增值金
            }else if(paymentMethodType.getName().equals("储值金") && paymentMethod.getUsedCashier()==1){
                isAccount=2;
                if(userMoney==null){
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未找到该用户的资金信息");
                }
                String storedValueFund = SimpleEncrypt.simpleDeCode(userMoney.getStoredValueFund());//储值金
                storedValueFundBig=new BigDecimal(storedValueFund);
                if(storedValueFundBig.compareTo(money)==-1){//判断用户的储值金是否能支付该金额
                    throw new PlatTipsException(PlatformCode.ERROR_TIPS,"用户的储值金不足");
                }
                BigDecimal leftMoney = storedValueFundBig.subtract(money);//支付完成的增值金额
                storedValueFund = SimpleEncrypt.simpleEnCode(leftMoney.toString());//剩下之后并且加密的增值金
                userMoney.setValueAddedFund(storedValueFund);
                //记录储值金用户资金变动日志
                setUserLog(sysAdmin, ordersTotal.getUserId(), money, storedValueFundBig, userMoneyLog, leftMoney,UserMoneyLog.TYPE_STORED_VALUE_FUND,UserMoneyLog.OP_TYPE_REDUCE);
                userMoneyLogService.insert(userMoneyLog);
                payRecharge=payRecharge.add(money);//累加储值金
            }
        }
        if(isAccount==0){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"请传支付方式编码");
        }else if(isAccount<=1){
            userMoneyService.updateValueAddedFund(userMoney);
        }else if(isAccount>=1 && isAccount <=2){
            userMoneyService.updateStoredValueFund(userMoney);
        }
        //获取子订单
        List<OrderItem> orderItemList= orderItemService.selectItemList(ordersTotal.getId());
        if(orderItemList ==null || orderItemList.size()==0){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"没有对应的子订单");
        }
        UserProject userProject = null;
        UserProjectItem userProjectItem = null;
        Date date = new Date();
        BigDecimal itemMoneyBig=null;
        for(OrderItem vo:orderItemList){
            date = new Date();
            userProject=new UserProject();
            userProjectItem = new UserProjectItem();
            if(vo.getType().equals(OrderItemConstants.TYPE_PROJECT) && vo.getType().equals(OrderItemConstants.TYPE_RETAIL)){
                setUserProject(ordersTotal, userProject, vo,vo.getType());
                userProjectService.insert(userProject);//新增用户项目记录
                setUserProjectItem(ordersTotal, userProject, userProjectItem, date, vo);
                userProjectItemService.insert(userProjectItem);//新增用户项目子项记录
            }
            //暂定,如果是套餐还需要根据套餐找出子订单的子项
            String itemMoney = itemMap.get(vo.getCommonId());
            if(StringUtils.noNull(itemMoney)){
                itemMoneyBig=new BigDecimal(itemMoney);
                if(itemMoneyBig.compareTo(vo.getActualTotal()) ==-1){
                    vo.setPayStatus(OrderTotalConstants.PAY_STATUS_PART);//部分支付
                }else if(itemMoneyBig.compareTo(vo.getActualTotal()) ==0){
                    vo.setPayStatus(OrderTotalConstants.PAY_STATUS_SUC);//已支付
                }
                orderItemService.updatePayStatus(vo);//更改子订单的支付状态
            }
        }
        //更改总订单接口
        ordersTotal.setPayRecharge(payRecharge);//用户实际支付的储值金
        ordersTotal.setPayIncrement(payIncrement);//用户实际支付的增值金
        ordersTotal.setPayTotal(payTotal);//用户实际支付的现金金额(微信/支付宝支付/其他)
        actualTotal=payRecharge.add(payIncrement).add(payTotal);//用户实际支付的总金额
        ordersTotal.setActualTotal(actualTotal);
        if(actualTotal.compareTo(ordersTotal.getShouldTotal()) ==-1){
            ordersTotal.setPayStatus(OrderTotalConstants.PAY_STATUS_PART);//部分支付
            ordersTotal.setStatus(OrderTotalConstants.STATUS_ARREARS);//欠费
        }else if(actualTotal.compareTo(ordersTotal.getShouldTotal()) ==0){
            ordersTotal.setPayStatus(OrderTotalConstants.PAY_STATUS_SUC);//已支付
            ordersTotal.setStatus(OrderTotalConstants.STATUS_PAY);//已支付
        }
        ordersTotal.setPayTime(new Date());//支付时间
        ordersTotalService.updatePay(ordersTotal);//更新总订单
    }
    @Override
    public void test(String value, String storeValue,String userId) {
        System.out.println("增值金"+value);
        System.out.println("储值金"+storeValue);
        if(StringUtils.noNull(value)){
            try {
                UserMoney userMoney1 = userMoneyService.selectUserId(userId);
                if(userMoney1==null){
                    UserMoney userMoney = new UserMoney();
                    userMoney.setValueAddedFund(SimpleEncrypt.simpleEnCode(value));
                    userMoney.setIntegral(SimpleEncrypt.simpleEnCode("0"));
                    userMoney.setStoredValueFund(SimpleEncrypt.simpleEnCode(storeValue));
                    userMoney.setUserId(userId);
                    userMoneyService.insert(userMoney);
                }else {
                    if(StringUtils.noNull(value)){
                        userMoney1.setValueAddedFund(SimpleEncrypt.simpleEnCode(value));
                        userMoneyService.updateValueAddedFund(userMoney1);
                    }
                    if(StringUtils.noNull(storeValue)){
                        userMoney1.setStoredValueFund(SimpleEncrypt.simpleEnCode(storeValue));
                        userMoneyService.updateStoredValueFund(userMoney1);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    private void setUserProjectItem(OrdersTotal ordersTotal, UserProject userProject, UserProjectItem userProjectItem, Date date, OrderItem vo) {
        userProjectItem.setTotal(vo.getTotal());//子项总金额
        userProjectItem.setActualTotal(vo.getActualTotal());//子项支付总金额
        userProjectItem.setOriPrice(vo.getOriPrice());//原价
        userProjectItem.setCurPrice(vo.getCurPrice());//现价
        userProjectItem.setBuyNum(vo.getBuyNum());//数量
        userProjectItem.setUsedTotal(vo.getUsedTotal());//总次数
        userProjectItem.setNotUsedNum(vo.getUsedTotal());//未使用次数(户口的时候需要相应扣减)
        userProjectItem.setUsedNum(0);//已使用次数
        userProjectItem.setEffectiveStatus(UserProjectConstants.EFF_STATUS_YES);//是否有效,结账默认项目和商品有效,套餐卡项暂定
        userProjectItem.setTimeLimit(0);//是否有效时间限制,目前项目和商品没有时间限制,套餐和卡项暂定
        userProjectItem.setLimitStartTime(date);//有效开始时间,系统当前时间
        userProjectItem.setLimitEndTime(date);//有效结束时间,系统当前时间,项目和商品是没有时间限制的,所以默认系统当前时间,如果是套餐和卡项就填套餐和卡项的有效时间
        userProjectItem.setCommonType(OrderSourceConstans.TYPE_PROJECT);//项目和商品是来源于一级子订单,套餐和卡项即使二级子订单
        userProjectItem.setCommonId(vo.getId());//类型是一级子订单,该字段就是一级子订单标识,二级也是如此
        userProjectItem.setUsedOne(vo.getSingle());//单次疗程数量
        userProjectItem.setUserProjectId(userProject.getId());//用户项目id
        userProjectItem.setUserId(ordersTotal.getUserId());//用户id
    }
    private void setUserProject(OrdersTotal ordersTotal, UserProject userProject, OrderItem vo,String type) {
        userProject.setType(type);
        userProject.setGoodsNo(vo.getGoodsNo());
        userProject.setGoodsId(vo.getCommonId());
        userProject.setEffectiveStatus(UserProjectConstants.EFF_STATUS_YES);
        userProject.setUsedTotal(vo.getUsedTotal());
        userProject.setNotUsedNum(vo.getUsedTotal());
        userProject.setUsedNum(0);
        userProject.setOverdueNum(0);
        userProject.setTransferNum(0);
        userProject.setUserId(ordersTotal.getUserId());
    }
    private void setUserLog(SysAdmin sysAdmin, String userId, BigDecimal money, BigDecimal valueAddedFundBig, UserMoneyLog userMoneyLog, BigDecimal leftMoney,Integer type,Integer opType) {
        userMoneyLog.setUserId(userId);
        userMoneyLog.setType(type);
        userMoneyLog.setOpNumber(money);
        userMoneyLog.setOpBeforeNumber(valueAddedFundBig);
        userMoneyLog.setOpAfterNumber(leftMoney);
        userMoneyLog.setOpAdminId(sysAdmin.getId());
        userMoneyLog.setOpAdminName(sysAdmin.getName());
        userMoneyLog.setRemarks("");
        userMoneyLog.setOpType(opType);
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/OrderItemService.java
@@ -30,4 +30,16 @@
    
    void deleteOne(String delId);
    /**
     * 获取子订单
     * @param id            总订单
     * @return
     */
    List<OrderItem> selectItemList(String id);
    /**
     * 更新支付状态
     * @param vo
     */
    void updatePayStatus(OrderItem vo);
}
phi_platform_user/src/main/java/com/hx/phip/service/OrdersTotalService.java
@@ -29,5 +29,6 @@
    
    void deleteOne(String delId);
    /*更新总订单*/
    void updatePay(OrdersTotal ordersTotal);
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrderItemServiceImpl.java
@@ -92,7 +92,17 @@
        }
    }
    /**查询条数*/
    @Override
    public List<OrderItem> selectItemList(String id) {
        return orderItemMapper.selectItemList(id);
    }
    @Override
    public void updatePayStatus(OrderItem vo) {
        orderItemMapper.updatePayStatus(vo.getPayStatus(),vo.getId());
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = orderItemMapper.selectCount(sqlSentence);
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrdersTotalServiceImpl.java
@@ -92,7 +92,12 @@
        }
    }
    /**查询条数*/
    @Override
    public void updatePay(OrdersTotal ordersTotal) {
        ordersTotalMapper.updatePay(ordersTotal.getPayRecharge(),ordersTotal.getPayIncrement(),ordersTotal.getPayTotal(),ordersTotal.getStatus(),ordersTotal.getId(),ordersTotal.getPayTime());
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = ordersTotalMapper.selectCount(sqlSentence);
phi_platform_user/src/main/java/com/hx/phip/service/impl/PaymentMethodServiceImpl.java
New file
@@ -0,0 +1,106 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.PaymentMethodMapper;
import com.hx.phiappt.model.PaymentMethod;
import com.hx.phip.service.PaymentMethodService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class PaymentMethodServiceImpl implements PaymentMethodService {
    @Resource
    private PaymentMethodMapper paymentMethodMapper;
    /**查询列表*/
    @Override
    public List<PaymentMethod> selectList(SqlSentence sqlSentence) {
        return paymentMethodMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return paymentMethodMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public PaymentMethod selectOne(SqlSentence sqlSentence) {
        return paymentMethodMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return paymentMethodMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public PaymentMethod selectOneByKey(Object object) {
        return paymentMethodMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public PaymentMethod selectOneByKeyBlob(Object object) {
        return paymentMethodMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(PaymentMethod paymentMethod) {
        int count = paymentMethodMapper.insert(paymentMethod);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(PaymentMethod paymentMethod) {
        int count = paymentMethodMapper.updateAll(paymentMethod);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = paymentMethodMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = paymentMethodMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    @Override
    public PaymentMethod selectNumberNo(String method) {
        return paymentMethodMapper.selectNumberNo(method);
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = paymentMethodMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/PaymentMethodTypeServiceImpl.java
New file
@@ -0,0 +1,101 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.PaymentMethodTypeMapper;
import com.hx.phiappt.model.PaymentMethodType;
import com.hx.phip.service.PaymentMethodTypeService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class PaymentMethodTypeServiceImpl implements PaymentMethodTypeService {
    @Resource
    private PaymentMethodTypeMapper paymentMethodTypeMapper;
    /**查询列表*/
    @Override
    public List<PaymentMethodType> selectList(SqlSentence sqlSentence) {
        return paymentMethodTypeMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return paymentMethodTypeMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public PaymentMethodType selectOne(SqlSentence sqlSentence) {
        return paymentMethodTypeMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return paymentMethodTypeMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public PaymentMethodType selectOneByKey(Object object) {
        return paymentMethodTypeMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public PaymentMethodType selectOneByKeyBlob(Object object) {
        return paymentMethodTypeMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(PaymentMethodType paymentMethodType) {
        int count = paymentMethodTypeMapper.insert(paymentMethodType);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(PaymentMethodType paymentMethodType) {
        int count = paymentMethodTypeMapper.updateAll(paymentMethodType);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = paymentMethodTypeMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = paymentMethodTypeMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = paymentMethodTypeMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/ShopServiceImpl.java
New file
@@ -0,0 +1,101 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.ShopMapper;
import com.hx.phiappt.model.Shop;
import com.hx.phip.service.ShopService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class ShopServiceImpl implements ShopService {
    @Resource
    private ShopMapper shopMapper;
    /**查询列表*/
    @Override
    public List<Shop> selectList(SqlSentence sqlSentence) {
        return shopMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return shopMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Shop selectOne(SqlSentence sqlSentence) {
        return shopMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return shopMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public Shop selectOneByKey(Object object) {
        return shopMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public Shop selectOneByKeyBlob(Object object) {
        return shopMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(Shop shop) {
        int count = shopMapper.insert(shop);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(Shop shop) {
        int count = shopMapper.updateAll(shop);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = shopMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = shopMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = shopMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserMoneyLogServiceImpl.java
New file
@@ -0,0 +1,101 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.UserMoneyLogMapper;
import com.hx.phiappt.model.UserMoneyLog;
import com.hx.phip.service.UserMoneyLogService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class UserMoneyLogServiceImpl implements UserMoneyLogService {
    @Resource
    private UserMoneyLogMapper userMoneyLogMapper;
    /**查询列表*/
    @Override
    public List<UserMoneyLog> selectList(SqlSentence sqlSentence) {
        return userMoneyLogMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return userMoneyLogMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public UserMoneyLog selectOne(SqlSentence sqlSentence) {
        return userMoneyLogMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return userMoneyLogMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public UserMoneyLog selectOneByKey(Object object) {
        return userMoneyLogMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public UserMoneyLog selectOneByKeyBlob(Object object) {
        return userMoneyLogMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(UserMoneyLog userMoneyLog) {
        int count = userMoneyLogMapper.insert(userMoneyLog);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(UserMoneyLog userMoneyLog) {
        int count = userMoneyLogMapper.updateAll(userMoneyLog);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = userMoneyLogMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = userMoneyLogMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = userMoneyLogMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserMoneyServiceImpl.java
New file
@@ -0,0 +1,117 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import com.hx.phiappt.model.UserMoneyLog;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.UserMoneyMapper;
import com.hx.phiappt.model.UserMoney;
import com.hx.phip.service.UserMoneyService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class UserMoneyServiceImpl implements UserMoneyService {
    @Resource
    private UserMoneyMapper userMoneyMapper;
    /**查询列表*/
    @Override
    public List<UserMoney> selectList(SqlSentence sqlSentence) {
        return userMoneyMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return userMoneyMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public UserMoney selectOne(SqlSentence sqlSentence) {
        return userMoneyMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return userMoneyMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public UserMoney selectOneByKey(Object object) {
        return userMoneyMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public UserMoney selectOneByKeyBlob(Object object) {
        return userMoneyMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(UserMoney userMoney) {
        int count = userMoneyMapper.insert(userMoney);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(UserMoney userMoney) {
        int count = userMoneyMapper.updateAll(userMoney);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = userMoneyMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = userMoneyMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    @Override
    public UserMoney selectUserId(String userId) {
        return userMoneyMapper.selectUserId(userId);
    }
    @Override
    public void updateStoredValueFund(UserMoney userMoney) {
         userMoneyMapper.updateStoredValueFund(userMoney.getStoredValueFund(), userMoney.getId());
    }
    @Override
    public void updateValueAddedFund(UserMoney userMoney) {
        userMoneyMapper.updateValueAddedFund(userMoney.getValueAddedFund(), userMoney.getId());
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = userMoneyMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserProjectItemServiceImpl.java
New file
@@ -0,0 +1,101 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.UserProjectItemMapper;
import com.hx.phiappt.model.user.UserProjectItem;
import com.hx.phip.service.UserProjectItemService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class UserProjectItemServiceImpl implements UserProjectItemService {
    @Resource
    private UserProjectItemMapper userProjectItemMapper;
    /**查询列表*/
    @Override
    public List<UserProjectItem> selectList(SqlSentence sqlSentence) {
        return userProjectItemMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return userProjectItemMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public UserProjectItem selectOne(SqlSentence sqlSentence) {
        return userProjectItemMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return userProjectItemMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public UserProjectItem selectOneByKey(Object object) {
        return userProjectItemMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public UserProjectItem selectOneByKeyBlob(Object object) {
        return userProjectItemMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(UserProjectItem userProjectItem) {
        int count = userProjectItemMapper.insert(userProjectItem);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(UserProjectItem userProjectItem) {
        int count = userProjectItemMapper.updateAll(userProjectItem);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = userProjectItemMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = userProjectItemMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = userProjectItemMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserProjectServiceImpl.java
New file
@@ -0,0 +1,101 @@
package com.hx.phip.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.dao.mapper.UserProjectMapper;
import com.hx.phiappt.model.user.UserProject;
import com.hx.phip.service.UserProjectService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class UserProjectServiceImpl implements UserProjectService {
    @Resource
    private UserProjectMapper userProjectMapper;
    /**查询列表*/
    @Override
    public List<UserProject> selectList(SqlSentence sqlSentence) {
        return userProjectMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return userProjectMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public UserProject selectOne(SqlSentence sqlSentence) {
        return userProjectMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return userProjectMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public UserProject selectOneByKey(Object object) {
        return userProjectMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public UserProject selectOneByKeyBlob(Object object) {
        return userProjectMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(UserProject userProject) {
        int count = userProjectMapper.insert(userProject);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(UserProject userProject) {
        int count = userProjectMapper.updateAll(userProject);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = userProjectMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = userProjectMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = userProjectMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/resources/application-local.properties
@@ -8,7 +8,8 @@
#\u8BBE\u7F6E\u6570\u636E\u5E93\u8FDE\u63A5
spring.datasource.url=jdbc:mysql://localhost:3306/phi_guide?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=root
#spring.datasource.password=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#\u8BBE\u7F6E\u76D1\u63A7\u8D26\u53F7