101captain
2022-06-06 560db6a1036201e7e2ac50f34ad4a418f17eaba6
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialWorkerServiceImpl.java
@@ -10,12 +10,9 @@
import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO;
import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComActSocialOrgDao;
import com.panzhihua.service_community.dao.ComStreetDAO;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.entity.ComActSocialOrg;
import com.panzhihua.service_community.entity.ComActSocialWorker;
import com.panzhihua.service_community.dao.ComActSocialWorkerDao;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.ComActSocialWorkerService;
@@ -26,6 +23,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -45,6 +43,8 @@
    private ComActSocialOrgDao comActSocialOrgMapper;
    @Resource
    private ComActDAO comActDAO;
    @Resource
    private ComActActivityDAO comActActivityDAO;
    /**
     * 新增社工
     * @param comActSocialWorkerAddDTO
@@ -55,6 +55,7 @@
        ComActSocialWorker comActSocialWorkerDO = new ComActSocialWorker();
        BeanUtils.copyProperties(comActSocialWorkerAddDTO, comActSocialWorkerDO);
        comActSocialWorkerDO.setCreateBy(comActSocialWorkerAddDTO.getUserId());
        comActSocialWorkerDO.setCreateAt(new Date());
        if(comActSocialWorkerMapper.insert(comActSocialWorkerDO)>0){
            return R.ok();
        }
@@ -110,14 +111,9 @@
     * @return 查找结果
     */
    @Override
    public R<ComActSocialWorkerDetailsVO> comActSocialWorkerDetails(Long id){
        ComActSocialWorker comActSocialWorkerDO = comActSocialWorkerMapper.selectById(id);
        if(comActSocialWorkerDO!=null) {
            ComActSocialWorkerDetailsVO comActSocialWorkerDetailsVO = new ComActSocialWorkerDetailsVO();
            BeanUtils.copyProperties(comActSocialWorkerDO, comActSocialWorkerDetailsVO);
            return R.ok(comActSocialWorkerDetailsVO);
        }
        return R.fail();
    public R<ComActSocialWorkerVO> comActSocialWorkerDetails(Long id){
        ComActSocialWorkerVO comActSocialWorkerDO = comActSocialWorkerMapper.selectOneById(id);
        return R.ok(comActSocialWorkerDO);
    }
    @Override
@@ -127,18 +123,6 @@
            for(ComActSocialWorkerExcelVO comActSocialWorkerExcelVO:lis) {
                ComActSocialWorker comActSocialWorkerDO = new ComActSocialWorker();
                BeanUtils.copyProperties(comActSocialWorkerExcelVO,comActSocialWorkerDO);
                if (StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getStreetId())) {
                    ComStreetDO comStreetDO=comStreetDAO.selectOne(new QueryWrapper<ComStreetDO>().eq("name",comActSocialWorkerExcelVO.getStreetId()));
                    if(comStreetDO!=null){
                        comActSocialWorkerDO.setStreetId(comStreetDO.getStreetId());
                    }
                }
                if (StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getSocialOrgId())) {
                    ComActSocialOrg comActSocialOrgDO=comActSocialOrgMapper.selectOne(new QueryWrapper<ComActSocialOrg>().eq("name",comActSocialWorkerExcelVO.getSocialOrgId()));
                    if(comActSocialOrgDO!=null){
                        comActSocialWorkerDO.setSocialOrgId(comActSocialOrgDO.getId());
                    }
                }
                if(StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getCommunityId())){
                    ComActDO comActDO= comActDAO.selectOne(new QueryWrapper<ComActDO>().eq("name",comActSocialWorkerExcelVO.getCommunityId()));
                    if(comActDO!=null){
@@ -153,6 +137,22 @@
                        comActSocialWorkerDO.setGen(0);
                    }
                }
                if(StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getCredential())){
                    if("是".equals(comActSocialWorkerExcelVO.getCredential())){
                        comActSocialWorkerDO.setCredential(1);
                    }
                    else {
                        comActSocialWorkerDO.setCredential(0);
                    }
                }
                if(StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getCredential())){
                    if("是".equals(comActSocialWorkerExcelVO.getCredential())){
                        comActSocialWorkerDO.setCredential(1);
                    }
                    else {
                        comActSocialWorkerDO.setCredential(0);
                    }
                }
                list.add(comActSocialWorkerDO);
            }
            this.saveBatch(list);
@@ -160,4 +160,14 @@
        return R.ok();
    }
    @Override
    public R activity(CommonPage commonPage) {
        return R.ok(comActSocialWorkerMapper.selectActivity(new Page(commonPage.getPage(),commonPage.getSize()),commonPage.getParamId()));
    }
    @Override
    public R activityList(CommonPage commonPage) {
        return R.ok(comActActivityDAO.selectActivityBySocialWorker(new Page(commonPage.getPage(),commonPage.getSize()),commonPage.getParamId()));
    }
}