From ba6510ad0e7e306f3ac106ba3d7f3d935cc49058 Mon Sep 17 00:00:00 2001 From: "517612449@qq.com" Date: Thu, 30 Jun 2022 10:01:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E5=91=98=E6=B4=BB=E5=8A=A8=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PartyMemberEventController.java | 34 +++++++++++++++++ .../partyMemberEvent/entity/EventContact.java | 2 + .../entity/EventContactSuggestion.java | 2 + .../entity/EventPartyBranch.java | 2 + .../partyMemberEvent/entity/EventStyle.java | 2 + .../partyMemberEvent/entity/EventSubject.java | 2 + .../enums/PartyEventExceptionEnum.java | 30 +++++++++++++++ .../service/EventContactService.java | 1 + .../service/EventPartyBranchService.java | 3 ++ .../service/EventStyleService.java | 2 + .../service/EventSubjectService.java | 2 + .../service/impl/EventContactServiceImpl.java | 16 ++++++++ .../impl/EventPartyBranchServiceImpl.java | 37 +++++++++++++++++++ .../service/impl/EventStyleServiceImpl.java | 18 +++++++++ .../service/impl/EventSubjectServiceImpl.java | 13 +++++++ 15 files changed, 166 insertions(+) create mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/enums/PartyEventExceptionEnum.java diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java index e5cc715..31f9b0b 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java @@ -109,4 +109,38 @@ public class PartyMemberEventController { return BaseResponse.success(eventStyleService.getEventStyle("list", inVO)); } + + @ApiOperation("保存联系人") + @PostMapping("/save/contact") + public BaseResponse saveContact(@RequestBody EventContact inVO) { + return BaseResponse.success(eventContactService.saveContact(inVO)); + } + + + @ApiOperation("保存攻坚项目") + @PostMapping("/save/subject") + public BaseResponse saveSubject(@RequestBody EventSubject inVO) { + return BaseResponse.success(eventSubjectService.saveSubject(inVO)); + } + + + @ApiOperation("保存活动风采") + @PostMapping("/save/style") + public BaseResponse saveStyle(@RequestBody EventStyle inVO) { + return BaseResponse.success(eventStyleService.saveStyle(inVO)); + } + + @ApiOperation("保存党支部") + @PostMapping("/save/branch") + public BaseResponse saveBranch(@RequestBody EventPartyBranch inVO) { + return BaseResponse.success(eventPartyBranchService.saveBranch(inVO)); + } + + @ApiOperation("保存党员") + @PostMapping("/save/member") + public BaseResponse saveMember(@RequestBody EventPartyBranch inVO) { + return BaseResponse.success(eventPartyBranchService.saveMember(inVO)); + } + + } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContact.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContact.java index 4c343d0..7a081fc 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContact.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContact.java @@ -1,6 +1,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; import com.fasterxml.jackson.annotation.JsonFormat; @@ -28,6 +29,7 @@ public class EventContact implements Serializable { /** * id */ + @TableId @ApiModelProperty(value = "id") private String id; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java index 1be2b1f..b4c8e59 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java @@ -1,6 +1,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; import com.fasterxml.jackson.annotation.JsonFormat; @@ -28,6 +29,7 @@ public class EventContactSuggestion implements Serializable { /** * id */ + @TableId @ApiModelProperty(value = "id") private String id; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyBranch.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyBranch.java index 97c63c8..6571b3f 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyBranch.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyBranch.java @@ -1,6 +1,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; import com.fasterxml.jackson.annotation.JsonFormat; @@ -28,6 +29,7 @@ public class EventPartyBranch implements Serializable { /** * id */ + @TableId @ApiModelProperty(value = "id") private String id; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventStyle.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventStyle.java index 41675a0..38340c5 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventStyle.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventStyle.java @@ -1,6 +1,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; import com.fasterxml.jackson.annotation.JsonFormat; @@ -28,6 +29,7 @@ public class EventStyle implements Serializable { /** * id */ + @TableId @ApiModelProperty(value = "id") private String id; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventSubject.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventSubject.java index 0c6cb67..5374b60 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventSubject.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventSubject.java @@ -1,6 +1,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; import com.fasterxml.jackson.annotation.JsonFormat; @@ -29,6 +30,7 @@ public class EventSubject implements Serializable { /** * id */ + @TableId @ApiModelProperty(value = "id") private String id; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/enums/PartyEventExceptionEnum.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/enums/PartyEventExceptionEnum.java new file mode 100644 index 0000000..11364ba --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/enums/PartyEventExceptionEnum.java @@ -0,0 +1,30 @@ +package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.enums; + +import com.chinaunicom.mall.ebtp.common.exception.service.BusinessExceptionAssert; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum PartyEventExceptionEnum implements BusinessExceptionAssert { + /** + * 没有党支部信息 + */ + FRAME_EXCEPTION_NO_BRANCH_INFO_FAIL(2200001, "没有党支部信息!"), + + + + /** + * 判断接口返回是否有数据 + */ + IS_SUCCESS(2200002, "接口返回异常"); + + /** + * 返回码 + */ + private final int code; + /** + * 返回消息 + */ + private final String message; +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java index 9ba9397..dab913d 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java @@ -19,4 +19,5 @@ public interface EventContactService extends IService{ List getEventContactList(); + boolean saveContact(EventContact inVO); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java index 38f1595..6a402be 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java @@ -26,4 +26,7 @@ public interface EventPartyBranchService extends IService{ List getPartyMemberListByParam(EventQueryInVO inVO); + boolean saveBranch(EventPartyBranch inVO); + + boolean saveMember(EventPartyBranch inVO); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventStyleService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventStyleService.java index 8c5fd35..f3600e6 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventStyleService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventStyleService.java @@ -15,4 +15,6 @@ public interface EventStyleService extends IService{ List getEventStyle(String type, EventQueryInVO inVO); + + boolean saveStyle(EventStyle inVO); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventSubjectService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventSubjectService.java index f51e13c..3216a83 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventSubjectService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventSubjectService.java @@ -15,4 +15,6 @@ public interface EventSubjectService extends IService{ List getEventSubjectList(EventQueryInVO inVO); + + boolean saveSubject(EventSubject inVO); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java index e181aaf..5890462 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java @@ -1,14 +1,17 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.chinaunicom.mall.ebtp.common.util.PropertyUtils; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventContactMapper; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContact; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventContactService; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -35,5 +38,18 @@ public class EventContactServiceImpl extends ServiceImpl queryWrapper = Wrappers.lambdaQuery(); + queryWrapper.eq(EventPartyBranch::getBranchName, inVO.getBranchName()).eq(EventPartyBranch::getType, "1"); + EventPartyBranch one = this.getOne(queryWrapper); + inVO.setBranchCode(one.getBranchCode()); + inVO.setBelongBranch(one.getBranchCode()); + inVO.setId(PropertyUtils.getSnowflakeId()); + inVO.setStatus("1"); + inVO.setType("2"); + inVO.setCreateTime(LocalDateTime.now()); + return this.save(inVO); + } + } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java index 8e1d4c7..659a7fc 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.chinaunicom.mall.ebtp.common.util.PropertyUtils; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventStyleMapper; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventQueryInVO; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventStyle; @@ -13,6 +14,7 @@ import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventStyleServi import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.time.LocalDateTime; import java.util.List; /** @@ -38,4 +40,20 @@ public class EventStyleServiceImpl extends ServiceImpl