master
niuniuniu 2023-12-05 11:24:56 +08:00
parent a103801256
commit 0c48257895
6 changed files with 87 additions and 6 deletions

View File

@ -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()

View File

@ -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();
}
}

View File

@ -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<FirmInfo> {
void updateActivateStatus(@Param("firmId") Integer firmId);
void updateExamineStatus(@Param("firmId") Integer firmId);
}

View File

@ -14,4 +14,8 @@ public interface FirmService extends IService<FirmInfo> {
*/
TableDataInfo<FirmInfo> selectFirmList(FirmQueryReq firmQueryReq);
void updateActivateStatus(FirmInfo firmInfo);
void updateExamineStatus(FirmInfo firmInfo);
}

View File

@ -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<FirmMapper, FirmInfo> implements FirmService {
@Autowired
private FirmMapper firmMapper;
/**
*
* @param entity
* @return
*/
@Override
public boolean save(FirmInfo entity) {
@ -48,10 +56,9 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> implement
}
/**
*
*/
/**
* @param entity
* @return
@ -66,7 +73,9 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> implement
return true;
}
/**
*
* @param id
* @return
*/
@ -132,4 +141,19 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> 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());
}
}
}

View File

@ -5,4 +5,17 @@
<mapper namespace="com.dragon.vehicle.company.server.mapper.FirmMapper">
<update id="updateActivateStatus">
update firm_info
<set>
<if test="firmName != null">
firm_examine_status = 1
</if>
</set>
where firm_id =#{firmId}
</update>
<update id="updateExamineStatus">
update firm_info set firm_examine_staus=1 where firm_id=#{firmId}
</update>
</mapper>