findyguo
2021-03-03 8bb0a52f33f71836c015e9a28b26fc8e35b3f5a7
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java
@@ -213,18 +213,10 @@
     */
    @Override
    public R addPartyCommittee(PartyCommitteeVO partyCommitteeVO) {
        Long partyMemberId = partyCommitteeVO.getPartyMemberId();
        if (null==partyMemberId||0==partyMemberId) {
            return R.fail("党员id不能为空");
        }
        ComPbMemberRoleDO comPbMemberRoleDO1 = comPbMemberRoleDAO.selectOne(new QueryWrapper<ComPbMemberRoleDO>().lambda().eq(ComPbMemberRoleDO::getMemberId, partyMemberId));
        if (!ObjectUtils.isEmpty(comPbMemberRoleDO1)) {
            return R.fail("党员身份已经存在");
        }
        ComPbMemberRoleDO comPbMemberRoleDO=new ComPbMemberRoleDO();
        comPbMemberRoleDO.setCommunityId(partyCommitteeVO.getCommunityId());
        comPbMemberRoleDO.setMemberId(partyMemberId);
        comPbMemberRoleDO.setRoleId(partyCommitteeVO.getRoleId());
        BeanUtils.copyProperties(partyCommitteeVO,comPbMemberRoleDO);
        comPbMemberRoleDO.setCreateAt(new Date());
        comPbMemberRoleDO.setUpdateAt(new Date());
        int insert = comPbMemberRoleDAO.insert(comPbMemberRoleDO);
        if (insert>0) {
            return R.ok();
@@ -241,10 +233,10 @@
    @Override
    public R updatePartyCommittee(PartyCommitteeVO partyCommitteeVO) {
        ComPbMemberRoleDO comPbMemberRoleDO=new ComPbMemberRoleDO();
        comPbMemberRoleDO.setCommunityId(partyCommitteeVO.getCommunityId());
        comPbMemberRoleDO.setMemberId(partyCommitteeVO.getPartyMemberId());
        comPbMemberRoleDO.setRoleId(partyCommitteeVO.getRoleId());
        comPbMemberRoleDO.setId(partyCommitteeVO.getId());
        BeanUtils.copyProperties(partyCommitteeVO,comPbMemberRoleDO);
        ComPbMemberRoleDO comPbMemberRoleDOOld = comPbMemberRoleDAO.selectById(partyCommitteeVO.getId());
        comPbMemberRoleDO.setCreateAt(comPbMemberRoleDOOld.getCreateAt());
        comPbMemberRoleDO.setUpdateAt(new Date());
        int update = comPbMemberRoleDAO.updateById(comPbMemberRoleDO);
        if (update>0) {
            return R.ok();