Commit 16ec849f authored by 耿迪迪's avatar 耿迪迪

行业专家申报

parent 8cb5e7b5
package com.zehong.web.controller.specialist;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TProAppInfor;
import com.zehong.system.service.ITProAppInforService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 行业专家库-专家申报Controller
*
* @author zehong
* @date 2024-05-06
*/
@RestController
@RequestMapping("/specialist/info")
public class TProAppInforController extends BaseController
{
@Autowired
private ITProAppInforService tProAppInforService;
/**
* 查询行业专家库-专家申报列表
*/
@PreAuthorize("@ss.hasPermi('specialist:info:list')")
@GetMapping("/list")
public TableDataInfo list(TProAppInfor tProAppInfor)
{
startPage();
List<TProAppInfor> list = tProAppInforService.selectTProAppInforList(tProAppInfor);
return getDataTable(list);
}
/**
* 导出行业专家库-专家申报列表
*/
@PreAuthorize("@ss.hasPermi('specialist:info:export')")
@Log(title = "行业专家库-专家申报", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProAppInfor tProAppInfor)
{
List<TProAppInfor> list = tProAppInforService.selectTProAppInforList(tProAppInfor);
ExcelUtil<TProAppInfor> util = new ExcelUtil<TProAppInfor>(TProAppInfor.class);
return util.exportExcel(list, "行业专家库-专家申报数据");
}
/**
* 获取行业专家库-专家申报详细信息
*/
@PreAuthorize("@ss.hasPermi('specialist:info:query')")
@GetMapping(value = "/{fProAppInforId}")
public AjaxResult getInfo(@PathVariable("fProAppInforId") Long fProAppInforId)
{
return AjaxResult.success(tProAppInforService.selectTProAppInforById(fProAppInforId));
}
/**
* 新增行业专家库-专家申报
*/
@PreAuthorize("@ss.hasPermi('specialist:info:add')")
@Log(title = "行业专家库-专家申报", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProAppInfor tProAppInfor)
{
return toAjax(tProAppInforService.insertTProAppInfor(tProAppInfor));
}
/**
* 修改行业专家库-专家申报
*/
@PreAuthorize("@ss.hasPermi('specialist:info:edit')")
@Log(title = "行业专家库-专家申报", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProAppInfor tProAppInfor)
{
return toAjax(tProAppInforService.updateTProAppInfor(tProAppInfor));
}
/**
* 删除行业专家库-专家申报
*/
@PreAuthorize("@ss.hasPermi('specialist:info:remove')")
@Log(title = "行业专家库-专家申报", businessType = BusinessType.DELETE)
@DeleteMapping("/{fProAppInforIds}")
public AjaxResult remove(@PathVariable Long[] fProAppInforIds)
{
return toAjax(tProAppInforService.deleteTProAppInforByIds(fProAppInforIds));
}
/**
* 行业专家申报
* @param fProAppInforId 行业专家主键
* @return
*/
@GetMapping("/reportProAppInfo")
public AjaxResult reportProAppInfo(Long fProAppInforId){
try{
return toAjax(tProAppInforService.reportProAppInfo(fProAppInforId));
}catch (Exception e){
logger.error("行业专家申报接口异常=====",e);
return AjaxResult.error("行业专家申报接口异常");
}
}
}
...@@ -127,6 +127,13 @@ ...@@ -127,6 +127,13 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</dependency> </dependency>
<!--httpclient-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.zehong.common.utils;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
/**
* @author geng
* 上报市局实体类组装工具类
*/
public class GovernmentDataCopyUtil {
/**
* 信息拷贝
* @param source 源
* @param target 目标对象
*/
public static void copyObjectInfo(Object source,Object target) throws IllegalAccessException {
Field[] fields = source.getClass().getDeclaredFields();
Map<String,Field> targetMap = fieldsToMap(target.getClass().getDeclaredFields());
for(Field field : fields){
field.setAccessible(true);
String name = field.getName();
String targetName = Character.toLowerCase(name.charAt(1)) + name.substring(2);
if(targetMap.containsKey(targetName)){
Object value = field.get(source);
if(null != value){
targetMap.get(targetName).set(target,value);
}
}
}
}
/**
* field[]数组转map
* @param fields 属性数组
* @return map
*/
private static Map<String, Field> fieldsToMap(Field[] fields){
Map<String, Field> hashMap = new HashMap<>();
for (Field field : fields) {
//打开私有访问
field.setAccessible(true);
String name = field.getName();
hashMap.put(name, field);
}
return hashMap;
}
}
package com.zehong.common.utils;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.core.redis.RedisCache;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.http.HttpClientUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Component
public class GovernmentDataUtil {
@Resource
private RedisCache redisCache;
@Value("${zhengfu.appId}")
private String appId;
@Value("${zhengfu.appSecret}")
private String appSecret;
@Value("${zhengfu.tokenUrl}")
private String tokenUrl;
@Value("${zhengfu.apiUrl}")
private String apiUrl;
/**
* 获取token
* @return token
* @throws Exception
*/
public String getToken()throws Exception{
String token = redisCache.getCacheObject("apiToken");
if(token!=null){
token = getNewToken();
}
return token;
}
/**
* 获取接口参数
* @return dataInfo
* @throws Exception
*/
public JSONObject getInfo(String domain, String methodType, Map<String,Object> map)throws Exception{
String token = getToken();
JSONObject param = new JSONObject();
param.put("domain", domain);
param.put("method", methodType);
param.put("condition", map);
Map<String,Object> head = new HashMap<>();
head.put("authorization",token);
String result = HttpClientUtils.doPost(apiUrl,param.toJSONString(),head);
if(StringUtils.isEmpty(result)) throw new CustomException("获取市局数据失败!");
return JSONObject.parseObject(result);
}
/**
* 上传数据
* @param methodType
* @param list
* @return
* @throws Exception
*/
public JSONObject setInfo(String domain, String methodType, List list)throws Exception{
String token = getToken();
JSONObject param = new JSONObject();
param.put("domain", domain);
param.put("method", methodType);
param.put("data", list);
Map<String,Object> head = new HashMap<>();
head.put("authorization",token);
String result = HttpClientUtils.doPost(apiUrl,param.toJSONString(),head);
if(StringUtils.isEmpty(result)) throw new CustomException("上传市局数据失败!");
return JSONObject.parseObject(result);
}
/**
* 刷新token
* @return token
* @throws Exception
*/
public String getNewToken()throws Exception{
JSONObject param = new JSONObject();
param.put("appId",appId);
param.put("appSecret",appSecret);
String result = HttpClientUtils.doPost(tokenUrl,param.toJSONString(),null);
if(StringUtils.isEmpty(result)) throw new CustomException("获取上报市局token接口失败!");
JSONObject resultJson = JSONObject.parseObject(result);
redisCache.setCacheObject("apiToken", resultJson.getJSONObject("data").getString("accessToken"),7000, TimeUnit.SECONDS);
return resultJson.getJSONObject("data").getString("accessToken");
}
}
package com.zehong.common.utils.http;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class HttpClientUtils {
/**
* get请求
* @param url 请求地址
* @param param 请求参数
* @headData headData 请求头
* @return String
*/
public static String doGet(String url, Map<String, Object> param, Map<String, Object> headData) throws URISyntaxException, IOException {
//创建默认的httpclient实例
CloseableHttpClient httpClient = HttpClients.createDefault();
//响应对象
CloseableHttpResponse response = null;
//返回结果
String resultStr = "";
try {
URIBuilder builder = new URIBuilder(url);
if (param != null) {
for (String key : param.keySet()) {
builder.addParameter(key, String.valueOf(param.get(key)));
}
}
URI uri = builder.build();
HttpGet httpGet = new HttpGet(uri);
//携带head数据
if (headData != null && headData.size() > 0) {
for (String key : headData.keySet()) {
httpGet.setHeader(key, (String) headData.get(key));
}
}
response = httpClient.execute(httpGet);
if (response!=null && response.getStatusLine().getStatusCode() == 200){
HttpEntity httpEntity = response.getEntity();
resultStr = EntityUtils.toString(httpEntity,"UTF-8");
}
}finally {
close(response,httpClient);
}
return resultStr;
}
/**
* post请求
* @param url 请求地址
* @param param 请求参数
* @param headData 请求头
* @return String
* @throws IOException 异常信息
*/
public static String doPost(String url, Map<String, Object> param, Map<String, Object> headData) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
HttpPost httpPost = new HttpPost(url);
if (param != null) {
List<NameValuePair> formParams = new ArrayList<>();
for (String key : param.keySet()) {
formParams.add(new BasicNameValuePair(key, String.valueOf(param.get(key))));
}
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formParams,"UTF-8");
httpPost.setEntity(entity);
}
//携带head数据
if (headData != null && headData.size() > 0) {
for (String key : headData.keySet()) {
httpPost.setHeader(key, (String) headData.get(key));
}
}
//执行post请求
response = httpClient.execute(httpPost);
if (response!=null && response.getStatusLine().getStatusCode() == 200) {
resultString = EntityUtils.toString(response.getEntity(),"UTF-8");
}
}finally {
close(response,httpClient);
}
return resultString;
}
/**
* body传参
* @param url 请求地址
* @param param body参数
* @param headData 请求头
* @return String
* @throws IOException 异常
*/
public static String doPost(String url,String param,Map<String, Object> headData) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
HttpPost httpPost = new HttpPost(url);
if (param != null) {
httpPost.setEntity(new StringEntity(param, ContentType.create("application/json", "utf-8")));
}
//携带head数据
if (headData != null && headData.size() > 0) {
for (String key : headData.keySet()) {
httpPost.setHeader(key, (String) headData.get(key));
}
}
//执行post请求
response = httpClient.execute(httpPost);
if (response!=null && response.getStatusLine().getStatusCode() == 200) {
resultString = EntityUtils.toString(response.getEntity(),"UTF-8");
}
}finally {
close(response,httpClient);
}
return resultString;
}
/**
* 关闭客户端
* @param response 返回实体
* @param httpClient 客户端
* @throws IOException 异常信息
*/
private static void close( CloseableHttpResponse response,CloseableHttpClient httpClient) throws IOException {
if (response != null) {
response.close();
}
httpClient.close();
}
public static String uploadFile (String url,HttpEntity entity) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String result = "";
try {
// 路径自定义
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(entity);
// 执行提交
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
if (responseEntity != null) {
// 将响应内容转换为字符串
result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
close(response,httpClient);
}
return result;
}
}
package com.zehong.system.domain.vo;
public class ProAppInfoVo {
/** 数据限定 */
private String deptCode;
/** 数据来源-G政府:E企业 */
private String source;
/** 人员编码 */
private String code;
/** 专家姓名 */
private String name;
/** 身份证号 */
private String idNo;
/** 性别:1-男性,2-女性 */
private String sex;
/** 出生日期 */
private String birthday;
/** 邮箱 */
private String email;
/** 联系电话 */
private String phone;
/** 文化程度 */
private String education;
/** 毕业院校 */
private String graduationSchool;
/** 所属专业 */
private String major;
/** 毕业时间 */
private String graduationTime;
/** 工作单位编码 */
private String entUuid;
/** 工作单位名称 */
private String workUnit;
/** 参加工作时间 */
private String workTime;
/** 所在部门 */
private String department;
/** 职务 */
private String duties;
/** 专业技术职称 */
private String majorTitle;
/** 现从事专业 */
private String majorNow;
/** 从事专业工作年限 */
private Long majorLife;
/** 从事行业燃气种类 可以是多个,逗号分割
03-0100-0101:管道燃气
03-0100-0102:液化天然气(LNG)
03-0100-0103:压缩天然气(CNG)
03-0200:液化石油气(LPG)
03-0300:人工煤气
03-0400:液化石油气混空气
03-0500:沼气
03-0600:氢气 */
private String gasType;
/** 擅长工作领域,可以是多个,逗号分割 */
private String goodArea;
/** 相关学习工作经历及工作业绩 */
private String learningWorkExperience;
/** 所在地区 */
private String area;
/** 删除标记,0-可用,1-已删除 */
private Long deleteFlag;
/** 市局燃气主管部门意见 */
private String cRecord;
/** 省级燃气主管部门意见 */
private String pRecord;
/** 照片 */
private String picture;
/** 最后修改时间 */
private String updateTime;
/** 是否省级专家 1 是,0 不是 */
private String thisProvinceFlag;
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIdNo() {
return idNo;
}
public void setIdNo(String idNo) {
this.idNo = idNo;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEducation() {
return education;
}
public void setEducation(String education) {
this.education = education;
}
public String getGraduationSchool() {
return graduationSchool;
}
public void setGraduationSchool(String graduationSchool) {
this.graduationSchool = graduationSchool;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public String getGraduationTime() {
return graduationTime;
}
public void setGraduationTime(String graduationTime) {
this.graduationTime = graduationTime;
}
public String getEntUuid() {
return entUuid;
}
public void setEntUuid(String entUuid) {
this.entUuid = entUuid;
}
public String getWorkUnit() {
return workUnit;
}
public void setWorkUnit(String workUnit) {
this.workUnit = workUnit;
}
public String getWorkTime() {
return workTime;
}
public void setWorkTime(String workTime) {
this.workTime = workTime;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getDuties() {
return duties;
}
public void setDuties(String duties) {
this.duties = duties;
}
public String getMajorTitle() {
return majorTitle;
}
public void setMajorTitle(String majorTitle) {
this.majorTitle = majorTitle;
}
public String getMajorNow() {
return majorNow;
}
public void setMajorNow(String majorNow) {
this.majorNow = majorNow;
}
public Long getMajorLife() {
return majorLife;
}
public void setMajorLife(Long majorLife) {
this.majorLife = majorLife;
}
public String getGasType() {
return gasType;
}
public void setGasType(String gasType) {
this.gasType = gasType;
}
public String getGoodArea() {
return goodArea;
}
public void setGoodArea(String goodArea) {
this.goodArea = goodArea;
}
public String getLearningWorkExperience() {
return learningWorkExperience;
}
public void setLearningWorkExperience(String learningWorkExperience) {
this.learningWorkExperience = learningWorkExperience;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public Long getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Long deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getcRecord() {
return cRecord;
}
public void setcRecord(String cRecord) {
this.cRecord = cRecord;
}
public String getpRecord() {
return pRecord;
}
public void setpRecord(String pRecord) {
this.pRecord = pRecord;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getThisProvinceFlag() {
return thisProvinceFlag;
}
public void setThisProvinceFlag(String thisProvinceFlag) {
this.thisProvinceFlag = thisProvinceFlag;
}
@Override
public String toString() {
return "ProAppInfoVo{" +
"deptCode='" + deptCode + '\'' +
", source='" + source + '\'' +
", code='" + code + '\'' +
", name='" + name + '\'' +
", idNo='" + idNo + '\'' +
", sex='" + sex + '\'' +
", birthday='" + birthday + '\'' +
", email='" + email + '\'' +
", phone='" + phone + '\'' +
", education='" + education + '\'' +
", graduationSchool='" + graduationSchool + '\'' +
", major='" + major + '\'' +
", graduationTime='" + graduationTime + '\'' +
", entUuid='" + entUuid + '\'' +
", workUnit='" + workUnit + '\'' +
", workTime='" + workTime + '\'' +
", department='" + department + '\'' +
", duties='" + duties + '\'' +
", majorTitle='" + majorTitle + '\'' +
", majorNow='" + majorNow + '\'' +
", majorLife=" + majorLife +
", gasType='" + gasType + '\'' +
", goodArea='" + goodArea + '\'' +
", learningWorkExperience='" + learningWorkExperience + '\'' +
", area='" + area + '\'' +
", deleteFlag=" + deleteFlag +
", cRecord='" + cRecord + '\'' +
", pRecord='" + pRecord + '\'' +
", picture='" + picture + '\'' +
", updateTime='" + updateTime + '\'' +
", thisProvinceFlag='" + thisProvinceFlag + '\'' +
'}';
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TProAppInfor;
/**
* 行业专家库-专家申报Mapper接口
*
* @author zehong
* @date 2024-05-06
*/
public interface TProAppInforMapper
{
/**
* 查询行业专家库-专家申报
*
* @param fProAppInforId 行业专家库-专家申报ID
* @return 行业专家库-专家申报
*/
public TProAppInfor selectTProAppInforById(Long fProAppInforId);
/**
* 查询行业专家库-专家申报列表
*
* @param tProAppInfor 行业专家库-专家申报
* @return 行业专家库-专家申报集合
*/
public List<TProAppInfor> selectTProAppInforList(TProAppInfor tProAppInfor);
/**
* 新增行业专家库-专家申报
*
* @param tProAppInfor 行业专家库-专家申报
* @return 结果
*/
public int insertTProAppInfor(TProAppInfor tProAppInfor);
/**
* 修改行业专家库-专家申报
*
* @param tProAppInfor 行业专家库-专家申报
* @return 结果
*/
public int updateTProAppInfor(TProAppInfor tProAppInfor);
/**
* 删除行业专家库-专家申报
*
* @param fProAppInforId 行业专家库-专家申报ID
* @return 结果
*/
public int deleteTProAppInforById(Long fProAppInforId);
/**
* 批量删除行业专家库-专家申报
*
* @param fProAppInforIds 需要删除的数据ID
* @return 结果
*/
public int deleteTProAppInforByIds(Long[] fProAppInforIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TProAppInfor;
/**
* 行业专家库-专家申报Service接口
*
* @author zehong
* @date 2024-05-06
*/
public interface ITProAppInforService
{
/**
* 查询行业专家库-专家申报
*
* @param fProAppInforId 行业专家库-专家申报ID
* @return 行业专家库-专家申报
*/
public TProAppInfor selectTProAppInforById(Long fProAppInforId);
/**
* 查询行业专家库-专家申报列表
*
* @param tProAppInfor 行业专家库-专家申报
* @return 行业专家库-专家申报集合
*/
public List<TProAppInfor> selectTProAppInforList(TProAppInfor tProAppInfor);
/**
* 新增行业专家库-专家申报
*
* @param tProAppInfor 行业专家库-专家申报
* @return 结果
*/
public int insertTProAppInfor(TProAppInfor tProAppInfor);
/**
* 修改行业专家库-专家申报
*
* @param tProAppInfor 行业专家库-专家申报
* @return 结果
*/
public int updateTProAppInfor(TProAppInfor tProAppInfor);
/**
* 批量删除行业专家库-专家申报
*
* @param fProAppInforIds 需要删除的行业专家库-专家申报ID
* @return 结果
*/
public int deleteTProAppInforByIds(Long[] fProAppInforIds);
/**
* 删除行业专家库-专家申报信息
*
* @param fProAppInforId 行业专家库-专家申报ID
* @return 结果
*/
public int deleteTProAppInforById(Long fProAppInforId);
/**
* 专家申报
* @param fProAppInforId 专家数据
* @return
*/
int reportProAppInfo(Long fProAppInforId) throws Exception;
}
package com.zehong.system.service.impl;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.system.domain.vo.ProAppInfoVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProAppInforMapper;
import com.zehong.system.domain.TProAppInfor;
import com.zehong.system.service.ITProAppInforService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* 行业专家库-专家申报Service业务层处理
*
* @author zehong
* @date 2024-05-06
*/
@Service
public class TProAppInforServiceImpl implements ITProAppInforService {
private static final Logger log = LoggerFactory.getLogger(TProAppInforServiceImpl.class);
@Autowired
private TProAppInforMapper tProAppInforMapper;
@Resource
private GovernmentDataUtil governmentDataUtil;
/**
* 查询行业专家库-专家申报
*
* @param fProAppInforId 行业专家库-专家申报ID
* @return 行业专家库-专家申报
*/
@Override
public TProAppInfor selectTProAppInforById(Long fProAppInforId)
{
return tProAppInforMapper.selectTProAppInforById(fProAppInforId);
}
/**
* 查询行业专家库-专家申报列表
*
* @param tProAppInfor 行业专家库-专家申报
* @return 行业专家库-专家申报
*/
@Override
public List<TProAppInfor> selectTProAppInforList(TProAppInfor tProAppInfor)
{
return tProAppInforMapper.selectTProAppInforList(tProAppInfor);
}
/**
* 新增行业专家库-专家申报
*
* @param tProAppInfor 行业专家库-专家申报
* @return 结果
*/
@Override
public int insertTProAppInfor(TProAppInfor tProAppInfor)
{
tProAppInfor.setfUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
return tProAppInforMapper.insertTProAppInfor(tProAppInfor);
}
/**
* 修改行业专家库-专家申报
*
* @param tProAppInfor 行业专家库-专家申报
* @return 结果
*/
@Override
public int updateTProAppInfor(TProAppInfor tProAppInfor)
{
tProAppInfor.setfUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
return tProAppInforMapper.updateTProAppInfor(tProAppInfor);
}
/**
* 批量删除行业专家库-专家申报
*
* @param fProAppInforIds 需要删除的行业专家库-专家申报ID
* @return 结果
*/
@Override
public int deleteTProAppInforByIds(Long[] fProAppInforIds)
{
return tProAppInforMapper.deleteTProAppInforByIds(fProAppInforIds);
}
/**
* 删除行业专家库-专家申报信息
*
* @param fProAppInforId 行业专家库-专家申报ID
* @return 结果
*/
@Override
public int deleteTProAppInforById(Long fProAppInforId)
{
return tProAppInforMapper.deleteTProAppInforById(fProAppInforId);
}
/**
* 专家申报
* @param fProAppInforId 专家数据
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int reportProAppInfo(Long fProAppInforId) throws Exception {
TProAppInfor updateInfo = new TProAppInfor();
updateInfo.setfProAppInforId(fProAppInforId);
updateInfo.setfRepStatus(Long.parseLong("1"));
updateInfo.setfRepDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
int result = tProAppInforMapper.updateTProAppInfor(updateInfo);
TProAppInfor appInfor = tProAppInforMapper.selectTProAppInforById(fProAppInforId);
ProAppInfoVo proAppInfoVo = new ProAppInfoVo();
GovernmentDataCopyUtil.copyObjectInfo(appInfor,proAppInfoVo);
List<ProAppInfoVo> data = new ArrayList<>();
data.add(proAppInfoVo);
JSONObject reportResult = governmentDataUtil.setInfo("professor/application/information","WRITE",data);
log.info("专家申报结果===================" + reportResult.toJSONString());
if(!"0".equals(reportResult.getString("resultCode"))) throw new CustomException("行业专家上报市局接口失败");
return result;
}
}
import request from '@/utils/request'
// 查询行业专家库-专家申报列表
export function listInfor(query) {
return request({
url: '/specialist/info/list',
method: 'get',
params: query
})
}
// 查询行业专家库-专家申报详细
export function getInfor(fProAppInforId) {
return request({
url: '/specialist/info/' + fProAppInforId,
method: 'get'
})
}
// 新增行业专家库-专家申报
export function addInfor(data) {
return request({
url: '/specialist/info',
method: 'post',
data: data
})
}
// 修改行业专家库-专家申报
export function updateInfor(data) {
return request({
url: '/specialist/info',
method: 'put',
data: data
})
}
// 删除行业专家库-专家申报
export function delInfor(fProAppInforId) {
return request({
url: '/specialist/info/' + fProAppInforId,
method: 'delete'
})
}
// 导出行业专家库-专家申报
export function exportInfor(query) {
return request({
url: '/specialist/info/export',
method: 'get',
params: query
})
}
//行业专家申报
export function reportProAppInfo(query) {
return request({
url: '/specialist/info/reportProAppInfo',
method: 'get',
params: query
})
}
...@@ -237,3 +237,8 @@ ...@@ -237,3 +237,8 @@
position: relative; position: relative;
float: right; float: right;
} }
.el-row-table{
display:flex;
flex-wrap: wrap;
}
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="160px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="专家姓名">
<span v-if="detailInfo.fName">{{ detailInfo.fName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证号">
<span v-if="detailInfo.fIdNo">{{ detailInfo.fIdNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别">
<span v-if="detailInfo.fSex">{{ $parent.fSexFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数据限定">
<span v-if="detailInfo.fDeptCode">{{ detailInfo.fDeptCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数据来源">
<span v-if="detailInfo.fSource">{{ $parent.fSourceFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="人员编码">
<span v-if="detailInfo.fCode">{{ detailInfo.fCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出生日期">
<span v-if="detailInfo.fBirthday">{{ detailInfo.fBirthday }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱">
<span v-if="detailInfo.fEmail">{{ detailInfo.fEmail }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话">
<span v-if="detailInfo.fPhone">{{ detailInfo.fPhone }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="文化程度">
<span v-if="detailInfo.fEducation">{{ detailInfo.fEducation }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="毕业院校">
<span v-if="detailInfo.fGraduationSchool">{{ detailInfo.fGraduationSchool }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属专业">
<span v-if="detailInfo.fMajor">{{ detailInfo.fMajor }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="毕业时间">
<span v-if="detailInfo.fGraduationTime">{{ detailInfo.fGraduationTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作单位编码">
<span v-if="detailInfo.fEntUuid">{{ detailInfo.fEntUuid }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作单位名称">
<span v-if="detailInfo.fWorkUnit">{{ detailInfo.fWorkUnit }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="参加工作时间">
<span v-if="detailInfo.fWorkTime">{{ detailInfo.fWorkTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在部门">
<span v-if="detailInfo.fDepartment">{{ detailInfo.fDepartment }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务">
<span v-if="detailInfo.fDuties">{{ detailInfo.fDuties }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="专业技术职称">
<span v-if="detailInfo.fMajorTitle">{{ detailInfo.fMajorTitle }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="现从事专业">
<span v-if="detailInfo.fMajorNow">{{ detailInfo.fMajorNow }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="从事专业工作年限">
<span v-if="detailInfo.fMajorLife">{{ detailInfo.fMajorLife }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="燃气种类">
<span v-if="detailInfo.fGasType">{{ $parent.fGasTypeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="擅长工作领域">
<span v-if="detailInfo.fGoodArea">{{ detailInfo.fGoodArea }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="相关经历">
<span v-if="detailInfo.fLearningWorkExperience">{{ detailInfo.fLearningWorkExperience }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在地区">
<span v-if="detailInfo.fArea">{{ detailInfo.fArea }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="市局燃气主管部门意见">
<span v-if="detailInfo.fCRecord">{{ detailInfo.fCRecord }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="省级燃气主管部门意见">
<span v-if="detailInfo.fPRecord">{{ detailInfo.fPRecord }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否省级专家">
<span v-if="detailInfo.fThisProvinceFlag">{{ $parent.fThisProvinceFlagFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否有效" prop="fValidType">
<span v-if="detailInfo.fValidType">{{ $parent.fValidTypeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="照片">
<el-image
:src="detailInfo.fPicture"
:preview-src-list="[detailInfo.fPicture]"
v-if="detailInfo.fPicture != '' && detailInfo.fPicture != null"
:z-index=5000 style="width: 200px;height: 200px;"
></el-image>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getInfor } from "@/api/specialist/info";
export default {
name: "detail-info",
data(){
return{
detailInfo: {},
detailOpen: false
}
},
methods:{
getDetailInfo(id){
getInfor(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
This diff is collapsed.
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