功能提交

This commit is contained in:
wans 2020-10-22 14:27:27 +08:00
parent 2bba275ad2
commit 4d91dd5307
23 changed files with 3614 additions and 0 deletions

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.advancedmodel;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.advancedmodel.AdvancedModelDTO;
import com.cm.partybuilding.pojo.vos.advancedmodel.AdvancedModelVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IAdvancedModelService
* @Description: 先进典型
* @Author: WenG
* @Date: 2020-10-19 11:24
* @Version: 1.0
**/
public interface IAdvancedModelService {
/**
* 新增先进典型
*
* @param advancedModelVO
* @return
* @throws Exception
*/
SuccessResult saveAdvancedModel(AdvancedModelVO advancedModelVO) throws Exception;
/**
* 新增先进典型(APP)
*
* @param token
* @param advancedModelVO
* @return
* @throws Exception
*/
SuccessResult saveAdvancedModelByToken(String token, AdvancedModelVO advancedModelVO) throws Exception;
/**
* 新增先进典型
*
* @param advancedModelVO
* @return advancedModelId
* @throws Exception
*/
String saveAdvancedModelReturnId(AdvancedModelVO advancedModelVO) throws Exception;
/**
* 新增先进典型(APP)
*
* @param token
* @param advancedModelVO
* @return advancedModelId
* @throws Exception
*/
String saveAdvancedModelByTokenReturnId(String token, AdvancedModelVO advancedModelVO) throws Exception;
/**
* 删除先进典型
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeAdvancedModel(String ids) throws RemoveException;
/**
* 删除先进典型物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteAdvancedModel(String ids) throws RemoveException;
/**
* 删除先进典型(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeAdvancedModelByToken(String token, String ids) throws RemoveException;
/**
* 修改先进典型
*
* @param advancedModelId
* @param advancedModelVO
* @return
* @throws Exception
*/
SuccessResult updateAdvancedModel(String advancedModelId, AdvancedModelVO advancedModelVO) throws Exception;
/**
* 修改先进典型(APP)
*
* @param token
* @param advancedModelId
* @param advancedModelVO
* @return
* @throws Exception
*/
SuccessResult updateAdvancedModelByToken(String token, String advancedModelId, AdvancedModelVO advancedModelVO) throws Exception;
/**
* 先进典型详情(通过ID)
*
* @param advancedModelId
* @return
* @throws SearchException
*/
AdvancedModelDTO getAdvancedModelById(String advancedModelId) throws SearchException;
/**
* 先进典型列表
*
* @param params
* @return
* @throws SearchException
*/
List<AdvancedModelDTO> listAdvancedModel(Map<String, Object> params) throws SearchException;
/**
* 先进典型分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<AdvancedModelDTO>> listPageAdvancedModel(ListPage page) throws SearchException;
/**
* 先进典型统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberAdvancedModel(Map<String, Object> params) throws SearchException;
/**
* 先进典型统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countAdvancedModel(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.advancedmodel.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.advancedmodel.IAdvancedModelDao;
import com.cm.partybuilding.pojo.dtos.advancedmodel.AdvancedModelDTO;
import com.cm.partybuilding.pojo.vos.advancedmodel.AdvancedModelVO;
import com.cm.partybuilding.service.advancedmodel.IAdvancedModelService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: AdvancedModelServiceImpl
* @Description: 先进典型
* @Author: WenG
* @Date: 2020-10-19 11:24
* @Version: 1.0
**/
@Service
public class AdvancedModelServiceImpl extends AbstractService implements IAdvancedModelService {
@Autowired
private IAdvancedModelDao advancedModelDao;
@Override
public SuccessResult saveAdvancedModel(AdvancedModelVO advancedModelVO) throws Exception {
saveAdvancedModelInfo(null, advancedModelVO);
return new SuccessResult();
}
@Override
public SuccessResult saveAdvancedModelByToken(String token, AdvancedModelVO advancedModelVO) throws Exception {
saveAdvancedModelInfo(token, advancedModelVO);
return new SuccessResult();
}
@Override
public String saveAdvancedModelReturnId(AdvancedModelVO advancedModelVO) throws Exception {
return saveAdvancedModelInfoReturnId(null, advancedModelVO);
}
@Override
public String saveAdvancedModelByTokenReturnId(String token, AdvancedModelVO advancedModelVO) throws Exception {
return saveAdvancedModelInfoReturnId(token, advancedModelVO);
}
/**
* 新增先进典型
*
* @param token
* @param advancedModelVO
* @throws Exception
*/
private void saveAdvancedModelInfo(String token, AdvancedModelVO advancedModelVO) throws Exception {
saveAdvancedModelInfoReturnId(token, advancedModelVO);
}
/**
* 新增先进典型
*
* @param token
* @param advancedModelVO
* @return advancedModelId
* @throws Exception
*/
private String saveAdvancedModelInfoReturnId(String token, AdvancedModelVO advancedModelVO) throws Exception {
String advancedModelId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(advancedModelVO);
params.put("advancedModelId", advancedModelId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
advancedModelDao.saveAdvancedModel(params);
return advancedModelId;
}
@Override
public SuccessResult removeAdvancedModel(String ids) throws RemoveException {
removeAdvancedModelInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeAdvancedModelByToken(String token, String ids) throws RemoveException {
removeAdvancedModelInfo(token, ids);
return new SuccessResult();
}
/**
* 删除先进典型
*
* @param token
* @param ids
*/
private void removeAdvancedModelInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("advancedModelIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
advancedModelDao.removeAdvancedModel(params);
}
@Override
public void deleteAdvancedModel(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("advancedModelIds", Arrays.asList(ids.split("_")));
advancedModelDao.deleteAdvancedModel(params);
}
@Override
public SuccessResult updateAdvancedModel(String advancedModelId, AdvancedModelVO advancedModelVO) throws Exception {
updateAdvancedModelInfo(null, advancedModelId, advancedModelVO);
return new SuccessResult();
}
@Override
public SuccessResult updateAdvancedModelByToken(String token, String advancedModelId, AdvancedModelVO advancedModelVO) throws Exception {
updateAdvancedModelInfo(token, advancedModelId, advancedModelVO);
return new SuccessResult();
}
/**
* 修改先进典型
*
* @param token
* @param advancedModelId
* @param advancedModelVO
*/
private void updateAdvancedModelInfo(String token, String advancedModelId, AdvancedModelVO advancedModelVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(advancedModelVO);
params.put("advancedModelId", advancedModelId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
advancedModelDao.updateAdvancedModel(params);
}
@Override
public AdvancedModelDTO getAdvancedModelById(String advancedModelId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("advancedModelId", advancedModelId);
return advancedModelDao.getAdvancedModel(params);
}
@Override
public List<AdvancedModelDTO> listAdvancedModel(Map<String, Object> params) throws SearchException {
return advancedModelDao.listAdvancedModel(params);
}
@Override
public SuccessResultList<List<AdvancedModelDTO>> listPageAdvancedModel(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<AdvancedModelDTO> advancedModelDTOs = advancedModelDao.listAdvancedModel(page.getParams());
PageInfo<AdvancedModelDTO> pageInfo = new PageInfo<>(advancedModelDTOs);
return new SuccessResultList<>(advancedModelDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberAdvancedModel(Map<String, Object> params) throws SearchException {
Integer count = advancedModelDao.countAdvancedModel(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countAdvancedModel(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberAdvancedModel(params));
}
}

View File

@ -0,0 +1,163 @@
package com.cm.partybuilding.service.countryhistorycatalog;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.pojo.dtos.ZTreeDTO;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.countryhistorycatalog.CountryHistoryCatalogDTO;
import com.cm.partybuilding.pojo.vos.countryhistorycatalog.CountryHistoryCatalogVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ICountryHistoryCatalogService
* @Description: 党史国史党建咨询目录
* @Author: WenG
* @Date: 2020-10-21 17:18
* @Version: 1.0
**/
public interface ICountryHistoryCatalogService {
/**
* 新增党史国史党建咨询目录
*
* @param countryHistoryCatalogVO
* @return
* @throws Exception
*/
SuccessResult saveCountryHistoryCatalog(CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception;
/**
* 新增党史国史党建咨询目录(APP)
*
* @param token
* @param countryHistoryCatalogVO
* @return
* @throws Exception
*/
SuccessResult saveCountryHistoryCatalogByToken(String token, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception;
/**
* 新增党史国史党建咨询目录
*
* @param countryHistoryCatalogVO
* @return countryHistoryCatalogId
* @throws Exception
*/
String saveCountryHistoryCatalogReturnId(CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception;
/**
* 新增党史国史党建咨询目录(APP)
*
* @param token
* @param countryHistoryCatalogVO
* @return countryHistoryCatalogId
* @throws Exception
*/
String saveCountryHistoryCatalogByTokenReturnId(String token, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception;
/**
* 删除党史国史党建咨询目录
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeCountryHistoryCatalog(String ids) throws RemoveException;
/**
* 删除党史国史党建咨询目录物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteCountryHistoryCatalog(String ids) throws RemoveException;
/**
* 删除党史国史党建咨询目录(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeCountryHistoryCatalogByToken(String token, String ids) throws RemoveException;
/**
* 修改党史国史党建咨询目录
*
* @param countryHistoryCatalogId
* @param countryHistoryCatalogVO
* @return
* @throws Exception
*/
SuccessResult updateCountryHistoryCatalog(String countryHistoryCatalogId, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception;
/**
* 修改党史国史党建咨询目录(APP)
*
* @param token
* @param countryHistoryCatalogId
* @param countryHistoryCatalogVO
* @return
* @throws Exception
*/
SuccessResult updateCountryHistoryCatalogByToken(String token, String countryHistoryCatalogId, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception;
/**
* 党史国史党建咨询目录详情(通过ID)
*
* @param countryHistoryCatalogId
* @return
* @throws SearchException
*/
CountryHistoryCatalogDTO getCountryHistoryCatalogById(String countryHistoryCatalogId) throws SearchException;
/**
* 党史国史党建咨询目录列表
*
* @param params
* @return
* @throws SearchException
*/
List<CountryHistoryCatalogDTO> listCountryHistoryCatalog(Map<String, Object> params) throws SearchException;
/**
* 党史国史党建咨询目录分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<CountryHistoryCatalogDTO>> listPageCountryHistoryCatalog(ListPage page) throws SearchException;
/**
* 党史国史党建咨询目录统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberCountryHistoryCatalog(Map<String, Object> params) throws SearchException;
/**
* 党史国史党建咨询目录统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countCountryHistoryCatalog(Map<String, Object> params) throws SearchException;
/**
* zTree
* @param params
* @return
*/
List<ZTreeDTO> listZTreeCatalog(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,219 @@
package com.cm.partybuilding.service.countryhistorycatalog.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.pojo.dtos.ZTreeDTO;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.countryhistorycatalog.ICountryHistoryCatalogDao;
import com.cm.partybuilding.pojo.dtos.countryhistorycatalog.CountryHistoryCatalogDTO;
import com.cm.partybuilding.pojo.vos.countryhistorycatalog.CountryHistoryCatalogVO;
import com.cm.partybuilding.service.countryhistorycatalog.ICountryHistoryCatalogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: CountryHistoryCatalogServiceImpl
* @Description: 党史国史党建咨询目录
* @Author: WenG
* @Date: 2020-10-21 17:18
* @Version: 1.0
**/
@Service
public class CountryHistoryCatalogServiceImpl extends AbstractService implements ICountryHistoryCatalogService {
@Autowired
private ICountryHistoryCatalogDao countryHistoryCatalogDao;
@Override
public SuccessResult saveCountryHistoryCatalog(CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
saveCountryHistoryCatalogInfo(null, countryHistoryCatalogVO);
return new SuccessResult();
}
@Override
public SuccessResult saveCountryHistoryCatalogByToken(String token, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
saveCountryHistoryCatalogInfo(token, countryHistoryCatalogVO);
return new SuccessResult();
}
@Override
public String saveCountryHistoryCatalogReturnId(CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
return saveCountryHistoryCatalogInfoReturnId(null, countryHistoryCatalogVO);
}
@Override
public String saveCountryHistoryCatalogByTokenReturnId(String token, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
return saveCountryHistoryCatalogInfoReturnId(token, countryHistoryCatalogVO);
}
/**
* 新增党史国史党建咨询目录
*
* @param token
* @param countryHistoryCatalogVO
* @throws Exception
*/
private void saveCountryHistoryCatalogInfo(String token, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
saveCountryHistoryCatalogInfoReturnId(token, countryHistoryCatalogVO);
}
/**
* 新增党史国史党建咨询目录
*
* @param token
* @param countryHistoryCatalogVO
* @return countryHistoryCatalogId
* @throws Exception
*/
private String saveCountryHistoryCatalogInfoReturnId(String token, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
String countryHistoryCatalogId = UUIDUtil.getUUID();
String parentAutoCode = null;
String parentCatalogId = countryHistoryCatalogVO.getParentCatalogId();
if(!StringUtils.isEmpty(parentCatalogId) && !ISystemConstant.TREE_BASE_ROOT_ID_VALUE.equals(parentCatalogId)){
CountryHistoryCatalogDTO dto = getCountryHistoryCatalogById(parentCatalogId);
parentAutoCode = dto.getAutoCode();
}
String autoCode = getAutoCode(parentAutoCode,parentCatalogId);
Map<String, Object> params = HashMapUtil.beanToMap(countryHistoryCatalogVO);
params.put("countryHistoryCatalogId", countryHistoryCatalogId);
params.put("autoCode",autoCode);
int levels = autoCode.length() / 4;
params.put("levels",levels + "");
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
countryHistoryCatalogDao.saveCountryHistoryCatalog(params);
return countryHistoryCatalogId;
}
private String getAutoCode(String parentAutoCode, String parentCatalogId) throws SearchException{
CountryHistoryCatalogDTO dto = countryHistoryCatalogDao.getLastByParentId(parentCatalogId);
String code = dto != null ? dto.getAutoCode() : "0000";
return super.getNewCode(code,parentAutoCode);
}
@Override
public SuccessResult removeCountryHistoryCatalog(String ids) throws RemoveException {
removeCountryHistoryCatalogInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeCountryHistoryCatalogByToken(String token, String ids) throws RemoveException {
removeCountryHistoryCatalogInfo(token, ids);
return new SuccessResult();
}
/**
* 删除党史国史党建咨询目录
*
* @param token
* @param ids
*/
private void removeCountryHistoryCatalogInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("countryHistoryCatalogIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
countryHistoryCatalogDao.removeCountryHistoryCatalog(params);
}
@Override
public void deleteCountryHistoryCatalog(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("countryHistoryCatalogIds", Arrays.asList(ids.split("_")));
countryHistoryCatalogDao.deleteCountryHistoryCatalog(params);
}
@Override
public SuccessResult updateCountryHistoryCatalog(String countryHistoryCatalogId, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
updateCountryHistoryCatalogInfo(null, countryHistoryCatalogId, countryHistoryCatalogVO);
return new SuccessResult();
}
@Override
public SuccessResult updateCountryHistoryCatalogByToken(String token, String countryHistoryCatalogId, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
updateCountryHistoryCatalogInfo(token, countryHistoryCatalogId, countryHistoryCatalogVO);
return new SuccessResult();
}
/**
* 修改党史国史党建咨询目录
*
* @param token
* @param countryHistoryCatalogId
* @param countryHistoryCatalogVO
*/
private void updateCountryHistoryCatalogInfo(String token, String countryHistoryCatalogId, CountryHistoryCatalogVO countryHistoryCatalogVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(countryHistoryCatalogVO);
params.put("countryHistoryCatalogId", countryHistoryCatalogId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
countryHistoryCatalogDao.updateCountryHistoryCatalog(params);
}
@Override
public CountryHistoryCatalogDTO getCountryHistoryCatalogById(String countryHistoryCatalogId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("countryHistoryCatalogId", countryHistoryCatalogId);
return countryHistoryCatalogDao.getCountryHistoryCatalog(params);
}
@Override
public List<CountryHistoryCatalogDTO> listCountryHistoryCatalog(Map<String, Object> params) throws SearchException {
return countryHistoryCatalogDao.listCountryHistoryCatalog(params);
}
@Override
public SuccessResultList<List<CountryHistoryCatalogDTO>> listPageCountryHistoryCatalog(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<CountryHistoryCatalogDTO> countryHistoryCatalogDTOs = countryHistoryCatalogDao.listCountryHistoryCatalog(page.getParams());
PageInfo<CountryHistoryCatalogDTO> pageInfo = new PageInfo<>(countryHistoryCatalogDTOs);
return new SuccessResultList<>(countryHistoryCatalogDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberCountryHistoryCatalog(Map<String, Object> params) throws SearchException {
Integer count = countryHistoryCatalogDao.countCountryHistoryCatalog(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countCountryHistoryCatalog(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberCountryHistoryCatalog(params));
}
@Override
public List<ZTreeDTO> listZTreeCatalog(Map<String, Object> params) throws SearchException {
List<ZTreeDTO> zTreeDTOs = countryHistoryCatalogDao.listZTreeCatalog(params);
for (ZTreeDTO zTreeDTO : zTreeDTOs) {
Map<String, Object> query = getHashMap(4);
query.put("parentCatalogId",zTreeDTO.getId());
Integer subCount = countryHistoryCatalogDao.countCountryHistoryCatalog(query);
setZTreeInfo(zTreeDTO, subCount);
}
return zTreeDTOs;
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.countryhistorycontent;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.countryhistorycontent.CountryHistoryContentDTO;
import com.cm.partybuilding.pojo.vos.countryhistorycontent.CountryHistoryContentVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ICountryHistoryContentService
* @Description: 党史国史党建咨询内容
* @Author: WenG
* @Date: 2020-10-22 12:05
* @Version: 1.0
**/
public interface ICountryHistoryContentService {
/**
* 新增党史国史党建咨询内容
*
* @param countryHistoryContentVO
* @return
* @throws Exception
*/
SuccessResult saveCountryHistoryContent(CountryHistoryContentVO countryHistoryContentVO) throws Exception;
/**
* 新增党史国史党建咨询内容(APP)
*
* @param token
* @param countryHistoryContentVO
* @return
* @throws Exception
*/
SuccessResult saveCountryHistoryContentByToken(String token, CountryHistoryContentVO countryHistoryContentVO) throws Exception;
/**
* 新增党史国史党建咨询内容
*
* @param countryHistoryContentVO
* @return countryHistoryContentId
* @throws Exception
*/
String saveCountryHistoryContentReturnId(CountryHistoryContentVO countryHistoryContentVO) throws Exception;
/**
* 新增党史国史党建咨询内容(APP)
*
* @param token
* @param countryHistoryContentVO
* @return countryHistoryContentId
* @throws Exception
*/
String saveCountryHistoryContentByTokenReturnId(String token, CountryHistoryContentVO countryHistoryContentVO) throws Exception;
/**
* 删除党史国史党建咨询内容
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeCountryHistoryContent(String ids) throws RemoveException;
/**
* 删除党史国史党建咨询内容物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteCountryHistoryContent(String ids) throws RemoveException;
/**
* 删除党史国史党建咨询内容(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeCountryHistoryContentByToken(String token, String ids) throws RemoveException;
/**
* 修改党史国史党建咨询内容
*
* @param countryHistoryContentId
* @param countryHistoryContentVO
* @return
* @throws Exception
*/
SuccessResult updateCountryHistoryContent(String countryHistoryContentId, CountryHistoryContentVO countryHistoryContentVO) throws Exception;
/**
* 修改党史国史党建咨询内容(APP)
*
* @param token
* @param countryHistoryContentId
* @param countryHistoryContentVO
* @return
* @throws Exception
*/
SuccessResult updateCountryHistoryContentByToken(String token, String countryHistoryContentId, CountryHistoryContentVO countryHistoryContentVO) throws Exception;
/**
* 党史国史党建咨询内容详情(通过ID)
*
* @param countryHistoryContentId
* @return
* @throws SearchException
*/
CountryHistoryContentDTO getCountryHistoryContentById(String countryHistoryContentId) throws SearchException;
/**
* 党史国史党建咨询内容列表
*
* @param params
* @return
* @throws SearchException
*/
List<CountryHistoryContentDTO> listCountryHistoryContent(Map<String, Object> params) throws SearchException;
/**
* 党史国史党建咨询内容分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<CountryHistoryContentDTO>> listPageCountryHistoryContent(ListPage page) throws SearchException;
/**
* 党史国史党建咨询内容统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberCountryHistoryContent(Map<String, Object> params) throws SearchException;
/**
* 党史国史党建咨询内容统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countCountryHistoryContent(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.countryhistorycontent.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.countryhistorycontent.ICountryHistoryContentDao;
import com.cm.partybuilding.pojo.dtos.countryhistorycontent.CountryHistoryContentDTO;
import com.cm.partybuilding.pojo.vos.countryhistorycontent.CountryHistoryContentVO;
import com.cm.partybuilding.service.countryhistorycontent.ICountryHistoryContentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: CountryHistoryContentServiceImpl
* @Description: 党史国史党建咨询内容
* @Author: WenG
* @Date: 2020-10-22 12:05
* @Version: 1.0
**/
@Service
public class CountryHistoryContentServiceImpl extends AbstractService implements ICountryHistoryContentService {
@Autowired
private ICountryHistoryContentDao countryHistoryContentDao;
@Override
public SuccessResult saveCountryHistoryContent(CountryHistoryContentVO countryHistoryContentVO) throws Exception {
saveCountryHistoryContentInfo(null, countryHistoryContentVO);
return new SuccessResult();
}
@Override
public SuccessResult saveCountryHistoryContentByToken(String token, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
saveCountryHistoryContentInfo(token, countryHistoryContentVO);
return new SuccessResult();
}
@Override
public String saveCountryHistoryContentReturnId(CountryHistoryContentVO countryHistoryContentVO) throws Exception {
return saveCountryHistoryContentInfoReturnId(null, countryHistoryContentVO);
}
@Override
public String saveCountryHistoryContentByTokenReturnId(String token, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
return saveCountryHistoryContentInfoReturnId(token, countryHistoryContentVO);
}
/**
* 新增党史国史党建咨询内容
*
* @param token
* @param countryHistoryContentVO
* @throws Exception
*/
private void saveCountryHistoryContentInfo(String token, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
saveCountryHistoryContentInfoReturnId(token, countryHistoryContentVO);
}
/**
* 新增党史国史党建咨询内容
*
* @param token
* @param countryHistoryContentVO
* @return countryHistoryContentId
* @throws Exception
*/
private String saveCountryHistoryContentInfoReturnId(String token, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
String countryHistoryContentId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(countryHistoryContentVO);
params.put("countryHistoryContentId", countryHistoryContentId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
countryHistoryContentDao.saveCountryHistoryContent(params);
return countryHistoryContentId;
}
@Override
public SuccessResult removeCountryHistoryContent(String ids) throws RemoveException {
removeCountryHistoryContentInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeCountryHistoryContentByToken(String token, String ids) throws RemoveException {
removeCountryHistoryContentInfo(token, ids);
return new SuccessResult();
}
/**
* 删除党史国史党建咨询内容
*
* @param token
* @param ids
*/
private void removeCountryHistoryContentInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("countryHistoryContentIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
countryHistoryContentDao.removeCountryHistoryContent(params);
}
@Override
public void deleteCountryHistoryContent(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("countryHistoryContentIds", Arrays.asList(ids.split("_")));
countryHistoryContentDao.deleteCountryHistoryContent(params);
}
@Override
public SuccessResult updateCountryHistoryContent(String countryHistoryContentId, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
updateCountryHistoryContentInfo(null, countryHistoryContentId, countryHistoryContentVO);
return new SuccessResult();
}
@Override
public SuccessResult updateCountryHistoryContentByToken(String token, String countryHistoryContentId, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
updateCountryHistoryContentInfo(token, countryHistoryContentId, countryHistoryContentVO);
return new SuccessResult();
}
/**
* 修改党史国史党建咨询内容
*
* @param token
* @param countryHistoryContentId
* @param countryHistoryContentVO
*/
private void updateCountryHistoryContentInfo(String token, String countryHistoryContentId, CountryHistoryContentVO countryHistoryContentVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(countryHistoryContentVO);
params.put("countryHistoryContentId", countryHistoryContentId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
countryHistoryContentDao.updateCountryHistoryContent(params);
}
@Override
public CountryHistoryContentDTO getCountryHistoryContentById(String countryHistoryContentId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("countryHistoryContentId", countryHistoryContentId);
return countryHistoryContentDao.getCountryHistoryContent(params);
}
@Override
public List<CountryHistoryContentDTO> listCountryHistoryContent(Map<String, Object> params) throws SearchException {
return countryHistoryContentDao.listCountryHistoryContent(params);
}
@Override
public SuccessResultList<List<CountryHistoryContentDTO>> listPageCountryHistoryContent(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<CountryHistoryContentDTO> countryHistoryContentDTOs = countryHistoryContentDao.listCountryHistoryContent(page.getParams());
PageInfo<CountryHistoryContentDTO> pageInfo = new PageInfo<>(countryHistoryContentDTOs);
return new SuccessResultList<>(countryHistoryContentDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberCountryHistoryContent(Map<String, Object> params) throws SearchException {
Integer count = countryHistoryContentDao.countCountryHistoryContent(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countCountryHistoryContent(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberCountryHistoryContent(params));
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.famoussecretaryoffice;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.famoussecretaryoffice.FamousSecretaryOfficeDTO;
import com.cm.partybuilding.pojo.vos.famoussecretaryoffice.FamousSecretaryOfficeVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IFamousSecretaryOfficeService
* @Description: 名书记工作室
* @Author: WenG
* @Date: 2020-10-19 14:21
* @Version: 1.0
**/
public interface IFamousSecretaryOfficeService {
/**
* 新增名书记工作室
*
* @param famousSecretaryOfficeVO
* @return
* @throws Exception
*/
SuccessResult saveFamousSecretaryOffice(FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception;
/**
* 新增名书记工作室(APP)
*
* @param token
* @param famousSecretaryOfficeVO
* @return
* @throws Exception
*/
SuccessResult saveFamousSecretaryOfficeByToken(String token, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception;
/**
* 新增名书记工作室
*
* @param famousSecretaryOfficeVO
* @return famousSecretaryOfficeId
* @throws Exception
*/
String saveFamousSecretaryOfficeReturnId(FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception;
/**
* 新增名书记工作室(APP)
*
* @param token
* @param famousSecretaryOfficeVO
* @return famousSecretaryOfficeId
* @throws Exception
*/
String saveFamousSecretaryOfficeByTokenReturnId(String token, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception;
/**
* 删除名书记工作室
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeFamousSecretaryOffice(String ids) throws RemoveException;
/**
* 删除名书记工作室物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteFamousSecretaryOffice(String ids) throws RemoveException;
/**
* 删除名书记工作室(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeFamousSecretaryOfficeByToken(String token, String ids) throws RemoveException;
/**
* 修改名书记工作室
*
* @param famousSecretaryOfficeId
* @param famousSecretaryOfficeVO
* @return
* @throws Exception
*/
SuccessResult updateFamousSecretaryOffice(String famousSecretaryOfficeId, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception;
/**
* 修改名书记工作室(APP)
*
* @param token
* @param famousSecretaryOfficeId
* @param famousSecretaryOfficeVO
* @return
* @throws Exception
*/
SuccessResult updateFamousSecretaryOfficeByToken(String token, String famousSecretaryOfficeId, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception;
/**
* 名书记工作室详情(通过ID)
*
* @param famousSecretaryOfficeId
* @return
* @throws SearchException
*/
FamousSecretaryOfficeDTO getFamousSecretaryOfficeById(String famousSecretaryOfficeId) throws SearchException;
/**
* 名书记工作室列表
*
* @param params
* @return
* @throws SearchException
*/
List<FamousSecretaryOfficeDTO> listFamousSecretaryOffice(Map<String, Object> params) throws SearchException;
/**
* 名书记工作室分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<FamousSecretaryOfficeDTO>> listPageFamousSecretaryOffice(ListPage page) throws SearchException;
/**
* 名书记工作室统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberFamousSecretaryOffice(Map<String, Object> params) throws SearchException;
/**
* 名书记工作室统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countFamousSecretaryOffice(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.famoussecretaryoffice.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.famoussecretaryoffice.IFamousSecretaryOfficeDao;
import com.cm.partybuilding.pojo.dtos.famoussecretaryoffice.FamousSecretaryOfficeDTO;
import com.cm.partybuilding.pojo.vos.famoussecretaryoffice.FamousSecretaryOfficeVO;
import com.cm.partybuilding.service.famoussecretaryoffice.IFamousSecretaryOfficeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: FamousSecretaryOfficeServiceImpl
* @Description: 名书记工作室
* @Author: WenG
* @Date: 2020-10-19 14:21
* @Version: 1.0
**/
@Service
public class FamousSecretaryOfficeServiceImpl extends AbstractService implements IFamousSecretaryOfficeService {
@Autowired
private IFamousSecretaryOfficeDao famousSecretaryOfficeDao;
@Override
public SuccessResult saveFamousSecretaryOffice(FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
saveFamousSecretaryOfficeInfo(null, famousSecretaryOfficeVO);
return new SuccessResult();
}
@Override
public SuccessResult saveFamousSecretaryOfficeByToken(String token, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
saveFamousSecretaryOfficeInfo(token, famousSecretaryOfficeVO);
return new SuccessResult();
}
@Override
public String saveFamousSecretaryOfficeReturnId(FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
return saveFamousSecretaryOfficeInfoReturnId(null, famousSecretaryOfficeVO);
}
@Override
public String saveFamousSecretaryOfficeByTokenReturnId(String token, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
return saveFamousSecretaryOfficeInfoReturnId(token, famousSecretaryOfficeVO);
}
/**
* 新增名书记工作室
*
* @param token
* @param famousSecretaryOfficeVO
* @throws Exception
*/
private void saveFamousSecretaryOfficeInfo(String token, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
saveFamousSecretaryOfficeInfoReturnId(token, famousSecretaryOfficeVO);
}
/**
* 新增名书记工作室
*
* @param token
* @param famousSecretaryOfficeVO
* @return famousSecretaryOfficeId
* @throws Exception
*/
private String saveFamousSecretaryOfficeInfoReturnId(String token, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
String famousSecretaryOfficeId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(famousSecretaryOfficeVO);
params.put("famousSecretaryOfficeId", famousSecretaryOfficeId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
famousSecretaryOfficeDao.saveFamousSecretaryOffice(params);
return famousSecretaryOfficeId;
}
@Override
public SuccessResult removeFamousSecretaryOffice(String ids) throws RemoveException {
removeFamousSecretaryOfficeInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeFamousSecretaryOfficeByToken(String token, String ids) throws RemoveException {
removeFamousSecretaryOfficeInfo(token, ids);
return new SuccessResult();
}
/**
* 删除名书记工作室
*
* @param token
* @param ids
*/
private void removeFamousSecretaryOfficeInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("famousSecretaryOfficeIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
famousSecretaryOfficeDao.removeFamousSecretaryOffice(params);
}
@Override
public void deleteFamousSecretaryOffice(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("famousSecretaryOfficeIds", Arrays.asList(ids.split("_")));
famousSecretaryOfficeDao.deleteFamousSecretaryOffice(params);
}
@Override
public SuccessResult updateFamousSecretaryOffice(String famousSecretaryOfficeId, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
updateFamousSecretaryOfficeInfo(null, famousSecretaryOfficeId, famousSecretaryOfficeVO);
return new SuccessResult();
}
@Override
public SuccessResult updateFamousSecretaryOfficeByToken(String token, String famousSecretaryOfficeId, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
updateFamousSecretaryOfficeInfo(token, famousSecretaryOfficeId, famousSecretaryOfficeVO);
return new SuccessResult();
}
/**
* 修改名书记工作室
*
* @param token
* @param famousSecretaryOfficeId
* @param famousSecretaryOfficeVO
*/
private void updateFamousSecretaryOfficeInfo(String token, String famousSecretaryOfficeId, FamousSecretaryOfficeVO famousSecretaryOfficeVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(famousSecretaryOfficeVO);
params.put("famousSecretaryOfficeId", famousSecretaryOfficeId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
famousSecretaryOfficeDao.updateFamousSecretaryOffice(params);
}
@Override
public FamousSecretaryOfficeDTO getFamousSecretaryOfficeById(String famousSecretaryOfficeId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("famousSecretaryOfficeId", famousSecretaryOfficeId);
return famousSecretaryOfficeDao.getFamousSecretaryOffice(params);
}
@Override
public List<FamousSecretaryOfficeDTO> listFamousSecretaryOffice(Map<String, Object> params) throws SearchException {
return famousSecretaryOfficeDao.listFamousSecretaryOffice(params);
}
@Override
public SuccessResultList<List<FamousSecretaryOfficeDTO>> listPageFamousSecretaryOffice(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<FamousSecretaryOfficeDTO> famousSecretaryOfficeDTOs = famousSecretaryOfficeDao.listFamousSecretaryOffice(page.getParams());
PageInfo<FamousSecretaryOfficeDTO> pageInfo = new PageInfo<>(famousSecretaryOfficeDTOs);
return new SuccessResultList<>(famousSecretaryOfficeDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberFamousSecretaryOffice(Map<String, Object> params) throws SearchException {
Integer count = famousSecretaryOfficeDao.countFamousSecretaryOffice(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countFamousSecretaryOffice(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberFamousSecretaryOffice(params));
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.interactiveactivity;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.interactiveactivity.InteractiveActivityDTO;
import com.cm.partybuilding.pojo.vos.interactiveactivity.InteractiveActivityVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IInteractiveActivityService
* @Description: 互联互动
* @Author: WenG
* @Date: 2020-10-19 14:40
* @Version: 1.0
**/
public interface IInteractiveActivityService {
/**
* 新增互联互动
*
* @param interactiveActivityVO
* @return
* @throws Exception
*/
SuccessResult saveInteractiveActivity(InteractiveActivityVO interactiveActivityVO) throws Exception;
/**
* 新增互联互动(APP)
*
* @param token
* @param interactiveActivityVO
* @return
* @throws Exception
*/
SuccessResult saveInteractiveActivityByToken(String token, InteractiveActivityVO interactiveActivityVO) throws Exception;
/**
* 新增互联互动
*
* @param interactiveActivityVO
* @return interactiveActivityId
* @throws Exception
*/
String saveInteractiveActivityReturnId(InteractiveActivityVO interactiveActivityVO) throws Exception;
/**
* 新增互联互动(APP)
*
* @param token
* @param interactiveActivityVO
* @return interactiveActivityId
* @throws Exception
*/
String saveInteractiveActivityByTokenReturnId(String token, InteractiveActivityVO interactiveActivityVO) throws Exception;
/**
* 删除互联互动
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeInteractiveActivity(String ids) throws RemoveException;
/**
* 删除互联互动物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteInteractiveActivity(String ids) throws RemoveException;
/**
* 删除互联互动(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeInteractiveActivityByToken(String token, String ids) throws RemoveException;
/**
* 修改互联互动
*
* @param interactiveActivityId
* @param interactiveActivityVO
* @return
* @throws Exception
*/
SuccessResult updateInteractiveActivity(String interactiveActivityId, InteractiveActivityVO interactiveActivityVO) throws Exception;
/**
* 修改互联互动(APP)
*
* @param token
* @param interactiveActivityId
* @param interactiveActivityVO
* @return
* @throws Exception
*/
SuccessResult updateInteractiveActivityByToken(String token, String interactiveActivityId, InteractiveActivityVO interactiveActivityVO) throws Exception;
/**
* 互联互动详情(通过ID)
*
* @param interactiveActivityId
* @return
* @throws SearchException
*/
InteractiveActivityDTO getInteractiveActivityById(String interactiveActivityId) throws SearchException;
/**
* 互联互动列表
*
* @param params
* @return
* @throws SearchException
*/
List<InteractiveActivityDTO> listInteractiveActivity(Map<String, Object> params) throws SearchException;
/**
* 互联互动分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<InteractiveActivityDTO>> listPageInteractiveActivity(ListPage page) throws SearchException;
/**
* 互联互动统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberInteractiveActivity(Map<String, Object> params) throws SearchException;
/**
* 互联互动统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countInteractiveActivity(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.interactiveactivity.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.interactiveactivity.IInteractiveActivityDao;
import com.cm.partybuilding.pojo.dtos.interactiveactivity.InteractiveActivityDTO;
import com.cm.partybuilding.pojo.vos.interactiveactivity.InteractiveActivityVO;
import com.cm.partybuilding.service.interactiveactivity.IInteractiveActivityService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: InteractiveActivityServiceImpl
* @Description: 互联互动
* @Author: WenG
* @Date: 2020-10-19 14:40
* @Version: 1.0
**/
@Service
public class InteractiveActivityServiceImpl extends AbstractService implements IInteractiveActivityService {
@Autowired
private IInteractiveActivityDao interactiveActivityDao;
@Override
public SuccessResult saveInteractiveActivity(InteractiveActivityVO interactiveActivityVO) throws Exception {
saveInteractiveActivityInfo(null, interactiveActivityVO);
return new SuccessResult();
}
@Override
public SuccessResult saveInteractiveActivityByToken(String token, InteractiveActivityVO interactiveActivityVO) throws Exception {
saveInteractiveActivityInfo(token, interactiveActivityVO);
return new SuccessResult();
}
@Override
public String saveInteractiveActivityReturnId(InteractiveActivityVO interactiveActivityVO) throws Exception {
return saveInteractiveActivityInfoReturnId(null, interactiveActivityVO);
}
@Override
public String saveInteractiveActivityByTokenReturnId(String token, InteractiveActivityVO interactiveActivityVO) throws Exception {
return saveInteractiveActivityInfoReturnId(token, interactiveActivityVO);
}
/**
* 新增互联互动
*
* @param token
* @param interactiveActivityVO
* @throws Exception
*/
private void saveInteractiveActivityInfo(String token, InteractiveActivityVO interactiveActivityVO) throws Exception {
saveInteractiveActivityInfoReturnId(token, interactiveActivityVO);
}
/**
* 新增互联互动
*
* @param token
* @param interactiveActivityVO
* @return interactiveActivityId
* @throws Exception
*/
private String saveInteractiveActivityInfoReturnId(String token, InteractiveActivityVO interactiveActivityVO) throws Exception {
String interactiveActivityId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(interactiveActivityVO);
params.put("interactiveActivityId", interactiveActivityId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
interactiveActivityDao.saveInteractiveActivity(params);
return interactiveActivityId;
}
@Override
public SuccessResult removeInteractiveActivity(String ids) throws RemoveException {
removeInteractiveActivityInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeInteractiveActivityByToken(String token, String ids) throws RemoveException {
removeInteractiveActivityInfo(token, ids);
return new SuccessResult();
}
/**
* 删除互联互动
*
* @param token
* @param ids
*/
private void removeInteractiveActivityInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("interactiveActivityIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
interactiveActivityDao.removeInteractiveActivity(params);
}
@Override
public void deleteInteractiveActivity(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("interactiveActivityIds", Arrays.asList(ids.split("_")));
interactiveActivityDao.deleteInteractiveActivity(params);
}
@Override
public SuccessResult updateInteractiveActivity(String interactiveActivityId, InteractiveActivityVO interactiveActivityVO) throws Exception {
updateInteractiveActivityInfo(null, interactiveActivityId, interactiveActivityVO);
return new SuccessResult();
}
@Override
public SuccessResult updateInteractiveActivityByToken(String token, String interactiveActivityId, InteractiveActivityVO interactiveActivityVO) throws Exception {
updateInteractiveActivityInfo(token, interactiveActivityId, interactiveActivityVO);
return new SuccessResult();
}
/**
* 修改互联互动
*
* @param token
* @param interactiveActivityId
* @param interactiveActivityVO
*/
private void updateInteractiveActivityInfo(String token, String interactiveActivityId, InteractiveActivityVO interactiveActivityVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(interactiveActivityVO);
params.put("interactiveActivityId", interactiveActivityId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
interactiveActivityDao.updateInteractiveActivity(params);
}
@Override
public InteractiveActivityDTO getInteractiveActivityById(String interactiveActivityId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("interactiveActivityId", interactiveActivityId);
return interactiveActivityDao.getInteractiveActivity(params);
}
@Override
public List<InteractiveActivityDTO> listInteractiveActivity(Map<String, Object> params) throws SearchException {
return interactiveActivityDao.listInteractiveActivity(params);
}
@Override
public SuccessResultList<List<InteractiveActivityDTO>> listPageInteractiveActivity(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<InteractiveActivityDTO> interactiveActivityDTOs = interactiveActivityDao.listInteractiveActivity(page.getParams());
PageInfo<InteractiveActivityDTO> pageInfo = new PageInfo<>(interactiveActivityDTOs);
return new SuccessResultList<>(interactiveActivityDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberInteractiveActivity(Map<String, Object> params) throws SearchException {
Integer count = interactiveActivityDao.countInteractiveActivity(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countInteractiveActivity(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberInteractiveActivity(params));
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.officeactivity;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.officeactivity.OfficeActivityDTO;
import com.cm.partybuilding.pojo.vos.officeactivity.OfficeActivityVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IOfficeActivityService
* @Description: 工作室活动
* @Author: WenG
* @Date: 2020-10-21 15:29
* @Version: 1.0
**/
public interface IOfficeActivityService {
/**
* 新增工作室活动
*
* @param officeActivityVO
* @return
* @throws Exception
*/
SuccessResult saveOfficeActivity(OfficeActivityVO officeActivityVO) throws Exception;
/**
* 新增工作室活动(APP)
*
* @param token
* @param officeActivityVO
* @return
* @throws Exception
*/
SuccessResult saveOfficeActivityByToken(String token, OfficeActivityVO officeActivityVO) throws Exception;
/**
* 新增工作室活动
*
* @param officeActivityVO
* @return officeActivityId
* @throws Exception
*/
String saveOfficeActivityReturnId(OfficeActivityVO officeActivityVO) throws Exception;
/**
* 新增工作室活动(APP)
*
* @param token
* @param officeActivityVO
* @return officeActivityId
* @throws Exception
*/
String saveOfficeActivityByTokenReturnId(String token, OfficeActivityVO officeActivityVO) throws Exception;
/**
* 删除工作室活动
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeOfficeActivity(String ids) throws RemoveException;
/**
* 删除工作室活动物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteOfficeActivity(String ids) throws RemoveException;
/**
* 删除工作室活动(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeOfficeActivityByToken(String token, String ids) throws RemoveException;
/**
* 修改工作室活动
*
* @param officeActivityId
* @param officeActivityVO
* @return
* @throws Exception
*/
SuccessResult updateOfficeActivity(String officeActivityId, OfficeActivityVO officeActivityVO) throws Exception;
/**
* 修改工作室活动(APP)
*
* @param token
* @param officeActivityId
* @param officeActivityVO
* @return
* @throws Exception
*/
SuccessResult updateOfficeActivityByToken(String token, String officeActivityId, OfficeActivityVO officeActivityVO) throws Exception;
/**
* 工作室活动详情(通过ID)
*
* @param officeActivityId
* @return
* @throws SearchException
*/
OfficeActivityDTO getOfficeActivityById(String officeActivityId) throws SearchException;
/**
* 工作室活动列表
*
* @param params
* @return
* @throws SearchException
*/
List<OfficeActivityDTO> listOfficeActivity(Map<String, Object> params) throws SearchException;
/**
* 工作室活动分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<OfficeActivityDTO>> listPageOfficeActivity(ListPage page) throws SearchException;
/**
* 工作室活动统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberOfficeActivity(Map<String, Object> params) throws SearchException;
/**
* 工作室活动统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countOfficeActivity(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.officeactivity.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.officeactivity.IOfficeActivityDao;
import com.cm.partybuilding.pojo.dtos.officeactivity.OfficeActivityDTO;
import com.cm.partybuilding.pojo.vos.officeactivity.OfficeActivityVO;
import com.cm.partybuilding.service.officeactivity.IOfficeActivityService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: OfficeActivityServiceImpl
* @Description: 工作室活动
* @Author: WenG
* @Date: 2020-10-21 15:29
* @Version: 1.0
**/
@Service
public class OfficeActivityServiceImpl extends AbstractService implements IOfficeActivityService {
@Autowired
private IOfficeActivityDao officeActivityDao;
@Override
public SuccessResult saveOfficeActivity(OfficeActivityVO officeActivityVO) throws Exception {
saveOfficeActivityInfo(null, officeActivityVO);
return new SuccessResult();
}
@Override
public SuccessResult saveOfficeActivityByToken(String token, OfficeActivityVO officeActivityVO) throws Exception {
saveOfficeActivityInfo(token, officeActivityVO);
return new SuccessResult();
}
@Override
public String saveOfficeActivityReturnId(OfficeActivityVO officeActivityVO) throws Exception {
return saveOfficeActivityInfoReturnId(null, officeActivityVO);
}
@Override
public String saveOfficeActivityByTokenReturnId(String token, OfficeActivityVO officeActivityVO) throws Exception {
return saveOfficeActivityInfoReturnId(token, officeActivityVO);
}
/**
* 新增工作室活动
*
* @param token
* @param officeActivityVO
* @throws Exception
*/
private void saveOfficeActivityInfo(String token, OfficeActivityVO officeActivityVO) throws Exception {
saveOfficeActivityInfoReturnId(token, officeActivityVO);
}
/**
* 新增工作室活动
*
* @param token
* @param officeActivityVO
* @return officeActivityId
* @throws Exception
*/
private String saveOfficeActivityInfoReturnId(String token, OfficeActivityVO officeActivityVO) throws Exception {
String officeActivityId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(officeActivityVO);
params.put("officeActivityId", officeActivityId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
officeActivityDao.saveOfficeActivity(params);
return officeActivityId;
}
@Override
public SuccessResult removeOfficeActivity(String ids) throws RemoveException {
removeOfficeActivityInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeOfficeActivityByToken(String token, String ids) throws RemoveException {
removeOfficeActivityInfo(token, ids);
return new SuccessResult();
}
/**
* 删除工作室活动
*
* @param token
* @param ids
*/
private void removeOfficeActivityInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("officeActivityIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
officeActivityDao.removeOfficeActivity(params);
}
@Override
public void deleteOfficeActivity(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("officeActivityIds", Arrays.asList(ids.split("_")));
officeActivityDao.deleteOfficeActivity(params);
}
@Override
public SuccessResult updateOfficeActivity(String officeActivityId, OfficeActivityVO officeActivityVO) throws Exception {
updateOfficeActivityInfo(null, officeActivityId, officeActivityVO);
return new SuccessResult();
}
@Override
public SuccessResult updateOfficeActivityByToken(String token, String officeActivityId, OfficeActivityVO officeActivityVO) throws Exception {
updateOfficeActivityInfo(token, officeActivityId, officeActivityVO);
return new SuccessResult();
}
/**
* 修改工作室活动
*
* @param token
* @param officeActivityId
* @param officeActivityVO
*/
private void updateOfficeActivityInfo(String token, String officeActivityId, OfficeActivityVO officeActivityVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(officeActivityVO);
params.put("officeActivityId", officeActivityId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
officeActivityDao.updateOfficeActivity(params);
}
@Override
public OfficeActivityDTO getOfficeActivityById(String officeActivityId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("officeActivityId", officeActivityId);
return officeActivityDao.getOfficeActivity(params);
}
@Override
public List<OfficeActivityDTO> listOfficeActivity(Map<String, Object> params) throws SearchException {
return officeActivityDao.listOfficeActivity(params);
}
@Override
public SuccessResultList<List<OfficeActivityDTO>> listPageOfficeActivity(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<OfficeActivityDTO> officeActivityDTOs = officeActivityDao.listOfficeActivity(page.getParams());
PageInfo<OfficeActivityDTO> pageInfo = new PageInfo<>(officeActivityDTOs);
return new SuccessResultList<>(officeActivityDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberOfficeActivity(Map<String, Object> params) throws SearchException {
Integer count = officeActivityDao.countOfficeActivity(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countOfficeActivity(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberOfficeActivity(params));
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.partybuildingcase;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.partybuildingcase.PartyBuildingCaseDTO;
import com.cm.partybuilding.pojo.vos.partybuildingcase.PartyBuildingCaseVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IPartyBuildingCaseService
* @Description: 党建案例
* @Author: WenG
* @Date: 2020-10-19 10:53
* @Version: 1.0
**/
public interface IPartyBuildingCaseService {
/**
* 新增党建案例
*
* @param partyBuildingCaseVO
* @return
* @throws Exception
*/
SuccessResult savePartyBuildingCase(PartyBuildingCaseVO partyBuildingCaseVO) throws Exception;
/**
* 新增党建案例(APP)
*
* @param token
* @param partyBuildingCaseVO
* @return
* @throws Exception
*/
SuccessResult savePartyBuildingCaseByToken(String token, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception;
/**
* 新增党建案例
*
* @param partyBuildingCaseVO
* @return partyBuildingCaseId
* @throws Exception
*/
String savePartyBuildingCaseReturnId(PartyBuildingCaseVO partyBuildingCaseVO) throws Exception;
/**
* 新增党建案例(APP)
*
* @param token
* @param partyBuildingCaseVO
* @return partyBuildingCaseId
* @throws Exception
*/
String savePartyBuildingCaseByTokenReturnId(String token, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception;
/**
* 删除党建案例
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removePartyBuildingCase(String ids) throws RemoveException;
/**
* 删除党建案例物理删除
*
* @param ids
* @throws RemoveException
*/
void deletePartyBuildingCase(String ids) throws RemoveException;
/**
* 删除党建案例(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removePartyBuildingCaseByToken(String token, String ids) throws RemoveException;
/**
* 修改党建案例
*
* @param partyBuildingCaseId
* @param partyBuildingCaseVO
* @return
* @throws Exception
*/
SuccessResult updatePartyBuildingCase(String partyBuildingCaseId, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception;
/**
* 修改党建案例(APP)
*
* @param token
* @param partyBuildingCaseId
* @param partyBuildingCaseVO
* @return
* @throws Exception
*/
SuccessResult updatePartyBuildingCaseByToken(String token, String partyBuildingCaseId, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception;
/**
* 党建案例详情(通过ID)
*
* @param partyBuildingCaseId
* @return
* @throws SearchException
*/
PartyBuildingCaseDTO getPartyBuildingCaseById(String partyBuildingCaseId) throws SearchException;
/**
* 党建案例列表
*
* @param params
* @return
* @throws SearchException
*/
List<PartyBuildingCaseDTO> listPartyBuildingCase(Map<String, Object> params) throws SearchException;
/**
* 党建案例分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<PartyBuildingCaseDTO>> listPagePartyBuildingCase(ListPage page) throws SearchException;
/**
* 党建案例统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberPartyBuildingCase(Map<String, Object> params) throws SearchException;
/**
* 党建案例统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countPartyBuildingCase(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,206 @@
package com.cm.partybuilding.service.partybuildingcase.impl;
import com.alibaba.fastjson.JSONObject;
import com.cm.common.base.AbstractService;
import com.cm.common.component.SecurityComponent;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.plugin.oauth.service.user.IUserService;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.partybuildingcase.IPartyBuildingCaseDao;
import com.cm.partybuilding.pojo.dtos.partybuildingcase.PartyBuildingCaseDTO;
import com.cm.partybuilding.pojo.vos.partybuildingcase.PartyBuildingCaseVO;
import com.cm.partybuilding.service.partybuildingcase.IPartyBuildingCaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: PartyBuildingCaseServiceImpl
* @Description: 党建案例
* @Author: WenG
* @Date: 2020-10-19 10:53
* @Version: 1.0
**/
@Service
public class PartyBuildingCaseServiceImpl extends AbstractService implements IPartyBuildingCaseService {
@Autowired
private IPartyBuildingCaseDao partyBuildingCaseDao;
@Autowired
private IUserService userService;
@Override
public SuccessResult savePartyBuildingCase(PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
savePartyBuildingCaseInfo(null, partyBuildingCaseVO);
return new SuccessResult();
}
@Override
public SuccessResult savePartyBuildingCaseByToken(String token, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
savePartyBuildingCaseInfo(token, partyBuildingCaseVO);
return new SuccessResult();
}
@Override
public String savePartyBuildingCaseReturnId(PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
return savePartyBuildingCaseInfoReturnId(null, partyBuildingCaseVO);
}
@Override
public String savePartyBuildingCaseByTokenReturnId(String token, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
return savePartyBuildingCaseInfoReturnId(token, partyBuildingCaseVO);
}
/**
* 新增党建案例
*
* @param token
* @param partyBuildingCaseVO
* @throws Exception
*/
private void savePartyBuildingCaseInfo(String token, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
savePartyBuildingCaseInfoReturnId(token, partyBuildingCaseVO);
}
/**
* 新增党建案例
*
* @param token
* @param partyBuildingCaseVO
* @return partyBuildingCaseId
* @throws Exception
*/
private String savePartyBuildingCaseInfoReturnId(String token, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
String partyBuildingCaseId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(partyBuildingCaseVO);
params.put("partyBuildingCaseId", partyBuildingCaseId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
partyBuildingCaseDao.savePartyBuildingCase(params);
return partyBuildingCaseId;
}
@Override
public SuccessResult removePartyBuildingCase(String ids) throws RemoveException {
removePartyBuildingCaseInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removePartyBuildingCaseByToken(String token, String ids) throws RemoveException {
removePartyBuildingCaseInfo(token, ids);
return new SuccessResult();
}
/**
* 删除党建案例
*
* @param token
* @param ids
*/
private void removePartyBuildingCaseInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("partyBuildingCaseIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
partyBuildingCaseDao.removePartyBuildingCase(params);
}
@Override
public void deletePartyBuildingCase(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("partyBuildingCaseIds", Arrays.asList(ids.split("_")));
partyBuildingCaseDao.deletePartyBuildingCase(params);
}
@Override
public SuccessResult updatePartyBuildingCase(String partyBuildingCaseId, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
updatePartyBuildingCaseInfo(null, partyBuildingCaseId, partyBuildingCaseVO);
return new SuccessResult();
}
@Override
public SuccessResult updatePartyBuildingCaseByToken(String token, String partyBuildingCaseId, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
updatePartyBuildingCaseInfo(token, partyBuildingCaseId, partyBuildingCaseVO);
return new SuccessResult();
}
/**
* 修改党建案例
*
* @param token
* @param partyBuildingCaseId
* @param partyBuildingCaseVO
*/
private void updatePartyBuildingCaseInfo(String token, String partyBuildingCaseId, PartyBuildingCaseVO partyBuildingCaseVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(partyBuildingCaseVO);
params.put("partyBuildingCaseId", partyBuildingCaseId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
partyBuildingCaseDao.updatePartyBuildingCase(params);
}
@Override
public PartyBuildingCaseDTO getPartyBuildingCaseById(String partyBuildingCaseId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("partyBuildingCaseId", partyBuildingCaseId);
return partyBuildingCaseDao.getPartyBuildingCase(params);
}
@Override
public List<PartyBuildingCaseDTO> listPartyBuildingCase(Map<String, Object> params) throws SearchException {
return partyBuildingCaseDao.listPartyBuildingCase(params);
}
@Override
public SuccessResultList<List<PartyBuildingCaseDTO>> listPagePartyBuildingCase(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<PartyBuildingCaseDTO> partyBuildingCaseDTOs = partyBuildingCaseDao.listPartyBuildingCase(page.getParams());
for (PartyBuildingCaseDTO item : partyBuildingCaseDTOs){
if("1".equals(item.getCreator().trim())){
item.setCreatorName("系统管理员");
continue;
}
JSONObject obj = userService.getDynamicUserInfoByUserId("d7557537-b911-4ed9-8e89-d4a946192bea");
if(obj == null ){
item.setCreatorName("系统管理员");
continue;
}
item.setCreatorName("未知");
}
PageInfo<PartyBuildingCaseDTO> pageInfo = new PageInfo<>(partyBuildingCaseDTOs);
return new SuccessResultList<>(partyBuildingCaseDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberPartyBuildingCase(Map<String, Object> params) throws SearchException {
Integer count = partyBuildingCaseDao.countPartyBuildingCase(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countPartyBuildingCase(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberPartyBuildingCase(params));
}
}

View File

@ -0,0 +1,162 @@
package com.cm.partybuilding.service.partymemberpoints;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.partymemberpoints.PartyMemberPointsDTO;
import com.cm.partybuilding.pojo.vos.partymemberpoints.PartyMemberPointsVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IPartyMemberPointsService
* @Description: 党员积分
* @Author: WenG
* @Date: 2020-10-19 10:34
* @Version: 1.0
**/
public interface IPartyMemberPointsService {
/**
* 新增党员积分
*
* @param partyMemberPointsVO
* @return
* @throws Exception
*/
SuccessResult savePartyMemberPoints(PartyMemberPointsVO partyMemberPointsVO) throws Exception;
/**
* 新增党员积分(APP)
*
* @param token
* @param partyMemberPointsVO
* @return
* @throws Exception
*/
SuccessResult savePartyMemberPointsByToken(String token, PartyMemberPointsVO partyMemberPointsVO) throws Exception;
/**
* 新增党员积分
*
* @param partyMemberPointsVO
* @return partyMemberPointsId
* @throws Exception
*/
String savePartyMemberPointsReturnId(PartyMemberPointsVO partyMemberPointsVO) throws Exception;
/**
* 新增党员积分(APP)
*
* @param token
* @param partyMemberPointsVO
* @return partyMemberPointsId
* @throws Exception
*/
String savePartyMemberPointsByTokenReturnId(String token, PartyMemberPointsVO partyMemberPointsVO) throws Exception;
/**
* 删除党员积分
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removePartyMemberPoints(String ids) throws RemoveException;
/**
* 删除党员积分物理删除
*
* @param ids
* @throws RemoveException
*/
void deletePartyMemberPoints(String ids) throws RemoveException;
/**
* 删除党员积分(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removePartyMemberPointsByToken(String token, String ids) throws RemoveException;
/**
* 修改党员积分
*
* @param partyMemberPointsId
* @param partyMemberPointsVO
* @return
* @throws Exception
*/
SuccessResult updatePartyMemberPoints(String partyMemberPointsId, PartyMemberPointsVO partyMemberPointsVO) throws Exception;
/**
* 修改党员积分(APP)
*
* @param token
* @param partyMemberPointsId
* @param partyMemberPointsVO
* @return
* @throws Exception
*/
SuccessResult updatePartyMemberPointsByToken(String token, String partyMemberPointsId, PartyMemberPointsVO partyMemberPointsVO) throws Exception;
/**
* 党员积分详情(通过ID)
*
* @param partyMemberPointsId
* @return
* @throws SearchException
*/
PartyMemberPointsDTO getPartyMemberPointsById(String partyMemberPointsId) throws SearchException;
/**
* 党员积分列表
*
* @param params
* @return
* @throws SearchException
*/
List<PartyMemberPointsDTO> listPartyMemberPoints(Map<String, Object> params) throws SearchException;
/**
* 党员积分分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<PartyMemberPointsDTO>> listPagePartyMemberPoints(ListPage page) throws SearchException;
/**
* 党员积分统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberPartyMemberPoints(Map<String, Object> params) throws SearchException;
/**
* 党员积分统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countPartyMemberPoints(Map<String, Object> params) throws SearchException;
/**
* 根据条件查询
* @param partyMemberPointsVO
* @return
*/
PartyMemberPointsDTO getPartyMemberPointsByInfo(PartyMemberPointsVO partyMemberPointsVO) throws Exception;
}

View File

@ -0,0 +1,194 @@
package com.cm.partybuilding.service.partymemberpoints.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.partymemberpoints.IPartyMemberPointsDao;
import com.cm.partybuilding.pojo.dtos.partymemberpoints.PartyMemberPointsDTO;
import com.cm.partybuilding.pojo.vos.partymemberpoints.PartyMemberPointsVO;
import com.cm.partybuilding.service.partymemberpoints.IPartyMemberPointsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: PartyMemberPointsServiceImpl
* @Description: 党员积分
* @Author: WenG
* @Date: 2020-10-19 10:34
* @Version: 1.0
**/
@Service
public class PartyMemberPointsServiceImpl extends AbstractService implements IPartyMemberPointsService {
@Autowired
private IPartyMemberPointsDao partyMemberPointsDao;
@Override
public SuccessResult savePartyMemberPoints(PartyMemberPointsVO partyMemberPointsVO) throws Exception {
savePartyMemberPointsInfo(null, partyMemberPointsVO);
return new SuccessResult();
}
@Override
public SuccessResult savePartyMemberPointsByToken(String token, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
savePartyMemberPointsInfo(token, partyMemberPointsVO);
return new SuccessResult();
}
@Override
public String savePartyMemberPointsReturnId(PartyMemberPointsVO partyMemberPointsVO) throws Exception {
return savePartyMemberPointsInfoReturnId(null, partyMemberPointsVO);
}
@Override
public String savePartyMemberPointsByTokenReturnId(String token, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
return savePartyMemberPointsInfoReturnId(token, partyMemberPointsVO);
}
/**
* 新增党员积分
*
* @param token
* @param partyMemberPointsVO
* @throws Exception
*/
private void savePartyMemberPointsInfo(String token, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
savePartyMemberPointsInfoReturnId(token, partyMemberPointsVO);
}
/**
* 新增党员积分
*
* @param token
* @param partyMemberPointsVO
* @return partyMemberPointsId
* @throws Exception
*/
private String savePartyMemberPointsInfoReturnId(String token, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
String partyMemberPointsId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(partyMemberPointsVO);
params.put("partyMemberPointsId", partyMemberPointsId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
partyMemberPointsDao.savePartyMemberPoints(params);
return partyMemberPointsId;
}
@Override
public SuccessResult removePartyMemberPoints(String ids) throws RemoveException {
removePartyMemberPointsInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removePartyMemberPointsByToken(String token, String ids) throws RemoveException {
removePartyMemberPointsInfo(token, ids);
return new SuccessResult();
}
/**
* 删除党员积分
*
* @param token
* @param ids
*/
private void removePartyMemberPointsInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("partyMemberPointsIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
partyMemberPointsDao.removePartyMemberPoints(params);
}
@Override
public void deletePartyMemberPoints(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("partyMemberPointsIds", Arrays.asList(ids.split("_")));
partyMemberPointsDao.deletePartyMemberPoints(params);
}
@Override
public SuccessResult updatePartyMemberPoints(String partyMemberPointsId, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
updatePartyMemberPointsInfo(null, partyMemberPointsId, partyMemberPointsVO);
return new SuccessResult();
}
@Override
public SuccessResult updatePartyMemberPointsByToken(String token, String partyMemberPointsId, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
updatePartyMemberPointsInfo(token, partyMemberPointsId, partyMemberPointsVO);
return new SuccessResult();
}
/**
* 修改党员积分
*
* @param token
* @param partyMemberPointsId
* @param partyMemberPointsVO
*/
private void updatePartyMemberPointsInfo(String token, String partyMemberPointsId, PartyMemberPointsVO partyMemberPointsVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(partyMemberPointsVO);
params.put("partyMemberPointsId", partyMemberPointsId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
partyMemberPointsDao.updatePartyMemberPoints(params);
}
@Override
public PartyMemberPointsDTO getPartyMemberPointsById(String partyMemberPointsId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("partyMemberPointsId", partyMemberPointsId);
return partyMemberPointsDao.getPartyMemberPoints(params);
}
@Override
public PartyMemberPointsDTO getPartyMemberPointsByInfo(PartyMemberPointsVO vo) throws Exception{
Map<String, Object> params = HashMapUtil.beanToMap(vo);
return partyMemberPointsDao.getPartyMemberPoints(params);
}
@Override
public List<PartyMemberPointsDTO> listPartyMemberPoints(Map<String, Object> params) throws SearchException {
return partyMemberPointsDao.listPartyMemberPoints(params);
}
@Override
public SuccessResultList<List<PartyMemberPointsDTO>> listPagePartyMemberPoints(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<PartyMemberPointsDTO> partyMemberPointsDTOs = partyMemberPointsDao.listPartyMemberPoints(page.getParams());
PageInfo<PartyMemberPointsDTO> pageInfo = new PageInfo<>(partyMemberPointsDTOs);
return new SuccessResultList<>(partyMemberPointsDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberPartyMemberPoints(Map<String, Object> params) throws SearchException {
Integer count = partyMemberPointsDao.countPartyMemberPoints(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countPartyMemberPoints(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberPartyMemberPoints(params));
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.partypayment;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.partypayment.PartyPaymentDTO;
import com.cm.partybuilding.pojo.vos.partypayment.PartyPaymentVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IPartyPaymentService
* @Description: 党费管理
* @Author: WenG
* @Date: 2020-10-19 10:16
* @Version: 1.0
**/
public interface IPartyPaymentService {
/**
* 新增党费管理
*
* @param partyPaymentVO
* @return
* @throws Exception
*/
SuccessResult savePartyPayment(PartyPaymentVO partyPaymentVO) throws Exception;
/**
* 新增党费管理(APP)
*
* @param token
* @param partyPaymentVO
* @return
* @throws Exception
*/
SuccessResult savePartyPaymentByToken(String token, PartyPaymentVO partyPaymentVO) throws Exception;
/**
* 新增党费管理
*
* @param partyPaymentVO
* @return partyPaymentId
* @throws Exception
*/
String savePartyPaymentReturnId(PartyPaymentVO partyPaymentVO) throws Exception;
/**
* 新增党费管理(APP)
*
* @param token
* @param partyPaymentVO
* @return partyPaymentId
* @throws Exception
*/
String savePartyPaymentByTokenReturnId(String token, PartyPaymentVO partyPaymentVO) throws Exception;
/**
* 删除党费管理
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removePartyPayment(String ids) throws RemoveException;
/**
* 删除党费管理物理删除
*
* @param ids
* @throws RemoveException
*/
void deletePartyPayment(String ids) throws RemoveException;
/**
* 删除党费管理(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removePartyPaymentByToken(String token, String ids) throws RemoveException;
/**
* 修改党费管理
*
* @param partyPaymentId
* @param partyPaymentVO
* @return
* @throws Exception
*/
SuccessResult updatePartyPayment(String partyPaymentId, PartyPaymentVO partyPaymentVO) throws Exception;
/**
* 修改党费管理(APP)
*
* @param token
* @param partyPaymentId
* @param partyPaymentVO
* @return
* @throws Exception
*/
SuccessResult updatePartyPaymentByToken(String token, String partyPaymentId, PartyPaymentVO partyPaymentVO) throws Exception;
/**
* 党费管理详情(通过ID)
*
* @param partyPaymentId
* @return
* @throws SearchException
*/
PartyPaymentDTO getPartyPaymentById(String partyPaymentId) throws SearchException;
/**
* 党费管理列表
*
* @param params
* @return
* @throws SearchException
*/
List<PartyPaymentDTO> listPartyPayment(Map<String, Object> params) throws SearchException;
/**
* 党费管理分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<PartyPaymentDTO>> listPagePartyPayment(ListPage page) throws SearchException;
/**
* 党费管理统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberPartyPayment(Map<String, Object> params) throws SearchException;
/**
* 党费管理统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countPartyPayment(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.partypayment.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.partypayment.IPartyPaymentDao;
import com.cm.partybuilding.pojo.dtos.partypayment.PartyPaymentDTO;
import com.cm.partybuilding.pojo.vos.partypayment.PartyPaymentVO;
import com.cm.partybuilding.service.partypayment.IPartyPaymentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: PartyPaymentServiceImpl
* @Description: 党费管理
* @Author: WenG
* @Date: 2020-10-19 10:16
* @Version: 1.0
**/
@Service
public class PartyPaymentServiceImpl extends AbstractService implements IPartyPaymentService {
@Autowired
private IPartyPaymentDao partyPaymentDao;
@Override
public SuccessResult savePartyPayment(PartyPaymentVO partyPaymentVO) throws Exception {
savePartyPaymentInfo(null, partyPaymentVO);
return new SuccessResult();
}
@Override
public SuccessResult savePartyPaymentByToken(String token, PartyPaymentVO partyPaymentVO) throws Exception {
savePartyPaymentInfo(token, partyPaymentVO);
return new SuccessResult();
}
@Override
public String savePartyPaymentReturnId(PartyPaymentVO partyPaymentVO) throws Exception {
return savePartyPaymentInfoReturnId(null, partyPaymentVO);
}
@Override
public String savePartyPaymentByTokenReturnId(String token, PartyPaymentVO partyPaymentVO) throws Exception {
return savePartyPaymentInfoReturnId(token, partyPaymentVO);
}
/**
* 新增党费管理
*
* @param token
* @param partyPaymentVO
* @throws Exception
*/
private void savePartyPaymentInfo(String token, PartyPaymentVO partyPaymentVO) throws Exception {
savePartyPaymentInfoReturnId(token, partyPaymentVO);
}
/**
* 新增党费管理
*
* @param token
* @param partyPaymentVO
* @return partyPaymentId
* @throws Exception
*/
private String savePartyPaymentInfoReturnId(String token, PartyPaymentVO partyPaymentVO) throws Exception {
String partyPaymentId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(partyPaymentVO);
params.put("partyPaymentId", partyPaymentId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
partyPaymentDao.savePartyPayment(params);
return partyPaymentId;
}
@Override
public SuccessResult removePartyPayment(String ids) throws RemoveException {
removePartyPaymentInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removePartyPaymentByToken(String token, String ids) throws RemoveException {
removePartyPaymentInfo(token, ids);
return new SuccessResult();
}
/**
* 删除党费管理
*
* @param token
* @param ids
*/
private void removePartyPaymentInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("partyPaymentIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
partyPaymentDao.removePartyPayment(params);
}
@Override
public void deletePartyPayment(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("partyPaymentIds", Arrays.asList(ids.split("_")));
partyPaymentDao.deletePartyPayment(params);
}
@Override
public SuccessResult updatePartyPayment(String partyPaymentId, PartyPaymentVO partyPaymentVO) throws Exception {
updatePartyPaymentInfo(null, partyPaymentId, partyPaymentVO);
return new SuccessResult();
}
@Override
public SuccessResult updatePartyPaymentByToken(String token, String partyPaymentId, PartyPaymentVO partyPaymentVO) throws Exception {
updatePartyPaymentInfo(token, partyPaymentId, partyPaymentVO);
return new SuccessResult();
}
/**
* 修改党费管理
*
* @param token
* @param partyPaymentId
* @param partyPaymentVO
*/
private void updatePartyPaymentInfo(String token, String partyPaymentId, PartyPaymentVO partyPaymentVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(partyPaymentVO);
params.put("partyPaymentId", partyPaymentId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
partyPaymentDao.updatePartyPayment(params);
}
@Override
public PartyPaymentDTO getPartyPaymentById(String partyPaymentId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("partyPaymentId", partyPaymentId);
return partyPaymentDao.getPartyPayment(params);
}
@Override
public List<PartyPaymentDTO> listPartyPayment(Map<String, Object> params) throws SearchException {
return partyPaymentDao.listPartyPayment(params);
}
@Override
public SuccessResultList<List<PartyPaymentDTO>> listPagePartyPayment(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<PartyPaymentDTO> partyPaymentDTOs = partyPaymentDao.listPartyPayment(page.getParams());
PageInfo<PartyPaymentDTO> pageInfo = new PageInfo<>(partyPaymentDTOs);
return new SuccessResultList<>(partyPaymentDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberPartyPayment(Map<String, Object> params) throws SearchException {
Integer count = partyPaymentDao.countPartyPayment(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countPartyPayment(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberPartyPayment(params));
}
}

View File

@ -0,0 +1,156 @@
package com.cm.partybuilding.service.threemeetlesson;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IThreeMeetLessonService
* @Description:
* @Author: WenG
* @Date: 2020-10-19 09:46
* @Version: 1.0
**/
public interface IThreeMeetLessonService {
/**
* 新增
*
* @param threeMeetLessonVO
* @return
* @throws Exception
*/
SuccessResult saveThreeMeetLesson(ThreeMeetLessonVO threeMeetLessonVO) throws Exception;
/**
* 新增(APP)
*
* @param token
* @param threeMeetLessonVO
* @return
* @throws Exception
*/
SuccessResult saveThreeMeetLessonByToken(String token, ThreeMeetLessonVO threeMeetLessonVO) throws Exception;
/**
* 新增
*
* @param threeMeetLessonVO
* @return threeMeetLessonId
* @throws Exception
*/
String saveThreeMeetLessonReturnId(ThreeMeetLessonVO threeMeetLessonVO) throws Exception;
/**
* 新增(APP)
*
* @param token
* @param threeMeetLessonVO
* @return threeMeetLessonId
* @throws Exception
*/
String saveThreeMeetLessonByTokenReturnId(String token, ThreeMeetLessonVO threeMeetLessonVO) throws Exception;
/**
* 删除
*
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeThreeMeetLesson(String ids) throws RemoveException;
/**
* 删除物理删除
*
* @param ids
* @throws RemoveException
*/
void deleteThreeMeetLesson(String ids) throws RemoveException;
/**
* 删除(APP)
*
* @param token
* @param ids
* @return
* @throws RemoveException
*/
SuccessResult removeThreeMeetLessonByToken(String token, String ids) throws RemoveException;
/**
* 修改
*
* @param threeMeetLessonId
* @param threeMeetLessonVO
* @return
* @throws Exception
*/
SuccessResult updateThreeMeetLesson(String threeMeetLessonId, ThreeMeetLessonVO threeMeetLessonVO) throws Exception;
/**
* 修改(APP)
*
* @param token
* @param threeMeetLessonId
* @param threeMeetLessonVO
* @return
* @throws Exception
*/
SuccessResult updateThreeMeetLessonByToken(String token, String threeMeetLessonId, ThreeMeetLessonVO threeMeetLessonVO) throws Exception;
/**
* 详情(通过ID)
*
* @param threeMeetLessonId
* @return
* @throws SearchException
*/
ThreeMeetLessonDTO getThreeMeetLessonById(String threeMeetLessonId) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<ThreeMeetLessonDTO> listThreeMeetLesson(Map<String, Object> params) throws SearchException;
/**
* 分页列表
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<ThreeMeetLessonDTO>> listPageThreeMeetLesson(ListPage page) throws SearchException;
/**
* 统计
*
* @param params
* @return
* @throws SearchException
*/
Integer countNumberThreeMeetLesson(Map<String, Object> params) throws SearchException;
/**
* 统计
*
* @param params
* @return
* @throws SearchException
*/
SuccessResultData<Integer> countThreeMeetLesson(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,188 @@
package com.cm.partybuilding.service.threemeetlesson.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.threemeetlesson.IThreeMeetLessonDao;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO;
import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: ThreeMeetLessonServiceImpl
* @Description:
* @Author: WenG
* @Date: 2020-10-19 09:46
* @Version: 1.0
**/
@Service
public class ThreeMeetLessonServiceImpl extends AbstractService implements IThreeMeetLessonService {
@Autowired
private IThreeMeetLessonDao threeMeetLessonDao;
@Override
public SuccessResult saveThreeMeetLesson(ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
saveThreeMeetLessonInfo(null, threeMeetLessonVO);
return new SuccessResult();
}
@Override
public SuccessResult saveThreeMeetLessonByToken(String token, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
saveThreeMeetLessonInfo(token, threeMeetLessonVO);
return new SuccessResult();
}
@Override
public String saveThreeMeetLessonReturnId(ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
return saveThreeMeetLessonInfoReturnId(null, threeMeetLessonVO);
}
@Override
public String saveThreeMeetLessonByTokenReturnId(String token, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
return saveThreeMeetLessonInfoReturnId(token, threeMeetLessonVO);
}
/**
* 新增
*
* @param token
* @param threeMeetLessonVO
* @throws Exception
*/
private void saveThreeMeetLessonInfo(String token, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
saveThreeMeetLessonInfoReturnId(token, threeMeetLessonVO);
}
/**
* 新增
*
* @param token
* @param threeMeetLessonVO
* @return threeMeetLessonId
* @throws Exception
*/
private String saveThreeMeetLessonInfoReturnId(String token, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
String threeMeetLessonId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(threeMeetLessonVO);
params.put("threeMeetLessonId", threeMeetLessonId);
if (token != null) {
setSaveInfo(token, params);
} else {
setSaveInfo(params);
}
threeMeetLessonDao.saveThreeMeetLesson(params);
return threeMeetLessonId;
}
@Override
public SuccessResult removeThreeMeetLesson(String ids) throws RemoveException {
removeThreeMeetLessonInfo(null, ids);
return new SuccessResult();
}
@Override
public SuccessResult removeThreeMeetLessonByToken(String token, String ids) throws RemoveException {
removeThreeMeetLessonInfo(token, ids);
return new SuccessResult();
}
/**
* 删除
*
* @param token
* @param ids
*/
private void removeThreeMeetLessonInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("threeMeetLessonIds", Arrays.asList(ids.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
threeMeetLessonDao.removeThreeMeetLesson(params);
}
@Override
public void deleteThreeMeetLesson(String ids) throws RemoveException {
Map<String, Object> params = getHashMap(3);
params.put("threeMeetLessonIds", Arrays.asList(ids.split("_")));
threeMeetLessonDao.deleteThreeMeetLesson(params);
}
@Override
public SuccessResult updateThreeMeetLesson(String threeMeetLessonId, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
updateThreeMeetLessonInfo(null, threeMeetLessonId, threeMeetLessonVO);
return new SuccessResult();
}
@Override
public SuccessResult updateThreeMeetLessonByToken(String token, String threeMeetLessonId, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
updateThreeMeetLessonInfo(token, threeMeetLessonId, threeMeetLessonVO);
return new SuccessResult();
}
/**
* 修改
*
* @param token
* @param threeMeetLessonId
* @param threeMeetLessonVO
*/
private void updateThreeMeetLessonInfo(String token, String threeMeetLessonId, ThreeMeetLessonVO threeMeetLessonVO) throws Exception {
Map<String, Object> params = HashMapUtil.beanToMap(threeMeetLessonVO);
params.put("threeMeetLessonId", threeMeetLessonId);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
threeMeetLessonDao.updateThreeMeetLesson(params);
}
@Override
public ThreeMeetLessonDTO getThreeMeetLessonById(String threeMeetLessonId) throws SearchException {
Map<String, Object> params = super.getHashMap(1);
params.put("threeMeetLessonId", threeMeetLessonId);
return threeMeetLessonDao.getThreeMeetLesson(params);
}
@Override
public List<ThreeMeetLessonDTO> listThreeMeetLesson(Map<String, Object> params) throws SearchException {
return threeMeetLessonDao.listThreeMeetLesson(params);
}
@Override
public SuccessResultList<List<ThreeMeetLessonDTO>> listPageThreeMeetLesson(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
List<ThreeMeetLessonDTO> threeMeetLessonDTOs = threeMeetLessonDao.listThreeMeetLesson(page.getParams());
PageInfo<ThreeMeetLessonDTO> pageInfo = new PageInfo<>(threeMeetLessonDTOs);
return new SuccessResultList<>(threeMeetLessonDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer countNumberThreeMeetLesson(Map<String, Object> params) throws SearchException {
Integer count = threeMeetLessonDao.countThreeMeetLesson(params);
return count == null ? 0 : count;
}
@Override
public SuccessResultData<Integer> countThreeMeetLesson(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberThreeMeetLesson(params));
}
}

View File

@ -0,0 +1,50 @@
package com.cm.utils;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.partybuilding.pojo.dtos.partymemberpoints.PartyMemberPointsDTO;
import com.cm.partybuilding.pojo.vos.partymemberpoints.PartyMemberPointsVO;
import com.cm.partybuilding.service.partymemberpoints.IPartyMemberPointsService;
import java.util.Map;
/**
* @author xwangs
* @create 2020-10-20 16:31
* @description
*/
public class PartyMemberPointsUploadListener extends AnalysisEventListener<Map<String,Object>> {
private static final int BATCH_COUNT = 3000;
private IPartyMemberPointsService partyMemberPointsService;
public PartyMemberPointsUploadListener(){}
public PartyMemberPointsUploadListener(IPartyMemberPointsService service){
this.partyMemberPointsService = service;
}
@Override
public void invoke(Map<String, Object> data, AnalysisContext context) {
PartyMemberPointsVO vo = new PartyMemberPointsVO();
vo.setPartyName(data.get(0).toString().trim());
vo.setPhone(data.get(1).toString().trim());
vo.setCurrentPoints(data.get(2).toString().trim());
try {
PartyMemberPointsDTO temp = partyMemberPointsService.getPartyMemberPointsByInfo(vo);
if(temp == null){
partyMemberPointsService.savePartyMemberPoints(vo);
} else {
partyMemberPointsService.updatePartyMemberPoints(temp.getPartyMemberPointsId(),vo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
}
}

View File

@ -0,0 +1,52 @@
package com.cm.utils;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;
import com.cm.partybuilding.dao.partypayment.IPartyPaymentDao;
import com.cm.partybuilding.pojo.vos.partypayment.PartyPaymentVO;
import com.cm.partybuilding.service.partypayment.IPartyPaymentService;
import java.util.Map;
/**
* @author xwangs
* @create 2020-10-20 14:50
* @description
*/
public class PartyPaymentUploadListener extends AnalysisEventListener<Map<String,Object>> {
private static final int BATCH_COUNT = 3000;
private IPartyPaymentService partyPaymentService;
//List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>();
public PartyPaymentUploadListener(){}
public PartyPaymentUploadListener(IPartyPaymentService service){
this.partyPaymentService = service;
}
@Override
public void invoke(Map<String, Object> data, AnalysisContext context){
PartyPaymentVO vo = new PartyPaymentVO();
vo.setPartyName(data.get(0).toString());
vo.setPayment(data.get(1).toString());
vo.setPaymentDate(data.get(2).toString().substring(0,10));
vo.setPaymentType("".equals(data.get(3).toString())? "1" : "0");
saveData(vo);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
}
private void saveData(PartyPaymentVO vo){
try {
partyPaymentService.savePartyPayment(vo);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -60,6 +60,10 @@
AND
t1.article_category_id = #{articleCategoryId}
</if>
<if test="isPublish != null and isPublish != ''">
AND
t1.is_publish = #{isPublish}
</if>
<if test="articleContentIds != null and articleContentIds.size > 0">
AND
t1.article_content_id IN