Browse Source

测试接口; userId bug修改; post访问乱码

v2
蟑螂恶霸 2 years ago
parent
commit
cbd2075180
  1. 75
      lib/EmergencyBaseLib/EmergencyCommon/src/main/java/com/zdxt/common/util/StringNumUtil.java
  2. 141
      lib/EmergencyBaseLib/EmergencyCommonEntity/src/main/java/com/zdxt/domain/auth/User.java
  3. 16
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java
  4. 6
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java
  5. 10
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseLawEnforcementController.java
  6. 9
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppSystemController.java
  7. 112
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java
  8. 100
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/task/UserInfoAndDeptTask.java
  9. 20
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/feign/UserApiImpl.java
  10. 24
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/JacksonConverters.java
  11. 47
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/ResourcesConfig.java
  12. 56
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml
  13. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java
  14. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseLawEnforcementController.java
  15. 47
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java
  16. 37
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseLawEnforcement.java
  17. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java
  18. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnterpriseLawEnforcementService.java
  19. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ThirdLoginService.java
  20. 9
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java
  21. 13
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java
  22. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseLawEnforcementServiceImpl.java
  23. 26
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java
  24. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java
  25. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml
  26. 154
      lib/EmergencyServiceApi/emergencyAuthServiceApi/src/main/java/com/zdxt/auth/dto/UserBean.java
  27. 4
      lib/EmergencyServiceApi/emergencyAuthServiceApi/src/main/java/com/zdxt/auth/feign/UserApi.java

75
lib/EmergencyBaseLib/EmergencyCommon/src/main/java/com/zdxt/common/util/StringNumUtil.java

@ -1,5 +1,8 @@
package com.zdxt.common.util;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
public class StringNumUtil {
@ -21,12 +24,70 @@ public class StringNumUtil {
String l = "%0"+len+"d";
return String.format(l, nextVal);
}
public static void main(String args[]){
StringNumUtil stringNumUtil = new StringNumUtil();
// System.out.println(stringNumUtil.getNext());
System.out.println(stringNumUtil.getNext(0-1,"3"));
// String str = "000000001234034120";
// String newStr = str.replaceAll("^(0+)", "");
// System.out.println(newStr);
public static void main(String args[]) throws UnsupportedEncodingException {
// StringNumUtil stringNumUtil = new StringNumUtil();
//// System.out.println(stringNumUtil.getNext());
// System.out.println(stringNumUtil.getNext(0-1,"3"));
//// String str = "000000001234034120";
//// String newStr = str.replaceAll("^(0+)", "");
//// System.out.println(newStr);
String testString = "娆ц搐鍐�";
// System.out.println(new String(testString.getBytes("ISO-8859-1"),"gb2312"));
// System.out.println(new String(testString.getBytes("UTF8"),"gb2312"));
// System.out.println(new String(testString.getBytes("GB2312"),"gb2312"));
// System.out.println(new String(testString.getBytes("GBK"),"gb2312"));
// System.out.println(new String(testString.getBytes("BIG5"),"gb2312"));
List<String> source = new ArrayList<>(10);
List<String> corrupted = new ArrayList<>(10);
source.add("信息");
// "信息"用utf8编码,gbk解码后,显示的文字就是"淇℃伅"。后面的也是同理。
corrupted.add("淇℃伅");
corrupted.add("娆ц搐鍐�");
encodeAndDecode(source, corrupted);
}
public static void encodeAndDecode(List<String> source, List<String> corrupted) {
for (String s : source) {
//utf8编码,gbk解码
try {
System.out.println("编码前的原文: " + s);
byte[] utf8Bytes = s.getBytes("utf8");
System.out.print("utf8编码后的字节: ");
for (byte b : utf8Bytes) {
System.out.print(Integer.toHexString(b & 0xff) + ",");
}
System.out.println();
String utf8ToGbk = null;
// 直接获取到utf8编码后的字节,然后用gbk解码
utf8ToGbk = new String(utf8Bytes, "gbk");
System.out.println("utf8编码,gbk解码后的文字: " + utf8ToGbk + "\n" + "----------------------");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
System.out.println("<==================分割线===================>");
for (String s : corrupted) {
// gbk编码,utf8解码
try {
System.out.println("编码前的原文: " + s);
byte[] gbkBytes = s.getBytes("gbk");
System.out.print("gbk编码后的字节: ");
for (byte b : gbkBytes) {
System.out.print(Integer.toHexString(b & 0xff) + ",");
}
System.out.println();
String gbkToUtf8 = new String(gbkBytes, "utf8");
System.out.println("gbk编码,utf8解码后的文字: " + gbkToUtf8 + "\n" + "----------------------");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
}

141
lib/EmergencyBaseLib/EmergencyCommonEntity/src/main/java/com/zdxt/domain/auth/User.java

@ -159,6 +159,35 @@ public class User extends BaseDomain {
/** 执法证件号 */
private String lawCertificateNum;
/** 姓名 */
private String fullname;
/** 任务ID */
private String taskId;
/** 业务系统ID */
private String systemId;
/** 作用点 (CREATE:新建;UPDATE:更新;DELETED:删除;ENABLED:启用;DISABLED:禁用) */
private String effectOn;
/** 是否删除 (0否;1是)*/
private int isDeleted;
/** 是否禁用 (0否;1是)*/
private int isDisabled;
/** 创建日期 */
private String createAt;
/** 更新日期 */
private String updateAt;
/** 下游唯一标识 */
private String guid;
/** 手机号 */
private String mobileNumber;
/** 证件号码 */
private String certificateNumber;
/** 省认证用户id */
private String srzUserid;
/** 是否驻区人员 */
private String isMappingPerson;
/** 人员所在部门(包括主岗和兼岗部门) */
private String units;
public String getLawCertificateNum() {
return lawCertificateNum;
}
@ -433,6 +462,118 @@ public class User extends BaseDomain {
this.token = token;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getSystemId() {
return systemId;
}
public void setSystemId(String systemId) {
this.systemId = systemId;
}
public String getEffectOn() {
return effectOn;
}
public void setEffectOn(String effectOn) {
this.effectOn = effectOn;
}
public int getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(int isDeleted) {
this.isDeleted = isDeleted;
}
public int getIsDisabled() {
return isDisabled;
}
public void setIsDisabled(int isDisabled) {
this.isDisabled = isDisabled;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) {
this.createAt = createAt;
}
public String getUpdateAt() {
return updateAt;
}
public void setUpdateAt(String updateAt) {
this.updateAt = updateAt;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public String getMobileNumber() {
return mobileNumber;
}
public void setMobileNumber(String mobileNumber) {
this.mobileNumber = mobileNumber;
}
public String getCertificateNumber() {
return certificateNumber;
}
public void setCertificateNumber(String certificateNumber) {
this.certificateNumber = certificateNumber;
}
public String getSrzUserid() {
return srzUserid;
}
public void setSrzUserid(String srzUserid) {
this.srzUserid = srzUserid;
}
public String getIsMappingPerson() {
return isMappingPerson;
}
public void setIsMappingPerson(String isMappingPerson) {
this.isMappingPerson = isMappingPerson;
}
public String getUnits() {
return units;
}
public void setUnits(String units) {
this.units = units;
}
@Override
public String toString() {
return "User{" +

16
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java

@ -59,7 +59,7 @@ public class AppEnforcementRegistrationController extends BaseController
/**
* 查询执法端-执法登记列表
*/
@RequiresPermissions("code:registration:list")
// @RequiresPermissions("code:registration:list")
@GetMapping("/queryList")
@ResponseBody
public ZDResponse queryList(EnforcementRegistration enforcementRegistration)
@ -80,7 +80,7 @@ public class AppEnforcementRegistrationController extends BaseController
/**
* 新增保存执法端-执法登记
*/
@RequiresPermissions("code:registration:add")
// @RequiresPermissions("code:registration:add")
@PostMapping("/add")
@ResponseBody
public ZDResponse addSave(@RequestBody EnforcementRegistration enforcementRegistration)
@ -103,7 +103,7 @@ public class AppEnforcementRegistrationController extends BaseController
/**
* 修改保存执法端-执法登记
*/
@RequiresPermissions("code:registration:edit")
// @RequiresPermissions("code:registration:edit")
@PostMapping("/edit")
@ResponseBody
public ZDResponse editSave(@RequestBody EnforcementRegistration enforcementRegistration)
@ -208,16 +208,16 @@ public class AppEnforcementRegistrationController extends BaseController
/**
* 查看预约记录详情
*/
@GetMapping( "/getByUserIdAndZero")
@GetMapping( "/getByUserIdAndZero/{userId}")
@ResponseBody
public ZDResponse getByUserIdAndZero()
public ZDResponse getByUserIdAndZero(@PathVariable Long userId)
{
EnforcementRegistration registration = enforcementRegistrationService.getByUserIdAndZero();
EnforcementRegistration registration = enforcementRegistrationService.getByUserIdAndZero(userId);
Map<String, Object> params = new HashMap<>();
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem());
params.put("lawEnforcementItemText", tmp.getTitle());
params.put("lawEnforcementItemText", null!=tmp?tmp.getTitle():"");
tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementBasis());
params.put("lawEnforcementBasisText", tmp.getTitle());
params.put("lawEnforcementBasisText", null!=tmp?tmp.getTitle():"");
registration.setParams(params);
return ZDResponse.success("查询成功", registration);
}

6
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java

@ -157,10 +157,10 @@ public class AppEnterpriseInformationController extends BaseController
/**
* 查询企业二维码信息
*/
@RequiresPermissions("code:information:getQrCode")
@GetMapping("/getQrCode")
// @RequiresPermissions("code:information:getQrCode")
@GetMapping("/getQrCode/{enterpriseNumber}")
@ResponseBody
public ZDResponse getQrCode(String enterpriseNumber)
public ZDResponse getQrCode(@PathVariable String enterpriseNumber)
{
//查询企业二维码信息
QrCodeGenerateHistory qrCodeGenerateHistory = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseNumber);

10
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseLawEnforcementController.java

@ -57,7 +57,7 @@ public class AppEnterpriseLawEnforcementController extends BaseController
/**
* 查询企业端-执法部门预约记录列表
*/
@RequiresPermissions("code:enforcement:queryList")
// @RequiresPermissions("code:enforcement:queryList")
@GetMapping("/queryList")
@ResponseBody
public ZDResponse queryList(EnterpriseLawEnforcement enterpriseLawEnforcement)
@ -113,7 +113,7 @@ public class AppEnterpriseLawEnforcementController extends BaseController
/**
* 修改保存企业端-执法部门预约记录
*/
@RequiresPermissions("code:enforcement:edit")
// @RequiresPermissions("code:enforcement:edit")
@PostMapping("/edit")
@ResponseBody
public ZDResponse editSave(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement)
@ -156,11 +156,11 @@ public class AppEnterpriseLawEnforcementController extends BaseController
/**
* 查看预约记录详情
*/
@GetMapping( "/getByUserIdAndZero")
@GetMapping( "/getByUserIdAndZero/{userId}")
@ResponseBody
public ZDResponse getByUserIdAndZero()
public ZDResponse getByUserIdAndZero(@PathVariable Long userId)
{
EnterpriseLawEnforcement enfrorcement = enterpriseLawEnforcementService.getByUserIdAndZero();
EnterpriseLawEnforcement enfrorcement = enterpriseLawEnforcementService.getByUserIdAndZero(userId);
Map<String, Object> params = new HashMap<>();
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(enfrorcement.getCheckItem());
params.put("checkItemText", tmp.getTitle());

9
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppSystemController.java

@ -42,10 +42,11 @@ public class AppSystemController extends BaseController {
@Autowired
private PostApi postApi;
@GetMapping("/getUserInfo")
@GetMapping("/getUserInfo/{userId}")
@ResponseBody
public ZDResponse getUserInfo(){
UserBean user = userApi.getCurrentUser();
public ZDResponse getUserInfo(@PathVariable Long userId){
// UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(userId);
return ZDResponse.success("查询成功",user);
}
@ -57,7 +58,7 @@ public class AppSystemController extends BaseController {
return ZDResponse.success("获取字典成功",list);
}
@RequiresPermissions("system:user:list")
// @RequiresPermissions("system:user:list")
@PostMapping("/listApp")
@ResponseBody
public ZDResponse listApp(@RequestBody User user) {

112
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java

@ -1,7 +1,9 @@
package com.zdxt.app.controller;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.auth0.jwt.JWTVerifier;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.framework.shiro.jwt.JWTUtils;
import com.zdxt.auth.project.system.user.service.IUserService;
@ -38,41 +40,48 @@ public class AppThirdLoginController {
@Value("${siq.siqUrl}")
private String siqUrl;
@Value("${szypt.corpid}")
private String szyptCorpid;
@Value("${szypt.corpsecret}")
private String szyptCorpsecret;
@Value("${szypt.url}")
private String szyptUrl;
@Autowired
private ThirdLoginService thirdLoginService;
@Autowired
private UserApi userApi;
/**
* 深i企用户登录
* @param siqLogin
* 深圳易平台登录
*/
@PostMapping("/siqLogin")
@GetMapping("/szyptLogin/{code}")
@ResponseBody
public ZDResponse siqLogin(@RequestBody SiqLogin siqLogin){
//敏感信息加密
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getUserId());
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getUserName());
//获取登录的token
String token = IdCardCryptoUtil.httpSendPost(siqUrl + "/pub/auth/token", userIdCode, userNameCode, code);
Map<String, String> params = new HashMap<>();
log.info("获取用户登录令牌:{}",token);
String secret = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, token);
params.put("accessKeySign",secret);
params.put("appCode",code);
String userInfo = null;
public ZDResponse szyptLogin(@PathVariable String code){
String accessToken = "";
String userInfo = "";
try {
userInfo = HttpUtil.HttpSendPost(siqUrl + "/pub/auth/getUserInfo", params, null, null);
// 获取 access_token
accessToken = HttpUtil.HttpSendGet(szyptUrl + "/cgi-bin/gettoken?corpid="+szyptCorpid+"&corpsecret="+szyptCorpsecret, null);
System.out.println("====================== accessToken ======================");
System.out.println(accessToken);
System.out.println("====================== accessToken ======================");
// 获取 用户信息
userInfo = HttpUtil.HttpSendGet(szyptUrl + "/cgi-bin/user/getuserinfo?access_token="+accessToken+"&code="+code, null);
System.out.println("====================== userInfo ======================");
System.out.println(userInfo);
System.out.println("====================== userInfo ======================");
} catch (Exception e) {
e.printStackTrace();
}
JSONObject jsonObject = JSONObject.parseObject(userInfo);
//添加深i企用户
thirdLoginService.addSiqUser(jsonObject);
//添加深i企用户关联企业信息
thirdLoginService.addSiqUserCompany(jsonObject);
return thirdLoginService.siqLogin(jsonObject);
System.out.println("====================== userInfo ======================");
System.out.println(jsonObject);
System.out.println("====================== userInfo ======================");
return ZDResponse.success();
}
@ -111,4 +120,63 @@ public class AppThirdLoginController {
return map;
}
/**
* 深i企用户登录
* @param siqLogin
*/
@PostMapping("/siqLogin")
@ResponseBody
public ZDResponse siqLogin(@RequestBody SiqLogin siqLogin){
Map<String, String> params = new HashMap<>();
String secret = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getCode());
params.put("accessKeySign",secret);
params.put("appCode",code);
String data = null;
try {
data = HttpUtil.httpSendPost(siqUrl + "/pub/auth/getUserInfo", JSONObject.toJSONString(params),new HashMap<>());
} catch (Exception e) {
e.printStackTrace();
}
JSONObject jsonObject = JSONObject.parseObject(data);
JSONObject userInfo = (JSONObject) jsonObject.get("data");
//添加深i企用户
Long userId = thirdLoginService.addSiqUser(userInfo);
userInfo.put("userId", userId);
//添加深i企用户关联企业信息
thirdLoginService.addSiqUserCompany(userInfo);
return thirdLoginService.siqLogin(userInfo);
}
@PostMapping("/siqLoginTest")
@ResponseBody
public ZDResponse siqLoginTest(@RequestBody SiqLogin siqLogin){
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", siqLogin.getUserId());
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", siqLogin.getUserName());
Map<String,Object> heardMap = new HashMap<>();
heardMap.put("x-auth-channel", IdUtil.simpleUUID());
heardMap.put("x-auth-app-code","zfjdm");
String s = IdCardCryptoUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/token",userIdCode,userNameCode,"zfjdm");
String secret = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", s);
Map<String,Object> params = new HashMap<>();
params.put("accessKeySign",secret);
params.put("appCode","zfjdm");
String data = HttpUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/getUserInfo", JSONObject.toJSONString(params),new HashMap<>());
JSONObject jsonObject = JSONObject.parseObject(data);
JSONObject userInfo = (JSONObject) jsonObject.get("data");
//添加深i企用户
Long userId = thirdLoginService.addSiqUser(userInfo);
userInfo.put("userId", userId);
//添加深i企用户关联企业信息
thirdLoginService.addSiqUserCompany(userInfo);
return thirdLoginService.siqLogin(userInfo);
}
}

100
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/task/UserInfoAndDeptTask.java

@ -0,0 +1,100 @@
package com.zdxt.app.task;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.code.utils.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @Author: kylin
* @Date: 2024/5/9 2:58 下午
* @Version: 1.0
* @Desc: TODO
*/
@Component("userInfoAndDeptTask")
public class UserInfoAndDeptTask {
@Value("${znwg.systemCode}")
private String systemCode;
@Value("${znwg.integrationKey}")
private String integrationKey;
@Value("${znwg.url}")
private String znwgUrl;
@Autowired private UserApi userApi;
public void run(){
this.userInfoAndDept();
}
/**
* 预警任务
*/
public void userInfoAndDept(){
String token = "";
String userInfo = "";
String deptInfo = "";
String destroyTken = "";
try {
// 获取 access_token
token = HttpUtil.HttpSendGet(znwgUrl + "/ebus/sfrzhqxglmk/sysPullLogin?systemCode="+systemCode+"&integrationKey="+integrationKey, null);
System.out.println("====================== accessToken ======================");
System.out.println(token);
System.out.println("====================== accessToken ======================");
// 获取 用户信息
userInfo = HttpUtil.HttpSendGet(znwgUrl + "/ebus/sfrzhqxglmk/sysPullTacc?token="+token+"&page=0&pageSize=20&status=0", null);
System.out.println("====================== userInfo ======================");
System.out.println(userInfo);
System.out.println("====================== userInfo ======================");
// 获取 部门信息
deptInfo = HttpUtil.HttpSendGet(znwgUrl + "/ebus/sfrzhqxglmk/sysPullOrg?token="+token+"&page=0&pageSize=20&status=0", null);
System.out.println("====================== userInfo ======================");
System.out.println(deptInfo);
System.out.println("====================== userInfo ======================");
// 注销token
HttpUtil.HttpSendGet(znwgUrl + "/ebus/sfrzhqxglmk/sysPullLogout?token="+token, null);
System.out.println("====================== destroyTken ======================");
System.out.println(destroyTken);
System.out.println("====================== destroyTken ======================");
} catch (Exception e) {
e.printStackTrace();
}
JSONObject userObj = JSONObject.parseObject(userInfo);
JSONObject deptObj = JSONObject.parseObject(deptInfo);
System.out.println("====================== userInfo ======================");
System.out.println(userObj);
System.out.println("====================== userInfo ======================");
System.out.println("====================== userInfo ======================");
System.out.println(deptObj);
System.out.println("====================== userInfo ======================");
userApi.insertOrUpdateUserResId(convertUser(userObj));
}
private UserBean convertUser(JSONObject userJson) {
UserBean userBean = new UserBean();
userBean.setFullname(userJson.getString("fullname"));
userBean.setTaskId(userJson.getString("taskId"));
userBean.setSystemId(userJson.getString("systemId"));
userBean.setEffectOn(userJson.getString("effectOn"));
userBean.setIsDeleted(Integer.valueOf(userJson.getString("isDeleted")));
userBean.setIsDisabled(Integer.valueOf(userJson.getString("isDisabled")));
userBean.setCreateAt(userJson.getString("createAt"));
userBean.setUpdateAt(userJson.getString("updateAt"));
userBean.setGuid(userJson.getString("guid"));
userBean.setMobileNumber(userJson.getString("mobileNumber"));
userBean.setCertificateNumber(userJson.getString("certificateNumber"));
userBean.setSrzUserid(userJson.getString("srzUserid"));
userBean.setIsMappingPerson(userJson.getString("isMappingPerson"));
userBean.setUnits(userJson.getString("units"));
return userBean;
}
}

20
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/feign/UserApiImpl.java

@ -1,7 +1,6 @@
package com.zdxt.auth.feign;
import cn.hutool.core.bean.BeanUtil;
import com.zdxt.auth.common.constant.UserConstants;
import com.zdxt.auth.common.utils.security.ShiroUtils;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.auth.dto.RoleBean;
@ -11,6 +10,8 @@ import com.zdxt.auth.project.system.dict.mapper.DictDataMapper;
import com.zdxt.auth.project.system.user.mapper.UserMapper;
import com.zdxt.auth.project.system.user.service.IUserService;
import com.zdxt.common.annotation.DataScope;
import com.zdxt.common.util.DateUtils;
import com.zdxt.common.util.UserConstants;
import com.zdxt.domain.auth.Dept;
import com.zdxt.domain.auth.Role;
import com.zdxt.domain.auth.User;
@ -248,6 +249,23 @@ public class UserApiImpl implements UserApi {
return iUserService.updateUserInfo(user);
}
@Override
public Long insertOrUpdateUserResId(UserBean userBean) {
if(UserConstants.USER_NAME_UNIQUE.equals(this.checkLoginNameUnique(userBean.getLoginName()))){
//设置默认用户权限,权限为默认值
userBean.setRoleId(178L);
//设置为默认密码
userBean.setPassword("123456");
userBean.setCreateTime(DateUtils.getNowDate());
//部门ID设置为默认值
userBean.setDeptId(405L);
return this.insertUserResId(userBean);
}
int resNum = this.updateUserInfo(userBean);
return resNum>0?userBean.getUserId():0L;
}
@Override
public String checkLoginNameUnique(String loginName) {
return iUserService.checkLoginNameUnique(loginName);

24
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/JacksonConverters.java

@ -0,0 +1,24 @@
//package com.zdxt.auth.framework.config;
//
//import com.fasterxml.jackson.databind.DeserializationFeature;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//
//@Configuration
//public class JacksonConverters {
// @Bean
// public HttpMessageConverters JacksonHttpMessageConverters() {
// MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter
// = new MappingJackson2HttpMessageConverter();
// ObjectMapper objectMapper = new ObjectMapper();
// //省略其他配置开始
// //反序列化的时候如果多了其他属性,抛出异常
// objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
// mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
// //省略其他配置结束
// return new HttpMessageConverters(mappingJackson2HttpMessageConverter);
// }
//}

47
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/ResourcesConfig.java

@ -63,29 +63,30 @@ public class ResourcesConfig implements WebMvcConfigurer
public void addInterceptors(InterceptorRegistry registry)
{
// registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
registry.addInterceptor(new JWTInterceptor())
.excludePathPatterns("/app/thirdLogin/siqLogin", "/appLogin","/login","/index",
"/enterpriseInformation",
"/code/registration",
"/code/linkage",
"/code/ruleList",
"/code/LawEnforcementWarningList",
"/system/dept",
"/system/user",
"/system/role",
"/system/post",
"/system/menu",
"/monitor/operlog",
"/monitor/logininfor",
"/system/dict",
"/system/config",
"/monitor/job",
"/statistical/analysis",
"/statistical/view",
"/**/*.css",
"/**/*.js", "/**/*.png", "/**/*.jpg",
"/**/*.jpeg", "/**/*.gif", "/**/fonts/*"
).addPathPatterns("/**");
// registry.addInterceptor(new JWTInterceptor())
// .addPathPatterns("/app/**")
// .excludePathPatterns("/app/thirdLogin/siqLogin", "/appLogin","/login","/index",
// "/enterpriseInformation",
// "/code/registration",
// "/code/linkage",
// "/code/ruleList",
// "/code/LawEnforcementWarningList",
// "/system/dept",
// "/system/user",
// "/system/role",
// "/system/post",
// "/system/menu",
// "/monitor/operlog",
// "/monitor/logininfor",
// "/system/dict",
// "/system/config",
// "/monitor/job",
// "/statistical/analysis",
// "/statistical/view",
// "/**/*.css",
// "/**/*.js", "/**/*.png", "/**/*.jpg",
// "/**/*.jpeg", "/**/*.gif", "/**/fonts/*"
// ).addPathPatterns("/**");
// 除了登录放行,其他接口都token验证
}
}

56
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml

@ -29,6 +29,20 @@
<result property="kingdeeOrgId" column="kingdee_org_id"/>
<result property="type" column="type"/>
<result property="tenantCode" column="tenant_code"/>
<result property="fullname" column="fullname"/>
<result property="taskId" column="taskId"/>
<result property="systemId" column="systemId"/>
<result property="effectOn" column="effectOn"/>
<result property="isDeleted" column="isDeleted"/>
<result property="isDisabled" column="isDisabled"/>
<result property="createAt" column="createAt"/>
<result property="updateAt" column="updateAt"/>
<result property="guid" column="guid"/>
<result property="mobileNumber" column="mobileNumber"/>
<result property="certificateNumber" column="certificateNumber"/>
<result property="srzUserid" column="srzUserid"/>
<result property="isMappingPerson" column="isMappingPerson"/>
<result property="units" column="units"/>
<association property="dept" column="dept_id" javaType="Dept" resultMap="deptResult"/>
<association property="tenant" column="tenant_code" javaType="SysTenant" resultMap="tenantResult"/>
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
@ -314,6 +328,20 @@
<if test="type != null and type != ''">type = #{type},</if>
<if test="kingdeeOrgId != null and kingdeeOrgId != ''">kingdee_org_id = #{kingdeeOrgId},</if>
<if test="kingdeeUserId != null and kingdeeUserId != ''">kingdee_user_id = #{kingdeeUserId},</if>
<if test="fullname != null and fullname != ''">fullname = #{fullname},</if>
<if test="taskId != null and taskId != ''">taskId = #{taskId},</if>
<if test="systemId != null and systemId != ''">systemId = #{systemId},</if>
<if test="effectOn != null and effectOn != ''">effectOn = #{effectOn},</if>
<if test="isDeleted != null and isDeleted != ''">isDeleted = #{isDeleted},</if>
<if test="isDisabled != null and isDisabled != ''">isDisabled = #{isDisabled},</if>
<if test="createAt != null and createAt != ''">createAt = #{createAt},</if>
<if test="updateAt != null and updateAt != ''">updateAt = #{updateAt},</if>
<if test="guid != null and guid != ''">guid = #{guid},</if>
<if test="mobileNumber != null and mobileNumber != ''">mobileNumber = #{mobileNumber},</if>
<if test="certificateNumber != null and certificateNumber != ''">certificateNumber = #{certificateNumber},</if>
<if test="srzUserid != null and srzUserid != ''">srzUserid = #{srzUserid},</if>
<if test="isMappingPerson != null and isMappingPerson != ''">isMappingPerson = #{isMappingPerson},</if>
<if test="units != null and units != ''">units = #{units},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
@ -367,6 +395,20 @@
<if test="kingdeeOrgId != null and kingdeeOrgId != ''">kingdee_org_id,</if>
<if test="kingdeeUserId != null and kingdeeUserId != ''">kingdee_user_id,</if>
<if test="tenantCode != null and tenantCode != ''">tenant_code,</if>
<if test="fullname != null and fullname != ''">fullname,</if>
<if test="taskId != null and taskId != ''">taskId,</if>
<if test="systemId != null and systemId != ''">systemId,</if>
<if test="effectOn != null and effectOn != ''">effectOn,</if>
<if test="isDeleted != null and isDeleted != ''">isDeleted,</if>
<if test="isDisabled != null and isDisabled != ''">isDisabled,</if>
<if test="createAt != null and createAt != ''">createAt,</if>
<if test="updateAt != null and updateAt != ''">updateAt,</if>
<if test="guid != null and guid != ''">guid,</if>
<if test="mobileNumber != null and mobileNumber != ''">mobileNumber,</if>
<if test="certificateNumber != null and certificateNumber != ''">certificateNumber,</if>
<if test="srzUserid != null and srzUserid != ''">srzUserid,</if>
<if test="isMappingPerson != null and isMappingPerson != ''">isMappingPerson,</if>
<if test="units != null and units != ''">units,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@ -387,6 +429,20 @@
<if test="kingdeeOrgId != null and kingdeeOrgId != ''">#{kingdeeOrgId},</if>
<if test="kingdeeUserId != null and kingdeeUserId != ''">#{kingdeeUserId},</if>
<if test="tenantCode != null and tenantCode != ''">#{tenantCode},</if>
<if test="fullname != null and fullname != ''">#{fullname},</if>
<if test="taskId != null and taskId != ''">#{taskId},</if>
<if test="systemId != null and systemId != ''">#{systemId},</if>
<if test="effectOn != null and effectOn != ''">#{effectOn},</if>
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
<if test="isDisabled != null and isDisabled != ''">#{isDisabled},</if>
<if test="createAt != null and createAt != ''">#{createAt},</if>
<if test="updateAt != null and updateAt != ''">#{updateAt},</if>
<if test="guid != null and guid != ''">#{guid},</if>
<if test="mobileNumber != null and mobileNumber != ''">#{mobileNumber},</if>
<if test="certificateNumber != null and certificateNumber != ''">#{certificateNumber},</if>
<if test="srzUserid != null and srzUserid != ''">#{srzUserid},</if>
<if test="isMappingPerson != null and isMappingPerson != ''">#{isMappingPerson},</if>
<if test="units != null and units != ''">#{units},</if>
sysdate()
)
</insert>

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java

@ -209,11 +209,11 @@ public class EnforcementRegistrationController extends BaseController
/**
* 查看预约记录详情
*/
@GetMapping( "/getByUserIdAndZero")
@GetMapping( "/getByUserIdAndZero/{userId}")
@ResponseBody
public ZDResponse getByUserIdAndZero()
public ZDResponse getByUserIdAndZero(@PathVariable Long userId)
{
EnforcementRegistration registration = enforcementRegistrationService.getByUserIdAndZero();
EnforcementRegistration registration = enforcementRegistrationService.getByUserIdAndZero(userId);
Map<String, Object> params = new HashMap<>();
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem());
params.put("lawEnforcementItemText", tmp.getTitle());

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseLawEnforcementController.java

@ -156,11 +156,11 @@ public class EnterpriseLawEnforcementController extends BaseController
/**
* 查看预约记录详情
*/
@GetMapping( "/getByUserIdAndZero")
@GetMapping( "/getByUserIdAndZero/{userId}")
@ResponseBody
public ZDResponse getByUserIdAndZero()
public ZDResponse getByUserIdAndZero(@PathVariable Long userId)
{
EnterpriseLawEnforcement enfrorcement = enterpriseLawEnforcementService.getByUserIdAndZero();
EnterpriseLawEnforcement enfrorcement = enterpriseLawEnforcementService.getByUserIdAndZero(userId);
Map<String, Object> params = new HashMap<>();
LinkageDict tmp = iLinkageDictService.selectLinkageDictById(enfrorcement.getCheckItem());
params.put("checkItemText", tmp.getTitle());

47
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java

@ -129,6 +129,53 @@ public class EnforcementRegistration extends BaseDomain
*/
private String searchText;
/** 临时用 */
private String lawCertificateNum;
private String lawCertificateNumText;
private String lawCertificateNumTwoText;
private String subsidiaryerText;
private List fileListObj;
public List getFileListObj() {
return fileListObj;
}
public void setFileListObj(List fileListObj) {
this.fileListObj = fileListObj;
}
public String getSubsidiaryerText() {
return subsidiaryerText;
}
public void setSubsidiaryerText(String subsidiaryerText) {
this.subsidiaryerText = subsidiaryerText;
}
public String getLawCertificateNumTwoText() {
return lawCertificateNumTwoText;
}
public void setLawCertificateNumTwoText(String lawCertificateNumTwoText) {
this.lawCertificateNumTwoText = lawCertificateNumTwoText;
}
public String getLawCertificateNumText() {
return lawCertificateNumText;
}
public void setLawCertificateNumText(String lawCertificateNumText) {
this.lawCertificateNumText = lawCertificateNumText;
}
public String getLawCertificateNum() {
return lawCertificateNum;
}
public void setLawCertificateNum(String lawCertificateNum) {
this.lawCertificateNum = lawCertificateNum;
}
public String getId() {
return id;
}

37
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseLawEnforcement.java

@ -94,6 +94,35 @@ public class EnterpriseLawEnforcement extends BaseDomain
*/
private Integer dateType;
/** 临时用 */
private String lawCertificateNum;
private String lawEnforcerText;
private String lawCertificateNumTwo;
private String lawEnforcerTextTwo;
public String getLawEnforcerTextTwo() {
return lawEnforcerTextTwo;
}
public void setLawEnforcerTextTwo(String lawEnforcerTextTwo) {
this.lawEnforcerTextTwo = lawEnforcerTextTwo;
}
public String getLawCertificateNumTwo() {
return lawCertificateNumTwo;
}
public void setLawCertificateNumTwo(String lawCertificateNumTwo) {
this.lawCertificateNumTwo = lawCertificateNumTwo;
}
public String getLawEnforcerText() {
return lawEnforcerText;
}
public void setLawEnforcerText(String lawEnforcerText) {
this.lawEnforcerText = lawEnforcerText;
}
public void setId(String id)
{
@ -322,6 +351,14 @@ public class EnterpriseLawEnforcement extends BaseDomain
this.isSubmit = isSubmit;
}
public String getLawCertificateNum() {
return lawCertificateNum;
}
public void setLawCertificateNum(String lawCertificateNum) {
this.lawCertificateNum = lawCertificateNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java

@ -77,6 +77,6 @@ public interface IEnforcementRegistrationService
*/
AttFileRespDTO queryFiles(String key);
public EnforcementRegistration getByUserIdAndZero();
public EnforcementRegistration getByUserIdAndZero(Long userId);
}

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnterpriseLawEnforcementService.java

@ -19,7 +19,7 @@ public interface IEnterpriseLawEnforcementService
*/
public EnterpriseLawEnforcement selectEnterpriseLawEnforcementById(String id);
public EnterpriseLawEnforcement getEnterpriseLawEnforcementById(String id);
public EnterpriseLawEnforcement getByUserIdAndZero();
public EnterpriseLawEnforcement getByUserIdAndZero(Long userId);
/**
* 查询企业端-执法部门预约记录列表

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ThirdLoginService.java

@ -18,7 +18,7 @@ public interface ThirdLoginService {
* @param jsonObject
* @return
*/
Boolean addSiqUser(JSONObject jsonObject);
Long addSiqUser(JSONObject jsonObject);
/**
* 添加深i企

9
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java

@ -132,7 +132,7 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
@Override
public int insertEnforcementRegistration(EnforcementRegistration enforcementRegistration)
{
UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(enforcementRegistration.getUserId());
int resNum = 0;
if (StringUtils.isNotEmpty(enforcementRegistration.getId())) {
// enforcementRegistration.setIsSubmit(0);
@ -173,7 +173,7 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
@Override
public int updateEnforcementRegistration(EnforcementRegistration enforcementRegistration)
{
UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(enforcementRegistration.getUserId());
enforcementRegistration.setUpdateTime(DateUtils.getNowDate());
int i = enforcementRegistrationMapper.updateEnforcementRegistration(enforcementRegistration);
if (i > 0 && enforcementRegistration.getFileList().size() > 0) {
@ -303,10 +303,9 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
}
@Override
public EnforcementRegistration getByUserIdAndZero() {
public EnforcementRegistration getByUserIdAndZero(Long userId) {
EnforcementRegistration registration = new EnforcementRegistration();
UserBean user = userApi.getCurrentUser();
registration.setUserId(user.getUserId());
registration.setUserId(userId);
registration.setIsSubmit(0);
List<EnforcementRegistration> es = enforcementRegistrationMapper.selectEnforcementRegistrationList(registration);

13
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

@ -110,14 +110,23 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
{
enterpriseInformation.setCreateTime(DateUtils.getNowDate());
enterpriseInformation.setId(IdUtil.simpleUUID());
UserBean user = userApi.getCurrentUser();
// UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(enterpriseInformation.getUserId());
enterpriseInformation.setCreateBy(user.getUserName());
enterpriseInformation.setUserId(user.getUserId());
enterpriseInformation.setDeptId(user.getDeptId());
//生成企业统一信用代码盐
String salt = PasswordTools.encrypt(enterpriseInformation.getEnterpriseNumber());
enterpriseInformation.setSalt(salt);
int i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation);
EnterpriseInformation info = enterpriseInformationMapper.selectEnterpriseInformationById(enterpriseInformation.getId());
int i=0;
if (null!=info && null != info.getId()) {
i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation);
} else {
System.out.println("````````````````````````````````````````");
System.out.println(enterpriseInformation.getEnterpriseName());
i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation);
}
if(i > 0){
String text = salt;
//这里设置自定义网站url

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseLawEnforcementServiceImpl.java

@ -88,10 +88,9 @@ public class EnterpriseLawEnforcementServiceImpl implements IEnterpriseLawEnforc
}
@Override
public EnterpriseLawEnforcement getByUserIdAndZero() {
public EnterpriseLawEnforcement getByUserIdAndZero(Long userId) {
EnterpriseLawEnforcement enterpriseLawEnforcement = new EnterpriseLawEnforcement();
UserBean user = userApi.getCurrentUser();
enterpriseLawEnforcement.setUserId(user.getUserId());
enterpriseLawEnforcement.setUserId(userId);
enterpriseLawEnforcement.setIsSubmit(0);
List<EnterpriseLawEnforcement> es = enterpriseLawEnforcementMapper.selectEnterpriseLawEnforcementList(enterpriseLawEnforcement);
return null != es && es.size() >0 ? es.get(0):null;
@ -135,7 +134,7 @@ public class EnterpriseLawEnforcementServiceImpl implements IEnterpriseLawEnforc
enterpriseLawEnforcement.setCreateTime(DateUtils.getNowDate());
enterpriseLawEnforcement.setId(IdUtil.simpleUUID());
enterpriseLawEnforcement.setLawEnforcementCode(IdUtil.simpleUUID());
UserBean user = userApi.getCurrentUser();
UserBean user = userApi.getUserByUserId(enterpriseLawEnforcement.getUserId());
enterpriseLawEnforcement.setUserId(user.getUserId());
enterpriseLawEnforcement.setDeptId(user.getDeptId());
enterpriseLawEnforcement.setCreateBy(user.getUserName());

26
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java

@ -52,14 +52,14 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
public ZDResponse siqLogin(JSONObject jsonObject) {
try {
//查询登录用户
JSONObject tmpObj = JSON.parseObject(jsonObject.getString("data"));
log.info("用户名:{}",tmpObj.getString("account"));
UserBean user = userApi.getUserByUserLoginName(tmpObj.getString("account"));
log.info("用户名:{}",jsonObject.getString("account"));
UserBean user = userApi.getUserByUserLoginName(jsonObject.getString("account"));
//本系统令牌
// UsernamePasswordToken sysToken = new UsernamePasswordToken(user.getLoginName(), user.getPassword(), false);
UserToken sysToken = new UserToken(user.getLoginName(), LoginType.NOPASSWD);
Subject subject = SecurityUtils.getSubject();
subject.login(sysToken);
user.setEnterpriseNumber(jsonObject.getString("corpCid"));
return ZDResponse.success("登录成功",user);
} catch (Exception e) {
e.printStackTrace();
@ -68,18 +68,18 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
}
@Override
public Boolean addSiqUser(JSONObject jsonObject) {
if(UserConstants.USER_NAME_NOT_UNIQUE.equals(userApi.checkLoginNameUnique(jsonObject.getString("account")))){
public Long addSiqUser(JSONObject jsonObject) {
if(UserConstants.USER_NAME_UNIQUE.equals(userApi.checkLoginNameUnique(jsonObject.getString("account")))){
//新增用户信息
UserBean userBean = new UserBean();
//设置默认用户权限,权限为默认值
userBean.setRoleId(178L);
//用户姓名
userBean.setUserName(jsonObject.getString("contactName"));
userBean.setUserName(jsonObject.getString("userName"));
//登录账号
userBean.setLoginName(jsonObject.getString("account"));
//手机号码
userBean.setPhonenumber(IdCardCryptoUtil.symmetricDecryptIdCard(secretKey,jsonObject.getString("account")));
userBean.setPhonenumber(IdCardCryptoUtil.symmetricDecryptIdCard(secretKey,jsonObject.getString("phone")));
//设置为默认密码
userBean.setPassword("123456");
userBean.setCreateTime(DateUtils.getNowDate());
@ -87,9 +87,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
//部门ID设置为默认值
userBean.setDeptId(405L);
return userApi.insertUser(userBean) > 0 ? Boolean.TRUE : Boolean.FALSE;
return userApi.insertUserResId(userBean);
}
return true;
UserBean tmp = userApi.getUserByUserLoginName(jsonObject.getString("account"));
return tmp.getUserId();
}
@Override
@ -112,9 +113,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
//注册资金
enterpriseInformation.setRegisteredCapital(jsonObject.getString("regCapital"));
//企业联系人电话
enterpriseInformation.setEnterpriseTel(jsonObject.getString("contactTel"));
enterpriseInformation.setEnterpriseTel(IdCardCryptoUtil.symmetricDecryptIdCard(secretKey,jsonObject.getString("phone")));
//企业法人
enterpriseInformation.setLegalPerson(jsonObject.getString("legalPersonName"));
//用户Id
enterpriseInformation.setUserId(Long.valueOf(jsonObject.getString("userId")));
//营业时间
//开始时间
String termStart = jsonObject.getString("termStart");
@ -123,8 +126,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
//营业时间
enterpriseInformation.setOperatingTerm(termStart+ "-" +termEnd);
return enterpriseInformationService.insertEnterpriseInformation(enterpriseInformation) > 0
? Boolean.TRUE : Boolean.FALSE;
return enterpriseInformationService.insertEnterpriseInformation(enterpriseInformation) > 0 ? Boolean.TRUE : Boolean.FALSE;
}
return true;
}

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java

@ -179,6 +179,7 @@ public class HttpUtil {
HttpURLConnection connection = (HttpURLConnection) uri.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type","application/json");
connection.setRequestProperty("Charsert","UTF-8");
for (Map.Entry<String, Object> entry : heardMap.entrySet()) {
// 对value进行相应的操作
connection.setRequestProperty(entry.getKey(), String.valueOf(entry.getValue()));
@ -187,12 +188,13 @@ public class HttpUtil {
// connection.setRequestProperty("x-auth-app-code","zfjdm");
connection.setDoOutput(true);
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.writeBytes(params);
// out.writeBytes(params);
out.write(params.getBytes("utf-8")); //解决中文乱码
out.flush();
out.close();
int responseCode = connection.getResponseCode();
if(responseCode == HttpURLConnection.HTTP_OK){
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
String inputLine;
StringBuffer response = new StringBuffer();
@ -202,6 +204,7 @@ public class HttpUtil {
in.close();
System.out.println(new String(response.toString()));
System.out.println("请求成功");
return response.toString();
}else{
System.out.println("请求失败");
}

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml

@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">dept_id,</if>
<if test="isUnsubscribe != null">is_unsubscribe,</if>
<if test="salt != null and salt != ''">salt,</if>
<if test="enterpriseTel != null and enterpriseTel != ''">enterprise_tel,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
@ -101,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="isUnsubscribe != null">#{isUnsubscribe},</if>
<if test="salt != null and salt != ''">#{salt},</if>
<if test="enterpriseTel != null and enterpriseTel != ''">#{enterpriseTel},</if>
</trim>
</insert>

154
lib/EmergencyServiceApi/emergencyAuthServiceApi/src/main/java/com/zdxt/auth/dto/UserBean.java

@ -78,6 +78,9 @@ public class UserBean implements Serializable {
@ApiModelProperty("执法证件号")
private String lawCertificateNum;
/** 企业纳税识别号 */
private String enterpriseNumber;
/**
* 用户性别
*/
@ -117,6 +120,37 @@ public class UserBean implements Serializable {
private String password;
/** 姓名 */
private String fullname;
/** 任务ID */
private String taskId;
/** 业务系统ID */
private String systemId;
/** 作用点 (CREATE:新建;UPDATE:更新;DELETED:删除;ENABLED:启用;DISABLED:禁用) */
private String effectOn;
/** 是否删除 (0否;1是)*/
private int isDeleted;
/** 是否禁用 (0否;1是)*/
private int isDisabled;
/** 创建日期 */
private String createAt;
/** 更新日期 */
private String updateAt;
/** 下游唯一标识 */
private String guid;
/** 手机号 */
private String mobileNumber;
/** 证件号码 */
private String certificateNumber;
/** 省认证用户id */
private String srzUserid;
/** 是否驻区人员 */
private String isMappingPerson;
/** 人员所在部门(包括主岗和兼岗部门) */
private String units;
public Long getUserId() {
return userId;
}
@ -292,6 +326,126 @@ public class UserBean implements Serializable {
this.token = token;
}
public String getEnterpriseNumber() {
return enterpriseNumber;
}
public void setEnterpriseNumber(String enterpriseNumber) {
this.enterpriseNumber = enterpriseNumber;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getSystemId() {
return systemId;
}
public void setSystemId(String systemId) {
this.systemId = systemId;
}
public String getEffectOn() {
return effectOn;
}
public void setEffectOn(String effectOn) {
this.effectOn = effectOn;
}
public int getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(int isDeleted) {
this.isDeleted = isDeleted;
}
public int getIsDisabled() {
return isDisabled;
}
public void setIsDisabled(int isDisabled) {
this.isDisabled = isDisabled;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) {
this.createAt = createAt;
}
public String getUpdateAt() {
return updateAt;
}
public void setUpdateAt(String updateAt) {
this.updateAt = updateAt;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public String getMobileNumber() {
return mobileNumber;
}
public void setMobileNumber(String mobileNumber) {
this.mobileNumber = mobileNumber;
}
public String getCertificateNumber() {
return certificateNumber;
}
public void setCertificateNumber(String certificateNumber) {
this.certificateNumber = certificateNumber;
}
public String getSrzUserid() {
return srzUserid;
}
public void setSrzUserid(String srzUserid) {
this.srzUserid = srzUserid;
}
public String getIsMappingPerson() {
return isMappingPerson;
}
public void setIsMappingPerson(String isMappingPerson) {
this.isMappingPerson = isMappingPerson;
}
public String getUnits() {
return units;
}
public void setUnits(String units) {
this.units = units;
}
@Override
public String toString() {
return "UserBean{" +

4
lib/EmergencyServiceApi/emergencyAuthServiceApi/src/main/java/com/zdxt/auth/feign/UserApi.java

@ -67,6 +67,10 @@ public interface UserApi {
@ApiOperation("修改用户信息,不修改用户角色,职务")
public int updateUserInfo(UserBean userBean);
@PostMapping("/insertOrUpdateUserResId")
@ApiOperation("插入或更新")
public Long insertOrUpdateUserResId(UserBean userBean);
@PostMapping("/checkLoginNameUnique")
@ApiOperation("校验用户名称是否唯一")
public String checkLoginNameUnique(String loginName);

Loading…
Cancel
Save