zhouxiang
2021-12-14 a4b44c41b51091150ab24733edd8d5f0b127cbbc
完善项目子订单的信息
2个文件已添加
5个文件已修改
180 ■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrdersTotalMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrderDeveloperMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrdersTotalMapper.xml 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/OrderDeveloperService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderDeveloperServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrdersTotalServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrdersTotalMapper.java
@@ -39,7 +39,7 @@
    int deleteById(Object object);
    /*更新总订单 支付信息*/
    void updatePay(@Param("payRecharge")BigDecimal payRecharge,@Param("payIncrement") BigDecimal payIncrement,
    void updatePay(@Param("actualTotal")BigDecimal actualTotal,@Param("payRecharge")BigDecimal payRecharge,@Param("payIncrement") BigDecimal payIncrement,
                   @Param("payTotal") BigDecimal payTotal,@Param("status") Integer status, @Param("id")String id,@Param("payTime") Date payTime,
                   @Param("payStatus") Integer payStatus);
}
phi_platform_common/src/main/resources/mapper/OrderDeveloperMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,orderId = #{orderId},shopId = #{shopId},shopName = #{shopName},employeeId = #{employeeId},employeeName = #{employeeName},isDel = #{isDel},createTime = #{createTime}
            ,orderId = #{orderId},shopId = #{shopId},shopName = #{shopName},employeeId = #{employeeId},employeeName = #{employeeName},type = #{type},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_developer (id,orderId,shopId,shopName,employeeId,employeeName,isDel,createTime)  values (#{id},#{orderId},#{shopId},#{shopName},#{employeeId},#{employeeName},#{isDel},#{createTime})
        insert into orders_developer (id,orderId,shopId,shopName,employeeId,employeeName,type,isDel,createTime)  values (#{id},#{orderId},#{shopId},#{shopName},#{employeeId},#{employeeName},#{type},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.order.OrderDeveloper" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrderDeveloper" parameterType="java.lang.Object" >
        select 
            id,orderId,shopId,shopName,employeeId,employeeName,isDel,createTime
            id,orderId,shopId,shopName,employeeId,employeeName,type,isDel,createTime
        from orders_developer
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrderDeveloper" parameterType="java.lang.Object" >
        select 
            id,orderId,shopId,shopName,employeeId,employeeName,isDel,createTime
            id,orderId,shopId,shopName,employeeId,employeeName,type,isDel,createTime
        from orders_developer
        WHERE id = #{value}
    </select>
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},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}
            ,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},developerId = #{developerId},developerName = #{developerName},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,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 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,developerId,developerName,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},#{developerId},#{developerName},#{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" >
@@ -49,22 +49,16 @@
            ${sqlSentence}
     </select>
    <select id="selectOneByUserProjectId" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" >
        SELECT ot.* FROM `user_project_item` AS upi
        INNER JOIN order_item AS oi ON oi.id=upi.orderItemId
        INNER JOIN orders_total AS ot ON ot.id=oi.orderId WHERE ot.isDel=0  AND upi.userProjectId=#{value} LIMIT 1;
    </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" >
        select 
            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
            id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,developerId,developerName,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,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
            id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,developerId,developerName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime
        from orders_total
        WHERE id = #{value}
    </select>
@@ -89,6 +83,13 @@
        delete from orders_total WHERE id = #{value}
    </delete>
    
    <select id="selectOneByUserProjectId" parameterType="java.lang.Object" resultType="com.hx.phiappt.model.order.OrdersTotal">
        SELECT ot.* FROM `user_project_item` AS upi
        INNER JOIN order_item AS oi ON oi.id=upi.orderItemId
        INNER JOIN orders_total AS ot ON ot.id=oi.orderId WHERE ot.isDel=0  AND upi.userProjectId=#{value} LIMIT 1;
    </select>
    
    
    
@@ -97,7 +98,7 @@
    <update id="updatePay">
        update
            orders_total
        SET payTotal=#{payTotal},payRecharge=#{payRecharge},payIncrement=#{payIncrement},status=#{status},payStatus=#{payStatus},payTime=#{payTime}
        SET actualTotal=#{actualTotal},payTotal=#{payTotal},payRecharge=#{payRecharge},payIncrement=#{payIncrement},status=#{status},payStatus=#{payStatus},payTime=#{payTime}
        where id =#{id}
    </update>
</mapper>
phi_platform_user/src/main/java/com/hx/phip/order/service/OrderDeveloperService.java
New file
@@ -0,0 +1,33 @@
package com.hx.phip.order.service;
import com.hx.phiappt.model.order.OrderDeveloper;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
public interface OrderDeveloperService {
    int selectCount(SqlSentence sqlSentence);
    void insert(OrderDeveloper orderDeveloper);
    List<OrderDeveloper> selectList(SqlSentence sqlSentence);
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    OrderDeveloper selectOne(SqlSentence sqlSentence);
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    OrderDeveloper selectOneByKey(Object object);
    OrderDeveloper selectOneByKeyBlob(Object object);
    void updateAll(OrderDeveloper orderDeveloper);
    void updateWhere(SqlSentence sqlSentence);
    void deleteOne(String delId);
}
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderDeveloperServiceImpl.java
New file
@@ -0,0 +1,101 @@
package com.hx.phip.order.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.OrderDeveloperMapper;
import com.hx.phiappt.model.order.OrderDeveloper;
import com.hx.phip.order.service.OrderDeveloperService;
import com.hx.mybatisTool.SqlSentence;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class OrderDeveloperServiceImpl implements OrderDeveloperService {
    @Resource
    private OrderDeveloperMapper orderDeveloperMapper;
    /**查询列表*/
    @Override
    public List<OrderDeveloper> selectList(SqlSentence sqlSentence) {
        return orderDeveloperMapper.selectList(sqlSentence);
    }
    /**查询列表*/
    @Override
    public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
        return orderDeveloperMapper.selectListMap(sqlSentence);
    }
    /**查询单个*/
    @Override
    public OrderDeveloper selectOne(SqlSentence sqlSentence) {
        return orderDeveloperMapper.selectOne(sqlSentence);
    }
    /**查询单个*/
    @Override
    public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
        return orderDeveloperMapper.selectOneMap(sqlSentence);
    }
    /**查询单个,大数据不拿取*/
    @Override
    public OrderDeveloper selectOneByKey(Object object) {
        return orderDeveloperMapper.selectOneByKey(object);
    }
    /**查询单个,大数据拿取*/
    @Override
    public OrderDeveloper selectOneByKeyBlob(Object object) {
        return orderDeveloperMapper.selectOneByKeyBlob(object);
    }
    /**新增*/
    @Override
    public void insert(OrderDeveloper orderDeveloper) {
        int count = orderDeveloperMapper.insert(orderDeveloper);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(OrderDeveloper orderDeveloper) {
        int count = orderDeveloperMapper.updateAll(orderDeveloper);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = orderDeveloperMapper.updateWhere(sqlSentence);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = orderDeveloperMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = orderDeveloperMapper.selectCount(sqlSentence);
        return count;
    }
}
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java
@@ -179,19 +179,22 @@
        }
        //如果开发人集合为空,那么默认用户的所属顾问
        if(orderDeveloperList==null || orderDeveloperList.size()==0){
//        if(orderDeveloperList==null || orderDeveloperList.size()==0){
            User user = userService.selectOneByKey(ordersTotal.getUserId());
            if(StringUtils.noNull(user.getHisCorpUserId())){
                Shop userShop = shopService.selectAdiver(user.getHisCorpUserId());
                Employee userAdiver = employeeService.selectOneByKey(user.getHisCorpUserId());
                //开发人门店标识(用户绑定的销售顾问)
                ordersTotal.setDeveloperShopId(userShop.getId());
                //开发人门店名称
                ordersTotal.setDeveloperShopName(userShop.getName());
                ordersTotal.setDeveloperId(userAdiver.getId());
                ordersTotal.setDeveloperName(userAdiver.getCnName());
            }else{
                throw new PlatTipsException(PlatformCode.ERROR_TIPS,"请填写好开发人或者用户绑定一个销售顾问在重试");
            }
        }
//        }
        setOrderTotal(ordersTotal, shop, totalPrice, shouldOrderTotal, discountTotal,operatorId,operatorName,operatorType);
@@ -459,6 +462,10 @@
        userProjectItem.setUserProjectId(userProject.getId());//用户项目id
        userProjectItem.setUserId(ordersTotal.getUserId());//用户id
        userProjectItem.setOrderItemId(vo.getId()); // 存OrderItemId
        userProjectItem.setDepartmentCode(ordersTotal.getDepartmentCode());//科室编码
        userProjectItem.setDepartmentName(ordersTotal.getDepartmentName());//科室名称
        userProjectItem.setShopId(ordersTotal.getDeveloperShopId());//开单人门店id
        userProjectItem.setShopName(ordersTotal.getShopName());//开单人门店名称
    }
    private void setUserProject(OrdersTotal ordersTotal, UserProject userProject, OrderItem vo) {
phi_platform_user/src/main/java/com/hx/phip/service/impl/OrdersTotalServiceImpl.java
@@ -94,7 +94,7 @@
    @Override
    public void updatePay(OrdersTotal ordersTotal) {
        ordersTotalMapper.updatePay(ordersTotal.getPayRecharge(),ordersTotal.getPayIncrement(),ordersTotal.getPayTotal(),ordersTotal.getStatus(),ordersTotal.getId(),ordersTotal.getPayTime(),ordersTotal.getPayStatus());
        ordersTotalMapper.updatePay(ordersTotal.getActualTotal(),ordersTotal.getPayRecharge(),ordersTotal.getPayIncrement(),ordersTotal.getPayTotal(),ordersTotal.getStatus(),ordersTotal.getId(),ordersTotal.getPayTime(),ordersTotal.getPayStatus());
    }
    /**查询条数*/