updates 院校后台页面调整

This commit is contained in:
zhouwentao 2024-06-21 20:20:38 +08:00
parent e6a9756b7f
commit 62cc9b1166
2 changed files with 34 additions and 11 deletions

View File

@ -9,8 +9,12 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 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.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.AssertUtils;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.yx.entity.YxSchoolChild; import org.jeecg.modules.yx.entity.YxSchoolChild;
import org.jeecg.modules.yx.service.IYxSchoolChildService; import org.jeecg.modules.yx.service.IYxSchoolChildService;
@ -96,11 +100,31 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
*/ */
@AutoLog(value = "子级院校表-编辑") @AutoLog(value = "子级院校表-编辑")
@ApiOperation(value="子级院校表-编辑", notes="子级院校表-编辑") @ApiOperation(value="子级院校表-编辑", notes="子级院校表-编辑")
@RequiresPermissions("yx:yx_school_child:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody YxSchoolChild yxSchoolChild) { public Result<String> edit(@RequestBody YxSchoolChild yxSchoolChild) {
yxSchoolChildService.updateById(yxSchoolChild); AssertUtils.notEmpty(yxSchoolChild.getSchoolCode(),"请输入[院校代码]");
return Result.OK("编辑成功!"); 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("保存成功!");
}
} }
/** /**
@ -126,7 +150,6 @@ public class YxSchoolChildController extends JeecgController<YxSchoolChild, IYxS
*/ */
@AutoLog(value = "子级院校表-批量删除") @AutoLog(value = "子级院校表-批量删除")
@ApiOperation(value="子级院校表-批量删除", notes="子级院校表-批量删除") @ApiOperation(value="子级院校表-批量删除", notes="子级院校表-批量删除")
@RequiresPermissions("yx:yx_school_child:deleteBatch")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.yxSchoolChildService.removeByIds(Arrays.asList(ids.split(","))); this.yxSchoolChildService.removeByIds(Arrays.asList(ids.split(",")));

View File

@ -37,7 +37,7 @@ public class YxSchoolMajor implements Serializable {
/**学校代码*/ /**学校代码*/
@Excel(name = "学校代码", width = 15) @Excel(name = "学校代码", width = 15)
@ApiModelProperty(value = "学校代码") @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; private java.lang.String schoolCode;
/**专业代码*/ /**专业代码*/
@ApiModelProperty(value = "专业代码") @ApiModelProperty(value = "专业代码")