updates 院校后台页面调整
This commit is contained in:
parent
e6a9756b7f
commit
62cc9b1166
|
|
@ -9,8 +9,12 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolChild;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolChildService;
|
||||
|
|
@ -50,7 +54,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||
public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxSchoolChildService> {
|
||||
@Autowired
|
||||
private IYxSchoolChildService yxSchoolChildService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
|
@ -72,7 +76,7 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
|
|||
IPage<YxSchoolChild> pageList = yxSchoolChildService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
@ -87,7 +91,7 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
|
|||
yxSchoolChildService.save(yxSchoolChild);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
|
|
@ -96,13 +100,33 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
|
|||
*/
|
||||
@AutoLog(value = "子级院校表-编辑")
|
||||
@ApiOperation(value="子级院校表-编辑", notes="子级院校表-编辑")
|
||||
@RequiresPermissions("yx:yx_school_child:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody YxSchoolChild yxSchoolChild) {
|
||||
yxSchoolChildService.updateById(yxSchoolChild);
|
||||
return Result.OK("编辑成功!");
|
||||
AssertUtils.notEmpty(yxSchoolChild.getSchoolCode(),"请输入[院校代码]");
|
||||
AssertUtils.notEmpty(yxSchoolChild.getSchoolName(),"请输入[院校名称]");
|
||||
AssertUtils.notEmpty(yxSchoolChild.getSchoolId(),"请跟主院校进行关联");
|
||||
long count = 0;
|
||||
LambdaQueryWrapper<YxSchoolChild> lambdaQueryWrapper = new LambdaQueryWrapper<YxSchoolChild>();
|
||||
if (StringUtils.isNotBlank(yxSchoolChild.getId())) {
|
||||
lambdaQueryWrapper.ne(YxSchoolChild::getSchoolId,yxSchoolChild.getId());
|
||||
}
|
||||
lambdaQueryWrapper.eq(YxSchoolChild::getSchoolName, yxSchoolChild.getSchoolName());
|
||||
count = yxSchoolChildService.count(lambdaQueryWrapper);
|
||||
AssertUtils.notTrue(count>0,"当前专业名称已存在");
|
||||
lambdaQueryWrapper.clear();
|
||||
lambdaQueryWrapper.eq(YxSchoolChild::getSchoolCode, yxSchoolChild.getSchoolCode());
|
||||
count = yxSchoolChildService.count(lambdaQueryWrapper);
|
||||
AssertUtils.notTrue(count>0,"当前专业代码已存在");
|
||||
if (StringUtils.isNotBlank(yxSchoolChild.getId())) {
|
||||
yxSchoolChildService.updateById(yxSchoolChild);
|
||||
return Result.OK("编辑成功!");
|
||||
}else{
|
||||
yxSchoolChildService.save(yxSchoolChild);
|
||||
return Result.OK("保存成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
|
|
@ -117,7 +141,7 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
|
|||
yxSchoolChildService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
|
|
@ -126,13 +150,12 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
|
|||
*/
|
||||
@AutoLog(value = "子级院校表-批量删除")
|
||||
@ApiOperation(value="子级院校表-批量删除", notes="子级院校表-批量删除")
|
||||
@RequiresPermissions("yx:yx_school_child:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.yxSchoolChildService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class YxSchoolMajor implements Serializable {
|
|||
/**学校代码*/
|
||||
@Excel(name = "学校代码", width = 15)
|
||||
@ApiModelProperty(value = "学校代码")
|
||||
@Dict(dictTable = "yx_school",dicCode = "school_code",dicText = "school_name")
|
||||
@Dict(dictTable = "yx_school_child",dicCode = "school_code",dicText = "school_name")
|
||||
private java.lang.String schoolCode;
|
||||
/**专业代码*/
|
||||
@ApiModelProperty(value = "专业代码")
|
||||
|
|
|
|||
Loading…
Reference in New Issue