diff --git a/vehicle-company-common/src/main/java/com/dragon/vehicle/company/common/domain/FirmInfo.java b/vehicle-company-common/src/main/java/com/dragon/vehicle/company/common/domain/FirmInfo.java index 8e11332..c42b690 100644 --- a/vehicle-company-common/src/main/java/com/dragon/vehicle/company/common/domain/FirmInfo.java +++ b/vehicle-company-common/src/main/java/com/dragon/vehicle/company/common/domain/FirmInfo.java @@ -35,7 +35,7 @@ public class FirmInfo { * 企业电话 */ private String firmTel; - /** + /**3 * 企业详细地址 */ private String firmAddress; @@ -71,6 +71,21 @@ public class FirmInfo { * 统一社会信用代码 */ private String firmSocialCredit; + /** + * 企业激活状态 + * 0 未激活 1 激活 + * 默认为0 + */ + private Integer firmActiveStatus; + /** + * 企业审核状态 + * 0 待审核 1审核通过 2 审核驳回 + * 默认为0 + */ + private Integer firmExamineStatus; + + + public static FirmInfo addReqBuild(FirmAddReq firmAddReq){ return FirmInfo.builder() diff --git a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/controller/FirmController.java b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/controller/FirmController.java index 3285ecd..2100de5 100644 --- a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/controller/FirmController.java +++ b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/controller/FirmController.java @@ -14,7 +14,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @RestController -@RequestMapping("/firm") +@RequestMapping("/company/firm") public class FirmController { @Autowired @@ -69,6 +69,27 @@ public class FirmController { } + /** + * 修改激活状态 + * @param firmInfo + * @return + */ + @PostMapping("/updatefirmActivateStatus}") + public Result updatefirmActivateStatus(@RequestBody FirmInfo firmInfo){ + firmService.updateActivateStatus(firmInfo); + return Result.success(); + } + /** + * 审核通过 + * @param firmInfo + * @return + */ + @PostMapping("/updateExamineStatus") + public Result updateExamineStaus(@RequestBody FirmInfo firmInfo){ + firmService.updateExamineStatus(firmInfo); + return Result.success(); + } + } diff --git a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/mapper/FirmMapper.java b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/mapper/FirmMapper.java index 2eb9d67..dc65e99 100644 --- a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/mapper/FirmMapper.java +++ b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/mapper/FirmMapper.java @@ -3,8 +3,12 @@ package com.dragon.vehicle.company.server.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dragon.vehicle.company.common.domain.FirmInfo; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; @Mapper public interface FirmMapper extends BaseMapper { + void updateActivateStatus(@Param("firmId") Integer firmId); + + void updateExamineStatus(@Param("firmId") Integer firmId); } diff --git a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/FirmService.java b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/FirmService.java index c9016b1..f587ded 100644 --- a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/FirmService.java +++ b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/FirmService.java @@ -14,4 +14,8 @@ public interface FirmService extends IService { */ TableDataInfo selectFirmList(FirmQueryReq firmQueryReq); + + void updateActivateStatus(FirmInfo firmInfo); + + void updateExamineStatus(FirmInfo firmInfo); } diff --git a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/impl/FirmServiceImpl.java b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/impl/FirmServiceImpl.java index aa125fd..bcd99a2 100644 --- a/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/impl/FirmServiceImpl.java +++ b/vehicle-company-server/src/main/java/com/dragon/vehicle/company/server/service/impl/FirmServiceImpl.java @@ -14,6 +14,7 @@ import com.dragon.vehicle.company.common.utils.BaiDuAiCheck; import com.dragon.vehicle.company.server.mapper.FirmMapper; import com.dragon.vehicle.company.server.service.FirmService; import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.Serializable; @@ -22,8 +23,15 @@ import java.io.Serializable; @Service public class FirmServiceImpl extends ServiceImpl implements FirmService { + @Autowired + private FirmMapper firmMapper; + /** + * 添加企业 + * @param entity + * @return + */ @Override public boolean save(FirmInfo entity) { @@ -48,10 +56,9 @@ public class FirmServiceImpl extends ServiceImpl implement } - - - - + /** + * 修改企业 + */ /** * @param entity * @return @@ -66,7 +73,9 @@ public class FirmServiceImpl extends ServiceImpl implement return true; } + /** + * 删除企业 * @param id * @return */ @@ -132,4 +141,19 @@ public class FirmServiceImpl extends ServiceImpl implement .build(); } + + @Override + public void updateActivateStatus(FirmInfo firmInfo) { + if (firmInfo.getFirmName()!=null){ + firmMapper.updateActivateStatus(firmInfo.getFirmId()); + } + } + + @Override + public void updateExamineStatus(FirmInfo firmInfo) { + if (firmInfo.getFirmActiveStatus().equals(1)){ + firmMapper.updateExamineStatus(firmInfo.getFirmId()); + } + } + } diff --git a/vehicle-company-server/src/main/resources/mappper.firm/FirmMapper.xml b/vehicle-company-server/src/main/resources/mappper.firm/FirmMapper.xml index a4bcce7..977b7f1 100644 --- a/vehicle-company-server/src/main/resources/mappper.firm/FirmMapper.xml +++ b/vehicle-company-server/src/main/resources/mappper.firm/FirmMapper.xml @@ -5,4 +5,17 @@ + + update firm_info + + + firm_examine_status = 1 + + + + where firm_id =#{firmId} + + + update firm_info set firm_examine_staus=1 where firm_id=#{firmId} +