Commit 8ed3845a authored by suhuiguang's avatar suhuiguang

1.联调修改,时间格式

2.树接口数据code非long之前接口用不了 3.非必输列表未判断进行save ,更新时进行saveOrUpdate
parent 537be9fa
......@@ -203,6 +203,25 @@ public class DataDictionaryController extends BaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionaryIdFillMenu", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典,id为SequenceNbr", notes = "根据字典类型查询字典,id为SequenceNbr")
public ResponseModel<Object> getDictionaryWithTreeFillId(@RequestParam String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type + "_ID")) {
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type + "_ID");
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", null,"getCode");
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type + "_ID", JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception {
......@@ -224,6 +243,7 @@ public class DataDictionaryController extends BaseController {
}
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
......
......@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -113,7 +115,7 @@ public class RegUnitInfoDto extends BaseDto {
private RegUnitIcDto regUnitIc;
@ApiModelProperty(value = "行政许可")
private List<BaseUnitLicenceDto> unitLicences;
private List<BaseUnitLicenceDto> unitLicences = new ArrayList<>();
@ApiModelProperty(value = "平台公司id,平台创建公司后更新")
private String amosCompanySeq;
......
......@@ -108,13 +108,15 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Bean.copyExistPropertis(s, target);
return target;
}).collect(Collectors.toList());
baseUnitLicenceService.saveOrUpdateBatch(baseUnitLicences);
if(!baseUnitLicences.isEmpty()){
baseUnitLicenceService.saveOrUpdateBatch(baseUnitLicences);
}
// 2.插入工商单位信息表:tz_flc_reg_unit_ic
RegUnitIc regUnitIc = new RegUnitIc();
model.getRegUnitIc().setUnitCode(model.getUnitCode());
model.getRegUnitIc().setUnitName(model.getName());
Bean.copyExistPropertis(model.getRegUnitIc(), regUnitIc);
regUnitIcService.save(regUnitIc);
regUnitIcService.saveOrUpdate(regUnitIc);
// 3.调用平台进行创建单位、用户信息,同步用户信息
if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// 3.1 创建企业信息
......@@ -132,6 +134,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// 5.3工商信息
model.setRegUnitIc(Bean.toModel(regUnitIc, new RegUnitIcDto()));
} catch (Exception e) {
log.error(e.getMessage(),e);
// 失败后回滚:删除已经创建的企业信息
if (StringUtils.isNotEmpty(regUnitInfo.getAmosCompanySeq())) {
FeignClientResult<CompanyModel> feignClientResult = Privilege.companyClient.seleteOne(Long.parseLong(regUnitInfo.getAmosCompanySeq()));
......
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