101captain
2022-02-22 c83cf9d2d82a0a29a15e38f4566eb470b9a3517b
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;
@@ -45,6 +42,8 @@
    private ComActSocialOrgDao comActSocialOrgMapper;
    @Resource
    private ComActDAO comActDAO;
    @Resource
    private ComActActivityDAO comActActivityDAO;
    /**
     * 新增社工
     * @param comActSocialWorkerAddDTO
@@ -127,18 +126,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 +140,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 +163,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()));
    }
}