Browse Source

系统用户绑定产品网格员功能

feature/screenDataPush
liuchuang 4 years ago
parent
commit
512dd40658
  1. 13
      esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/controller/SysEpmetUserRelationController.java
  2. 21
      esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/dao/SysEpmetUserRelationDao.java
  3. 10
      esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/service/SysEpmetUserRelationService.java
  4. 19
      esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/service/impl/SysEpmetUserRelationServiceImpl.java
  5. 8
      esua-epdc/epdc-admin/epdc-admin-epmet/src/main/resources/mapper/SysEpmetUserRelationDao.xml
  6. 9
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml

13
esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/controller/SysEpmetUserRelationController.java

@ -124,17 +124,4 @@ public class SysEpmetUserRelationController {
return sysEpmetUserRelationService.bindSysUserWithEpmetUser(formDto); return sysEpmetUserRelationService.bindSysUserWithEpmetUser(formDto);
} }
/**
* 解除当前用户已绑定的产品工作人员信息
*
* @param formDto 产品工作人员信息
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2021/7/8 16:49
*/
@PostMapping("unbindepmetuser")
public Result unbindEpmetUser(@RequestBody SysEpmetUserRelationDTO formDto) {
return sysEpmetUserRelationService.unbindSysUserWithEpmetUser(formDto);
}
} }

21
esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/dao/SysEpmetUserRelationDao.java

@ -18,6 +18,7 @@
package com.elink.esua.epdc.epmet.modules.userrelation.dao; package com.elink.esua.epdc.epmet.modules.userrelation.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.SysUserDTO;
import com.elink.esua.epdc.epmet.modules.userrelation.dto.SysEpmetUserRelationDTO; import com.elink.esua.epdc.epmet.modules.userrelation.dto.SysEpmetUserRelationDTO;
import com.elink.esua.epdc.epmet.modules.userrelation.entity.SysEpmetUserRelationEntity; import com.elink.esua.epdc.epmet.modules.userrelation.entity.SysEpmetUserRelationEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -40,4 +41,24 @@ public interface SysEpmetUserRelationDao extends BaseDao<SysEpmetUserRelationEnt
* @since 2021/7/8 17:04 * @since 2021/7/8 17:04
*/ */
SysEpmetUserRelationEntity selectSysUserRelationEpmetInfo(Long id); SysEpmetUserRelationEntity selectSysUserRelationEpmetInfo(Long id);
/**
* 根据手机号获取系统用户
*
* @param mobile 手机号
* @return com.elink.esua.epdc.dto.SysUserDTO
* @author liuchuang
* @since 2021/7/10 14:13
*/
SysUserDTO selectSysUserInfoByMobile(String mobile);
/**
* 删除已绑定网格员信息
*
* @param id 系统用户ID
* @return void
* @author liuchuang
* @since 2021/7/10 14:29
*/
void deleteRelationInfoBySysUserId(Long id);
} }

10
esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/service/SysEpmetUserRelationService.java

@ -123,14 +123,4 @@ public interface SysEpmetUserRelationService extends BaseService<SysEpmetUserRel
* @since 2021/7/8 17:09 * @since 2021/7/8 17:09
*/ */
Result bindSysUserWithEpmetUser(SysEpmetUserRelationDTO formDto); Result bindSysUserWithEpmetUser(SysEpmetUserRelationDTO formDto);
/**
* 解除当前用户已绑定的产品工作人员信息
*
* @param formDto 产品工作人员信息
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2021/7/8 17:12
*/
Result unbindSysUserWithEpmetUser(SysEpmetUserRelationDTO formDto);
} }

19
esua-epdc/epdc-admin/epdc-admin-epmet/src/main/java/com/elink/esua/epdc/epmet/modules/userrelation/service/impl/SysEpmetUserRelationServiceImpl.java

@ -20,10 +20,12 @@ package com.elink.esua.epdc.epmet.modules.userrelation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.SysUserDTO;
import com.elink.esua.epdc.dto.admin.SysEpmetUserFormDTO; import com.elink.esua.epdc.dto.admin.SysEpmetUserFormDTO;
import com.elink.esua.epdc.dto.admin.SysEpmetUserResultDTO; import com.elink.esua.epdc.dto.admin.SysEpmetUserResultDTO;
import com.elink.esua.epdc.epmet.modules.feign.EpmetAnalysisFeignClient; import com.elink.esua.epdc.epmet.modules.feign.EpmetAnalysisFeignClient;
@ -125,12 +127,19 @@ public class SysEpmetUserRelationServiceImpl extends BaseServiceImpl<SysEpmetUse
@Override @Override
public Result bindSysUserWithEpmetUser(SysEpmetUserRelationDTO formDto) { public Result bindSysUserWithEpmetUser(SysEpmetUserRelationDTO formDto) {
return null; // 获取系统工作人员ID
} SysUserDTO sysUser = baseDao.selectSysUserInfoByMobile(formDto.getMobile());
if (null == sysUser) {
throw new RenException("查询用户信息失败");
}
formDto.setSysUserId(sysUser.getId());
// 删除已绑定网格员信息
baseDao.deleteRelationInfoBySysUserId(sysUser.getId());
if (StringUtils.isNotEmpty(formDto.getId())) {
insert(ConvertUtils.sourceToTarget(formDto, SysEpmetUserRelationEntity.class));
}
@Override return new Result();
public Result unbindSysUserWithEpmetUser(SysEpmetUserRelationDTO formDto) {
return null;
} }
} }

8
esua-epdc/epdc-admin/epdc-admin-epmet/src/main/resources/mapper/SysEpmetUserRelationDao.xml

@ -7,4 +7,12 @@
SELECT * FROM sys_epmet_user_relation WHERE DEL_FLAG = '0' AND SYS_USER_ID = #{id} SELECT * FROM sys_epmet_user_relation WHERE DEL_FLAG = '0' AND SYS_USER_ID = #{id}
</select> </select>
<select id="selectSysUserInfoByMobile" resultType="com.elink.esua.epdc.dto.SysUserDTO">
SELECT * FROM sys_user WHERE DEL_FLAG = 0 AND mobile = #{mobile}
</select>
<delete id="deleteRelationInfoBySysUserId">
DELETE FROM sys_epmet_user_relation WHERE SYS_USER_ID = #{id}
</delete>
</mapper> </mapper>

9
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml

@ -136,10 +136,11 @@
<nacos.server-addr>47.105.119.155:8848</nacos.server-addr> <nacos.server-addr>47.105.119.155:8848</nacos.server-addr>
<nacos.ip></nacos.ip> <nacos.ip></nacos.ip>
<nacos.namespace>1da17390-6495-4e16-9ec6-0b8ece18a4a0</nacos.namespace> <nacos.namespace>1da17390-6495-4e16-9ec6-0b8ece18a4a0</nacos.namespace>
<epmet.url>https://epmet-dev.elinkservice.cn/api</epmet.url>
<epmet.secret>0398b33f845c4768a102d2ab6ebdd00b5fec222e437540428f55d1df53e6be1e</epmet.secret> <epmet.url>http://192.168.1.140/api</epmet.url>
<epmet.appId>d44a6daaea58be408bb74fe93714710f</epmet.appId> <epmet.secret>d2c011b14217425eb48e27cf6481716ae845cff14cc0429198a8348c76893023</epmet.secret>
<epmet.customerId>f5ff0770f409981c73adda6ae35143ef</epmet.customerId> <epmet.appId>c1fe1becebf94b8aef724728690816a0</epmet.appId>
<epmet.customerId>eac9d3b8b10c328350b59ac4b1d64db5</epmet.customerId>
</properties> </properties>
</profile> </profile>

Loading…
Cancel
Save