zhouxiang
2021-12-13 8edf76f0d3bb057824e9fd7af2ff28d143c53c57
Merge branch 'master' of http://1.15.4.62/r/~chenjiahe/phi_platform into zhouxiangTest
2个文件已添加
10个文件已修改
272 ■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/DeviceMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrdersTotalMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/DeductionDeviceParameterMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/DeductionProjectMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/DeviceMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/OrdersTotalMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/UserProjectItemMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/AutoDomeUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/deduction/controller/DeductionController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/deduction/service/impl/DeductionSingleServiceImpl.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/dto/DeductionDto.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/DeviceMapper.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.Device;
public interface DeviceMapper {
    /**新增,返回主键*/
    int insert(Device device);
    /**查询条数*/
    int selectCount(SqlSentence sqlSentence);
    /**查询条数*/
    int selectCountSql(SqlSentence sqlSentence);
    /**查询列表,返回实体类的List*/
    List<Device> selectList(SqlSentence sqlSentence);
    /**查询列表,返回Map的List*/
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    Device selectOne(SqlSentence sqlSentence);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
    Device selectOneByKey(Object object);
    /**查询,返回实体类有大数据的*/
    Device selectOneByKeyBlob(Object object);
    /**更新,返回更新数量*/
    int updateWhere(SqlSentence sqlSentence);
    /**更新,返回更新数量*/
    int updateAll(Device device);
    /**删除,返回删除数量*/
    int deleteWhere(SqlSentence sqlSentence);
    /**删除,返回删除数量*/
    int deleteById(Object object);
}
phi_platform_common/src/main/java/com/hx/phip/dao/mapper/OrdersTotalMapper.java
@@ -21,6 +21,8 @@
    List<Map<String,Object>> selectListMap(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    OrdersTotal selectOne(SqlSentence sqlSentence);
    /**查询,返回单个实体*/
    OrdersTotal selectOneByUserProjectId(Object object);
    /**查询,返回单个map*/
    Map<String,Object> selectOneMap(SqlSentence sqlSentence);
    /**查询,返回实体类没有大数据的*/
phi_platform_common/src/main/resources/mapper/DeductionDeviceParameterMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,deviceName = #{deviceName},parameterName = #{parameterName},parameterUntil = #{parameterUntil},reference = #{reference},optionalValue = #{optionalValue},deviceParameterId = #{deviceParameterId},deviceNoId = #{deviceNoId},deductionProjectId = #{deductionProjectId},deductionSingleId = #{deductionSingleId},isDel = #{isDel},createTime = #{createTime}
            ,deviceName = #{deviceName},parameterName = #{parameterName},parameterUntil = #{parameterUntil},reference = #{reference},optionalValue = #{optionalValue},deviceParameterId = #{deviceParameterId},deviceId = #{deviceId},deductionProjectId = #{deductionProjectId},deductionSingleId = #{deductionSingleId},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 deduction_device_parameter (id,deviceName,parameterName,parameterUntil,reference,optionalValue,deviceParameterId,deviceNoId,deductionProjectId,deductionSingleId,isDel,createTime)  values (#{id},#{deviceName},#{parameterName},#{parameterUntil},#{reference},#{optionalValue},#{deviceParameterId},#{deviceNoId},#{deductionProjectId},#{deductionSingleId},#{isDel},#{createTime})
        insert into deduction_device_parameter (id,deviceName,parameterName,parameterUntil,reference,optionalValue,deviceParameterId,deviceId,deductionProjectId,deductionSingleId,isDel,createTime)  values (#{id},#{deviceName},#{parameterName},#{parameterUntil},#{reference},#{optionalValue},#{deviceParameterId},#{deviceId},#{deductionProjectId},#{deductionSingleId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.deduction.DeductionDeviceParameter" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.deduction.DeductionDeviceParameter" parameterType="java.lang.Object" >
        select 
            id,deviceName,parameterName,parameterUntil,reference,optionalValue,deviceParameterId,deviceNoId,deductionProjectId,deductionSingleId,isDel,createTime
            id,deviceName,parameterName,parameterUntil,reference,optionalValue,deviceParameterId,deviceId,deductionProjectId,deductionSingleId,isDel,createTime
        from deduction_device_parameter
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.deduction.DeductionDeviceParameter" parameterType="java.lang.Object" >
        select 
            id,deviceName,parameterName,parameterUntil,reference,optionalValue,deviceParameterId,deviceNoId,deductionProjectId,deductionSingleId,isDel,createTime
            id,deviceName,parameterName,parameterUntil,reference,optionalValue,deviceParameterId,deviceId,deductionProjectId,deductionSingleId,isDel,createTime
        from deduction_device_parameter
        WHERE id = #{value}
    </select>
phi_platform_common/src/main/resources/mapper/DeductionProjectMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,projectNo = #{projectNo},projectName = #{projectName},price = #{price},num = #{num},shopId = #{shopId},shopName = #{shopName},departmentCode = #{departmentCode},departmentName = #{departmentName},specification = #{specification},useDuration = #{useDuration},palsyDuration = #{palsyDuration},projectId = #{projectId},deductionSingleId = #{deductionSingleId},executeStartTime = #{executeStartTime},executeEndTime = #{executeEndTime},remarkInfo = #{remarkInfo},isDel = #{isDel},createTime = #{createTime}
            ,projectNo = #{projectNo},projectName = #{projectName},projectFrequency = #{projectFrequency},price = #{price},num = #{num},shopId = #{shopId},shopName = #{shopName},departmentCode = #{departmentCode},departmentName = #{departmentName},specification = #{specification},useDuration = #{useDuration},palsyDuration = #{palsyDuration},projectId = #{projectId},deductionSingleId = #{deductionSingleId},executeStartTime = #{executeStartTime},executeEndTime = #{executeEndTime},remarkInfo = #{remarkInfo},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 deduction_project (id,projectNo,projectName,price,num,shopId,shopName,departmentCode,departmentName,specification,useDuration,palsyDuration,projectId,deductionSingleId,executeStartTime,executeEndTime,remarkInfo,isDel,createTime)  values (#{id},#{projectNo},#{projectName},#{price},#{num},#{shopId},#{shopName},#{departmentCode},#{departmentName},#{specification},#{useDuration},#{palsyDuration},#{projectId},#{deductionSingleId},#{executeStartTime},#{executeEndTime},#{remarkInfo},#{isDel},#{createTime})
        insert into deduction_project (id,projectNo,projectName,projectFrequency,price,num,shopId,shopName,departmentCode,departmentName,specification,useDuration,palsyDuration,projectId,deductionSingleId,executeStartTime,executeEndTime,remarkInfo,isDel,createTime)  values (#{id},#{projectNo},#{projectName},#{projectFrequency},#{price},#{num},#{shopId},#{shopName},#{departmentCode},#{departmentName},#{specification},#{useDuration},#{palsyDuration},#{projectId},#{deductionSingleId},#{executeStartTime},#{executeEndTime},#{remarkInfo},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.deduction.DeductionProject" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.deduction.DeductionProject" parameterType="java.lang.Object" >
        select 
            id,projectNo,projectName,price,num,shopId,shopName,departmentCode,departmentName,specification,useDuration,palsyDuration,projectId,deductionSingleId,executeStartTime,executeEndTime,remarkInfo,isDel,createTime
            id,projectNo,projectName,projectFrequency,price,num,shopId,shopName,departmentCode,departmentName,specification,useDuration,palsyDuration,projectId,deductionSingleId,executeStartTime,executeEndTime,remarkInfo,isDel,createTime
        from deduction_project
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.deduction.DeductionProject" parameterType="java.lang.Object" >
        select 
            id,projectNo,projectName,price,num,shopId,shopName,departmentCode,departmentName,specification,useDuration,palsyDuration,projectId,deductionSingleId,executeStartTime,executeEndTime,remarkInfo,isDel,createTime
            id,projectNo,projectName,projectFrequency,price,num,shopId,shopName,departmentCode,departmentName,specification,useDuration,palsyDuration,projectId,deductionSingleId,executeStartTime,executeEndTime,remarkInfo,isDel,createTime
        from deduction_project
        WHERE id = #{value}
    </select>
phi_platform_common/src/main/resources/mapper/DeviceMapper.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.DeviceMapper">
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,name = #{name},isUse = #{isUse},imgUrl = #{imgUrl},isDel = #{isDel},createTime = #{createTime}
        </trim>
    </sql>
    <!--  后续通过  namespace.id-->
    <!--parameterType:输入参数的类型
    resultType:查询返回结果值的类型  ,返回类型  -->
    <insert id="insert" parameterType="com.hx.phiappt.model.Device">
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into device (id,name,isUse,imgUrl,isDel,createTime)  values (#{id},#{name},#{isUse},#{imgUrl},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.Device" 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.Device" 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 device
                WHERE ${sqlSentence}
    </select>
    <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
            ${sqlSentence}
     </select>
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.Device" parameterType="java.lang.Object" >
        select
            id,name,isUse,imgUrl,isDel,createTime
        from device
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.Device" parameterType="java.lang.Object" >
        select
            id,name,isUse,imgUrl,isDel,createTime
        from device
        WHERE id = #{value}
    </select>
    <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
        update
            device
        SET ${sqlSentence}
    </update>
    <update id="updateAll" parameterType="com.hx.phiappt.model.Device">
        update device
            SET <include refid="Update_Column_All"/>
        WHERE id = #{id}
    </update>
    <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
        delete from device WHERE ${sqlSentence}
    </delete>
    <delete id="deleteById"  parameterType="java.lang.Object">
        delete from device WHERE id = #{value}
    </delete>
</mapper>
phi_platform_common/src/main/resources/mapper/OrdersTotalMapper.xml
@@ -49,6 +49,12 @@
            ${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
@@ -86,6 +92,8 @@
    
    
    
    <update id="updatePay">
        update
            orders_total
phi_platform_common/src/main/resources/mapper/UserProjectItemMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <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}
            ,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},orderItemId = #{orderItemId},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 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 into user_project_item (id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime)  values (#{id},#{total},#{actualTotal},#{oriPrice},#{curPrice},#{buyNum},#{usedTotal},#{notUsedNum},#{usedNum},#{effectiveStatus},#{timeLimit},#{limitStartTime},#{limitEndTime},#{commonType},#{commonId},#{usedOne},#{userProjectId},#{userId},#{orderItemId},#{isDel},#{createTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.user.UserProjectItem" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -51,14 +51,14 @@
    <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
            id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,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
            id,total,actualTotal,oriPrice,curPrice,buyNum,usedTotal,notUsedNum,usedNum,effectiveStatus,timeLimit,limitStartTime,limitEndTime,commonType,commonId,usedOne,userProjectId,userId,orderItemId,isDel,createTime
        from user_project_item
        WHERE id = #{value}
    </select>
phi_platform_user/src/main/java/com/hx/phip/AutoDomeUtil.java
@@ -4,6 +4,7 @@
import com.hx.auto.common.UrlData;
import com.hx.phiappt.model.*;
import com.hx.phiappt.model.deduction.*;
import com.hx.phiappt.model.order.*;
import com.hx.phiappt.model.user.*;
import com.hx.phiappt.model.warehouse.*;
import com.hx.util.StringUtils;
phi_platform_user/src/main/java/com/hx/phip/deduction/controller/DeductionController.java
@@ -3,6 +3,7 @@
import com.hx.common.BaseController;
import com.hx.phip.deduction.service.DeductionSingleService;
import com.hx.phip.dto.DeductionDto;
import com.hx.resultTool.Result;
import com.hx.util.StringUtils;
import com.platform.constants.LoginConstant;
import com.platform.entity.ThirtApplication;
@@ -29,20 +30,24 @@
     * 划扣记录
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public void orderAdd(HttpServletRequest request, DeductionDto deductionDto) {
    public Result orderAdd(HttpServletRequest request, DeductionDto deductionDto) {
        // 校验参数
        checkParam(deductionDto);
        // 获取用户信息
        ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY);
        /*ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY);
        if(thirtApplication == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"登入失败,请登入后在试!");
        }
        // 填充接口登入信息
        deductionDto.setSourceCode(thirtApplication.getAppId());
        deductionDto.setSourceName(thirtApplication.getName());
        deductionDto.setSourceName(thirtApplication.getName());*/
        deductionDto.setSourceCode("8");
        deductionDto.setSourceName("9");
        // 添加数据
        deductionSingleService.insertInfo(deductionDto);
        return Result.success();
    }
    /**
@@ -54,7 +59,7 @@
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"userProjectId不能为空");
        }
        if(deductionDto.getDeductionNum() > 0){
        if(deductionDto.getDeductionNum() <= 0){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"数量/划扣次数需要大于0");
        }
phi_platform_user/src/main/java/com/hx/phip/deduction/service/impl/DeductionSingleServiceImpl.java
@@ -3,12 +3,12 @@
import javax.annotation.Resource;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hx.common.dao.CommonDao;
import com.hx.phiappt.common.DeductionSingleConstants;
import com.hx.phiappt.common.OrderGoodsConstants;
import com.hx.phiappt.model.*;
import com.hx.phiappt.model.deduction.*;
import com.hx.phiappt.model.order.OrdersTotal;
import com.hx.phiappt.model.user.UserProject;
import com.hx.phiappt.model.warehouse.ShopWarehouse;
import com.hx.phip.dao.mapper.*;
@@ -16,15 +16,12 @@
import com.hx.util.StringUtils;
import com.platform.exception.PlatTipsException;
import com.platform.resultTool.PlatformCode;
import com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hx.exception.TipsException;
import com.hx.phip.deduction.service.DeductionSingleService;
import com.hx.mybatisTool.SqlSentence;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@@ -35,9 +32,13 @@
    @Resource
    private CommonDao commonDao;
    @Resource
    private OrdersTotalMapper ordersTotalMapper;
    @Resource
    private DeductionSingleMapper deductionSingleMapper;
    @Resource
    private DeductionProjectMapper deductionProjectMapper;
    @Resource
    private UserProjectItemMapper userProjectItemMapper;
    /**查询列表*/
    @Override
@@ -120,18 +121,37 @@
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"未找到你要执行项目的项目信息!");
            }
            OrdersTotal ordersTotal = ordersTotalMapper.selectOneByUserProjectId(userProject.getId());
            if(ordersTotal == null){
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"未找到你的订单信息!");
            }
            // 查询有项目有几次执行记录
            SqlSentence sqlSentence = new SqlSentence();
            String sql = String.format(" isDel=0 AND status=1 AND commonId='%s'",deductionSingle.getCommonId());
            sqlSentence.setSqlSentence(sql);
            int projectFrequency = deductionSingleMapper.selectCount(sqlSentence);
            // 处理划扣项目
            DeductionProject deductionProject = new DeductionProject();
            deductionProject.setDeductionSingleId(deductionSingle.getId());
            deductionProject.setProjectId(userProject.getGoodsId());
            deductionProject.setProjectNo(userProject.getGoodsNo());
            deductionProject.setProjectName(project.getName());
            deductionProject.setProjectFrequency(projectFrequency);
            deductionProject.setPrice(project.getPrice());
            deductionProject.setNum(deductionDto.getDeductionNum());
            deductionProject.setShopId("1");
            deductionProject.setShopName("1");
            deductionProject.setDepartmentCode("1");
            deductionProject.setDepartmentName("1");
            deductionProject.setShopId(ordersTotal.getShopId());
            deductionProject.setShopName(ordersTotal.getShopName());
            // 科室编号为空默认科室
            if(StringUtils.isEmpty(deductionDto.getDepartmentCode()) && StringUtils.isEmpty(deductionDto.getDepartmentName())){
                deductionProject.setDepartmentCode(ordersTotal.getDepartmentCode());
                deductionProject.setDepartmentName(ordersTotal.getDepartmentName());
            }else{
                deductionProject.setDepartmentCode(deductionDto.getDepartmentCode());
                deductionProject.setDepartmentName(deductionDto.getDepartmentName());
            }
            deductionProject.setSpecification(project.getSpecification());
            deductionProject.setUseDuration(project.getUseDuration());
            deductionProject.setPalsyDuration(project.getPalsyDuration());
@@ -156,23 +176,23 @@
                        if(StringUtils.isEmpty(deductionJoin.getRoleId())){
                            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"员工角色id不能为空!");
                        }else{
                            EmployeeRole employeeRole = commonDao.selectOneByKey(EmployeeRoleMapper.class, deductionJoin.getRoleId());
                            /*EmployeeRole employeeRole = commonDao.selectOneByKey(EmployeeRoleMapper.class, deductionJoin.getRoleId());
                            if(employeeRole == null){
                                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"员工角色信息不存在!");
                            }else{
                                deductionJoin.setRoleName(employeeRole.getRoleName());
                            }
                            }*/
                        }
                        // 判断员工id
                        if(StringUtils.isEmpty(deductionJoin.getEmployeeId())){
                            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"员工id不能为空!");
                        }else{
                            Employee employee = commonDao.selectOneByKey(EmployeeMapper.class,deductionJoin.getEmployeeId());
                            /*Employee employee = commonDao.selectOneByKey(EmployeeMapper.class,deductionJoin.getEmployeeId());
                            if(employee == null){
                                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"员工信息不存在!");
                            }else{
                                deductionJoin.setEmployeeName(employee.getCnName());
                            }
                            }*/
                        }
                        deductionJoin.setDeductionSingleId(deductionSingle.getId());
                        deductionJoin.setDeductionProjectId(deductionProject.getId());
@@ -211,10 +231,10 @@
                        if(StringUtils.isEmpty(deductionDrugs.getWarehouseId())){
                            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"仓库信息不能为空!");
                        }else{
                            ShopWarehouse shopWarehouse = commonDao.selectOneByKey(ShopWarehouseMapper.class,deductionDrugs.getWarehouseId());
                            /*ShopWarehouse shopWarehouse = commonDao.selectOneByKey(ShopWarehouseMapper.class,deductionDrugs.getWarehouseId());
                            if(shopWarehouse == null){
                                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"未找到仓库信息!");
                            }
                            }*/
                        }
                        // 判断批次信息
                        if(StringUtils.isEmpty(deductionDrugs.getBatchNo())){
@@ -240,14 +260,14 @@
                            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"实际操作值不能为空!");
                        }
                        // 判断设备id是否为空
                        if(StringUtils.isEmpty(deductionDeviceParameter.getDeviceNoId())){
                        if(StringUtils.isEmpty(deductionDeviceParameter.getDeviceId())){
                            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"设备id不能为空!");
                        }else{
                            DeviceNo deviceNo = commonDao.selectOneByKey(DeviceNoMapper.class,deductionDeviceParameter.getDeviceNoId());
                            if(deviceNo == null){
                            Device device = commonDao.selectOneByKey(DeviceMapper.class,deductionDeviceParameter.getDeviceId());
                            if(device == null){
                                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"未找到您所选的设备信息!");
                            }else{
                                deductionDeviceParameter.setDeviceName(deviceNo.getDeviceNo());
                                deductionDeviceParameter.setDeviceName(device.getId());
                            }
                        }
                        // 判断设备参数id是否为空
@@ -301,7 +321,7 @@
            }
            //处理治疗图片信息
            if(StringUtils.isEmpty(deductionDto.getComparePhotoRecordJson())){
            if(!StringUtils.isEmpty(deductionDto.getComparePhotoRecordJson())){
                List<ComparePhotoRecordPictures> comparePhotoRecordPicturesList = JSONArray.parseArray(deductionDto.getComparePhotoRecordJson(), ComparePhotoRecordPictures.class);
                if( comparePhotoRecordPicturesList != null && comparePhotoRecordPicturesList.size() > 0) {
                    ComparePhotoRecord comparePhotoRecord = new ComparePhotoRecord();
phi_platform_user/src/main/java/com/hx/phip/dto/DeductionDto.java
@@ -9,8 +9,20 @@
 */
public class DeductionDto {
    // 划扣记录id
    private String deductionSingleId;
    // 用户项目id
    private String userProjectId;
    // 新增类型
    private String type;
    // 科室编号
    private String departmentCode;
    // 科室名称
    private String departmentName;
    // 备注信息
    private String remarkInfo;
@@ -50,6 +62,14 @@
    }
    public String getDeductionSingleId() {
        return deductionSingleId;
    }
    public void setDeductionSingleId(String deductionSingleId) {
        this.deductionSingleId = deductionSingleId;
    }
    public String getUserProjectId() {
        return userProjectId;
    }
@@ -58,6 +78,30 @@
        this.userProjectId = userProjectId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getDepartmentCode() {
        return departmentCode;
    }
    public void setDepartmentCode(String departmentCode) {
        this.departmentCode = departmentCode;
    }
    public String getDepartmentName() {
        return departmentName;
    }
    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }
    public String getRemarkInfo() {
        return remarkInfo;
    }
phi_platform_user/src/main/java/com/hx/phip/order/service/impl/OrderServiceImpl.java
@@ -458,6 +458,7 @@
        userProjectItem.setUsedOne(vo.getSingle());//单次疗程数量
        userProjectItem.setUserProjectId(userProject.getId());//用户项目id
        userProjectItem.setUserId(ordersTotal.getUserId());//用户id
        userProjectItem.setOrderItemId(vo.getId()); // 存OrderItemId
    }
    private void setUserProject(OrdersTotal ordersTotal, UserProject userProject, OrderItem vo) {