zhouxiang
2021-12-10 c53fd035eb5ad3b4ba957aa157d3e042f8ac527d
添加创建订单和支付订单日志,以及保存订单商品规格
10个文件已添加
5个文件已修改
774 ■■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrderGoodsSpecsMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrderLogMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/ShopMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrderGoodsSpecsMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrderLogMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/ShopMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/EmployeeRoleService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/OrderGoodsSpecsService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/OrderLogService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/ShopService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/EmployeeRoleServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrderGoodsSpecsServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrderLogServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/ShopServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrderGoodsSpecsMapper.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.order.OrderGoodsSpecs;
public interface OrderGoodsSpecsMapper {
    /**新增,返回主键*/
    int insert(OrderGoodsSpecs orderGoodsSpecs);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<OrderGoodsSpecs> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    OrderGoodsSpecs selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    OrderGoodsSpecs selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    OrderGoodsSpecs selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(OrderGoodsSpecs orderGoodsSpecs);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrderLogMapper.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.order.OrderLog;
public interface OrderLogMapper {
    /**新增,返回主键*/
    int insert(OrderLog orderLog);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<OrderLog> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    OrderLog selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    OrderLog selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    OrderLog selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(OrderLog orderLog);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/ShopMapper.java
@@ -4,6 +4,7 @@
import java.util.Map;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.model.Shop;
import org.apache.ibatis.annotations.Param;
public interface ShopMapper {
    /**新增,返回主键*/
@@ -32,4 +33,7 @@
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
    Shop selectAdiver(@Param("hisCorpUserId") String hisCorpUserId);
}
phi_platform_common/src/main/resources/mapper/OrderGoodsSpecsMapper.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.OrderGoodsSpecsMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,type = #{type},specsId = #{specsId},specsTitle = #{specsTitle},specsValue = #{specsValue},unit = #{unit},goodsNo = #{goodsNo},goodsId = #{goodsId},orderId = #{orderId},orderItemId = #{orderItemId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.order.OrderGoodsSpecs">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into order_goods_specs (id,type,specsId,specsTitle,specsValue,unit,goodsNo,goodsId,orderId,orderItemId,isDel,createTime)  values (#{id},#{type},#{specsId},#{specsTitle},#{specsValue},#{unit},#{goodsNo},#{goodsId},#{orderId},#{orderItemId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.order.OrderGoodsSpecs" 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.order.OrderGoodsSpecs" 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 order_goods_specs
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrderGoodsSpecs" parameterType="java.lang.Object" >
        select
            id,type,specsId,specsTitle,specsValue,unit,goodsNo,goodsId,orderId,orderItemId,isDel,createTime
        from order_goods_specs
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrderGoodsSpecs" parameterType="java.lang.Object" >
        select
            id,type,specsId,specsTitle,specsValue,unit,goodsNo,goodsId,orderId,orderItemId,isDel,createTime
        from order_goods_specs
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            order_goods_specs
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.order.OrderGoodsSpecs">
        update order_goods_specs
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from order_goods_specs WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from order_goods_specs WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/OrderLogMapper.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.OrderLogMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,logType = #{logType},content = #{content},opMan = #{opMan},opId = #{opId},status = #{status},orderId = #{orderId},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.order.OrderLog">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into order_log (id,logType,content,opMan,opId,status,orderId,isDel,createTime)  values (#{id},#{logType},#{content},#{opMan},#{opId},#{status},#{orderId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.order.OrderLog" 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.order.OrderLog" 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 order_log
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrderLog" parameterType="java.lang.Object" >
        select
            id,logType,content,opMan,opId,status,orderId,isDel,createTime
        from order_log
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrderLog" parameterType="java.lang.Object" >
        select
            id,logType,content,opMan,opId,status,orderId,isDel,createTime
        from order_log
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            order_log
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.order.OrderLog">
        update order_log
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from order_log WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from order_log WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/ShopMapper.xml
@@ -62,8 +62,11 @@
        from shop
        WHERE id = #{value}
    </select>
    <select id="selectAdiver" resultType="com.hx.phiappt.model.Shop">
        SELECT s.* FROM employee_role er LEFT JOIN shop s ON er.shopId = s.id WHERE er.isDel=0 and er.employeeId = #{hisCorpUserId} AND er.roleUniqueStr ='adviser_leader'
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            shop
        SET ${sqlSentence}
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java
@@ -2,13 +2,9 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hx.common.service.CommonService;
import com.hx.exception.TipsException;
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.order.*;
import com.hx.phiappt.model.user.UserProject;
import com.hx.phiappt.model.user.UserProjectItem;
import com.hx.phip.dao.mapper.*;
@@ -17,7 +13,6 @@
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;
@@ -26,7 +21,6 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Transactional
@Service
@@ -45,7 +39,7 @@
    @Resource
    private UserService userService;
    @Resource
    private EmployeeMapper employeeMapper;
    private EmployeeRoleService employeeRoleService;
    @Resource
    private OrderDeveloperService orderDeveloperService;
    @Resource
@@ -64,6 +58,10 @@
    private UserProjectItemService userProjectItemService;
    @Resource
    private ShopService shopService;
    @Resource
    private OrderLogService orderLogService;
    @Resource
    private OrderGoodsSpecsService orderGoodsSpecsService;
    @Override
    public void add(OrdersTotal ordersTotal, List<OrderItem> items, Integer type, List<OrderDeveloper> orderDeveloperList,String operatorId,String shopId) {
        SysAdmin sysAdmin = sysAdminService.selectOneByKey(operatorId);
@@ -88,6 +86,7 @@
        JSONArray jsonObject = new JSONArray();//用来封装规格json集合
        Map<String,Object> map=new HashMap<>();//用来存储规格的map
        BigDecimal discountTotal=BigDecimal.ZERO;//总订单的优惠总金额
        OrderGoodsSpecs orderGoodsSpecs=null;//订单子订单商品规格
        //计算总订单金额信息,填补子订单信息
        for(OrderItem vo:items){
@@ -121,6 +120,7 @@
                vo.setCurPrice(project.getPrice());//现价,项目的销售单价格
                map.put("specsTitle",project.getSpecification());
                map.put("unit","");
                jsonObject.add(map);
                vo.setSpecs(StringUtils.isEmpty(project.getSpecification())?"[]":jsonObject.toString());//规格
@@ -150,6 +150,7 @@
                vo.setCurPrice(consumables.getPrice());//现价
                map.put("specsTitle",consumables.getSpec());
                map.put("unit",consumables.getUnitName());
                vo.setSpecs(StringUtils.isEmpty(consumables.getSpec())?"[]":jsonObject.toString());//规格
                vo.setGoodsNo(consumables.getSerialNumber());//项目编号
                vo.setGoodsName(consumables.getName());//项目名称
@@ -174,36 +175,23 @@
        //如果开发人集合为空,那么默认用户的所属顾问
        if(orderDeveloperList==null || orderDeveloperList.size()==0){
            User user = userService.selectOneByKey(ordersTotal.getUserId());
            String shopName="";
            if(StringUtils.noNull(user.getHisCorpUserId())){
                Employee employee = employeeMapper.selectOneByKey(user.getHisCorpUserId());
                shopId=employee.getShopId();
                shopName=employee.getShopName();
                Shop userShop = shopService.selectAdiver(user.getHisCorpUserId());
                //开发人门店标识(用户绑定的销售顾问)
                ordersTotal.setDeveloperShopId(userShop.getId());
                //开发人门店名称
                ordersTotal.setDeveloperShopName(userShop.getName());
            }else{
                throw new PlatTipsException(PlatformCode.ERROR_TIPS,"请填写好开发人或者用户绑定一个销售顾问在重试");
            }
            //开发人门店标识(用户绑定的销售顾问)
            ordersTotal.setDeveloperShopId(shopId);
            //开发人门店名称
            ordersTotal.setDeveloperShopName(shopName);
        }
        String orderNum = CreateNo.createTimeNo(systemParameterMapper, "S", 4, "yyyyMMdd");
        ordersTotal.setOrderNo(orderNum);//订单编号
        ordersTotal.setOperatorType(sysAdmin.getType());//操作类型(0:系统管理员,1:员工)
        ordersTotal.setOperatorId(sysAdmin.getId());//下单操作人标识
        ordersTotal.setOperatorName(sysAdmin.getName());//下单操作人名称
        ordersTotal.setPayTotal(BigDecimal.ZERO);//支付现金金额
        ordersTotal.setPayRecharge(BigDecimal.ZERO);//支付储值金金额
        ordersTotal.setPayIncrement(BigDecimal.ZERO);//支付增值金金额
        ordersTotal.setTotal(totalPrice);//订单总金额
        ordersTotal.setShouldTotal(shouldOrderTotal);//订单应付支付总金额
        ordersTotal.setDiscountTotal(discountTotal);//优惠金额,以元为存储
        ordersTotal.setShopId(shop.getId());//操作人门店标识
        ordersTotal.setShopName(shop.getName());//操作人门店名称
        ordersTotal.setActualTotal(BigDecimal.ZERO);//用户实际支付的总金额
        ordersTotal.setChannelType(OrderTotalConstants.CHANNEL_TYPE_NOTHING);//暂定用没有渠道类型
        setOrderTotal(ordersTotal, sysAdmin, shop, totalPrice, shouldOrderTotal, discountTotal);
        //创建总订单
        ordersTotalService.insert(ordersTotal);
        orderLogService.insert(setCreateOrderTotalUserLog(ordersTotal,sysAdmin.getName(),sysAdmin.getId()));
        //总订单绑定开发人
        if(orderDeveloperList !=null && orderDeveloperList.size()>0){
@@ -221,10 +209,50 @@
            if(packageTypes.contains(vo.getType())){
                packageIds.add(vo.getCommonId());//套餐/卡项id集合
            }
            //如果是套餐也需要保存,暂时没有套餐和卡项
            JSONArray objects = JSONArray.parseArray(vo.getSpecs());
            for(int i=0;i<objects.size();i++){
                JSONObject object = objects.getJSONObject(i);
                //保存子订单商品规格表
                orderGoodsSpecs=new OrderGoodsSpecs();
                setOrderGoodsSpecs(ordersTotal, orderGoodsSpecs, vo, object);
                orderGoodsSpecsService.insert(orderGoodsSpecs);
            }
        }
        //暂定,查询套餐/卡项的项目/商品,并且遍历保存子订单的子项
    }
    private void setOrderGoodsSpecs(OrdersTotal ordersTotal, OrderGoodsSpecs orderGoodsSpecs, OrderItem vo, JSONObject object) {
        orderGoodsSpecs.setType(vo.getType());
        orderGoodsSpecs.setGoodsId(vo.getCommonId());
        orderGoodsSpecs.setGoodsNo(vo.getGoodsNo());
        orderGoodsSpecs.setOrderId(ordersTotal.getId());
        orderGoodsSpecs.setOrderItemId(vo.getId());
        orderGoodsSpecs.setSpecsTitle("规格");
        orderGoodsSpecs.setSpecsValue(object.getString("specsTitle"));
        orderGoodsSpecs.setSpecsId(vo.getCommonId());
        orderGoodsSpecs.setUnit(object.getString("unit"));
    }
    private void setOrderTotal(OrdersTotal ordersTotal, SysAdmin sysAdmin, Shop shop, BigDecimal totalPrice, BigDecimal shouldOrderTotal, BigDecimal discountTotal) {
        String orderNum = CreateNo.createTimeNo(systemParameterMapper, "S", 4, "yyyyMMdd");
        ordersTotal.setOrderNo(orderNum);//订单编号
        ordersTotal.setOperatorType(sysAdmin.getType());//操作类型(0:系统管理员,1:员工)
        ordersTotal.setOperatorId(sysAdmin.getId());//下单操作人标识
        ordersTotal.setOperatorName(sysAdmin.getName());//下单操作人名称
        ordersTotal.setPayTotal(BigDecimal.ZERO);//支付现金金额
        ordersTotal.setPayRecharge(BigDecimal.ZERO);//支付储值金金额
        ordersTotal.setPayIncrement(BigDecimal.ZERO);//支付增值金金额
        ordersTotal.setTotal(totalPrice);//订单总金额
        ordersTotal.setShouldTotal(shouldOrderTotal);//订单应付支付总金额
        ordersTotal.setDiscountTotal(discountTotal);//优惠金额,以元为存储
        ordersTotal.setShopId(shop.getId());//操作人门店标识
        ordersTotal.setShopName(shop.getName());//操作人门店名称
        ordersTotal.setActualTotal(BigDecimal.ZERO);//用户实际支付的总金额
        ordersTotal.setChannelType(OrderTotalConstants.CHANNEL_TYPE_NOTHING);//暂定用没有渠道类型
    }
    @Override
@@ -241,8 +269,8 @@
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"后台应付金额和传进参数不符合请检查");
        }
        UserMoney userMoney=userMoneyService.selectUserId(ordersTotal.getUserId());
        System.out.println("变化前的增值金:"+SimpleEncrypt.simpleDeCode(userMoney.getValueAddedFund()));
        System.out.println("变化前的储值金:"+SimpleEncrypt.simpleDeCode(userMoney.getStoredValueFund()));
//        System.out.println("变化前的增值金:"+SimpleEncrypt.simpleDeCode(userMoney.getValueAddedFund()));
//        System.out.println("变化前的储值金:"+SimpleEncrypt.simpleDeCode(userMoney.getStoredValueFund()));
        BigDecimal money = null;//用户真实支付的金额
        BigDecimal valueAddedFundBig = null;//增值金,用来转换类型
@@ -327,6 +355,7 @@
        }
        ordersTotalService.updatePay(ordersTotal);//更新总订单
        orderLogService.insert(setPayOrderTotalUserLog(ordersTotal,sysAdmin.getName(),sysAdmin.getId()));//记录日志
        //获取子订单
        List<OrderItem> orderItemList= orderItemService.selectItemList(ordersTotal.getId());
@@ -352,13 +381,20 @@
            String itemMoney = itemMap.get(vo.getCommonId());
            if(StringUtils.noNull(itemMoney)){
                vo.setPayStatus(ordersTotal.getPayStatus());//支付状态,先暂定按照总订单的支付状态来
                vo.setPayStatus(ordersTotal.getPayStatus());//支付状态,先暂定总订单支付状态
                orderItemService.updatePayStatus(vo);//更改子订单的支付状态
            }
        }
    }
    private OrderLog setPayOrderTotalUserLog(OrdersTotal ordersTotal, String opName, String opId) {
        return new OrderLog(ordersTotal.getId(),OrderLogConstants.LOG_TYPE_PAY,
                            "操作人:"+opName+",操作订单类型:"+ordersTotal.getType()+",订单编号:"+ordersTotal.getOrderNo()+",应付总金额:"+ordersTotal.getShouldTotal()
                                            +",已支付总金额:"+ordersTotal.getActualTotal()+",优惠总金额:"+ordersTotal.getDiscountTotal(),
                            opName,opId,ordersTotal.getStatus());
    }
    @Override
@@ -439,4 +475,8 @@
        userMoneyLog.setOpType(opType);
    }
    private OrderLog setCreateOrderTotalUserLog(OrdersTotal ordersTotal,String opName,String opId){
        return new OrderLog(ordersTotal.getId(),OrderLogConstants.LOG_TYPE_CREATE,"操作人:"+opName+",创建订单类型:"+ordersTotal.getType()+",订单编号:"+ordersTotal.getOrderNo()
                    +",应付总金额:"+ordersTotal.getShouldTotal(),opName,opId,ordersTotal.getStatus());
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/EmployeeRoleService.java
New file
@@ -0,0 +1,32 @@
package com.hx.phip.service;
import com.hx.phiappt.model.EmployeeRole;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
public interface EmployeeRoleService {
    int selectCount(SqlSentence sqlSentence);
    void insert(EmployeeRole employeeRole);
    List<EmployeeRole> selectList(SqlSentence sqlSentence);
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    EmployeeRole selectOne(SqlSentence sqlSentence);
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    EmployeeRole selectOneByKey(Object object);
    EmployeeRole selectOneByKeyBlob(Object object);
    void updateAll(EmployeeRole employeeRole);
    void updateWhere(SqlSentence sqlSentence);
    void deleteOne(String delId);
}
phi_platform_user/src/main/java/com/hx/phip/service/OrderGoodsSpecsService.java
New file
@@ -0,0 +1,33 @@
package com.hx.phip.service;
import com.hx.phiappt.model.order.OrderGoodsSpecs;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
public interface OrderGoodsSpecsService {
    int selectCount(SqlSentence sqlSentence);
    void insert(OrderGoodsSpecs orderGoodsSpecs);
    List<OrderGoodsSpecs> selectList(SqlSentence sqlSentence);
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    OrderGoodsSpecs selectOne(SqlSentence sqlSentence);
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    OrderGoodsSpecs selectOneByKey(Object object);
    OrderGoodsSpecs selectOneByKeyBlob(Object object);
    void updateAll(OrderGoodsSpecs orderGoodsSpecs);
    void updateWhere(SqlSentence sqlSentence);
    void deleteOne(String delId);
}
phi_platform_user/src/main/java/com/hx/phip/service/OrderLogService.java
New file
@@ -0,0 +1,33 @@
package com.hx.phip.service;
import com.hx.phiappt.model.order.OrderLog;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
public interface OrderLogService {
    int selectCount(SqlSentence sqlSentence);
    void insert(OrderLog orderLog);
    List<OrderLog> selectList(SqlSentence sqlSentence);
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    OrderLog selectOne(SqlSentence sqlSentence);
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    OrderLog selectOneByKey(Object object);
    OrderLog selectOneByKeyBlob(Object object);
    void updateAll(OrderLog orderLog);
    void updateWhere(SqlSentence sqlSentence);
    void deleteOne(String delId);
}
phi_platform_user/src/main/java/com/hx/phip/service/ShopService.java
@@ -29,5 +29,10 @@
    
    void deleteOne(String delId);
    /**
     * 根据用户的所属顾问查询员工门店信息
     * @param hisCorpUserId         用户绑定的所属顾问
     * @return
     */
    Shop selectAdiver(String hisCorpUserId);
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/EmployeeRoleServiceImpl.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.EmployeeRoleMapper;
import com.hx.phiappt.model.EmployeeRole;
import com.hx.phip.service.EmployeeRoleService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class EmployeeRoleServiceImpl implements EmployeeRoleService {
    @Resource
    private EmployeeRoleMapper employeeRoleMapper;
    /**查询列表*/
    @Override
    public List<EmployeeRole> selectList(SqlSentence sqlSentence) {
        return employeeRoleMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return employeeRoleMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public EmployeeRole selectOne(SqlSentence sqlSentence) {
        return employeeRoleMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return employeeRoleMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public EmployeeRole selectOneByKey(Object object) {
        return employeeRoleMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public EmployeeRole selectOneByKeyBlob(Object object) {
        return employeeRoleMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(EmployeeRole employeeRole) {
        int count = employeeRoleMapper.insert(employeeRole);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(EmployeeRole employeeRole) {
        int count = employeeRoleMapper.updateAll(employeeRole);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = employeeRoleMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = employeeRoleMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = employeeRoleMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrderGoodsSpecsServiceImpl.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.OrderGoodsSpecsMapper;
import com.hx.phiappt.model.order.OrderGoodsSpecs;
import com.hx.phip.service.OrderGoodsSpecsService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class OrderGoodsSpecsServiceImpl implements OrderGoodsSpecsService {
    @Resource
    private OrderGoodsSpecsMapper orderGoodsSpecsMapper;
    /**查询列表*/
    @Override
    public List<OrderGoodsSpecs> selectList(SqlSentence sqlSentence) {
        return orderGoodsSpecsMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return orderGoodsSpecsMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public OrderGoodsSpecs selectOne(SqlSentence sqlSentence) {
        return orderGoodsSpecsMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return orderGoodsSpecsMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public OrderGoodsSpecs selectOneByKey(Object object) {
        return orderGoodsSpecsMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public OrderGoodsSpecs selectOneByKeyBlob(Object object) {
        return orderGoodsSpecsMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(OrderGoodsSpecs orderGoodsSpecs) {
        int count = orderGoodsSpecsMapper.insert(orderGoodsSpecs);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(OrderGoodsSpecs orderGoodsSpecs) {
        int count = orderGoodsSpecsMapper.updateAll(orderGoodsSpecs);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = orderGoodsSpecsMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = orderGoodsSpecsMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = orderGoodsSpecsMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrderLogServiceImpl.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.OrderLogMapper;
import com.hx.phiappt.model.order.OrderLog;
import com.hx.phip.service.OrderLogService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class OrderLogServiceImpl implements OrderLogService {
    @Resource
    private OrderLogMapper orderLogMapper;
    /**查询列表*/
    @Override
    public List<OrderLog> selectList(SqlSentence sqlSentence) {
        return orderLogMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return orderLogMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public OrderLog selectOne(SqlSentence sqlSentence) {
        return orderLogMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return orderLogMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public OrderLog selectOneByKey(Object object) {
        return orderLogMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public OrderLog selectOneByKeyBlob(Object object) {
        return orderLogMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(OrderLog orderLog) {
        int count = orderLogMapper.insert(orderLog);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(OrderLog orderLog) {
        int count = orderLogMapper.updateAll(orderLog);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = orderLogMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = orderLogMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = orderLogMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/service/impl/ShopServiceImpl.java
@@ -92,7 +92,12 @@
        }
    }
    /**查询条数*/
    @Override
    public Shop selectAdiver(String hisCorpUserId) {
        return shopMapper.selectAdiver(hisCorpUserId);
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = shopMapper.selectCount(sqlSentence);