瀏覽代碼

台州温州接口修改

小么熊🐻 1 年之前
父節點
當前提交
922bf41b73

+ 13 - 1
jsjp-admin/src/main/java/com/miaxis/app/controller/tms/TmsStudentInfoController.java

@@ -118,11 +118,23 @@ public class TmsStudentInfoController extends BaseController {
      * 根据学员id获取详细信息
      */
     @GetMapping("/getTmsStudentInfoById")
-    @ApiOperation("根据ID获取学员员详细信息")
+    @ApiOperation("根据ID获取学员员详细信息(无时间点)")
     public Response<TmsStudentInfoIdVo> getTmsStudentInfoById(TmsStudentInfoIdDTO studentInfoIdDTO) {
         return Response.success(studentInfoService.getTmsStudentInfoById(studentInfoIdDTO));
     }
 
+    /**
+     * 温州根据学员id获取详细信息
+     */
+    @GetMapping("/getTmsStudentInfoApplyById")
+    @ApiOperation("温州等根据ID获取学员员详细信息(需要报名时间)")
+    public Response<TmsStudentInfoIdVo> getTmsStudentInfoApplyById(TmsStudentInfoApplyIdDTO studentInfoApplyIdDTO) {
+        return Response.success(studentInfoService.getTmsStudentInfoApplyById(studentInfoApplyIdDTO));
+    }
+
+
+
+
 
     /**
      * 根据学员id学员训练照片

+ 22 - 0
jsjp-service/src/main/java/com/miaxis/tms/dto/TmsStudentInfoApplyIdDTO.java

@@ -0,0 +1,22 @@
+package com.miaxis.tms.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class TmsStudentInfoApplyIdDTO implements Serializable {
+
+
+    @ApiModelProperty(value = "学员ID",required = true)
+    private Long id;
+
+    @ApiModelProperty(value = "地区编号",required = true)
+    private String city;
+
+    @ApiModelProperty(value = "报名时间",required = true)
+    private String applyDate;
+
+}

+ 6 - 0
jsjp-service/src/main/java/com/miaxis/tms/mapper/TmsStudentInfoMapper.java

@@ -21,6 +21,10 @@ public interface TmsStudentInfoMapper extends BaseMapper<TmsStudentInfoVo> {
 
     TmsStudentInfoIdVo getTmsStudentInfoById(TmsStudentInfoIdDTO stuIdDTO);
 
+    TmsStudentInfoIdVo getWzTmsStudentInfoById(TmsStudentInfoApplyIdDTO stuIdDTO);
+
+    TmsStudentInfoIdVo getWzOldTmsStudentInfoById(TmsStudentInfoApplyIdDTO stuIdDTO);
+
     int upStuAppCoachIdById(TmsStudentInfoQrDTO studentInfoQrDTO);
 
     List<TmsLogFaceVo> getTmsLogFaceListByStuId(TmsStudentInfoIdDTO studentInfoIdDTO);
@@ -45,4 +49,6 @@ public interface TmsStudentInfoMapper extends BaseMapper<TmsStudentInfoVo> {
     List<TmsBmCountVo> getEveryYearStuCountBySchoolId(TmsBmYearListDTO bmMonthListDTO);
 
     List<TmsStudentInfoVo> getTmsAllStudentInfoList(TmsAllStudentInfoDTO aLLStudentInfoDTO);
+
+    TmsStudentInfoIdVo getTzTmsStudentInfoById(TmsStudentInfoIdDTO stuIdDTO);
 }

+ 1 - 5
jsjp-service/src/main/java/com/miaxis/tms/service/ITmsStudentInfoService.java

@@ -40,9 +40,5 @@ public interface ITmsStudentInfoService extends IService<TmsStudentInfoVo> {
 
     List<TmsBmCountVo> getEveryYearStuCountBySchoolId(TmsBmYearListDTO yearListDTO);
 
-
-
-
-
-
+    TmsStudentInfoIdVo getTmsStudentInfoApplyById(TmsStudentInfoApplyIdDTO studentInfoApplyIdDTO);
 }

+ 29 - 1
jsjp-service/src/main/java/com/miaxis/tms/service/impl/TmsStudentInfoServiceImpl.java

@@ -3,6 +3,7 @@ package com.miaxis.tms.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.miaxis.common.annotation.DataSource;
 import com.miaxis.common.enums.DataSourceTypeEnum;
+import com.miaxis.common.utils.DateUtils;
 import com.miaxis.common.utils.bean.BeanUtils;
 import com.miaxis.tms.dto.*;
 import com.miaxis.tms.mapper.TmsStudentInfoMapper;
@@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.sql.SQLException;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -51,7 +53,12 @@ public class TmsStudentInfoServiceImpl extends ServiceImpl<TmsStudentInfoMapper,
 
     @Override
     public TmsStudentInfoIdVo getTmsStudentInfoById(TmsStudentInfoIdDTO stuIdDTO) {
-        return mapper.getTmsStudentInfoById(stuIdDTO);
+        //台州
+        if("3310".equals(stuIdDTO.getCity())){
+            return mapper.getTzTmsStudentInfoById(stuIdDTO);
+        } else { //福建其他地区
+            return mapper.getTmsStudentInfoById(stuIdDTO);
+        }
     }
 
     @Override
@@ -200,4 +207,25 @@ public class TmsStudentInfoServiceImpl extends ServiceImpl<TmsStudentInfoMapper,
     }
 
 
+    @Override
+    public TmsStudentInfoIdVo getTmsStudentInfoApplyById(TmsStudentInfoApplyIdDTO studentInfoApplyIdDTO) {
+
+        Date applyDate = DateUtils.parseDate(studentInfoApplyIdDTO.getApplyDate()) ;
+        Date pointDate = DateUtils.parseDate("2022-04-25");
+
+        if(applyDate.compareTo(pointDate)>=0){
+            return mapper.getWzTmsStudentInfoById(studentInfoApplyIdDTO);
+        } else {
+            return mapper.getWzOldTmsStudentInfoById(studentInfoApplyIdDTO);
+        }
+
+    }
+
+
+    @Override
+    public TmsStudentInfoIdVo getTzTmsStudentInfoById(TmsStudentInfoIdDTO stuIdDTO) {
+        return mapper.getTzTmsStudentInfoById(stuIdDTO);
+    }
+
+
 }

+ 158 - 0
jsjp-service/src/main/resources/mapper/tms/TmsStudentInfoMapper.xml

@@ -238,6 +238,162 @@
      WHERE T.TSO_ID = #{id}
     </select>
 
+
+    <select id="getWzTmsStudentInfoById"  parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentInfoIdResultMap">
+        SELECT t.tso_id,
+        t.tso_cardtype,
+               t.tso_Idcard,
+               t.tso_name,
+               t.tso_sex,
+               t.tso_phone,
+               t.tso_source,
+               t.TSO_NATIONALITY,
+               t.tso_traintype,
+               t.tso_active,
+               t.tso_record_date,
+               t.tso_address,
+               t.tso_photo_path,
+               t.tso_password,
+               fi.face,
+               S.TSI_ID,
+               S.TSI_NAME,
+               S.TSI_SHORTNAME,
+               S.TSI_ADDRESS,
+               S.TSI_INSCODE,
+               S.TSI_QXBH,
+               S.TSI_QXMC,
+               S.TSI_DQBH,
+               S.TSI_DQMC,
+               t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
+               t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,
+               nvl(trunc(t2.sri_train_one / 60), 0) || '学时' ||nvl((mod(t2.sri_train_one, 60)), 0) || '分钟' as K1,
+               nvl(trunc(t2.sri_train_two / 60), 0) || '学时' ||nvl((mod(t2.sri_train_two, 60)), 0) || '分钟' as K2,
+               nvl(trunc(t2.sri_train_three / 60), 0) || '学时' ||nvl((mod(t2.sri_train_three, 60)), 0) || '分钟' as K3,
+               nvl(trunc(t2.sri_train_four / 60), 0) || '学时' ||nvl((mod(t2.sri_train_four, 60)), 0) || '分钟' as K4,
+        (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 1) as total_km1,
+        (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 2) as total_km2,
+        (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 3) as total_km3,
+        (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 4) as total_km4,
+        nvl(ttv.SCTWOTOTALMILE, 0) K2MILEAGE,
+        nvl(ttv.SCTOTALMILE, 0) MILEAGE,
+        nvl(ttv.SCTHREETOTALMILE, 0) K3MILEAGE
+        FROM TMS_STUDENT_INFO@tms${city} T
+        LEFT JOIN TMS_SCHOOL_INFO@tms${city} S
+        ON T.TSO_SCHOOL_ID = S.TSI_ID
+        left join tms_student_train_info@tms${city} t2
+        on t.tso_id = t2.sri_student_id
+        left join TMS_TRAIN_TIME_VIEW@tms${city} ttv
+        on ttv.studentId = tso_id
+        left join tms_student_face_info@tms${city} fi
+        on t.tso_id = fi.student_id
+        WHERE T.TSO_ID = #{id}
+    </select>
+
+
+    <select id="getTzTmsStudentInfoById"  parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentInfoIdResultMap">
+        SELECT t.tso_id,
+               t.tso_cardtype,
+               t.tso_Idcard,
+               t.tso_name,
+               t.tso_sex,
+               t.tso_phone,
+               t.tso_source,
+               t.TSO_NATIONALITY,
+               t.tso_traintype,
+               t.tso_active,
+               t.tso_record_date,
+               t.tso_address,
+               t.tso_photo_path,
+               t.tso_password,
+               fi.face,
+               S.TSI_ID,
+               S.TSI_NAME,
+               S.TSI_SHORTNAME,
+               S.TSI_ADDRESS,
+               S.TSI_INSCODE,
+               S.TSI_QXBH,
+               S.TSI_QXMC,
+               S.TSI_DQBH,
+               S.TSI_DQMC,
+               t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
+               t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,
+               nvl(trunc(t2.sri_train_one / 60), 0) || '学时' ||nvl((mod(t2.sri_train_one, 60)), 0) || '分钟' as K1,
+               nvl(trunc(t2.sri_train_two / 60), 0) || '学时' ||nvl((mod(t2.sri_train_two, 60)), 0) || '分钟' as K2,
+               nvl(trunc(t2.sri_train_three / 60), 0) || '学时' ||nvl((mod(t2.sri_train_three, 60)), 0) || '分钟' as K3,
+               nvl(trunc(t2.sri_train_four / 60), 0) || '学时' ||nvl((mod(t2.sri_train_four, 60)), 0) || '分钟' as K4,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 1) as total_km1,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 2) as total_km2,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 3) as total_km3,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 4) as total_km4,
+               nvl(ttv.SCTWOTOTALMILE, 0) K2MILEAGE,
+               nvl(ttv.SCTOTALMILE, 0) MILEAGE,
+               nvl(ttv.SCTHREETOTALMILE, 0) K3MILEAGE
+        FROM TMS_STUDENT_INFO@tms${city} T
+                 LEFT JOIN TMS_SCHOOL_INFO@tms${city} S
+                           ON T.TSO_SCHOOL_ID = S.TSI_ID
+                 left join tms_student_train_info@tms${city} t2
+                           on t.tso_id = t2.sri_student_id
+                 left join TMS_TRAIN_TIME_VIEW@tms${city} ttv
+                           on ttv.studentId = tso_id
+                 left join tms_student_face_info@tms${city} fi
+                           on t.tso_id = fi.student_id
+        WHERE T.TSO_ID = #{id}
+    </select>
+
+
+    <select id="getWzOldTmsStudentInfoById" resultType="com.miaxis.tms.vo.TmsStudentInfoIdVo" resultMap="TmsStudentInfoIdResultMap">
+        SELECT t.tso_id,
+               t.tso_cardtype,
+               t.tso_Idcard,
+               t.tso_name,
+               t.tso_sex,
+               t.tso_phone,
+               t.tso_source,
+               t.TSO_NATIONALITY,
+               t.tso_traintype,
+               t.tso_active,
+               t.tso_record_date,
+               t.tso_address,
+               t.tso_photo_path,
+               t.tso_password,
+               fi.face,
+               S.TSI_ID,
+               S.TSI_NAME,
+               S.TSI_SHORTNAME,
+               S.TSI_ADDRESS,
+               S.TSI_INSCODE,
+               S.TSI_QXBH,
+               S.TSI_QXMC,
+               S.TSI_DQBH,
+               S.TSI_DQMC,
+               t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
+               t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,
+               nvl(trunc(t2.sri_train_one / 60), 0) || '学时' ||nvl((mod(t2.sri_train_one, 60)), 0) || '分钟' as K1,
+               nvl(trunc(t2.sri_train_two / 60), 0) || '学时' ||nvl((mod(t2.sri_train_two, 60)), 0) || '分钟' as K2,
+               nvl(trunc(t2.sri_train_three / 60), 0) || '学时' ||nvl((mod(t2.sri_train_three, 60)), 0) || '分钟' as K3,
+               nvl(trunc(t2.sri_train_four / 60), 0) || '学时' ||nvl((mod(t2.sri_train_four, 60)), 0) || '分钟' as K4,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 1) as total_km1,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 2) as total_km2,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 3) as total_km3,
+               (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 4) as total_km4,
+               nvl(ttv.SCTWOTOTALMILE, 0) K2MILEAGE,
+               nvl(ttv.SCTOTALMILE, 0) MILEAGE,
+               nvl(ttv.SCTHREETOTALMILE, 0) K3MILEAGE
+        FROM TMS_STUDENT_INFO@tms${city} T
+                 LEFT JOIN TMS_SCHOOL_INFO@tms${city} S
+                           ON T.TSO_SCHOOL_ID = S.TSI_ID
+                 left join tms_student_train_info@tms${city} t2
+                           on t.tso_id = t2.sri_student_id
+                 left join TMS_TRAIN_TIME_VIEW@tms${city} ttv
+                           on ttv.studentId = tso_id
+                 left join tms_student_face_info@tms${city} fi
+                           on t.tso_id = fi.student_id
+        WHERE T.TSO_ID = #{id}
+
+    </select>
+
+
+
     <select id="getTmsLogFaceListByStuId" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultType="com.miaxis.tms.vo.TmsLogFaceVo" >
         select f.crdate,f.sim,f.sourceimg,f.img, f.similar, f.type from tms_log_face_info@tms${city} f
         where f.stu_out_id = #{id}
@@ -335,6 +491,8 @@
     </select>
 
 
+
+
     <update id="upStuAppCoachIdById" parameterType="com.miaxis.tms.dto.TmsStudentInfoQrDTO">
         update TMS_STUDENT_INFO@tms${city} set tso_app_coach_id = #{appCoachId} where tso_id = #{id}
     </update>