Commit f091fc0a authored by 蔡镇泽's avatar 蔡镇泽

更改评定机构状态

parent 8dfc39e8
......@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.AprOrganService;
import com.hungraim.ltc.pojo.vo.governance.AprOrganVO;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
......@@ -41,4 +44,19 @@ public class AprOrganController {
return Result.success(page);
}
/**
* 更改评定机构状态
*
* @param aprOrganId 监管机构id
* @param status 状态 有效:0;失效:1
*/
@DeleteMapping("/updateAprOrganStatus")
public Result updateSpvStatus(String aprOrganId, Short status) {
if (StringUtils.isBlank(aprOrganId) || status == null || (status != 1 && status != 0)) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
aprOrganService.updateAprOrganStatus(aprOrganId, status);
return Result.success();
}
}
......@@ -12,4 +12,6 @@ import org.springframework.stereotype.Service;
@Service
public interface AprOrganService {
Page<AprOrganVO> aprOrganList(Page<AprOrganVO> page, Long organId, Boolean isIncluded, String organName, String code);
void updateAprOrganStatus(String aprOrganId, Short status);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.OrganFeignService;
import com.hungraim.ltc.governance.dao.AprOrganMapper;
import com.hungraim.ltc.governance.service.AprOrganService;
import com.hungraim.ltc.pojo.entity.serviceManage.ChAprOrgan;
import com.hungraim.ltc.pojo.vo.governance.AprOrganVO;
import com.hungraim.ltc.util.Result;
import lombok.AllArgsConstructor;
......@@ -34,4 +35,11 @@ public class AprOrganServiceImpl implements AprOrganService {
}
return aprOrganMapper.aprOrganList(page, organIds, organName, code);
}
@Override
public void updateAprOrganStatus(String aprOrganId, Short status) {
ChAprOrgan chAprOrgan = aprOrganMapper.selectById(aprOrganId);
chAprOrgan.setStatus(status);
aprOrganMapper.updateById(chAprOrgan);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment