Commit f763d687 by 邓实川 Committed by chenzg

电子合同优化

parent 131442a4
......@@ -332,12 +332,19 @@ public class DzhtController {
@PostMapping("/rzUserNow")
@ApiOperation(value = "发起当前公司用户的e签宝个人帐户认证", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> rzUserNow(@CurrentUser UserBean userBean, Integer empNum) {
if (empNum == null || empNum <= 0)
return ResultUtil.error("请输入正确的员工信息");
DzhtAssoGrrz grrz = new DzhtAssoGrrz();
grrz.setType(0);
System.err.println(empNum);
YgglMainEmp yg = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().select("phone")
.eq("org_code", userBean.getOrgCode()).eq("emp_num", empNum));
System.err.println(yg);
if (yg == null)
return ResultUtil.error("请确认员工是否存在");
String phone = yg.getPhone();
if (phone == null)
return ResultUtil.error("请确认员工手机号是否存在");
grrz.setMobileNo(yg.getPhone());
DzhtAssoGrzc grzc = DzhtAssoGrzc.builder().build().selectOne(new QueryWrapper<DzhtAssoGrzc>()
......@@ -565,31 +572,56 @@ public class DzhtController {
}
}
// 查询认证信息
// // 查询认证信息(当前用户所有公司)
// @GetMapping("/detail")
// @ApiOperation(value = "查询最新认证信息", httpMethod = "GET", notes = "接口发布说明")
// public Result<Object> detail(@CurrentUser UserBean userBean) {
// ResponseEntity<JSONObject> a = null;
// String code = null;
// List<JSONObject> returnList = new ArrayList<JSONObject>();
//
// List<QyzxEmpEntAsso> list = QyzxEmpEntAsso.builder().build()
// .selectList(new QueryWrapper<QyzxEmpEntAsso>().eq("emp_num", userBean.getEmpNum()));
//
// List<Integer> orgCodeList = Lists.transform(list, newList -> newList.getOrgCode());
//
// for (Integer orgCode : orgCodeList) {
// DzhtAssoQyrz qyrz = DzhtAssoQyrz.builder().build().selectOne(new QueryWrapper<DzhtAssoQyrz>()
// .eq("org_code", orgCode).select("flow_id").orderByDesc("id").last("limit 1"));
// if (qyrz != null) {
// String flowId = qyrz.getFlowId();
// HttpEntity<?> entity = new HttpEntity<>(headers());
// a = restTemplate.exchange(ConfigConstant.host + "/v2/identity/auth/api/common/" + flowId + "/detail",
// HttpMethod.GET, entity, JSONObject.class);
//
// code = a.getBody().get("code").toString();
// returnList.add(a.getBody());
// }
// }
// if (code.equals("0")) {
// return ResultUtil.data(returnList);
// } else {
// return ResultUtil.data(returnList, "查询失败");
// }
// }
// 查询认证信息(当前公司)
@GetMapping("/detail")
@ApiOperation(value = "查询最新认证信息", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> detail(@CurrentUser UserBean userBean) {
ResponseEntity<JSONObject> a = null;
String code = null;
List<JSONObject> returnList = new ArrayList<JSONObject>();
List<QyzxEmpEntAsso> list = QyzxEmpEntAsso.builder().build()
.selectList(new QueryWrapper<QyzxEmpEntAsso>().eq("emp_num", userBean.getEmpNum()));
List<Integer> orgCodeList = Lists.transform(list, newList -> newList.getOrgCode());
for (Integer orgCode : orgCodeList) {
DzhtAssoQyrz qyrz = DzhtAssoQyrz.builder().build().selectOne(new QueryWrapper<DzhtAssoQyrz>()
.eq("org_code", orgCode).select("flow_id").orderByDesc("id").last("limit 1"));
if (qyrz != null) {
String flowId = qyrz.getFlowId();
HttpEntity<?> entity = new HttpEntity<>(headers());
a = restTemplate.exchange(ConfigConstant.host + "/v2/identity/auth/api/common/" + flowId + "/detail",
HttpMethod.GET, entity, JSONObject.class);
code = a.getBody().get("code").toString();
returnList.add(a.getBody());
}
DzhtAssoQyrz qyrz = DzhtAssoQyrz.builder().build().selectOne(new QueryWrapper<DzhtAssoQyrz>()
.eq("org_code", userBean.getOrgCode()).select("flow_id").orderByDesc("id").last("limit 1"));
if (qyrz != null) {
String flowId = qyrz.getFlowId();
HttpEntity<?> entity = new HttpEntity<>(headers());
a = restTemplate.exchange(ConfigConstant.host + "/v2/identity/auth/api/common/" + flowId + "/detail",
HttpMethod.GET, entity, JSONObject.class);
code = a.getBody().get("code").toString();
returnList.add(a.getBody());
}
if (code.equals("0")) {
return ResultUtil.data(returnList);
......@@ -665,7 +697,7 @@ public class DzhtController {
File file = new File(filePath);
boolean delete = file.delete();
System.err.println(delete);
return ResultUtil.data(a);
} else {
return ResultUtil.data(a, "创建失败");
......
......@@ -42,6 +42,7 @@ import cn.timer.api.bean.dzht.DzhtAssoQyyz;
import cn.timer.api.bean.dzht.DzhtAssoQyzc;
import cn.timer.api.bean.dzht.DzhtAssoSdgzq;
import cn.timer.api.bean.dzht.DzhtAssoTpyz;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity;
import cn.timer.api.bean.qyzx.businessService.QyzxUseRecord;
import cn.timer.api.bean.yggl.YgglMainEmp;
......@@ -197,6 +198,34 @@ public class DzhtController2 {
return ResultUtil.data(j, "查詢成功");
}
// 查询企业信息s
@GetMapping("/getOrganizations")
@ApiOperation(value = "查询企业信息s", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getOrganizations(@CurrentUser UserBean userBean) {
List<QyzxEmpEntAsso> list = QyzxEmpEntAsso.builder().build()
.selectList(new QueryWrapper<QyzxEmpEntAsso>().eq("emp_num", userBean.getEmpNum()));
List<Integer> orgCodeList = Lists.transform(list, newList -> newList.getOrgCode());
List<String> orgIds = new ArrayList<String>();
for (Integer orgCode : orgCodeList) {
DzhtAssoQyzc qyzc = DzhtAssoQyzc.builder().build().selectOne(new QueryWrapper<DzhtAssoQyzc>().lambda()
.eq(DzhtAssoQyzc::getOrgCode, orgCode).select(DzhtAssoQyzc::getOrgId));
if (qyzc != null)
orgIds.add(qyzc.getOrgId());
}
JSONObject j = null;
List<JSONObject> result = new ArrayList<JSONObject>();
try {
TokenHelper.getTokenData();
for (String orgId : orgIds) {
j = AccountHelper.qryOrgAcctByOrgId(orgId);
result.add(j);
}
} catch (DefineException e) {
e.printStackTrace();
}
return ResultUtil.data(result, "查詢成功");
}
// 创建机构印章
@PostMapping("/orgTemplate")
@ApiOperation(value = "创建机构模板印章", httpMethod = "POST", notes = "接口发布说明")
......
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