| | |
| | | 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; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private ComActSocialOrgDao comActSocialOrgMapper; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | /** |
| | | * 新增社工 |
| | | * @param comActSocialWorkerAddDTO |
| | |
| | | ComActSocialWorker comActSocialWorkerDO = new ComActSocialWorker(); |
| | | BeanUtils.copyProperties(comActSocialWorkerAddDTO, comActSocialWorkerDO); |
| | | comActSocialWorkerDO.setCreateBy(comActSocialWorkerAddDTO.getUserId()); |
| | | comActSocialWorkerDO.setCreateAt(new Date()); |
| | | if(comActSocialWorkerMapper.insert(comActSocialWorkerDO)>0){ |
| | | return R.ok(); |
| | | } |
| | |
| | | * @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 |
| | |
| | | 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){ |
| | |
| | | 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); |
| | |
| | | |
| | | 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())); |
| | | } |
| | | } |