Commit 86630eb0 authored by xulihui's avatar xulihui

修改专家申报

parent f3fb4bf9
package com.zehong.web.controller.specialist;
import java.util.List;
import com.zehong.system.domain.TProAppInforBrowse;
import com.zehong.system.service.ITProAppInforBrowseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -31,6 +34,8 @@ public class FProBehInforController extends BaseController
{
@Autowired
private IFProBehInforService fProBehInforService;
@Autowired
private ITProAppInforBrowseService tProAppInforBrowseService;
/**
* 查询行业专家库-专家行为申报列表
......@@ -108,4 +113,14 @@ public class FProBehInforController extends BaseController
return AjaxResult.error("行业专家申报接口异常");
}
}
/**
* 获取申报人列表
*/
@GetMapping("/getUserList")
public AjaxResult getUserList(){
List<TProAppInforBrowse> list = tProAppInforBrowseService.selectTProAppInforBrowseList(new TProAppInforBrowse());
list.stream().forEach(e->e.setfShowName(e.getfName()+"-"+e.getfIdNo()+"-" + ("1".equals(e.getfSex())? "男性": "女性")));
return AjaxResult.success(list);
}
}
package com.zehong.web.controller.task;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.redis.RedisCache;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.StringUtils;
import com.zehong.common.utils.http.HttpClientUtils;
import com.zehong.system.domain.TProAppInforBrowse;
import com.zehong.system.domain.TUserLocation;
import com.zehong.system.domain.vo.ProAppInforBrowseVo;
import com.zehong.system.service.ISysUserService;
import com.zehong.system.service.ITUserLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Component("timeTasks")
public class TimeTasksController {
@Value("${wjyhq.apiUrl}")
private String apiUrl;
@Autowired
private RedisCache redisCache;
@Autowired
ITUserLocationService tUserLocationService;
/**
* 获取token
* @return token
* @throws Exception
*/
public String getToken()throws Exception{
String token = redisCache.getCacheObject("yhqToken");
if(StringUtils.isEmpty(token)){
token = getNewToken();
}
return token;
}
/**
* 刷新token
* @return token
* @throws Exception
*/
public String getNewToken()throws Exception{
JSONObject param = new JSONObject();
param.put("authcode","LPG-HSRQ-101807423011");
param.put("accessKey","3D4B933297C6CA68E2FD9CEB3697FC78");
param.put("secretKey","pu8s3Z8TsPi09fCFpOFunWqbi9TDtXTq");
String result = HttpClientUtils.doPost(apiUrl+"/SyncDataApi/CreateToken",param.toJSONString(),null);
if(StringUtils.isEmpty(result)) throw new CustomException("获取液化气token接口失败!");
JSONObject resultJson = JSONObject.parseObject(result);
redisCache.setCacheObject("yhqToken", resultJson.getJSONObject("result").getString("token"),30, TimeUnit.DAYS);
return resultJson.getJSONObject("result").getString("token");
}
/**
* 获取钢瓶档案
* @return token
* @throws Exception
*/
public void getArchivesList()throws Exception{
//String token = getToken();
JSONObject param = new JSONObject();
param.put("maxReturnNum","100");
param.put("lastUpTime","2000-03-12 00:00:00");
Map<String,Object> head = new HashMap<>();
head.put("authorization","token");
String result = HttpClientUtils.doPost(apiUrl+"/SyncDataApi/ArchivesList",param.toJSONString(),head);
if(StringUtils.isEmpty(result)) throw new CustomException("获取钢瓶档案接口失败!");
JSONObject json = JSONObject.parseObject(result);
//结果入库
if(null != json && "0".equals(json.getString("resultCode")) && null != json.getJSONArray("data")){
JSONArray data = json.getJSONArray("data");
List<TProAppInforBrowse> proAppInforBrowseList = new ArrayList<>();
for(int i = 0; i < data.size(); i++){
ProAppInforBrowseVo proAppInforBrowseVo = JSONObject.toJavaObject(data.getJSONObject(i), ProAppInforBrowseVo.class);
TProAppInforBrowse tProAppInforBrowse = new TProAppInforBrowse();
GovernmentDataCopyUtil.copyToLocalData(proAppInforBrowseVo,tProAppInforBrowse);
proAppInforBrowseList.add(tProAppInforBrowse);
}
//tProAppInforBrowseMapper.batchInsertTProAppInforBrowse(proAppInforBrowseList);
}
}
}
......@@ -105,3 +105,5 @@ zhengfu:
tokenUrl: http://test.zfcxjst.hebei.gov.cn:8082/openApi/authorization/api-entry/v1/getAccessToken
#链接访问地址
apiUrl: http://test.zfcxjst.hebei.gov.cn:8082/openApi/index/sync/v1/entrypoint
wjyhq:
apiUrl: https://api.117915.com/openapi
......@@ -23,6 +23,10 @@ public class FProBehInfor extends BaseEntity
@Excel(name = "身份证号")
private String fIdNo;
/** 姓名 */
@Excel(name = "姓名")
private String fName;
/** 专家表现评价 */
@Excel(name = "专家表现评价")
private String fExpertEval;
......@@ -70,6 +74,15 @@ public class FProBehInfor extends BaseEntity
{
return fIdNo;
}
public String getfName() {
return fName;
}
public void setfName(String fName) {
this.fName = fName;
}
public void setfExpertEval(String fExpertEval)
{
this.fExpertEval = fExpertEval;
......
......@@ -158,6 +158,16 @@ public class TProAppInforBrowse extends BaseEntity
@Excel(name = "聘用批次")
private String fEmployBatch;
private String fShowName;
public String getfShowName() {
return fShowName;
}
public void setfShowName(String fShowName) {
this.fShowName = fShowName;
}
public void setfProAppInforId(Long fProAppInforId)
{
this.fProAppInforId = fProAppInforId;
......
......@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="FProBehInfor" id="FProBehInforResult">
<result property="fProBehInforId" column="f_pro_beh_infor_id" />
<result property="fIdNo" column="f_id_no" />
<result property="fName" column="f_name" />
<result property="fExpertEval" column="f_expert_eval" />
<result property="fSelectionEvent" column="f_selection_event" />
<result property="fSelectionStartTime" column="f_selection_start_time" />
......@@ -17,13 +18,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectFProBehInforVo">
select f_pro_beh_infor_id, f_id_no, f_expert_eval, f_selection_event, f_selection_start_time, f_scor_desc, f_update_time, f_rep_status, f_rep_date from f_pro_beh_infor
select f_pro_beh_infor_id, f_id_no, f_name, f_expert_eval, f_selection_event, f_selection_start_time, f_scor_desc, f_update_time, f_rep_status, f_rep_date from f_pro_beh_infor
</sql>
<select id="selectFProBehInforList" parameterType="FProBehInfor" resultMap="FProBehInforResult">
<include refid="selectFProBehInforVo"/>
<where>
<if test="fIdNo != null and fIdNo != ''"> and f_id_no like concat('%', #{fIdNo}, '%')</if>
<if test="fName != null and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
<if test="fRepStatus != null "> and f_rep_status = #{fRepStatus}</if>
</where>
ORDER BY f_update_time DESC
......@@ -38,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into f_pro_beh_infor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fIdNo != null and fIdNo != ''">f_id_no,</if>
<if test="fName != null and fName != ''">f_name,</if>
<if test="fExpertEval != null and fExpertEval != ''">f_expert_eval,</if>
<if test="fSelectionEvent != null">f_selection_event,</if>
<if test="fSelectionStartTime != null">f_selection_start_time,</if>
......@@ -48,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fIdNo != null and fIdNo != ''">#{fIdNo},</if>
<if test="fName != null and fName != ''">#{fName},</if>
<if test="fExpertEval != null and fExpertEval != ''">#{fExpertEval},</if>
<if test="fSelectionEvent != null">#{fSelectionEvent},</if>
<if test="fSelectionStartTime != null">#{fSelectionStartTime},</if>
......@@ -62,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update f_pro_beh_infor
<trim prefix="SET" suffixOverrides=",">
<if test="fIdNo != null and fIdNo != ''">f_id_no = #{fIdNo},</if>
<if test="fName != null and fName != ''">f_name = #{fName},</if>
<if test="fExpertEval != null and fExpertEval != ''">f_expert_eval = #{fExpertEval},</if>
<if test="fSelectionEvent != null">f_selection_event = #{fSelectionEvent},</if>
<if test="fSelectionStartTime != null">f_selection_start_time = #{fSelectionStartTime},</if>
......
......@@ -60,3 +60,11 @@ export function reportProBehInfo(query) {
params: query
})
}
export function getUserList(query) {
return request({
url: '/specialist/behInfo/getUserList',
method: 'get'
})
}
......@@ -72,6 +72,7 @@
<el-table v-loading="loading" :data="inforList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="身份证号" align="center" prop="fIdNo" />
<el-table-column label="姓名" align="center" prop="fName" />
<el-table-column label="专家表现评价" align="center" prop="fExpertEval" :show-overflow-tooltip="true"/>
<el-table-column label="选用事件" align="center" prop="fSelectionEvent" :show-overflow-tooltip="true">
<template slot-scope="scope">
......@@ -140,8 +141,19 @@
<!-- 添加或修改专家行为申报对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="身份证号" prop="fIdNo">
<el-input v-model="form.fIdNo" placeholder="请输入身份证号" :maxlength="18"/>
<el-form-item label="专家" prop="fIdNo">
<!-- <el-input v-model="form.fIdNo" placeholder="请输入身份证号" :maxlength="18"/>-->
<el-select v-model="form.fIdNo" filterable placeholder="请选择专家" style="width: 100% !important;" @change="setfName">
<el-option
v-for="item in userList"
:key="item.fIdNo"
:label="item.fShowName"
:value="item.fIdNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名" prop="fName" v-show="false">
<el-input type="input" v-model="form.fName" placeholder="请选择身份证号" readonly />
</el-form-item>
<el-form-item label="专家表现评价" prop="fExpertEval">
<el-input type="textarea" v-model="form.fExpertEval" placeholder="请输入专家表现评价" />
......@@ -174,7 +186,7 @@
</template>
<script>
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportProBehInfo } from "@/api/specialist/behInfo";
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportProBehInfo, getUserList } from "@/api/specialist/behInfo";
import DetailInfo from "./components/DetailInfo";
export default {
name: "Infor",
......@@ -183,6 +195,7 @@ export default {
},
data() {
return {
userList: [],
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -231,6 +244,7 @@ export default {
};
},
created() {
this.getUserList();
this.getList();
this.getDicts("t_expert_rep_status").then(response => {
this.fRepStatusOptions = response.data;
......@@ -246,6 +260,20 @@ export default {
this.loading = false;
});
},
getUserList() {
getUserList().then(response => {
console.log(response.data)
this.userList = response.data;
});
},
setfName(value){
let obj = {};
obj = this.userList.find((item)=>{
return item.fIdNo === value;
``});
this.form.fName = obj.fName;
//this.form.fIdNo = value;
},
// 申报状态:1 已上报,2 未上报,3 已通过,4未通过 字典翻译
fRepStatusFormat(row, column) {
return this.selectDictLabel(this.fRepStatusOptions, row.fRepStatus);
......
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