Commit 0289ad85 authored by suhuiguang's avatar suhuiguang

1.单位注册接口参数修改

parent b09736b3
...@@ -53,7 +53,7 @@ public class RegUnitInfoController extends BaseController { ...@@ -53,7 +53,7 @@ public class RegUnitInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增单位注册信息表", notes = "新增单位注册信息表") @ApiOperation(httpMethod = "POST", value = "单位注册", notes = "单位注册")
public ResponseModel<RegUnitInfoDto> save(@RequestBody RegUnitInfoDto model) { public ResponseModel<RegUnitInfoDto> save(@RequestBody RegUnitInfoDto model) {
model = iRegUnitInfoService.registerUnit(model); model = iRegUnitInfoService.registerUnit(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
......
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tzs.api.entity.RegUnitInfo; import com.yeejoin.amos.boot.module.tzs.api.entity.RegUnitInfo;
import com.yeejoin.amos.boot.module.tzs.api.service.IRegUnitInfoService; import com.yeejoin.amos.boot.module.tzs.api.service.IRegUnitInfoService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitInfoDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitIc; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitIc;
...@@ -56,6 +57,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -56,6 +57,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired @Autowired
RegUnitIcServiceImpl regUnitIcService; RegUnitIcServiceImpl regUnitIcService;
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
/** /**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1051 * 使用单位的类型,数据来源:cb_data_dictionary code = 1051
*/ */
...@@ -70,15 +74,17 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -70,15 +74,17 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public RegUnitInfoDto registerUnit(RegUnitInfoDto model) { public RegUnitInfoDto registerUnit(RegUnitInfoDto model) {
tzsAuthServiceImpl.setRequestContext();
// 1.插入注册单位基本信息表:tz_flc_reg_unit_info // 1.插入注册单位基本信息表:tz_flc_reg_unit_info
RegUnitInfo regUnitInfo = new RegUnitInfo(); RegUnitInfo regUnitInfo = new RegUnitInfo();
// 注册用统一信用码注册,默认证件类型为营业执照,数据来源:cb_data_dictionary code = 1060 // 注册用统一信用码注册,默认证件类型为营业执照,数据来源:cb_data_dictionary code = 1060
model.setUnitType("营业执照"); model.setUnitCodeType("1060");
model.setUnitTypeCode("1060");
Bean.copyExistPropertis(model, regUnitInfo); Bean.copyExistPropertis(model, regUnitInfo);
// 2.插入单位注册许可信息表:tz_base_unit_licence // 2.插入单位注册许可信息表:tz_base_unit_licence
List<BaseUnitLicenceDto> unitLicenceDtos = model.getUnitLicences(); List<BaseUnitLicenceDto> unitLicenceDtos = model.getUnitLicences();
List<BaseUnitLicence> baseUnitLicences = unitLicenceDtos.stream().map(s -> { List<BaseUnitLicence> baseUnitLicences = unitLicenceDtos.stream().map(s -> {
s.setUnitCode(model.getUnitCode());
s.setUnitName(model.getName());
BaseUnitLicence target = new BaseUnitLicence(); BaseUnitLicence target = new BaseUnitLicence();
Bean.copyExistPropertis(s, target); Bean.copyExistPropertis(s, target);
return target; return target;
...@@ -149,7 +155,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -149,7 +155,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return "headquarter".equals(c.getLevel()) || "prefecture-level".equals(c.getLevel()) || "county".equals(c.getLevel()); return "headquarter".equals(c.getLevel()) || "prefecture-level".equals(c.getLevel()) || "county".equals(c.getLevel());
}).peek(n->{ }).peek(n->{
CompanyModel c = JSONObject.parseObject(JSON.toJSONString(n),CompanyModel.class); CompanyModel c = JSONObject.parseObject(JSON.toJSONString(n),CompanyModel.class);
dealChildCompany(c.getChildren()); dealChildCompany(c.getChildren() != null ? new ArrayList() : c.getChildren());
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
...@@ -188,7 +194,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -188,7 +194,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
String unitTypeCode = regUnitInfo.getUnitTypeCode(); String unitTypeCode = regUnitInfo.getUnitTypeCode();
// 根据unitTypeCode 获取应用和角色 数据字典配置 // 根据unitTypeCode 获取应用和角色 数据字典配置
DataDictionary unitType = iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, unitTypeCode)); DataDictionary unitType = iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, unitTypeCode));
String appCode = unitType.getTypeDesc(); String appCode = unitType.getTypeDesc() != null ? unitType.getTypeDesc(): "";
String[] appCodes = appCode.split(","); String[] appCodes = appCode.split(",");
Set<String> appCodesSet = new HashSet<>(); Set<String> appCodesSet = new HashSet<>();
Collections.addAll(appCodesSet, appCodes); Collections.addAll(appCodesSet, appCodes);
...@@ -199,9 +205,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -199,9 +205,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
roleIds.add(r.getSequenceNbr()); roleIds.add(r.getSequenceNbr());
}); });
roleSeqMap.put(companyInfo.getSequenceNbr(), roleIds); roleSeqMap.put(companyInfo.getSequenceNbr(), roleIds);
agencyUserModel.setAppCodes(new ArrayList<>(appCodesSet));
Map<Long, List<RoleModel>> orgRoles = new HashMap<>(); Map<Long, List<RoleModel>> orgRoles = new HashMap<>();
orgRoles.put(companyInfo.getSequenceNbr(), userRoleList); orgRoles.put(companyInfo.getSequenceNbr(), userRoleList);
agencyUserModel.setAppCodes(new ArrayList<>(appCodesSet));
agencyUserModel.setOrgRoles(orgRoles); agencyUserModel.setOrgRoles(orgRoles);
agencyUserModel.setOrgRoleSeqs(roleSeqMap); agencyUserModel.setOrgRoleSeqs(roleSeqMap);
FeignClientResult<AgencyUserModel> userResult; FeignClientResult<AgencyUserModel> userResult;
......
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