政策启用禁用功能开发
This commit is contained in:
@@ -107,6 +107,17 @@ public class CmsPolicyInfoController extends BaseController {
|
||||
return toAjax(policyInfoService.deleteByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新政策状态(启用/禁用)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cms:policyInfo:edit')")
|
||||
@Log(title = "政策信息", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("更新政策状态")
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestParam Long id, @RequestParam String status) {
|
||||
return toAjax(policyInfoService.updateStatus(id, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传政策文件
|
||||
*/
|
||||
|
||||
@@ -67,4 +67,7 @@ public class PolicyInfo extends BaseEntity {
|
||||
//标签
|
||||
/** 1-大龄人员;2-低保人员;3-残疾人员;4-失地农名或联队职工;5-防止返贫;6-未就业大中专毕业生;7-退役军人;8-长期失业人员;9-城镇零就业家庭成员;10.刑满释放人员 **/
|
||||
private String policyTag;
|
||||
|
||||
@ApiModelProperty("状态(0启用 1禁用)")
|
||||
private String status;
|
||||
}
|
||||
|
||||
@@ -28,5 +28,8 @@ public class PolicyInfoQuery {
|
||||
@ApiModelProperty("标签")
|
||||
private String policyTag;
|
||||
|
||||
@ApiModelProperty("状态(0启用 1禁用),空表示不过滤")
|
||||
private String status;
|
||||
|
||||
private List<String> policyTags;
|
||||
}
|
||||
|
||||
@@ -42,4 +42,9 @@ public interface PolicyInfoMapper {
|
||||
* 批量删除政策
|
||||
*/
|
||||
int deletePolicyInfoByIds(@Param("ids") Long[] ids);
|
||||
|
||||
/**
|
||||
* 更新政策状态(启用/禁用)
|
||||
*/
|
||||
int updateStatus(@Param("id") Long id, @Param("status") String status);
|
||||
}
|
||||
|
||||
@@ -54,4 +54,9 @@ public interface IPolicyInfoService {
|
||||
* 批量删除政策
|
||||
*/
|
||||
int deleteByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 更新政策状态(启用/禁用)
|
||||
*/
|
||||
int updateStatus(Long id, String status);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ public class PolicyInfoServiceImpl implements IPolicyInfoService {
|
||||
List<String> policyTags = Arrays.asList(query.getPolicyTag().split(","));
|
||||
query.setPolicyTags(policyTags);
|
||||
}
|
||||
// 仅返回启用状态的政策给前端
|
||||
query.setStatus("0");
|
||||
List<PolicyInfo> list = policyInfoMapper.selectPolicyInfoList(query);
|
||||
PageInfo<PolicyInfo> pageInfo = new PageInfo<>(list);
|
||||
|
||||
@@ -94,4 +96,9 @@ public class PolicyInfoServiceImpl implements IPolicyInfoService {
|
||||
public int deleteByIds(Long[] ids) {
|
||||
return policyInfoMapper.deletePolicyInfoByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateStatus(Long id, String status) {
|
||||
return policyInfoMapper.updateStatus(id, status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user