diff --git a/src/main/java/com/cm/partybuilding/controller/resources/activity/ActivityResourceController.java b/src/main/java/com/cm/partybuilding/controller/resources/activity/ActivityResourceController.java new file mode 100644 index 0000000..a114cea --- /dev/null +++ b/src/main/java/com/cm/partybuilding/controller/resources/activity/ActivityResourceController.java @@ -0,0 +1,120 @@ +package com.cm.partybuilding.controller.resources.activity; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +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.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultData; +import com.cm.common.result.SuccessResultList; +import com.cm.partybuilding.pojo.dtos.activity.ActivityDTO; +import com.cm.partybuilding.pojo.vos.activity.ActivityVO; +import com.cm.partybuilding.service.activity.IActivityService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ActivityResourceController + * @Description: 名书记工作室活动 + * @Author: WenG + * @Date: 2020-10-21 10:50 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "名书记工作室活动接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/activity") +public class ActivityResourceController extends AbstractController { + + @Autowired + private IActivityService activityService; + + @ApiOperation(value = "新增名书记工作室活动", notes = "新增名书记工作室活动接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("saveactivity") + @CheckRequestBodyAnnotation + public SuccessResult saveActivity(@RequestBody ActivityVO activityVO) throws Exception { + return activityService.saveActivity(activityVO); + } + + @ApiOperation(value = "删除名书记工作室活动(id列表)", notes = "删除名书记工作室活动(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("removeactivity/{ids}") + public SuccessResult removeActivity(@PathVariable("ids") String ids) throws RemoveException { + return activityService.removeActivity(ids); + } + + @ApiOperation(value = "修改名书记工作室活动", notes = "修改名书记工作室活动接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "activityId", value = "名书记工作室活动ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updateactivity/{activityId}") + @CheckRequestBodyAnnotation + public SuccessResult updateActivity(@PathVariable("activityId") String activityId, @RequestBody ActivityVO activityVO) throws Exception { + return activityService.updateActivity(activityId, activityVO); + } + + @ApiOperation(value = "名书记工作室活动详情(通过ID)", notes = "名书记工作室活动详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "activityId", value = "名书记工作室活动ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getactivitybyid/{activityId}") + public ActivityDTO getActivityById(@PathVariable("activityId") String activityId) throws SearchException { + return activityService.getActivityById(activityId); + } + + @ApiOperation(value = "名书记工作室活动列表", notes = "名书记工作室活动列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listactivity") + public List listActivity() throws SearchException { + Map params = requestParams(); + return activityService.listActivity(params); + } + + @ApiOperation(value = "名书记工作室活动分页列表", notes = "名书记工作室活动分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpageactivity") + public SuccessResultList> listPageActivity(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return activityService.listPageActivity(page); + } + + @ApiOperation(value = "名书记工作室活动统计", notes = "名书记工作室活动统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("countactivity") + SuccessResultData countActivity() throws SearchException { + Map params = requestParams(); + return activityService.countActivity(params); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/controller/resources/partymemberorganize/PartyMemberOrganizeResourceController.java b/src/main/java/com/cm/partybuilding/controller/resources/partymemberorganize/PartyMemberOrganizeResourceController.java new file mode 100644 index 0000000..df484ac --- /dev/null +++ b/src/main/java/com/cm/partybuilding/controller/resources/partymemberorganize/PartyMemberOrganizeResourceController.java @@ -0,0 +1,120 @@ +package com.cm.partybuilding.controller.resources.partymemberorganize; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +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.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultData; +import com.cm.common.result.SuccessResultList; +import com.cm.partybuilding.pojo.dtos.partymemberorganize.PartyMemberOrganizeDTO; +import com.cm.partybuilding.pojo.vos.partymemberorganize.PartyMemberOrganizeVO; +import com.cm.partybuilding.service.partymemberorganize.IPartyMemberOrganizeService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: PartyMemberOrganizeResourceController + * @Description: 党员管理 + * @Author: WenG + * @Date: 2020-10-20 10:18 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "党员管理接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/partymemberorganize") +public class PartyMemberOrganizeResourceController extends AbstractController { + + @Autowired + private IPartyMemberOrganizeService partyMemberOrganizeService; + + @ApiOperation(value = "新增党员管理", notes = "新增党员管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("savepartymemberorganize") + @CheckRequestBodyAnnotation + public SuccessResult savePartyMemberOrganize(@RequestBody PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + return partyMemberOrganizeService.savePartyMemberOrganize(partyMemberOrganizeVO); + } + + @ApiOperation(value = "删除党员管理(id列表)", notes = "删除党员管理(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("removepartymemberorganize/{ids}") + public SuccessResult removePartyMemberOrganize(@PathVariable("ids") String ids) throws RemoveException { + return partyMemberOrganizeService.removePartyMemberOrganize(ids); + } + + @ApiOperation(value = "修改党员管理", notes = "修改党员管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "partyMemberOrganizeId", value = "党员管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updatepartymemberorganize/{partyMemberOrganizeId}") + @CheckRequestBodyAnnotation + public SuccessResult updatePartyMemberOrganize(@PathVariable("partyMemberOrganizeId") String partyMemberOrganizeId, @RequestBody PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + return partyMemberOrganizeService.updatePartyMemberOrganize(partyMemberOrganizeId, partyMemberOrganizeVO); + } + + @ApiOperation(value = "党员管理详情(通过ID)", notes = "党员管理详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "partyMemberOrganizeId", value = "党员管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getpartymemberorganizebyid/{partyMemberOrganizeId}") + public PartyMemberOrganizeDTO getPartyMemberOrganizeById(@PathVariable("partyMemberOrganizeId") String partyMemberOrganizeId) throws SearchException { + return partyMemberOrganizeService.getPartyMemberOrganizeById(partyMemberOrganizeId); + } + + @ApiOperation(value = "党员管理列表", notes = "党员管理列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpartymemberorganize") + public List listPartyMemberOrganize() throws SearchException { + Map params = requestParams(); + return partyMemberOrganizeService.listPartyMemberOrganize(params); + } + + @ApiOperation(value = "党员管理分页列表", notes = "党员管理分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagepartymemberorganize") + public SuccessResultList> listPagePartyMemberOrganize(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return partyMemberOrganizeService.listPagePartyMemberOrganize(page); + } + + @ApiOperation(value = "党员管理统计", notes = "党员管理统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("countpartymemberorganize") + SuccessResultData countPartyMemberOrganize() throws SearchException { + Map params = requestParams(); + return partyMemberOrganizeService.countPartyMemberOrganize(params); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/controller/resources/partyorganize/PartyOrganizeResourceController.java b/src/main/java/com/cm/partybuilding/controller/resources/partyorganize/PartyOrganizeResourceController.java new file mode 100644 index 0000000..1573be3 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/controller/resources/partyorganize/PartyOrganizeResourceController.java @@ -0,0 +1,120 @@ +package com.cm.partybuilding.controller.resources.partyorganize; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +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.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultData; +import com.cm.common.result.SuccessResultList; +import com.cm.partybuilding.pojo.dtos.partyorganize.PartyOrganizeDTO; +import com.cm.partybuilding.pojo.vos.partyorganize.PartyOrganizeVO; +import com.cm.partybuilding.service.partyorganize.IPartyOrganizeService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: PartyOrganizeResourceController + * @Description: 党组织 + * @Author: WenG + * @Date: 2020-10-16 14:24 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "党组织接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/partyorganize") +public class PartyOrganizeResourceController extends AbstractController { + + @Autowired + private IPartyOrganizeService partyOrganizeService; + + @ApiOperation(value = "新增党组织", notes = "新增党组织接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("savepartyorganize") + @CheckRequestBodyAnnotation + public SuccessResult savePartyOrganize(@RequestBody PartyOrganizeVO partyOrganizeVO) throws Exception { + return partyOrganizeService.savePartyOrganize(partyOrganizeVO); + } + + @ApiOperation(value = "删除党组织(id列表)", notes = "删除党组织(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("removepartyorganize/{ids}") + public SuccessResult removePartyOrganize(@PathVariable("ids") String ids) throws RemoveException { + return partyOrganizeService.removePartyOrganize(ids); + } + + @ApiOperation(value = "修改党组织", notes = "修改党组织接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "partyOrganizeId", value = "党组织ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updatepartyorganize/{partyOrganizeId}") + @CheckRequestBodyAnnotation + public SuccessResult updatePartyOrganize(@PathVariable("partyOrganizeId") String partyOrganizeId, @RequestBody PartyOrganizeVO partyOrganizeVO) throws Exception { + return partyOrganizeService.updatePartyOrganize(partyOrganizeId, partyOrganizeVO); + } + + @ApiOperation(value = "党组织详情(通过ID)", notes = "党组织详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "partyOrganizeId", value = "党组织ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getpartyorganizebyid/{partyOrganizeId}") + public PartyOrganizeDTO getPartyOrganizeById(@PathVariable("partyOrganizeId") String partyOrganizeId) throws SearchException { + return partyOrganizeService.getPartyOrganizeById(partyOrganizeId); + } + + @ApiOperation(value = "党组织列表", notes = "党组织列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpartyorganize") + public List listPartyOrganize() throws SearchException { + Map params = requestParams(); + return partyOrganizeService.listPartyOrganize(params); + } + + @ApiOperation(value = "党组织分页列表", notes = "党组织分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagepartyorganize") + public SuccessResultList> listPagePartyOrganize(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return partyOrganizeService.listPagePartyOrganize(page); + } + + @ApiOperation(value = "党组织统计", notes = "党组织统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("countpartyorganize") + SuccessResultData countPartyOrganize() throws SearchException { + Map params = requestParams(); + return partyOrganizeService.countPartyOrganize(params); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/controller/resources/secretarynoffice/SecretarynOfficeResourceController.java b/src/main/java/com/cm/partybuilding/controller/resources/secretarynoffice/SecretarynOfficeResourceController.java new file mode 100644 index 0000000..c0a54f4 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/controller/resources/secretarynoffice/SecretarynOfficeResourceController.java @@ -0,0 +1,120 @@ +package com.cm.partybuilding.controller.resources.secretarynoffice; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +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.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultData; +import com.cm.common.result.SuccessResultList; +import com.cm.partybuilding.pojo.dtos.secretarynoffice.SecretarynOfficeDTO; +import com.cm.partybuilding.pojo.vos.secretarynoffice.SecretarynOfficeVO; +import com.cm.partybuilding.service.secretarynoffice.ISecretarynOfficeService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: SecretarynOfficeResourceController + * @Description: 名书记工作室 + * @Author: WenG + * @Date: 2020-10-21 10:46 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "名书记工作室接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/secretarynoffice") +public class SecretarynOfficeResourceController extends AbstractController { + + @Autowired + private ISecretarynOfficeService secretarynOfficeService; + + @ApiOperation(value = "新增名书记工作室", notes = "新增名书记工作室接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("savesecretarynoffice") + @CheckRequestBodyAnnotation + public SuccessResult saveSecretarynOffice(@RequestBody SecretarynOfficeVO secretarynOfficeVO) throws Exception { + return secretarynOfficeService.saveSecretarynOffice(secretarynOfficeVO); + } + + @ApiOperation(value = "删除名书记工作室(id列表)", notes = "删除名书记工作室(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("removesecretarynoffice/{ids}") + public SuccessResult removeSecretarynOffice(@PathVariable("ids") String ids) throws RemoveException { + return secretarynOfficeService.removeSecretarynOffice(ids); + } + + @ApiOperation(value = "修改名书记工作室", notes = "修改名书记工作室接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "secretarynOfficeId", value = "名书记工作室ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updatesecretarynoffice/{secretarynOfficeId}") + @CheckRequestBodyAnnotation + public SuccessResult updateSecretarynOffice(@PathVariable("secretarynOfficeId") String secretarynOfficeId, @RequestBody SecretarynOfficeVO secretarynOfficeVO) throws Exception { + return secretarynOfficeService.updateSecretarynOffice(secretarynOfficeId, secretarynOfficeVO); + } + + @ApiOperation(value = "名书记工作室详情(通过ID)", notes = "名书记工作室详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "secretarynOfficeId", value = "名书记工作室ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getsecretarynofficebyid/{secretarynOfficeId}") + public SecretarynOfficeDTO getSecretarynOfficeById(@PathVariable("secretarynOfficeId") String secretarynOfficeId) throws SearchException { + return secretarynOfficeService.getSecretarynOfficeById(secretarynOfficeId); + } + + @ApiOperation(value = "名书记工作室列表", notes = "名书记工作室列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listsecretarynoffice") + public List listSecretarynOffice() throws SearchException { + Map params = requestParams(); + return secretarynOfficeService.listSecretarynOffice(params); + } + + @ApiOperation(value = "名书记工作室分页列表", notes = "名书记工作室分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagesecretarynoffice") + public SuccessResultList> listPageSecretarynOffice(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return secretarynOfficeService.listPageSecretarynOffice(page); + } + + @ApiOperation(value = "名书记工作室统计", notes = "名书记工作室统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("countsecretarynoffice") + SuccessResultData countSecretarynOffice() throws SearchException { + Map params = requestParams(); + return secretarynOfficeService.countSecretarynOffice(params); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/activity/IActivityService.java b/src/main/java/com/cm/partybuilding/service/activity/IActivityService.java new file mode 100644 index 0000000..752a99f --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/activity/IActivityService.java @@ -0,0 +1,156 @@ +package com.cm.partybuilding.service.activity; + +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.activity.ActivityDTO; +import com.cm.partybuilding.pojo.vos.activity.ActivityVO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IActivityService + * @Description: 名书记工作室活动 + * @Author: WenG + * @Date: 2020-10-21 10:50 + * @Version: 1.0 + **/ +public interface IActivityService { + + /** + * 新增名书记工作室活动 + * + * @param activityVO + * @return + * @throws Exception + */ + SuccessResult saveActivity(ActivityVO activityVO) throws Exception; + + /** + * 新增名书记工作室活动(APP) + * + * @param token + * @param activityVO + * @return + * @throws Exception + */ + SuccessResult saveActivityByToken(String token, ActivityVO activityVO) throws Exception; + + /** + * 新增名书记工作室活动 + * + * @param activityVO + * @return activityId + * @throws Exception + */ + String saveActivityReturnId(ActivityVO activityVO) throws Exception; + + /** + * 新增名书记工作室活动(APP) + * + * @param token + * @param activityVO + * @return activityId + * @throws Exception + */ + String saveActivityByTokenReturnId(String token, ActivityVO activityVO) throws Exception; + + /** + * 删除名书记工作室活动 + * + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeActivity(String ids) throws RemoveException; + + /** + * 删除名书记工作室活动(物理删除) + * + * @param ids + * @throws RemoveException + */ + void deleteActivity(String ids) throws RemoveException; + + /** + * 删除名书记工作室活动(APP) + * + * @param token + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeActivityByToken(String token, String ids) throws RemoveException; + + /** + * 修改名书记工作室活动 + * + * @param activityId + * @param activityVO + * @return + * @throws Exception + */ + SuccessResult updateActivity(String activityId, ActivityVO activityVO) throws Exception; + + /** + * 修改名书记工作室活动(APP) + * + * @param token + * @param activityId + * @param activityVO + * @return + * @throws Exception + */ + SuccessResult updateActivityByToken(String token, String activityId, ActivityVO activityVO) throws Exception; + + /** + * 名书记工作室活动详情(通过ID) + * + * @param activityId + * @return + * @throws SearchException + */ + ActivityDTO getActivityById(String activityId) throws SearchException; + + /** + * 名书记工作室活动列表 + * + * @param params + * @return + * @throws SearchException + */ + List listActivity(Map params) throws SearchException; + + /** + * 名书记工作室活动分页列表 + * + * @param page + * @return + * @throws SearchException + */ + SuccessResultList> listPageActivity(ListPage page) throws SearchException; + + /** + * 名书记工作室活动统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer countNumberActivity(Map params) throws SearchException; + + /** + * 名书记工作室活动统计 + * + * @param params + * @return + * @throws SearchException + */ + SuccessResultData countActivity(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/activity/impl/ActivityServiceImpl.java b/src/main/java/com/cm/partybuilding/service/activity/impl/ActivityServiceImpl.java new file mode 100644 index 0000000..31150a6 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/activity/impl/ActivityServiceImpl.java @@ -0,0 +1,188 @@ +package com.cm.partybuilding.service.activity.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.activity.IActivityDao; +import com.cm.partybuilding.pojo.dtos.activity.ActivityDTO; +import com.cm.partybuilding.pojo.vos.activity.ActivityVO; +import com.cm.partybuilding.service.activity.IActivityService; +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: ActivityServiceImpl + * @Description: 名书记工作室活动 + * @Author: WenG + * @Date: 2020-10-21 10:50 + * @Version: 1.0 + **/ +@Service +public class ActivityServiceImpl extends AbstractService implements IActivityService { + + @Autowired + private IActivityDao activityDao; + + @Override + public SuccessResult saveActivity(ActivityVO activityVO) throws Exception { + saveActivityInfo(null, activityVO); + return new SuccessResult(); + } + + @Override + public SuccessResult saveActivityByToken(String token, ActivityVO activityVO) throws Exception { + saveActivityInfo(token, activityVO); + return new SuccessResult(); + } + + @Override + public String saveActivityReturnId(ActivityVO activityVO) throws Exception { + return saveActivityInfoReturnId(null, activityVO); + } + + @Override + public String saveActivityByTokenReturnId(String token, ActivityVO activityVO) throws Exception { + return saveActivityInfoReturnId(token, activityVO); + } + + /** + * 新增名书记工作室活动 + * + * @param token + * @param activityVO + * @throws Exception + */ + private void saveActivityInfo(String token, ActivityVO activityVO) throws Exception { + saveActivityInfoReturnId(token, activityVO); + } + + /** + * 新增名书记工作室活动 + * + * @param token + * @param activityVO + * @return activityId + * @throws Exception + */ + private String saveActivityInfoReturnId(String token, ActivityVO activityVO) throws Exception { + String activityId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(activityVO); + params.put("activityId", activityId); + if (token != null) { + setSaveInfo(token, params); + } else { + setSaveInfo(params); + } + activityDao.saveActivity(params); + return activityId; + } + + @Override + public SuccessResult removeActivity(String ids) throws RemoveException { + removeActivityInfo(null, ids); + return new SuccessResult(); + } + + @Override + public SuccessResult removeActivityByToken(String token, String ids) throws RemoveException { + removeActivityInfo(token, ids); + return new SuccessResult(); + } + + /** + * 删除名书记工作室活动 + * + * @param token + * @param ids + */ + private void removeActivityInfo(String token, String ids) { + Map params = getHashMap(3); + params.put("activityIds", Arrays.asList(ids.split("_"))); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + activityDao.removeActivity(params); + } + + @Override + public void deleteActivity(String ids) throws RemoveException { + Map params = getHashMap(3); + params.put("activityIds", Arrays.asList(ids.split("_"))); + activityDao.deleteActivity(params); + } + + @Override + public SuccessResult updateActivity(String activityId, ActivityVO activityVO) throws Exception { + updateActivityInfo(null, activityId, activityVO); + return new SuccessResult(); + } + + @Override + public SuccessResult updateActivityByToken(String token, String activityId, ActivityVO activityVO) throws Exception { + updateActivityInfo(token, activityId, activityVO); + return new SuccessResult(); + } + + /** + * 修改名书记工作室活动 + * + * @param token + * @param activityId + * @param activityVO + */ + private void updateActivityInfo(String token, String activityId, ActivityVO activityVO) throws Exception { + Map params = HashMapUtil.beanToMap(activityVO); + params.put("activityId", activityId); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + activityDao.updateActivity(params); + } + + @Override + public ActivityDTO getActivityById(String activityId) throws SearchException { + Map params = super.getHashMap(1); + params.put("activityId", activityId); + return activityDao.getActivity(params); + } + + @Override + public List listActivity(Map params) throws SearchException { + return activityDao.listActivity(params); + } + + @Override + public SuccessResultList> listPageActivity(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List activityDTOs = activityDao.listActivity(page.getParams()); + PageInfo pageInfo = new PageInfo<>(activityDTOs); + return new SuccessResultList<>(activityDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer countNumberActivity(Map params) throws SearchException { + Integer count = activityDao.countActivity(params); + return count == null ? 0 : count; + } + + @Override + public SuccessResultData countActivity(Map params) throws SearchException { + return new SuccessResultData<>(countNumberActivity(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/partymemberorganize/IPartyMemberOrganizeService.java b/src/main/java/com/cm/partybuilding/service/partymemberorganize/IPartyMemberOrganizeService.java new file mode 100644 index 0000000..2f72318 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/partymemberorganize/IPartyMemberOrganizeService.java @@ -0,0 +1,157 @@ +package com.cm.partybuilding.service.partymemberorganize; + +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.partymemberorganize.PartyMemberOrganizeDTO; +import com.cm.partybuilding.pojo.vos.partymemberorganize.PartyMemberOrganizeVO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IPartyMemberOrganizeService + * @Description: 党员管理 + * @Author: WenG + * @Date: 2020-10-20 10:18 + * @Version: 1.0 + **/ +public interface IPartyMemberOrganizeService { + + /** + * 新增党员管理 + * + * @param partyMemberOrganizeVO + * @return + * @throws Exception + */ + SuccessResult savePartyMemberOrganize(PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception; + + /** + * 新增党员管理(APP) + * + * @param token + * @param partyMemberOrganizeVO + * @return + * @throws Exception + */ + SuccessResult savePartyMemberOrganizeByToken(String token, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception; + + /** + * 新增党员管理 + * + * @param partyMemberOrganizeVO + * @return partyMemberOrganizeId + * @throws Exception + */ + String savePartyMemberOrganizeReturnId(PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception; + + /** + * 新增党员管理(APP) + * + * @param token + * @param partyMemberOrganizeVO + * @return partyMemberOrganizeId + * @throws Exception + */ + String savePartyMemberOrganizeByTokenReturnId(String token, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception; + + /** + * 删除党员管理 + * + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removePartyMemberOrganize(String ids) throws RemoveException; + + /** + * 删除党员管理(物理删除) + * + * @param ids + * @throws RemoveException + */ + void deletePartyMemberOrganize(String ids) throws RemoveException; + + /** + * 删除党员管理(APP) + * + * @param token + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removePartyMemberOrganizeByToken(String token, String ids) throws RemoveException; + + /** + * 修改党员管理 + * + * @param partyMemberOrganizeId + * @param partyMemberOrganizeVO + * @return + * @throws Exception + */ + SuccessResult updatePartyMemberOrganize(String partyMemberOrganizeId, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception; + + /** + * 修改党员管理(APP) + * + * @param token + * @param partyMemberOrganizeId + * @param partyMemberOrganizeVO + * @return + * @throws Exception + */ + SuccessResult updatePartyMemberOrganizeByToken(String token, String partyMemberOrganizeId, + PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception; + + /** + * 党员管理详情(通过ID) + * + * @param partyMemberOrganizeId + * @return + * @throws SearchException + */ + PartyMemberOrganizeDTO getPartyMemberOrganizeById(String partyMemberOrganizeId) throws SearchException; + + /** + * 党员管理列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPartyMemberOrganize(Map params) throws SearchException; + + /** + * 党员管理分页列表 + * + * @param page + * @return + * @throws SearchException + */ + SuccessResultList> listPagePartyMemberOrganize(ListPage page) throws SearchException; + + /** + * 党员管理统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer countNumberPartyMemberOrganize(Map params) throws SearchException; + + /** + * 党员管理统计 + * + * @param params + * @return + * @throws SearchException + */ + SuccessResultData countPartyMemberOrganize(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/partymemberorganize/impl/PartyMemberOrganizeServiceImpl.java b/src/main/java/com/cm/partybuilding/service/partymemberorganize/impl/PartyMemberOrganizeServiceImpl.java new file mode 100644 index 0000000..41f6c3c --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/partymemberorganize/impl/PartyMemberOrganizeServiceImpl.java @@ -0,0 +1,188 @@ +package com.cm.partybuilding.service.partymemberorganize.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.partymemberorganize.IPartyMemberOrganizeDao; +import com.cm.partybuilding.pojo.dtos.partymemberorganize.PartyMemberOrganizeDTO; +import com.cm.partybuilding.pojo.vos.partymemberorganize.PartyMemberOrganizeVO; +import com.cm.partybuilding.service.partymemberorganize.IPartyMemberOrganizeService; +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: PartyMemberOrganizeServiceImpl + * @Description: 党员管理 + * @Author: WenG + * @Date: 2020-10-20 10:18 + * @Version: 1.0 + **/ +@Service +public class PartyMemberOrganizeServiceImpl extends AbstractService implements IPartyMemberOrganizeService { + + @Autowired + private IPartyMemberOrganizeDao partyMemberOrganizeDao; + + @Override + public SuccessResult savePartyMemberOrganize(PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + savePartyMemberOrganizeInfo(null, partyMemberOrganizeVO); + return new SuccessResult(); + } + + @Override + public SuccessResult savePartyMemberOrganizeByToken(String token, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + savePartyMemberOrganizeInfo(token, partyMemberOrganizeVO); + return new SuccessResult(); + } + + @Override + public String savePartyMemberOrganizeReturnId(PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + return savePartyMemberOrganizeInfoReturnId(null, partyMemberOrganizeVO); + } + + @Override + public String savePartyMemberOrganizeByTokenReturnId(String token, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + return savePartyMemberOrganizeInfoReturnId(token, partyMemberOrganizeVO); + } + + /** + * 新增党员管理 + * + * @param token + * @param partyMemberOrganizeVO + * @throws Exception + */ + private void savePartyMemberOrganizeInfo(String token, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + savePartyMemberOrganizeInfoReturnId(token, partyMemberOrganizeVO); + } + + /** + * 新增党员管理 + * + * @param token + * @param partyMemberOrganizeVO + * @return partyMemberOrganizeId + * @throws Exception + */ + private String savePartyMemberOrganizeInfoReturnId(String token, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + String partyMemberOrganizeId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(partyMemberOrganizeVO); + params.put("partyMemberOrganizeId", partyMemberOrganizeId); + if (token != null) { + setSaveInfo(token, params); + } else { + setSaveInfo(params); + } + partyMemberOrganizeDao.savePartyMemberOrganize(params); + return partyMemberOrganizeId; + } + + @Override + public SuccessResult removePartyMemberOrganize(String ids) throws RemoveException { + removePartyMemberOrganizeInfo(null, ids); + return new SuccessResult(); + } + + @Override + public SuccessResult removePartyMemberOrganizeByToken(String token, String ids) throws RemoveException { + removePartyMemberOrganizeInfo(token, ids); + return new SuccessResult(); + } + + /** + * 删除党员管理 + * + * @param token + * @param ids + */ + private void removePartyMemberOrganizeInfo(String token, String ids) { + Map params = getHashMap(3); + params.put("partyMemberOrganizeIds", Arrays.asList(ids.split("_"))); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + partyMemberOrganizeDao.removePartyMemberOrganize(params); + } + + @Override + public void deletePartyMemberOrganize(String ids) throws RemoveException { + Map params = getHashMap(3); + params.put("partyMemberOrganizeIds", Arrays.asList(ids.split("_"))); + partyMemberOrganizeDao.deletePartyMemberOrganize(params); + } + + @Override + public SuccessResult updatePartyMemberOrganize(String partyMemberOrganizeId, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + updatePartyMemberOrganizeInfo(null, partyMemberOrganizeId, partyMemberOrganizeVO); + return new SuccessResult(); + } + + @Override + public SuccessResult updatePartyMemberOrganizeByToken(String token, String partyMemberOrganizeId, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + updatePartyMemberOrganizeInfo(token, partyMemberOrganizeId, partyMemberOrganizeVO); + return new SuccessResult(); + } + + /** + * 修改党员管理 + * + * @param token + * @param partyMemberOrganizeId + * @param partyMemberOrganizeVO + */ + private void updatePartyMemberOrganizeInfo(String token, String partyMemberOrganizeId, PartyMemberOrganizeVO partyMemberOrganizeVO) throws Exception { + Map params = HashMapUtil.beanToMap(partyMemberOrganizeVO); + params.put("partyMemberOrganizeId", partyMemberOrganizeId); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + partyMemberOrganizeDao.updatePartyMemberOrganize(params); + } + + @Override + public PartyMemberOrganizeDTO getPartyMemberOrganizeById(String partyMemberOrganizeId) throws SearchException { + Map params = super.getHashMap(1); + params.put("partyMemberOrganizeId", partyMemberOrganizeId); + return partyMemberOrganizeDao.getPartyMemberOrganize(params); + } + + @Override + public List listPartyMemberOrganize(Map params) throws SearchException { + return partyMemberOrganizeDao.listPartyMemberOrganize(params); + } + + @Override + public SuccessResultList> listPagePartyMemberOrganize(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List partyMemberOrganizeDTOs = partyMemberOrganizeDao.listPartyMemberOrganize(page.getParams()); + PageInfo pageInfo = new PageInfo<>(partyMemberOrganizeDTOs); + return new SuccessResultList<>(partyMemberOrganizeDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer countNumberPartyMemberOrganize(Map params) throws SearchException { + Integer count = partyMemberOrganizeDao.countPartyMemberOrganize(params); + return count == null ? 0 : count; + } + + @Override + public SuccessResultData countPartyMemberOrganize(Map params) throws SearchException { + return new SuccessResultData<>(countNumberPartyMemberOrganize(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/partyorganize/IPartyOrganizeService.java b/src/main/java/com/cm/partybuilding/service/partyorganize/IPartyOrganizeService.java new file mode 100644 index 0000000..b40dc73 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/partyorganize/IPartyOrganizeService.java @@ -0,0 +1,156 @@ +package com.cm.partybuilding.service.partyorganize; + +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.partyorganize.PartyOrganizeDTO; +import com.cm.partybuilding.pojo.vos.partyorganize.PartyOrganizeVO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IPartyOrganizeService + * @Description: 党组织 + * @Author: WenG + * @Date: 2020-10-16 14:24 + * @Version: 1.0 + **/ +public interface IPartyOrganizeService { + + /** + * 新增党组织 + * + * @param partyOrganizeVO + * @return + * @throws Exception + */ + SuccessResult savePartyOrganize(PartyOrganizeVO partyOrganizeVO) throws Exception; + + /** + * 新增党组织(APP) + * + * @param token + * @param partyOrganizeVO + * @return + * @throws Exception + */ + SuccessResult savePartyOrganizeByToken(String token, PartyOrganizeVO partyOrganizeVO) throws Exception; + + /** + * 新增党组织 + * + * @param partyOrganizeVO + * @return partyOrganizeId + * @throws Exception + */ + String savePartyOrganizeReturnId(PartyOrganizeVO partyOrganizeVO) throws Exception; + + /** + * 新增党组织(APP) + * + * @param token + * @param partyOrganizeVO + * @return partyOrganizeId + * @throws Exception + */ + String savePartyOrganizeByTokenReturnId(String token, PartyOrganizeVO partyOrganizeVO) throws Exception; + + /** + * 删除党组织 + * + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removePartyOrganize(String ids) throws RemoveException; + + /** + * 删除党组织(物理删除) + * + * @param ids + * @throws RemoveException + */ + void deletePartyOrganize(String ids) throws RemoveException; + + /** + * 删除党组织(APP) + * + * @param token + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removePartyOrganizeByToken(String token, String ids) throws RemoveException; + + /** + * 修改党组织 + * + * @param partyOrganizeId + * @param partyOrganizeVO + * @return + * @throws Exception + */ + SuccessResult updatePartyOrganize(String partyOrganizeId, PartyOrganizeVO partyOrganizeVO) throws Exception; + + /** + * 修改党组织(APP) + * + * @param token + * @param partyOrganizeId + * @param partyOrganizeVO + * @return + * @throws Exception + */ + SuccessResult updatePartyOrganizeByToken(String token, String partyOrganizeId, PartyOrganizeVO partyOrganizeVO) throws Exception; + + /** + * 党组织详情(通过ID) + * + * @param partyOrganizeId + * @return + * @throws SearchException + */ + PartyOrganizeDTO getPartyOrganizeById(String partyOrganizeId) throws SearchException; + + /** + * 党组织列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPartyOrganize(Map params) throws SearchException; + + /** + * 党组织分页列表 + * + * @param page + * @return + * @throws SearchException + */ + SuccessResultList> listPagePartyOrganize(ListPage page) throws SearchException; + + /** + * 党组织统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer countNumberPartyOrganize(Map params) throws SearchException; + + /** + * 党组织统计 + * + * @param params + * @return + * @throws SearchException + */ + SuccessResultData countPartyOrganize(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/partyorganize/impl/PartyOrganizeServiceImpl.java b/src/main/java/com/cm/partybuilding/service/partyorganize/impl/PartyOrganizeServiceImpl.java new file mode 100644 index 0000000..aec3ae6 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/partyorganize/impl/PartyOrganizeServiceImpl.java @@ -0,0 +1,187 @@ +package com.cm.partybuilding.service.partyorganize.impl; + +import com.cm.common.base.AbstractService; +import com.cm.common.exception.RemoveException; +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.partyorganize.IPartyOrganizeDao; +import com.cm.partybuilding.pojo.dtos.partyorganize.PartyOrganizeDTO; +import com.cm.partybuilding.pojo.vos.partyorganize.PartyOrganizeVO; +import com.cm.partybuilding.service.partyorganize.IPartyOrganizeService; +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: PartyOrganizeServiceImpl + * @Description: 党组织 + * @Author: WenG + * @Date: 2020-10-16 14:24 + * @Version: 1.0 + **/ +@Service +public class PartyOrganizeServiceImpl extends AbstractService implements IPartyOrganizeService { + + @Autowired + private IPartyOrganizeDao partyOrganizeDao; + + @Override + public SuccessResult savePartyOrganize(PartyOrganizeVO partyOrganizeVO) throws Exception { + savePartyOrganizeInfo(null, partyOrganizeVO); + return new SuccessResult(); + } + + @Override + public SuccessResult savePartyOrganizeByToken(String token, PartyOrganizeVO partyOrganizeVO) throws Exception { + savePartyOrganizeInfo(token, partyOrganizeVO); + return new SuccessResult(); + } + + @Override + public String savePartyOrganizeReturnId(PartyOrganizeVO partyOrganizeVO) throws Exception { + return savePartyOrganizeInfoReturnId(null, partyOrganizeVO); + } + + @Override + public String savePartyOrganizeByTokenReturnId(String token, PartyOrganizeVO partyOrganizeVO) throws Exception { + return savePartyOrganizeInfoReturnId(token, partyOrganizeVO); + } + + /** + * 新增党组织 + * + * @param token + * @param partyOrganizeVO + * @throws Exception + */ + private void savePartyOrganizeInfo(String token, PartyOrganizeVO partyOrganizeVO) throws Exception { + savePartyOrganizeInfoReturnId(token, partyOrganizeVO); + } + + /** + * 新增党组织 + * + * @param token + * @param partyOrganizeVO + * @return partyOrganizeId + * @throws Exception + */ + private String savePartyOrganizeInfoReturnId(String token, PartyOrganizeVO partyOrganizeVO) throws Exception { + String partyOrganizeId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(partyOrganizeVO); + params.put("partyOrganizeId", partyOrganizeId); + if (token != null) { + setSaveInfo(token, params); + } else { + setSaveInfo(params); + } + partyOrganizeDao.savePartyOrganize(params); + return partyOrganizeId; + } + + @Override + public SuccessResult removePartyOrganize(String ids) throws RemoveException { + removePartyOrganizeInfo(null, ids); + return new SuccessResult(); + } + + @Override + public SuccessResult removePartyOrganizeByToken(String token, String ids) throws RemoveException { + removePartyOrganizeInfo(token, ids); + return new SuccessResult(); + } + + /** + * 删除党组织 + * + * @param token + * @param ids + */ + private void removePartyOrganizeInfo(String token, String ids) { + Map params = getHashMap(3); + params.put("partyOrganizeIds", Arrays.asList(ids.split("_"))); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + partyOrganizeDao.removePartyOrganize(params); + } + + @Override + public void deletePartyOrganize(String ids) throws RemoveException { + Map params = getHashMap(3); + params.put("partyOrganizeIds", Arrays.asList(ids.split("_"))); + partyOrganizeDao.deletePartyOrganize(params); + } + + @Override + public SuccessResult updatePartyOrganize(String partyOrganizeId, PartyOrganizeVO partyOrganizeVO) throws Exception { + updatePartyOrganizeInfo(null, partyOrganizeId, partyOrganizeVO); + return new SuccessResult(); + } + + @Override + public SuccessResult updatePartyOrganizeByToken(String token, String partyOrganizeId, PartyOrganizeVO partyOrganizeVO) throws Exception { + updatePartyOrganizeInfo(token, partyOrganizeId, partyOrganizeVO); + return new SuccessResult(); + } + + /** + * 修改党组织 + * + * @param token + * @param partyOrganizeId + * @param partyOrganizeVO + */ + private void updatePartyOrganizeInfo(String token, String partyOrganizeId, PartyOrganizeVO partyOrganizeVO) throws Exception { + Map params = HashMapUtil.beanToMap(partyOrganizeVO); + params.put("partyOrganizeId", partyOrganizeId); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + partyOrganizeDao.updatePartyOrganize(params); + } + + @Override + public PartyOrganizeDTO getPartyOrganizeById(String partyOrganizeId) throws SearchException { + Map params = super.getHashMap(1); + params.put("partyOrganizeId", partyOrganizeId); + return partyOrganizeDao.getPartyOrganize(params); + } + + @Override + public List listPartyOrganize(Map params) throws SearchException { + return partyOrganizeDao.listPartyOrganize(params); + } + + @Override + public SuccessResultList> listPagePartyOrganize(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List partyOrganizeDTOs = partyOrganizeDao.listPartyOrganize(page.getParams()); + PageInfo pageInfo = new PageInfo<>(partyOrganizeDTOs); + return new SuccessResultList<>(partyOrganizeDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer countNumberPartyOrganize(Map params) throws SearchException { + Integer count = partyOrganizeDao.countPartyOrganize(params); + return count == null ? 0 : count; + } + + @Override + public SuccessResultData countPartyOrganize(Map params) throws SearchException { + return new SuccessResultData<>(countNumberPartyOrganize(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/secretarynoffice/ISecretarynOfficeService.java b/src/main/java/com/cm/partybuilding/service/secretarynoffice/ISecretarynOfficeService.java new file mode 100644 index 0000000..b7e1c92 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/secretarynoffice/ISecretarynOfficeService.java @@ -0,0 +1,157 @@ +package com.cm.partybuilding.service.secretarynoffice; + +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.secretarynoffice.SecretarynOfficeDTO; +import com.cm.partybuilding.pojo.vos.secretarynoffice.SecretarynOfficeVO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ISecretarynOfficeService + * @Description: 名书记工作室 + * @Author: WenG + * @Date: 2020-10-21 10:46 + * @Version: 1.0 + **/ +public interface ISecretarynOfficeService { + + /** + * 新增名书记工作室 + * + * @param secretarynOfficeVO + * @return + * @throws Exception + */ + SuccessResult saveSecretarynOffice(SecretarynOfficeVO secretarynOfficeVO) throws Exception; + + /** + * 新增名书记工作室(APP) + * + * @param token + * @param secretarynOfficeVO + * @return + * @throws Exception + */ + SuccessResult saveSecretarynOfficeByToken(String token, SecretarynOfficeVO secretarynOfficeVO) throws Exception; + + /** + * 新增名书记工作室 + * + * @param secretarynOfficeVO + * @return secretarynOfficeId + * @throws Exception + */ + String saveSecretarynOfficeReturnId(SecretarynOfficeVO secretarynOfficeVO) throws Exception; + + /** + * 新增名书记工作室(APP) + * + * @param token + * @param secretarynOfficeVO + * @return secretarynOfficeId + * @throws Exception + */ + String saveSecretarynOfficeByTokenReturnId(String token, SecretarynOfficeVO secretarynOfficeVO) throws Exception; + + /** + * 删除名书记工作室 + * + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeSecretarynOffice(String ids) throws RemoveException; + + /** + * 删除名书记工作室(物理删除) + * + * @param ids + * @throws RemoveException + */ + void deleteSecretarynOffice(String ids) throws RemoveException; + + /** + * 删除名书记工作室(APP) + * + * @param token + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeSecretarynOfficeByToken(String token, String ids) throws RemoveException; + + /** + * 修改名书记工作室 + * + * @param secretarynOfficeId + * @param secretarynOfficeVO + * @return + * @throws Exception + */ + SuccessResult updateSecretarynOffice(String secretarynOfficeId, SecretarynOfficeVO secretarynOfficeVO) throws Exception; + + /** + * 修改名书记工作室(APP) + * + * @param token + * @param secretarynOfficeId + * @param secretarynOfficeVO + * @return + * @throws Exception + */ + SuccessResult updateSecretarynOfficeByToken(String token, String secretarynOfficeId, + SecretarynOfficeVO secretarynOfficeVO) throws Exception; + + /** + * 名书记工作室详情(通过ID) + * + * @param secretarynOfficeId + * @return + * @throws SearchException + */ + SecretarynOfficeDTO getSecretarynOfficeById(String secretarynOfficeId) throws SearchException; + + /** + * 名书记工作室列表 + * + * @param params + * @return + * @throws SearchException + */ + List listSecretarynOffice(Map params) throws SearchException; + + /** + * 名书记工作室分页列表 + * + * @param page + * @return + * @throws SearchException + */ + SuccessResultList> listPageSecretarynOffice(ListPage page) throws SearchException; + + /** + * 名书记工作室统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer countNumberSecretarynOffice(Map params) throws SearchException; + + /** + * 名书记工作室统计 + * + * @param params + * @return + * @throws SearchException + */ + SuccessResultData countSecretarynOffice(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/secretarynoffice/impl/SecretarynOfficeServiceImpl.java b/src/main/java/com/cm/partybuilding/service/secretarynoffice/impl/SecretarynOfficeServiceImpl.java new file mode 100644 index 0000000..57ef279 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/service/secretarynoffice/impl/SecretarynOfficeServiceImpl.java @@ -0,0 +1,188 @@ +package com.cm.partybuilding.service.secretarynoffice.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.secretarynoffice.ISecretarynOfficeDao; +import com.cm.partybuilding.pojo.dtos.secretarynoffice.SecretarynOfficeDTO; +import com.cm.partybuilding.pojo.vos.secretarynoffice.SecretarynOfficeVO; +import com.cm.partybuilding.service.secretarynoffice.ISecretarynOfficeService; +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: SecretarynOfficeServiceImpl + * @Description: 名书记工作室 + * @Author: WenG + * @Date: 2020-10-21 10:46 + * @Version: 1.0 + **/ +@Service +public class SecretarynOfficeServiceImpl extends AbstractService implements ISecretarynOfficeService { + + @Autowired + private ISecretarynOfficeDao secretarynOfficeDao; + + @Override + public SuccessResult saveSecretarynOffice(SecretarynOfficeVO secretarynOfficeVO) throws Exception { + saveSecretarynOfficeInfo(null, secretarynOfficeVO); + return new SuccessResult(); + } + + @Override + public SuccessResult saveSecretarynOfficeByToken(String token, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + saveSecretarynOfficeInfo(token, secretarynOfficeVO); + return new SuccessResult(); + } + + @Override + public String saveSecretarynOfficeReturnId(SecretarynOfficeVO secretarynOfficeVO) throws Exception { + return saveSecretarynOfficeInfoReturnId(null, secretarynOfficeVO); + } + + @Override + public String saveSecretarynOfficeByTokenReturnId(String token, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + return saveSecretarynOfficeInfoReturnId(token, secretarynOfficeVO); + } + + /** + * 新增名书记工作室 + * + * @param token + * @param secretarynOfficeVO + * @throws Exception + */ + private void saveSecretarynOfficeInfo(String token, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + saveSecretarynOfficeInfoReturnId(token, secretarynOfficeVO); + } + + /** + * 新增名书记工作室 + * + * @param token + * @param secretarynOfficeVO + * @return secretarynOfficeId + * @throws Exception + */ + private String saveSecretarynOfficeInfoReturnId(String token, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + String secretarynOfficeId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(secretarynOfficeVO); + params.put("secretarynOfficeId", secretarynOfficeId); + if (token != null) { + setSaveInfo(token, params); + } else { + setSaveInfo(params); + } + secretarynOfficeDao.saveSecretarynOffice(params); + return secretarynOfficeId; + } + + @Override + public SuccessResult removeSecretarynOffice(String ids) throws RemoveException { + removeSecretarynOfficeInfo(null, ids); + return new SuccessResult(); + } + + @Override + public SuccessResult removeSecretarynOfficeByToken(String token, String ids) throws RemoveException { + removeSecretarynOfficeInfo(token, ids); + return new SuccessResult(); + } + + /** + * 删除名书记工作室 + * + * @param token + * @param ids + */ + private void removeSecretarynOfficeInfo(String token, String ids) { + Map params = getHashMap(3); + params.put("secretarynOfficeIds", Arrays.asList(ids.split("_"))); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + secretarynOfficeDao.removeSecretarynOffice(params); + } + + @Override + public void deleteSecretarynOffice(String ids) throws RemoveException { + Map params = getHashMap(3); + params.put("secretarynOfficeIds", Arrays.asList(ids.split("_"))); + secretarynOfficeDao.deleteSecretarynOffice(params); + } + + @Override + public SuccessResult updateSecretarynOffice(String secretarynOfficeId, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + updateSecretarynOfficeInfo(null, secretarynOfficeId, secretarynOfficeVO); + return new SuccessResult(); + } + + @Override + public SuccessResult updateSecretarynOfficeByToken(String token, String secretarynOfficeId, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + updateSecretarynOfficeInfo(token, secretarynOfficeId, secretarynOfficeVO); + return new SuccessResult(); + } + + /** + * 修改名书记工作室 + * + * @param token + * @param secretarynOfficeId + * @param secretarynOfficeVO + */ + private void updateSecretarynOfficeInfo(String token, String secretarynOfficeId, SecretarynOfficeVO secretarynOfficeVO) throws Exception { + Map params = HashMapUtil.beanToMap(secretarynOfficeVO); + params.put("secretarynOfficeId", secretarynOfficeId); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + secretarynOfficeDao.updateSecretarynOffice(params); + } + + @Override + public SecretarynOfficeDTO getSecretarynOfficeById(String secretarynOfficeId) throws SearchException { + Map params = super.getHashMap(1); + params.put("secretarynOfficeId", secretarynOfficeId); + return secretarynOfficeDao.getSecretarynOffice(params); + } + + @Override + public List listSecretarynOffice(Map params) throws SearchException { + return secretarynOfficeDao.listSecretarynOffice(params); + } + + @Override + public SuccessResultList> listPageSecretarynOffice(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List secretarynOfficeDTOs = secretarynOfficeDao.listSecretarynOffice(page.getParams()); + PageInfo pageInfo = new PageInfo<>(secretarynOfficeDTOs); + return new SuccessResultList<>(secretarynOfficeDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer countNumberSecretarynOffice(Map params) throws SearchException { + Integer count = secretarynOfficeDao.countSecretarynOffice(params); + return count == null ? 0 : count; + } + + @Override + public SuccessResultData countSecretarynOffice(Map params) throws SearchException { + return new SuccessResultData<>(countNumberSecretarynOffice(params)); + } + +} \ No newline at end of file