Commit 19f04899 authored by suhuiguang's avatar suhuiguang

1.企业注册变更需求

parent 9c6e3f0f
......@@ -13,12 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -394,4 +389,14 @@ public class DataDictionaryController extends BaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/child-list")
@ApiOperation(httpMethod = "GET", value = "根据字典类型type和desc查询字典列表", notes = "根据字典类型type和desc查询字典列表")
public ResponseModel<List<DataDictionary>> getChildList(@RequestParam(value = "type") String type,
@RequestParam(value = "group") String group
){
return ResponseHelper.buildResponse(iDataDictionaryService.getChildList(type,group));
}
}
......@@ -23,4 +23,6 @@ public interface IDataDictionaryService {
public List<DataDictionary> getByType(String type);
public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception;
List<DataDictionary> getChildList(String type, String group);
}
......@@ -156,7 +156,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return list;
}
public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception {
@Override
public List<DataDictionary> getAllChildNodes(String type, Long parent) throws Exception {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<DataDictionary>();
wrapper.eq(DataDictionary::getIsDelete, false);
wrapper.eq(DataDictionary::getType, type);
......@@ -165,4 +166,12 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
}
return this.baseMapper.selectList(wrapper);
}
@Override
public List<DataDictionary> getChildList(String type, String group) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DataDictionary::getType,type);
wrapper.eq(DataDictionary::getTypeDesc,group);
return this.list(wrapper);
}
}
......@@ -50,4 +50,11 @@ public interface IRegUnitInfoService {
* @return 是否成功
*/
Boolean unitLogOut(String unitCode);
/**
* 校验是否已经存在相同的账号
* @param userName 账号
* @return true 已存在相同账号,不能注册 false 不存在账号,可以注册
*/
Boolean checkRepeatAccount(String userName);
}
......@@ -96,7 +96,7 @@ public class RegUnitInfoController extends BaseController {
throw new BadRequest("手机号不能为空");
}
Boolean isReg = (Boolean) Privilege.authClient.mobileVerify(tel).getResult();
if(isReg){
if (isReg) {
throw new RuntimeException("该手机号已注册!");
}
Boolean flag;
......@@ -151,12 +151,11 @@ public class RegUnitInfoController extends BaseController {
@GetMapping(value = "/{userName}/hasExistUser")
@ApiOperation(httpMethod = "GET", value = "判断用户是否存在", notes = "判断用户是否存在")
public ResponseModel<Boolean> hasExistUser(@PathVariable(value = "userName") String userName) {
boolean flag = false;
AgencyUserModel user = Privilege.agencyUserClient.queryByUserName(userName).getResult();
if (user != null) {
flag = true;
return ResponseHelper.buildResponse(false);
}
return ResponseHelper.buildResponse(flag);
return ResponseHelper.buildResponse(iRegUnitInfoService.checkRepeatAccount(userName));
}
......
......@@ -118,12 +118,12 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Bean.copyExistPropertis(model.getRegUnitIc(), regUnitIc);
regUnitIcService.saveOrUpdate(regUnitIc);
// 3.调用平台进行创建单位、用户信息,同步用户信息
if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// 3.1 创建企业信息
this.createBaseEnterpriseInfo(model);
// 3.2 自动创建:调用平台进行创建单位、用户信息
this.createCompanyAndUser(regUnitInfo);
}
// }
// 4.插入注册单位基本信息表:tz_flc_reg_unit_info
this.save(regUnitInfo);
// 5.组织返回数据
......@@ -281,6 +281,11 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return Boolean.TRUE;
}
@Override
public Boolean checkRepeatAccount(String userName) {
return this.count(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getAdminLoginName,userName)) > 0;
}
private CompanyModel dealChildCompany(CompanyModel cm) {
cm.setChildren(this.getFilterChild(cm.getChildren() != null ? cm.getChildren() : new ArrayList()));
cm.getChildren().stream().filter(n -> {
......
......@@ -718,5 +718,12 @@
REPLACE INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1202', '1202', '充装单位', 'zslx', NULL, NULL, NULL, NULL, NULL, b'0', '1');
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1660546840856-12">
<comment>设备品种字典维护</comment>
<sql>
DELETE FROM `cb_data_dictionary` where type = 'sbpz';
REPLACE INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1600', '1000', '移动式压力容器气瓶充装', 'sbpz', NULL, NULL, NULL, NULL, NULL, b'0', '1');
</sql>
</changeSet>
</databaseChangeLog>
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