Commit cd54953c authored by tianyiming's avatar tianyiming

Merge branch 'develop_tzs' into develop_tzs_96333

parents 3d0038d1 fef2a54e
...@@ -24,6 +24,8 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -24,6 +24,8 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
...@@ -52,6 +54,9 @@ import java.util.regex.Pattern; ...@@ -52,6 +54,9 @@ import java.util.regex.Pattern;
@Component @Component
@Order(value = 0) @Order(value = 0)
public class ControllerAop { public class ControllerAop {
private static final Logger logger = LoggerFactory.getLogger(ControllerAop.class);
/** /**
* saveUserRedis设置过期时间 * saveUserRedis设置过期时间
*/ */
...@@ -118,6 +123,7 @@ public class ControllerAop { ...@@ -118,6 +123,7 @@ public class ControllerAop {
if (ValidationUtil.isEmpty(token)) { if (ValidationUtil.isEmpty(token)) {
fillRequestContext(request); fillRequestContext(request);
token = RequestContext.getToken(); token = RequestContext.getToken();
logger.info("studio url token ===========>" + token);
} }
if (token != null) { if (token != null) {
String pattern = RedisKey.buildPatternKey(token); String pattern = RedisKey.buildPatternKey(token);
...@@ -132,7 +138,9 @@ public class ControllerAop { ...@@ -132,7 +138,9 @@ public class ControllerAop {
RequestContext.setExeUserId(userModel.getUserId()); RequestContext.setExeUserId(userModel.getUserId());
} catch (Exception e) { } catch (Exception e) {
// 删除失效token缓存 // 删除失效token缓存
logger.info("catch pattern before==========>" + pattern);
redisUtils.getAndDeletePatternKeys(pattern); redisUtils.getAndDeletePatternKeys(pattern);
logger.info("catch pattern after==========>" + pattern);
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
saveUserRedis(userModel, token); saveUserRedis(userModel, token);
...@@ -201,7 +209,9 @@ public class ControllerAop { ...@@ -201,7 +209,9 @@ public class ControllerAop {
String token = null; String token = null;
String product = null; String product = null;
String appKey = null; String appKey = null;
logger.info("fillRequestContext request =====>" + request);
if (request != null && request.getParameterMap() != null) { if (request != null && request.getParameterMap() != null) {
logger.info("fillRequestContext request getParameterMap =====>" + request.getParameterMap());
if (request.getParameterMap().get("token") != null && request.getParameterMap().get("product") != null if (request.getParameterMap().get("token") != null && request.getParameterMap().get("product") != null
&& request.getParameterMap().get("appKey") != null) { && request.getParameterMap().get("appKey") != null) {
token = request.getParameterMap().get("token")[0]; token = request.getParameterMap().get("token")[0];
......
...@@ -175,12 +175,12 @@ ...@@ -175,12 +175,12 @@
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
<version>5.7.22</version> <version>5.7.22</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.yeejoin</groupId> <!-- <groupId>com.yeejoin</groupId>-->
<artifactId>amos-component-influxdb</artifactId> <!-- <artifactId>amos-component-influxdb</artifactId>-->
<version>1.8.5-SNAPSHOT</version> <!-- <version>1.8.5-SNAPSHOT</version>-->
<scope>compile</scope> <!-- <scope>compile</scope>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-component-security</artifactId> <artifactId>amos-component-security</artifactId>
......
...@@ -47,8 +47,8 @@ import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl; ...@@ -47,8 +47,8 @@ import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl;
@ComponentScan({ "org.typroject", "com.yeejoin.amos" }) @ComponentScan({ "org.typroject", "com.yeejoin.amos" })
public class AccessapiApplication { public class AccessapiApplication {
// @Autowired @Autowired
// private TaAccessConfigServiceImpl taAccessConfigServiceImpl; private TaAccessConfigServiceImpl taAccessConfigServiceImpl;
private static final Logger logger = LogManager.getLogger(AccessapiApplication.class); private static final Logger logger = LogManager.getLogger(AccessapiApplication.class);
...@@ -69,9 +69,9 @@ public class AccessapiApplication { ...@@ -69,9 +69,9 @@ public class AccessapiApplication {
+ path + "/doc.html\n" + "----------------------------------------------------------"); + path + "/doc.html\n" + "----------------------------------------------------------");
} }
// @Bean @Bean
// public void initAccessConfig() { public void initAccessConfig() {
// taAccessConfigServiceImpl.refreshConfig(); taAccessConfigServiceImpl.refreshConfig();
// taAccessConfigServiceImpl.startTask(); taAccessConfigServiceImpl.startTask();
// } }
} }
package com.yeejoin.amos.api.householdapi.controller; //package com.yeejoin.amos.api.householdapi.controller;
//
import cn.hutool.http.HttpUtil; //import cn.hutool.http.HttpUtil;
import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils; //import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils;
import com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto; //import com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto;
import com.yeejoin.amos.api.householdapi.face.model.HouseholdPvProducerInfoDto; //import com.yeejoin.amos.api.householdapi.face.model.HouseholdPvProducerInfoDto;
import com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvApiServiceImpl; //import com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvApiServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvProducerInfoServiceImpl; //import com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvProducerInfoServiceImpl;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum; //import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import fastjson.JSON; //import fastjson.JSON;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; //import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; //import org.typroject.tyboot.core.restful.doc.TycloudOperation;
//
import java.io.IOException; //import java.io.IOException;
import java.util.HashMap; //import java.util.HashMap;
import java.util.Map; //import java.util.Map;
//
//
/** ///**
* 户用光伏-厂商API haders // * 户用光伏-厂商API haders
* // *
* @author system_generator // * @author system_generator
* @date 2023-06-07 // * @date 2023-06-07
*/ // */
@RestController //@RestController
@Api(tags = "测试") //@Api(tags = "测试")
@RequestMapping(value = "/household-pv-api-test1") //@RequestMapping(value = "/household-pv-api-test1")
public class HouseholdTestController { //public class HouseholdTestController {
@Autowired // @Autowired
private HouseholdPvUtils householdPvUtils; // private HouseholdPvUtils householdPvUtils;
//
//
/** // /**
* 新增户用光伏-厂商API haders // * 新增户用光伏-厂商API haders
* // *
* @return // * @return
*/ // */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) // @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/gdwdemo") // @PostMapping(value = "/gdwdemo")
@ApiOperation(httpMethod = "get", value = "固德威示例", notes = "固德威示例") // @ApiOperation(httpMethod = "get", value = "固德威示例", notes = "固德威示例")
public String save(Long seq) throws IOException { // public String save(Long seq) throws IOException {
return householdPvUtils.gerResponseByAPiID(seq); // return householdPvUtils.gerResponseByAPiID(seq);
} // }
} //}
...@@ -10,6 +10,8 @@ import com.csoft.sdk.domain.CsoftDataApiXixianGetzhutiinfoParam; ...@@ -10,6 +10,8 @@ import com.csoft.sdk.domain.CsoftDataApiXixianGetzhutiinfoParam;
import com.csoft.sdk.domain.request.CsoftDataApiXixianGetzhutiinfoRequest ; import com.csoft.sdk.domain.request.CsoftDataApiXixianGetzhutiinfoRequest ;
import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse; import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse;
import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper; import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -34,7 +36,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseBaseInfo; ...@@ -34,7 +36,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseBaseInfo;
*/ */
@Service @Service
public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAccessConfig, TaAccessConfigMapper> { public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAccessConfig, TaAccessConfigMapper> {
private final Logger log = LoggerFactory.getLogger(TaBusinessServiceImpl.class);
@Autowired @Autowired
private DataDictionaryMapper dataDictionaryMapper; private DataDictionaryMapper dataDictionaryMapper;
...@@ -50,8 +52,16 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc ...@@ -50,8 +52,16 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
CsoftDataApiXixianGetzhutiinfoParam csoftDataApiXixianParam = new CsoftDataApiXixianGetzhutiinfoParam(); CsoftDataApiXixianGetzhutiinfoParam csoftDataApiXixianParam = new CsoftDataApiXixianGetzhutiinfoParam();
csoftDataApiXixianParam.setUniscid(code); csoftDataApiXixianParam.setUniscid(code);
CsoftDataApiXixianGetzhutiinfoRequest request = new CsoftDataApiXixianGetzhutiinfoRequest(csoftDataApiXixianParam); CsoftDataApiXixianGetzhutiinfoRequest request = new CsoftDataApiXixianGetzhutiinfoRequest(csoftDataApiXixianParam);
CsoftDataApiXixianGetzhutiinfoResponse response = client.execute(request);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
CsoftDataApiXixianGetzhutiinfoResponse response = null;
try {
log.info("请求查询工商信息前");
response = client.execute(request);
log.info("请求查询工商信息完成,{}", response);
} catch (Exception e) {
log.error("返回信息,{}", e.getMessage());
return null;
}
// 4.返回校验 // 4.返回校验
if (response.isSuccess()) { if (response.isSuccess()) {
System.out.println("成功:" + response.getData()); System.out.println("成功:" + response.getData());
......
...@@ -39,6 +39,7 @@ import com.yeejoin.amos.feign.privilege.util.DesUtil; ...@@ -39,6 +39,7 @@ import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
...@@ -82,6 +83,7 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -82,6 +83,7 @@ public class TzBaseEnterpriseInfoServiceImpl
RegUnitIcServiceImpl regUnitIcService; RegUnitIcServiceImpl regUnitIcService;
@Autowired @Autowired
@Lazy
RegUnitInfoServiceImpl regUnitInfoService; RegUnitInfoServiceImpl regUnitInfoService;
@Autowired @Autowired
......
...@@ -68,5 +68,6 @@ public class TzsUserInfoDto extends BaseDto { ...@@ -68,5 +68,6 @@ public class TzsUserInfoDto extends BaseDto {
@ApiModelProperty(value = "年龄") @ApiModelProperty(value = "年龄")
private Integer age; private Integer age;
@ApiModelProperty(value = "平台账号锁定状态")
private String lockStatus;
} }
...@@ -117,4 +117,10 @@ public class TzsUserInfo extends BaseEntity { ...@@ -117,4 +117,10 @@ public class TzsUserInfo extends BaseEntity {
*/ */
@TableField("amos_user_id") @TableField("amos_user_id")
private String amosUserId; private String amosUserId;
/**
* 平台账号锁定状态
*/
@TableField("lock_status")
private String lockStatus;
} }
...@@ -22,4 +22,5 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> { ...@@ -22,4 +22,5 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
Map<String, Object> getDetail(Long id); Map<String, Object> getDetail(Long id);
boolean BindAccount(Map<String, Object> map); boolean BindAccount(Map<String, Object> map);
String startOrStopAccount(Map<String, Object> map);
} }
...@@ -107,4 +107,11 @@ public class TzsUserInfoVo { ...@@ -107,4 +107,11 @@ public class TzsUserInfoVo {
*/ */
@TableField("amos_user_id") @TableField("amos_user_id")
private String amosUserId; private String amosUserId;
/**
* 平台账号锁定状态
*/
@TableField("lock_status")
private String lockStatus;
} }
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
speciality, speciality,
profile, profile,
amos_user_name, amos_user_name,
amos_user_id,
lock_status,
CASE CASE
WHEN gender = 1 THEN WHEN gender = 1 THEN
'男' ELSE '女' '男' ELSE '女'
......
...@@ -126,4 +126,11 @@ public class TzsUserInfoController extends BaseController { ...@@ -126,4 +126,11 @@ public class TzsUserInfoController extends BaseController {
public ResponseModel<Boolean> BindAccount(@RequestBody Map<String, Object> map) { public ResponseModel<Boolean> BindAccount(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(tzsUserInfoService.BindAccount(map)); return ResponseHelper.buildResponse(tzsUserInfoService.BindAccount(map));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/startOrStopAccount")
@ApiOperation(httpMethod = "POST", value = "启用或者停用账户", notes = "启用或者停用账户")
public ResponseModel<String> startOrStopAccount(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(tzsUserInfoService.startOrStopAccount(map));
}
} }
...@@ -451,7 +451,7 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -451,7 +451,7 @@ public class TzBaseEnterpriseInfoServiceImpl
public TzBaseEnterpriseInfoDto companyInfoUpdate(Map<String, Object> map) { public TzBaseEnterpriseInfoDto companyInfoUpdate(Map<String, Object> map) {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = new TzBaseEnterpriseInfo(); TzBaseEnterpriseInfo tzBaseEnterpriseInfo = new TzBaseEnterpriseInfo();
tzBaseEnterpriseInfo.setSequenceNbr(Long.valueOf(map.get("sequenceNbr").toString())); tzBaseEnterpriseInfo.setSequenceNbr(Long.valueOf(map.get("sequenceNbr").toString()));
//修改基本信息
tzBaseEnterpriseInfo.setEquipCategory(JSON.toJSONString(map.get("equipCategory"))); tzBaseEnterpriseInfo.setEquipCategory(JSON.toJSONString(map.get("equipCategory")));
Map<String, String> map1 = (Map<String, String>) map.get("longitudeLatitude"); Map<String, String> map1 = (Map<String, String>) map.get("longitudeLatitude");
tzBaseEnterpriseInfo.setAddress(ObjectUtils.isEmpty(map1.get("address")) ? null : map1.get("address")); tzBaseEnterpriseInfo.setAddress(ObjectUtils.isEmpty(map1.get("address")) ? null : map1.get("address"));
...@@ -465,36 +465,34 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -465,36 +465,34 @@ public class TzBaseEnterpriseInfoServiceImpl
tzBaseEnterpriseInfo.setSuperviseOrgName(ObjectUtils.isEmpty(map.get("superviseOrgName")) ? null : String.valueOf(map.get("superviseOrgName"))); tzBaseEnterpriseInfo.setSuperviseOrgName(ObjectUtils.isEmpty(map.get("superviseOrgName")) ? null : String.valueOf(map.get("superviseOrgName")));
//修改工商信息 //修改工商信息
RegUnitIc regUnitIc = new RegUnitIc(); // RegUnitIc regUnitIc = new RegUnitIc();
List<String> addressList = (List<String>) map.get("registerAddressList"); // List<String> addressList = (List<String>) map.get("registerAddressList");
tzBaseEnterpriseInfo.setProvince(addressList.get(0)); // tzBaseEnterpriseInfo.setProvince(addressList.get(0));
tzBaseEnterpriseInfo.setCity(addressList.get(1)); // tzBaseEnterpriseInfo.setCity(addressList.get(1));
tzBaseEnterpriseInfo.setDistrict(addressList.get(3)); // tzBaseEnterpriseInfo.setDistrict(addressList.get(3));
tzBaseEnterpriseInfo.setCommunity(ObjectUtils.isEmpty(map.get("community")) ? null : String.valueOf(map.get("community"))); // tzBaseEnterpriseInfo.setCommunity(ObjectUtils.isEmpty(map.get("community")) ? null : String.valueOf(map.get("community")));
tzBaseEnterpriseInfo.setStreet(ObjectUtils.isEmpty(map.get("stree")) ? null : String.valueOf(map.get("stree"))); // tzBaseEnterpriseInfo.setStreet(ObjectUtils.isEmpty(map.get("stree")) ? null : String.valueOf(map.get("stree")));
tzBaseEnterpriseInfo.setLegalPerson(ObjectUtils.isEmpty(map.get("legalPerson")) ? null : String.valueOf(map.get("legalPerson"))); // tzBaseEnterpriseInfo.setLegalPerson(ObjectUtils.isEmpty(map.get("legalPerson")) ? null : String.valueOf(map.get("legalPerson")));
regUnitIc.setIndustryName(ObjectUtils.isEmpty(map.get("industryName")) ? null : String.valueOf(map.get("industryName"))); // regUnitIc.setIndustryName(ObjectUtils.isEmpty(map.get("industryName")) ? null : String.valueOf(map.get("industryName")));
regUnitIc.setRegisteredOrgan(ObjectUtils.isEmpty(map.get("registeredOrgan")) ? null : String.valueOf(map.get("registeredOrgan"))); // regUnitIc.setRegisteredOrgan(ObjectUtils.isEmpty(map.get("registeredOrgan")) ? null : String.valueOf(map.get("registeredOrgan")));
Date approvedDate = new Date(); // Date approvedDate = new Date();
try { // try {
approvedDate = DateUtils.dateParse(String.valueOf(map.get("approvedDate")), "yyyy-MM-dd"); // approvedDate = DateUtils.dateParse(String.valueOf(map.get("approvedDate")), "yyyy-MM-dd");
} catch (ParseException e) { // } catch (ParseException e) {
throw new RuntimeException(e); // throw new RuntimeException(e);
} // }
regUnitIc.setBusinessState(ObjectUtils.isEmpty(map.get("businessState")) ? null : String.valueOf(map.get("businessState"))); // regUnitIc.setBusinessState(ObjectUtils.isEmpty(map.get("businessState")) ? null : String.valueOf(map.get("businessState")));
regUnitIc.setApprovedDate(ObjectUtils.isEmpty(map.get("approvedDate")) ? null : approvedDate); // regUnitIc.setApprovedDate(ObjectUtils.isEmpty(map.get("approvedDate")) ? null : approvedDate);
RegUnitIcDto regUnitIcDto = JSON.parseObject(JSON.toJSONString(map.get("regUnitIcDto")), new TypeReference<RegUnitIcDto>() { // RegUnitIcDto regUnitIcDto = JSON.parseObject(JSON.toJSONString(map.get("regUnitIcDto")), new TypeReference<RegUnitIcDto>() {
}); // });
// regUnitIcService.update(regUnitIc, new QueryWrapper<RegUnitIc>().eq("unit_code", regUnitIcDto.getUnitCode())); //// regUnitIcService.update(regUnitIc, new QueryWrapper<RegUnitIc>().eq("unit_code", regUnitIcDto.getUnitCode()));
//
//
//修改许可信息 // //修改许可信息
List<BaseUnitLicence> licences = (List<BaseUnitLicence>) map.get("unitLicences"); // List<BaseUnitLicence> licences = (List<BaseUnitLicence>) map.get("unitLicences");
// baseUnitLicenceService.saveOrUpdateBatch(licences); // baseUnitLicenceService.saveOrUpdateBatch(licences);
boolean b = tzBaseEnterpriseInfoService.updateById(tzBaseEnterpriseInfo);
// boolean b = tzBaseEnterpriseInfoService.updateById(tzBaseEnterpriseInfo);
boolean b = true;
if (b) { if (b) {
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto(); TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto); BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto);
......
...@@ -47,6 +47,13 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -47,6 +47,13 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Autowired @Autowired
private DataDictionaryMapper dataDictionaryMapper; private DataDictionaryMapper dataDictionaryMapper;
//企业人员角色
private final String USER_ROLE = "QYRYJS";
//企业人员用户组
private final String ROLE_GROUP = "QYRYYHZ";
//平台用户锁定状态
private final String UNLOCK = "UNLOCK";
private final String LOCK = "LOCK";
@Autowired @Autowired
private TzsUserQualificationsServiceImpl tzsUserQualificationsService; private TzsUserQualificationsServiceImpl tzsUserQualificationsService;
...@@ -174,6 +181,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -174,6 +181,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
String sequenceNbr = map.get("sequenceNbr").toString(); String sequenceNbr = map.get("sequenceNbr").toString();
String roles = map.get("role").toString(); String roles = map.get("role").toString();
String status = map.get("status").toString(); String status = map.get("status").toString();
String roleGroupCode = map.get("roleGroup").toString();
FeignClientResult<AgencyUserModel> userResult = null; FeignClientResult<AgencyUserModel> userResult = null;
try { try {
...@@ -195,7 +203,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -195,7 +203,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
List<RoleModel> allRoleList = new ArrayList<>(); List<RoleModel> allRoleList = new ArrayList<>();
List<Long> roleIds = new ArrayList<>(); List<Long> roleIds = new ArrayList<>();
DataDictionary unitType = iDataDictionaryService DataDictionary unitType = iDataDictionaryService
.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, roles)); .getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, roles).eq(DataDictionary::getType, USER_ROLE));
String role = unitType.getExtend() != null ? unitType.getExtend() : ""; String role = unitType.getExtend() != null ? unitType.getExtend() : "";
for (String s : role.split(",")) { for (String s : role.split(",")) {
RoleModel roleModel = Privilege.roleClient.seleteOne(Long.valueOf(s)).getResult(); RoleModel roleModel = Privilege.roleClient.seleteOne(Long.valueOf(s)).getResult();
...@@ -216,9 +224,17 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -216,9 +224,17 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
agencyUserModel.setOrgRoleSeqs(roleSeqMap); agencyUserModel.setOrgRoleSeqs(roleSeqMap);
userResult = Privilege.agencyUserClient.create(agencyUserModel); userResult = Privilege.agencyUserClient.create(agencyUserModel);
if (userResult.getStatus() == 200) { if (userResult.getStatus() == 200) {
List<String> userIds = new ArrayList<>();
userIds.add(userResult.getResult().getUserId());
DataDictionary roleGroup = iDataDictionaryService
.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, roleGroupCode).eq(DataDictionary::getType, ROLE_GROUP));
if (!ObjectUtils.isEmpty(roleGroup) && roleGroup.getExtend() != null) {
Privilege.groupUserClient.create(Long.valueOf(roleGroup.getExtend()), userIds);
}
TzsUserInfo tzsUserInfo = tzsUserInfoMapper.selectById(sequenceNbr); TzsUserInfo tzsUserInfo = tzsUserInfoMapper.selectById(sequenceNbr);
tzsUserInfo.setAmosUserId(userResult.getResult().getUserId()); tzsUserInfo.setAmosUserId(userResult.getResult().getUserId());
tzsUserInfo.setAmosUserName(userResult.getResult().getUserName()); tzsUserInfo.setAmosUserName(userResult.getResult().getUserName());
tzsUserInfo.setLockStatus(status);
tzsUserInfoMapper.updateById(tzsUserInfo); tzsUserInfoMapper.updateById(tzsUserInfo);
} }
return true; return true;
...@@ -232,4 +248,26 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -232,4 +248,26 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
} }
} }
@Override
public String startOrStopAccount(Map<String, Object> map) {
Long sequenceNbr = Long.valueOf(map.get("sequenceNbr").toString());
String amosUserId = map.get("amosUserId").toString();
String lockStatus = null;
FeignClientResult<List<String>> userResult = null;
if (UNLOCK.equals(map.get("lockStatus"))) {
userResult = Privilege.agencyUserClient.lockUsers(amosUserId);
lockStatus = 200 == userResult.getStatus() ? LOCK : UNLOCK;
} else {
userResult = Privilege.agencyUserClient.unlockUsers(amosUserId);
lockStatus = 200 == userResult.getStatus() ? UNLOCK : LOCK;
}
if(!ObjectUtils.isEmpty(lockStatus)){
TzsUserInfo tzsUserInfo = new TzsUserInfo();
tzsUserInfo.setSequenceNbr(sequenceNbr);
tzsUserInfo.setLockStatus(lockStatus);
tzsUserInfoMapper.updateById(tzsUserInfo);
}
return userResult.getResult().get(0);
}
} }
...@@ -371,6 +371,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -371,6 +371,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// 2.组织返回数据 // 2.组织返回数据
//2.1 工商信息查询 //2.1 工商信息查询
Map<String, Object> resultMap = accessFeignService.getData(unitCode).getResult(); Map<String, Object> resultMap = accessFeignService.getData(unitCode).getResult();
if (resultMap == null){
throw new BadRequest("工商信息接口查询失败,请稍后再试!");
}
if(!ValidationUtil.isEmpty(resultMap)){ if(!ValidationUtil.isEmpty(resultMap)){
// 2.2 工商信息组装 // 2.2 工商信息组装
String area = String.valueOf(resultMap.get("area")); String area = String.valueOf(resultMap.get("area"));
......
...@@ -41,19 +41,15 @@ public interface IdxFeignService { ...@@ -41,19 +41,15 @@ public interface IdxFeignService {
/** /**
* 多表单页提交 数据填报 * 多表单页提交 数据填报
*/ */
@RequestMapping(value = "/table/batch/submit", method = RequestMethod.POST) @RequestMapping(value = "/report/form/batch/submit", method = RequestMethod.POST)
ResponseModel batchSubmit(@RequestParam(required = false) String taskId, ResponseModel batchSubmit(@RequestParam(required = false) String topic,
@RequestParam(required = false) String planInstanceId,
@RequestParam(required = false) String topic,
@RequestParam(required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception; @RequestBody Map<String, Object> kv) throws Exception;
/** /**
* 多表单页修改数据修改 * 多表单页修改数据修改
*/ */
@RequestMapping(value = "/table/batch/update", method = RequestMethod.POST) @RequestMapping(value = "/report/form/batch/update", method = RequestMethod.POST)
ResponseModel batchUpdate(@RequestParam(required = false) String topic, ResponseModel batchUpdate(@RequestParam(required = false) String topic,
@RequestParam(required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception; @RequestBody Map<String, Object> kv) throws Exception;
/** /**
......
...@@ -103,23 +103,27 @@ ...@@ -103,23 +103,27 @@
<select id="checkCode" resultType="java.util.Map"> <select id="checkCode" resultType="java.util.Map">
SELECT SELECT
<if test="equCode != null and equCode != ''"> <if test="equCode != null and equCode != ''">
(SELECT COUNT ( 1 ) FROM idx_biz_jg_register_info ibjri WHERE ibjri."EQU_CODE" = #{equCode} (SELECT COUNT ( 1 ) FROM idx_biz_jg_register_info ibjri
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjoi."RECORD" = ibjri."RECORD"
WHERE ibjri."EQU_CODE" = #{equCode}
<if test="type != 'save' "> <if test="type != 'save' ">
and ibjri."RECORD" != #{record} and ibjri."RECORD" != #{record} and ibjoi."CLAIM_STATUS" = '已认领'
</if> </if>
) AS equCode, ) AS equCode,
</if> </if>
<if test="useOrgCode != null and useOrgCode != ''"> <if test="useOrgCode != null and useOrgCode != ''">
(SELECT COUNT ( 1 ) FROM idx_biz_jg_register_info ibjri WHERE ibjri."USE_ORG_CODE" = #{useOrgCode} (SELECT COUNT ( 1 ) FROM idx_biz_jg_register_info ibjri
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjoi."RECORD" = ibjri."RECORD"
WHERE ibjri."USE_ORG_CODE" = #{useOrgCode}
<if test="type != 'save'"> <if test="type != 'save'">
and ibjri."RECORD" != #{record} and ibjri."RECORD" != #{record} and ibjoi."CLAIM_STATUS" = '已认领'
</if> </if>
) AS useOrgCode, ) AS useOrgCode,
</if> </if>
<if test="code96333 != null and code96333 != ''"> <if test="code96333 != null and code96333 != ''">
(SELECT COUNT ( 1 ) FROM idx_biz_jg_other_info ibjoi WHERE ibjoi."CODE96333" = #{code96333} (SELECT COUNT ( 1 ) FROM idx_biz_jg_other_info ibjoi WHERE ibjoi."CODE96333" = #{code96333}
<if test="type != 'save'"> <if test="type != 'save'">
and ibjoi."RECORD" != #{record} and ibjoi."RECORD" != #{record} and ibjoi."CLAIM_STATUS" = '已认领'
</if> </if>
) AS code ) AS code
</if> </if>
......
package com.yeejoin.amos.boot.module.ymt.biz.config;
import lombok.extern.slf4j.Slf4j;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@Slf4j
public class RedissonManager {
//集群环境使用
// @Value("${spring.redis.cluster.nodes}")
// private String clusterNodes;
//通用
@Value("${spring.redis.password}")
private String password;
//单机环境使用
@Value("${spring.redis.host}")
private String host;
//单机环境使用
@Value("${spring.redis.port}")
private String port;
@Bean
public RedissonClient redissonClient() {
//集群环境使用
// log.info("clusterNodes{}",clusterNodes);
// log.info("password{}",password);
//
// Config config = new Config();
// config.useClusterServers()
// .addNodeAddress(clusterNodes.split(","))
// .setPassword(password);
// return Redisson.create(config);
//单机打包使用
Config config = new Config();
config.useSingleServer().setAddress(host + ":" + port).setPassword(password);
return Redisson.create(config);
}
}
...@@ -7,14 +7,14 @@ eureka.client.service-url.defaultZone=http://172.16.10.230:10001/eureka/ ...@@ -7,14 +7,14 @@ eureka.client.service-url.defaultZone=http://172.16.10.230:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.34:${server.port}${server.servlet.context-path}/actuator/health eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.34:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.34:${server.port}${server.servlet.context-path}/doc.html eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.34 eureka.instance.ip-address=172.16.3.17
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=123456
spring.elasticsearch.rest.uris=http://172.16.10.230:9200 spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
......
...@@ -68,7 +68,11 @@ ...@@ -68,7 +68,11 @@
<artifactId>amos-component-security</artifactId> <artifactId>amos-component-security</artifactId>
<version>${amos.version.tzs}</version> <version>${amos.version.tzs}</version>
</dependency> </dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
......
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