企业地区调整
This commit is contained in:
parent
6e623b4f5d
commit
f25ae4df68
|
|
@ -25,6 +25,9 @@ public class SysEnterpriseDo {
|
||||||
@ApiModelProperty("组/网格id")
|
@ApiModelProperty("组/网格id")
|
||||||
private String netCode;
|
private String netCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("地区id")
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
@ApiModelProperty("安全类别")
|
@ApiModelProperty("安全类别")
|
||||||
private String baseinclassid;
|
private String baseinclassid;
|
||||||
|
|
||||||
|
|
@ -85,6 +88,14 @@ public class SysEnterpriseDo {
|
||||||
@ApiModelProperty("企业简介")
|
@ApiModelProperty("企业简介")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
public String getAreaCode() {
|
||||||
|
return areaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAreaCode(String areaCode) {
|
||||||
|
this.areaCode = areaCode;
|
||||||
|
}
|
||||||
|
|
||||||
public String getComments() {
|
public String getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,6 @@ public interface SysOrgMapper extends BaseMapper<SysOrg> {
|
||||||
|
|
||||||
int deleteByPrimaryKey(String orgcode);
|
int deleteByPrimaryKey(String orgcode);
|
||||||
|
|
||||||
int insert(SysOrg record);
|
|
||||||
|
|
||||||
int insertSelective(SysOrg record);
|
int insertSelective(SysOrg record);
|
||||||
|
|
||||||
List<SysOrg> selectByExample(SysOrgExample example);
|
List<SysOrg> selectByExample(SysOrgExample example);
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ public interface SysEnterpriseMapper extends BaseMapper<SysEnterprise> {
|
||||||
|
|
||||||
int deleteByPrimaryKey(String sysenterpriseid);
|
int deleteByPrimaryKey(String sysenterpriseid);
|
||||||
|
|
||||||
int insert(SysEnterprise record);
|
|
||||||
|
|
||||||
int insertSelective(SysEnterprise record);
|
int insertSelective(SysEnterprise record);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -380,6 +380,30 @@ public class SysEnterprise implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public String getAreaCode() {
|
||||||
|
return areaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAreaCode(String areaCode) {
|
||||||
|
this.areaCode = areaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAreaPath() {
|
||||||
|
return areaPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAreaPath(String areaPath) {
|
||||||
|
this.areaPath = areaPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAreaName() {
|
||||||
|
return areaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAreaName(String areaName) {
|
||||||
|
this.areaName = areaName;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getCheckCount() {
|
public Integer getCheckCount() {
|
||||||
return checkCount;
|
return checkCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,16 +113,6 @@
|
||||||
<include refid="Example_Where_Clause" />
|
<include refid="Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.rzyc.model.SysOrg">
|
|
||||||
insert into SysOrg (OrgCode, OrgName, OrgLevel,charger,
|
|
||||||
SuperiorOrgCode, CreatedBy, CreatedOn,
|
|
||||||
ModifiedBy, ModifiedOn)
|
|
||||||
values (#{orgcode,jdbcType=VARCHAR}, #{orgname,jdbcType=VARCHAR},
|
|
||||||
#{orglevel,jdbcType=INTEGER},
|
|
||||||
#{charger,jdbcType=VARCHAR},
|
|
||||||
#{superiororgcode,jdbcType=VARCHAR}, #{createdby,jdbcType=VARCHAR}, #{createdon,jdbcType=TIMESTAMP},
|
|
||||||
#{modifiedby,jdbcType=VARCHAR}, #{modifiedon,jdbcType=TIMESTAMP})
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.rzyc.model.SysOrg">
|
<insert id="insertSelective" parameterType="com.rzyc.model.SysOrg">
|
||||||
insert into SysOrg
|
insert into SysOrg
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
@ -356,6 +346,9 @@
|
||||||
OrgLevel = #{orglevel,jdbcType=INTEGER},
|
OrgLevel = #{orglevel,jdbcType=INTEGER},
|
||||||
SuperiorOrgCode = #{superiororgcode,jdbcType=VARCHAR},
|
SuperiorOrgCode = #{superiororgcode,jdbcType=VARCHAR},
|
||||||
charger = #{charger,jdbcType=VARCHAR},
|
charger = #{charger,jdbcType=VARCHAR},
|
||||||
|
sort_id = #{sortId,jdbcType=VARCHAR},
|
||||||
|
parent_path = #{parentPath,jdbcType=VARCHAR},
|
||||||
|
parent_name = #{parentName,jdbcType=VARCHAR},
|
||||||
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
|
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
|
||||||
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP}
|
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP}
|
||||||
where OrgCode = #{orgcode,jdbcType=VARCHAR}
|
where OrgCode = #{orgcode,jdbcType=VARCHAR}
|
||||||
|
|
|
||||||
|
|
@ -92,63 +92,7 @@
|
||||||
where SysEnterpriseId = #{sysenterpriseid,jdbcType=VARCHAR}
|
where SysEnterpriseId = #{sysenterpriseid,jdbcType=VARCHAR}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.rzyc.model.ent.SysEnterprise">
|
|
||||||
insert into SysEnterprise (SysEnterpriseId,
|
|
||||||
|
|
||||||
OrgCode,
|
|
||||||
street_code,
|
|
||||||
community_code,
|
|
||||||
net_code,
|
|
||||||
|
|
||||||
SuperiorEnterpriseId,
|
|
||||||
LowOrgCode, EntName,isHide, State,complite,sysUnitId,ManagerDept,dynamicRiskLevel,inherentRisk,manageType,EntType,
|
|
||||||
EntSection, BaseSafeClassId, BaseInClassId,work_class_id,
|
|
||||||
PinYin, Principal,
|
|
||||||
SysAddress,
|
|
||||||
safeTelephone,
|
|
||||||
safeManager,
|
|
||||||
PostCode, EcoType, PersonCount,
|
|
||||||
EntLogoPic, MaleCode, OrgPassNo,
|
|
||||||
LegalRepre, LRIDCard, LRLinkTel,
|
|
||||||
EstablishDate, RiskLevel, Latitude,
|
|
||||||
Longitude, IsBlackList, Comments,
|
|
||||||
ISMaleCode, EntScore, EntHouseNum,
|
|
||||||
CreatedOn, CreatedBy, ModifiedOn,
|
|
||||||
ModifiedBy,qr_code)
|
|
||||||
values (
|
|
||||||
#{sysenterpriseid,jdbcType=VARCHAR},
|
|
||||||
#{orgcode,jdbcType=VARCHAR},
|
|
||||||
#{streetCode,jdbcType=VARCHAR},
|
|
||||||
#{communityCode,jdbcType=VARCHAR},
|
|
||||||
#{netCode,jdbcType=VARCHAR},
|
|
||||||
#{superiorenterpriseid,jdbcType=VARCHAR},
|
|
||||||
#{loworgcode,jdbcType=VARCHAR},
|
|
||||||
#{entname,jdbcType=VARCHAR},
|
|
||||||
#{isHide,jdbcType=VARCHAR},
|
|
||||||
#{state,jdbcType=VARCHAR},
|
|
||||||
#{complite,jdbcType=VARCHAR},
|
|
||||||
#{sysUnitId,jdbcType=VARCHAR},
|
|
||||||
#{managerDept,jdbcType=VARCHAR},
|
|
||||||
#{dynamicRiskLevel,jdbcType=VARCHAR},
|
|
||||||
#{inherentRisk,jdbcType=VARCHAR},
|
|
||||||
#{manageType,jdbcType=VARCHAR},
|
|
||||||
#{enttype,jdbcType=VARCHAR},
|
|
||||||
#{entsection,jdbcType=VARCHAR}, #{basesafeclassid,jdbcType=VARCHAR},
|
|
||||||
#{baseinclassid,jdbcType=VARCHAR},
|
|
||||||
#{workClassId,jdbcType=VARCHAR},
|
|
||||||
#{pinyin,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR},
|
|
||||||
#{sysaddress,jdbcType=VARCHAR},
|
|
||||||
#{safeTelephone,jdbcType=VARCHAR},
|
|
||||||
#{safeManager,jdbcType=VARCHAR},
|
|
||||||
#{postcode,jdbcType=VARCHAR}, #{ecotype,jdbcType=VARCHAR}, #{personcount,jdbcType=INTEGER},
|
|
||||||
#{entlogopic,jdbcType=VARCHAR}, #{malecode,jdbcType=VARCHAR}, #{orgpassno,jdbcType=VARCHAR},
|
|
||||||
#{legalrepre,jdbcType=VARCHAR}, #{lridcard,jdbcType=VARCHAR}, #{lrlinktel,jdbcType=VARCHAR},
|
|
||||||
#{establishdate,jdbcType=TIMESTAMP}, #{risklevel,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
|
|
||||||
#{longitude,jdbcType=VARCHAR}, #{isblacklist,jdbcType=VARCHAR}, #{comments,jdbcType=VARCHAR},
|
|
||||||
#{ismalecode,jdbcType=VARCHAR}, #{entscore,jdbcType=VARCHAR}, #{enthousenum,jdbcType=VARCHAR},
|
|
||||||
#{createdon,jdbcType=TIMESTAMP}, #{createdby,jdbcType=VARCHAR}, #{modifiedon,jdbcType=TIMESTAMP},
|
|
||||||
#{modifiedby,jdbcType=VARCHAR},#{qrCode})
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.rzyc.model.ent.SysEnterprise">
|
<insert id="insertSelective" parameterType="com.rzyc.model.ent.SysEnterprise">
|
||||||
insert into SysEnterprise
|
insert into SysEnterprise
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
@ -586,7 +530,9 @@
|
||||||
street_code = #{streetCode,jdbcType=VARCHAR},
|
street_code = #{streetCode,jdbcType=VARCHAR},
|
||||||
community_code = #{communityCode,jdbcType=VARCHAR},
|
community_code = #{communityCode,jdbcType=VARCHAR},
|
||||||
OrgCode = #{orgcode,jdbcType=VARCHAR},
|
OrgCode = #{orgcode,jdbcType=VARCHAR},
|
||||||
OrgCode = #{orgcode,jdbcType=VARCHAR},
|
area_code = #{areaCode,jdbcType=VARCHAR},
|
||||||
|
area_path = #{areaPath,jdbcType=VARCHAR},
|
||||||
|
area_name = #{areaName,jdbcType=VARCHAR},
|
||||||
SuperiorEnterpriseId = #{superiorenterpriseid,jdbcType=VARCHAR},
|
SuperiorEnterpriseId = #{superiorenterpriseid,jdbcType=VARCHAR},
|
||||||
LowOrgCode = #{loworgcode,jdbcType=VARCHAR},
|
LowOrgCode = #{loworgcode,jdbcType=VARCHAR},
|
||||||
EntName = #{entname,jdbcType=VARCHAR},
|
EntName = #{entname,jdbcType=VARCHAR},
|
||||||
|
|
@ -801,9 +747,7 @@
|
||||||
#{inherentRisk}
|
#{inherentRisk}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
AND (sys.`OrgCode` = #{areaCode}
|
AND FIND_IN_SET(#{areaCode},sys.area_path)
|
||||||
OR sys.`street_code` = #{areaCode}
|
|
||||||
OR sys.`community_code` = #{areaCode})
|
|
||||||
<if test="null != entName and '' != entName">
|
<if test="null != entName and '' != entName">
|
||||||
and sys.EntName like concat('%',#{entName},'%')
|
and sys.EntName like concat('%',#{entName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -2725,7 +2725,7 @@ public class BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户地区id
|
* 获取用户地区idchangeArea
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -868,9 +868,30 @@ public class SettingController extends BaseController{
|
||||||
sysOrg.setModifiedon(new Date());
|
sysOrg.setModifiedon(new Date());
|
||||||
sysOrg.setCreatedon(new Date());
|
sysOrg.setCreatedon(new Date());
|
||||||
|
|
||||||
//计算东区等级
|
|
||||||
if(StringUtils.isNotBlank(sysOrg.getSuperiororgcode())){
|
|
||||||
SysOrg superOrg = sysOrgMapper.selectByPrimaryKey(sysOrg.getSuperiororgcode());
|
if(StringUtils.isNotBlank(sysOrg.getOrgcode())){
|
||||||
|
handleAreaParent(sysOrg.getSuperiororgcode(),sysOrg);
|
||||||
|
sysOrgMapper.changeArea(sysOrg);
|
||||||
|
}else{
|
||||||
|
sysOrg.setOrgcode(RandomNumber.getUUid());
|
||||||
|
handleAreaParent(sysOrg.getSuperiororgcode(),sysOrg);
|
||||||
|
sysOrgMapper.insert(sysOrg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理地区信息
|
||||||
|
* @version v1.0
|
||||||
|
* @author dong
|
||||||
|
* @date 2022/11/1 14:20
|
||||||
|
*/
|
||||||
|
public void handleAreaParent(String superiororgcod,SysOrg sysOrg)throws Exception{
|
||||||
|
//计算地区等级
|
||||||
|
if(StringUtils.isNotBlank(superiororgcod)){
|
||||||
|
SysOrg superOrg = sysOrgMapper.selectById(superiororgcod);
|
||||||
if(null != superOrg){
|
if(null != superOrg){
|
||||||
Integer orgLevel = superOrg.getOrglevel();
|
Integer orgLevel = superOrg.getOrglevel();
|
||||||
orgLevel += 1;
|
orgLevel += 1;
|
||||||
|
|
@ -883,16 +904,6 @@ public class SettingController extends BaseController{
|
||||||
sysOrg.setParentName(sysOrg.getOrgname());
|
sysOrg.setParentName(sysOrg.getOrgname());
|
||||||
sysOrg.setOrglevel(2);
|
sysOrg.setOrglevel(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(sysOrg.getOrgcode())){
|
|
||||||
|
|
||||||
sysOrgMapper.changeArea(sysOrg);
|
|
||||||
}else{
|
|
||||||
sysOrg.setOrgcode(RandomNumber.getUUid());
|
|
||||||
sysOrgMapper.insert(sysOrg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -564,12 +564,16 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
|
||||||
singleResult.setCode(Code.ERROR.getCode());
|
singleResult.setCode(Code.ERROR.getCode());
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getEntAreaCode(sysEnterpriseDo.getAreaCode(),sysEnterprise);
|
||||||
|
|
||||||
sysEnterprise.setCreatedon(new Date());
|
sysEnterprise.setCreatedon(new Date());
|
||||||
sysEnterprise.setModifiedon(new Date());
|
sysEnterprise.setModifiedon(new Date());
|
||||||
sysEnterprise.setSysenterpriseid(RandomNumber.getUUid());
|
sysEnterprise.setSysenterpriseid(RandomNumber.getUUid());
|
||||||
sysEnterprise.setDynamicRiskLevel("100");//新建企业默认100分数
|
sysEnterprise.setDynamicRiskLevel("100");//新建企业默认100分数
|
||||||
sysEnterprise.setQrCode(entQrCode(sysEnterprise.getSysenterpriseid()));
|
sysEnterprise.setQrCode(entQrCode(sysEnterprise.getSysenterpriseid()));
|
||||||
result = sysEnterpriseMapper.insert(sysEnterprise);
|
sysEnterpriseMapper.insert(sysEnterprise);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
SysEnterprise verifyEnterprise = sysEnterpriseMapper.selectByName(sysEnterpriseDo.getEntname(),sysEnterpriseDo.getSysenterpriseid());
|
SysEnterprise verifyEnterprise = sysEnterpriseMapper.selectByName(sysEnterpriseDo.getEntname(),sysEnterpriseDo.getSysenterpriseid());
|
||||||
|
|
@ -585,8 +589,10 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
|
||||||
sysEnterprise.setQrCode(entQrCode(sysEnterprise.getSysenterpriseid()));
|
sysEnterprise.setQrCode(entQrCode(sysEnterprise.getSysenterpriseid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getEntAreaCode(sysEnterpriseDo.getAreaCode(),sysEnterprise);
|
||||||
|
|
||||||
sysEnterprise.setModifiedon(new Date());
|
sysEnterprise.setModifiedon(new Date());
|
||||||
result = sysEnterpriseMapper.updateByPrimaryKey(sysEnterprise);
|
sysEnterpriseMapper.updateByPrimaryKey(sysEnterprise);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -596,17 +602,28 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
|
||||||
//创建或者修改企业用户
|
//创建或者修改企业用户
|
||||||
createEntUser(sysEnterprise,sysUser.getChinaname(),sysUser);
|
createEntUser(sysEnterprise,sysUser.getChinaname(),sysUser);
|
||||||
|
|
||||||
if (result > 0){
|
|
||||||
singleResult.setMessage(Message.SUCCESS);
|
|
||||||
singleResult.setCode(Code.SUCCESS.getCode());
|
|
||||||
}else {
|
|
||||||
singleResult.setMessage(Message.ERROR);
|
|
||||||
singleResult.setCode(Code.ERROR.getCode());
|
|
||||||
}
|
|
||||||
|
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理企业地区信息
|
||||||
|
* @version v1.0
|
||||||
|
* @author dong
|
||||||
|
* @date 2022/11/1 14:40
|
||||||
|
*/
|
||||||
|
public void getEntAreaCode(String areaCode,SysEnterprise enterprise)throws Exception{
|
||||||
|
if(StringUtils.isNotBlank(areaCode)){
|
||||||
|
SysOrg sysOrg = sysOrgMapper.selectById(areaCode);
|
||||||
|
if(null != sysOrg){
|
||||||
|
enterprise.setAreaCode(areaCode);
|
||||||
|
enterprise.setAreaPath(sysOrg.getParentPath());
|
||||||
|
enterprise.setAreaName(sysOrg.getParentName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user