Commit 68c687d0 authored by 黄荣荣's avatar 黄荣荣

评定相关功能

parent 3e5bc2af
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
<version>0.0.1</version> <version>0.0.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -57,4 +57,6 @@ public interface TaskMapper extends BaseMapper<ChAprTask> { ...@@ -57,4 +57,6 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
List<AllotTaskHisVO> allotTaskHisList(@Param("taskId") Integer taskId); List<AllotTaskHisVO> allotTaskHisList(@Param("taskId") Integer taskId);
Page<ReTaskDistributionVO> reTaskDistributionList(Page<ReTaskDistributionVO> page, @Param("organIds") List<Long> organIds, String districtProvincial, String districtCity, String districtArea, String realName, String certiCode); Page<ReTaskDistributionVO> reTaskDistributionList(Page<ReTaskDistributionVO> page, @Param("organIds") List<Long> organIds, String districtProvincial, String districtCity, String districtArea, String realName, String certiCode);
Page<TaskGroupInfoByPageVO> taskGroupInfoListByPage(String aprEmpId, String appointStartTime, String appointEndTime, String queryBeginDate, String queryEndDate, String groupNo, Integer pageNo, Integer pageSize);
} }
package com.hungraim.ltc.dto;
import lombok.Data;
@Data
public class PageDto {
private Integer pageNo = 1;
private Integer pageSize = 10;
}
package com.hungraim.ltc.dto;
import lombok.Data;
@Data
public class QueryDto extends PageDto{
private String aprEmpId;
private String appointStartTime;
private String appointEndTime;
private String queryBeginDate;
private String queryEndDate;
private String groupNum;
private String status;
private String taskGroupNo;
private String empId;
private String organId;
private String taskId;
private String refuseReason;
private String refuseRemark;
private String taskPushId;
}
package com.hungraim.ltc.service; package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReport;
import com.hungraim.ltc.pojo.entity.assessment.ChAprTask;
import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason; import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
...@@ -10,6 +13,7 @@ import org.springframework.stereotype.Service; ...@@ -10,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 失能评定Service * 失能评定Service
...@@ -54,4 +58,28 @@ public interface TaskService { ...@@ -54,4 +58,28 @@ public interface TaskService {
List<ChRefuseReason> refuseReasonList(); List<ChRefuseReason> refuseReasonList();
Result<List<ChFndAttach>> reportFileList(Long reportId); Result<List<ChFndAttach>> reportFileList(Long reportId);
Result<Object> taskRefuseCause(String taskId, String optType, String aprOrganId, String aprEmpId, String optTime, String refuseReason, String refuseRemark, String status, String taskGroupNo, String taskPushId) throws TppesApiException;
Result<Object> deleteVodFile(String fileId, String taskId);
int uploadVideo(String taskId, String videoUrl, String videoName, String padUserName, String fileId);
List<Map<String,Object>> findReportVideo(String taskId);
Result<Object> startApprTask(String taskId,String operationId,String operationOrganId,String taskGroupNo) throws TppesApiException;
List<TaskGroupInfoVO> queryAppraisalInfo(String aprEmpId, String appointStartTime, String appointEndTime, String queryBeginDate, String queryEndDate, String groupNum, Integer pageNo, Integer pageSize);
Page<TaskGroupInfoByPageVO> queryAppraisalInfoByPage(String aprEmpId, String appointStartTime, String appointEndTime, String queryBeginDate, String queryEndDate, String groupNum, Integer pageNo, Integer pageSize);
ChAprReport taskReportDetails(String taskId) throws TppesApiException;
ChAprTask singleTaskDetails(String taskId, String taskGroupNo, String taskPushId) throws TppesApiException;
ChAprTask singleTaskDetailsWuXi(String taskId, String taskGroupNo, String taskPushId) throws TppesApiException;
ChAprReport queryAprReportForWUXI(String taskId) throws TppesApiException;
IPage<ChAprTask> apprTaskDetailInfo(String appointStartTime, String appointEndTime, String status, String taskGroupNo, Integer pageNo, Integer pageSize) throws TppesApiException;
} }
package com.hungraim.ltc.service;
public class TppesApiException extends Exception {
private static final long serialVersionUID = 8755420483172678311L;
public TppesApiException() {
super();
}
public TppesApiException(String message) {
super(message);
}
public TppesApiException(String message, Throwable cause) {
super(message, cause);
}
}
...@@ -3,6 +3,8 @@ package com.hungraim.ltc.service.impl; ...@@ -3,6 +3,8 @@ package com.hungraim.ltc.service.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService; import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*; import com.hungraim.ltc.dao.*;
...@@ -13,6 +15,7 @@ import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo; ...@@ -13,6 +15,7 @@ import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo; import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.service.TaskService; import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.service.TppesApiException;
import com.hungraim.ltc.util.AttachType; import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
...@@ -24,9 +27,7 @@ import org.springframework.beans.BeanUtils; ...@@ -24,9 +27,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
/** /**
* @author czz * @author czz
...@@ -461,4 +462,166 @@ public class TaskServiceImpl implements TaskService { ...@@ -461,4 +462,166 @@ public class TaskServiceImpl implements TaskService {
} }
return listResult; return listResult;
} }
/**
* 单条任务拒绝
* @return
*/
@Override
public Result<Object> taskRefuseCause(String taskId, String optType, String aprOrganId, String aprEmpId, String optTime, String refuseReason, String refuseRemark, String status, String taskGroupNo, String taskPushId) throws TppesApiException {
if(taskId != "" && taskId != null){
ChAprTask task = taskMapper.selectById(taskId);
if(task != null) {
task.setTaskStatus(0);
taskMapper.updateById(task);
return Result.success();
}
}
return Result.failed();
}
/**
* 开始鉴定
* @return
*/
@Override
public Result<Object> startApprTask(String taskId,String operationId,String operationOrganId,String taskGroupNo) throws TppesApiException {
if(taskId != "" && taskId != null){
ChAprTask task = taskMapper.selectById(taskId);
if(task != null) {
task.setAprType(0);
taskMapper.updateById(task);
return Result.success();
}
}
return Result.failed();
}
@Override
public Result<Object> deleteVodFile(String fileId, String taskId) {
return Result.success();
}
@Override
public int uploadVideo(String taskId, String videoUrl, String videoName, String padUserName, String fileId) {
return 1;
}
@Override
public List<Map<String, Object>> findReportVideo(String taskId) {
List<Map<String,Object>> list= new ArrayList<Map<String,Object>>();
return list;
}
/**
* 查询鉴定任务组信息
*
* @return
* @author fanglg
*/
@Override
public List<TaskGroupInfoVO> queryAppraisalInfo(String aprEmpId, String appointStartTime, String appointEndTime, String queryBeginDate, String queryEndDate, String groupNum, Integer pageNo, Integer pageSize) {
List<TaskGroupInfoVO> taskGroupInfoVOIList = taskMapper.taskGroupInfoList(groupNum);
return taskGroupInfoVOIList;
}
/**
* 查询鉴定任务组信息
*
* @return
* @author fanglg
*/
@Override
public Page<TaskGroupInfoByPageVO> queryAppraisalInfoByPage(String aprEmpId, String appointStartTime, String appointEndTime, String queryBeginDate, String queryEndDate, String groupNum, Integer pageNo, Integer pageSize) {
Page<TaskGroupInfoByPageVO> taskGroupInfoVOIList = taskMapper.taskGroupInfoListByPage( aprEmpId, appointStartTime, appointEndTime, queryBeginDate, queryEndDate, groupNum, pageNo, pageSize);
return taskGroupInfoVOIList;
}
/**
* 获取鉴定报告详情
* @return
*/
@Override
public ChAprReport taskReportDetails(String taskId) throws TppesApiException {
LambdaQueryWrapper<ChAprReport> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ChAprReport::getTaskId,taskId);
ChAprReport chAprReport = aprReportMapper.selectOne(wrapper);
return chAprReport;
}
/**
* 单条任务详情
* @return
*/
@Override
public ChAprTask singleTaskDetails(String taskId, String taskGroupNo, String taskPushId) throws TppesApiException {
LambdaQueryWrapper<ChAprTask> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ChAprTask::getTaskId,taskId);
ChAprTask aprTask = taskMapper.selectOne(wrapper);
return aprTask;
}
/**
* 无锡单条任务详情
* @return
*/
@Override
public ChAprTask singleTaskDetailsWuXi(String taskId, String taskGroupNo, String taskPushId) throws TppesApiException {
LambdaQueryWrapper<ChAprTask> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ChAprTask::getTaskId,taskId);
ChAprTask aprTask = taskMapper.selectOne(wrapper);
return aprTask;
}
/**
* 获取无锡鉴定报告详情
* @return
*/
@Override
public ChAprReport queryAprReportForWUXI(String taskId) throws TppesApiException {
LambdaQueryWrapper<ChAprReport> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ChAprReport::getTaskId,taskId);
ChAprReport chAprReport = aprReportMapper.selectOne(wrapper);
return chAprReport;
}
/**
* 鉴定人员鉴定任务详情获取
* @return
*/
@Override
public IPage<ChAprTask> apprTaskDetailInfo(String appointStartTime,String appointEndTime,String status,String taskGroupNo,Integer pageNo,Integer pageSize) throws TppesApiException {
LambdaQueryWrapper<ChAprTask> wrapper = Wrappers.lambdaQuery();
/*if(appointStartTime!=null && !"".equals(appointStartTime)){
wrapper.gt("appointStartTime",appointStartTime);
}
if(appointEndTime!=null && !"".equals(appointEndTime)){
wrapper.lt("appointEndTime",appointEndTime);
}
if(status!=null && !"".equals(status)){
wrapper.eq("status",status);
}
wrapper.eq("taskGroupNo",taskGroupNo);*/
Page<ChAprTask> page = new Page<>(pageNo , pageSize , false);
IPage<ChAprTask> chAprTaskPage = taskMapper.selectPage(page,wrapper);
return chAprTaskPage;
}
} }
\ No newline at end of file
...@@ -383,4 +383,25 @@ ...@@ -383,4 +383,25 @@
</where> </where>
</select> </select>
<select id="taskGroupInfoListByPage" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskGroupInfoByPageVO">
select
push.assign_time "date",
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) districtProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_CITY = dis.DISTRICT_CODE) districPity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
push.Group_number groupNo,
emp.real_name aprEmpName,
emp.certi_code idCard,
push.task_push_id taskGroupNo
from ch_apr_task_push push
left join ch_apr_task task on push.task_id = task.task_id
left join CH_FND_ORGAN organ on organ.organ_id = task.organ_id
left join ch_disable_info disable on task.disable_info_id = disable.disab_info_id
left join ch_apr_emp emp on emp.emp_id = push.emp_id
</select>
</mapper> </mapper>
\ No newline at end of file
package com.hungraim.ltc.pojo.vo.assessment;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 评定任务分组管理列表详情
*/
@Data
public class TaskGroupInfoByPageVO {
/**
* 分组日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date date;
/**
* 评定起点地址
*/
private String address;
/**
* 组号
*/
private String groupNo;
/**
* 评定组长姓名
*/
private String aprEmpName;
/**
* 评定组长身份证号码
*/
private String idCard;
/**
* 组号
*/
private String taskGroupNo;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.hungraim.ltc.util;
import com.alibaba.fastjson.JSONObject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.*;
import java.net.Socket;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class SocketCallUtil {
private final static Logger logger = LogManager.getLogger(SocketCallUtil.class);
/**
* 调用前置机
* @param ip
* @param port
* @param jsonStr 需要传输给前置机的报文
* @return
* @throws Exception
*/
public static String callSocket(String ip, int port, String jsonStr) {
Socket socket = null;
InputStream in = null;
PrintWriter out = null;
try {
socket = new Socket(ip, port);
out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "utf-8"));
jsonStr = URLEncoder.encode(jsonStr, "UTF-8");
String oraMessage = "http://iai.tencentcloudapi.com/Method=TCY&outputStr=" + jsonStr;
String length8Str = getByteLength8(oraMessage);
String message = "readFully" + length8Str + "nodecrypt" + oraMessage;
out.print(message);
out.flush();
in = socket.getInputStream();
Thread.sleep(1000);
byte[] buf = new byte[1024];
List<Byte> byteList = new ArrayList<Byte>();
while ((in.read(buf)) != -1) {
for (byte bt : buf) {
byteList.add(bt);
}
}
byte[] b = new byte[byteList.size()];
int i = 0;
Iterator<Byte> iterator = byteList.iterator();
while (iterator.hasNext()) {
b[i] = iterator.next();
i++;
}
byte[] byteLength8 = new byte[8];
System.arraycopy(b, 0, byteLength8, 0, 8);
int length8 = Integer.parseInt(new String(byteLength8));
byte[] bytes = new byte[length8];
System.arraycopy(b, 8, bytes, 0, length8);
return URLDecoder.decode(new String(bytes, "UTF-8"), "UTF-8");
} catch (Exception e) {
e.printStackTrace();
return "调用前置机异常";
} finally {
try {
in.close();
out.close();
if (!socket.isClosed()) {
socket.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 获取byte字符的8位长度(不足八位左补零) add by oydg 20140902
*
* @param content
* @return
*/
private static String getByteLength8(String content) {
String length8 = "";
if (null == content) {
return length8;
}
String length = (content.length() + 8) + "";
int size = length.length();
for (int i = 0; i < 8 - size; i++) {
length = "0" + length;
}
length8 = length;
return length8;
}
/**
* 通过socket连接前置机进行互联网接口的对接
*
* @param socketIp 前置机IP
* @param socketPort 前置机端口
* @param url 目标请求的URL
* @param characterEncoding 字符集编码
* @param isProxy 是否开启代理请求
* @return
*/
public static String commentSocketUtil(String socketIp, int socketPort, String url, String input, String characterEncoding, String isProxy) {
Socket socket = null;
try {
socket = new Socket(socketIp, socketPort);
JSONObject json = new JSONObject();
json.put("openProxy", isProxy);//必传 启用代理 TRUE、FALSE,一般传TRUE,不要传FALSE
json.put("encode", characterEncoding);//非必传,不传默认UTF-8,如http(s)接口提供方反馈中文乱码,按对方编码设置
json.put("contentType", "application/json");//非必传 Content-Type 按实际需要填写
if("deleteVideoFile".equals(input)){
json.put("requestMethod", "GET");//必传 POST、GET
}else{
json.put("requestMethod", "POST");//必传 POST、GET
json.put("outputString",input);//参数
}
String jsonStr = URLEncoder.encode(json.toString(), characterEncoding);
String oraMessage = url + "Method=WAN&outputStr=" + jsonStr;
String length8Str = getByteLength8(oraMessage);
logger.info("开始连接前置机,请求的目标地址为:" + url);
if (socket.isConnected()) {
InputStream in = new BufferedInputStream(socket.getInputStream());
OutputStream out = socket.getOutputStream();
String message = "readFully" + length8Str + "nodecrypt" + oraMessage;
out.write((message).getBytes());
out.flush();
byte htmlByte[] = readInputStream(in);
String result = new String(htmlByte, characterEncoding);
logger.info("前置机返回外部接口信息:" + url);
return result;
} else {
logger.info("程序正常,但是连接前置机失败!");
return "程序正常,但是连接前置机失败!";
}
} catch (Exception e) {
logger.info("前置机socket访问外部接口连接失败:" + e.getStackTrace());
return "查询失败";
} finally {
if (!socket.isClosed()) {
try {
socket.close();
} catch (Exception e) {
logger.info("关闭前置机socket连接错误:" + e.getStackTrace());
}
}
}
}
/**
* 流转byte[],无需修改
*
* @param inStream
* @return
* @throws Exception
*/
private static byte[] readInputStream(InputStream inStream) throws Exception {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[9024];
int len = 0;
while ((len = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, len);
}
inStream.close();
return outStream.toByteArray();
}
}
...@@ -54,6 +54,12 @@ ...@@ -54,6 +54,12 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.69</version>
</dependency>
</dependencies> </dependencies>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment