|
|
@@ -2,9 +2,12 @@ package com.xjrsoft.module.student.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.db.Entity;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
@@ -30,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @title: 学生去向登记
|
|
|
@@ -51,7 +55,7 @@ public class BaseStudentDevelopmentController {
|
|
|
@SaCheckPermission("basestudentdevelopment:detail")
|
|
|
public RT<PageOutput<BaseStudentDevelopmentPageVo>> page(@Valid BaseStudentDevelopmentPageDto dto){
|
|
|
|
|
|
- LambdaQueryWrapper<BaseStudentDevelopment> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ MPJLambdaWrapper<BaseStudentDevelopment> queryWrapper = new MPJLambdaWrapper<BaseStudentDevelopment>();
|
|
|
queryWrapper
|
|
|
.eq(BaseStudentDevelopment::getBaseStudentGraduateId, dto.getBaseStudentGraduateId())
|
|
|
.orderByDesc(BaseStudentDevelopment::getId)
|
|
|
@@ -79,6 +83,18 @@ public class BaseStudentDevelopmentController {
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddBaseStudentDevelopmentDto dto){
|
|
|
BaseStudentDevelopment baseStudentDevelopment = BeanUtil.toBean(dto, BaseStudentDevelopment.class);
|
|
|
baseStudentDevelopment.setCreateDate(new Date());
|
|
|
+
|
|
|
+ if(baseStudentDevelopment.getCompanyCoopId() != null){
|
|
|
+ String tableName = "company_coop";
|
|
|
+ Entity entity = Entity.create(tableName);
|
|
|
+ entity.set("id", baseStudentDevelopment.getCompanyCoopId());
|
|
|
+
|
|
|
+ Map<String, Object> objectMap = SqlRunnerAdapter.db().dynamicSelectOne(tableName, entity);
|
|
|
+ if(objectMap != null){
|
|
|
+ baseStudentDevelopment.setWorkCompany(objectMap.get("company_name").toString());
|
|
|
+ baseStudentDevelopment.setCompanyScale(objectMap.get("company_size").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
boolean isSuccess = developmentService.save(baseStudentDevelopment);
|
|
|
return RT.ok(isSuccess);
|
|
|
}
|
|
|
@@ -90,6 +106,17 @@ public class BaseStudentDevelopmentController {
|
|
|
|
|
|
BaseStudentDevelopment baseStudentDevelopment = BeanUtil.toBean(dto, BaseStudentDevelopment.class);
|
|
|
baseStudentDevelopment.setModifyDate(new Date());
|
|
|
+ if(baseStudentDevelopment.getCompanyCoopId() != null){
|
|
|
+ String tableName = "company_coop";
|
|
|
+ Entity entity = Entity.create(tableName);
|
|
|
+ entity.set("id", baseStudentDevelopment.getCompanyCoopId());
|
|
|
+
|
|
|
+ Map<String, Object> objectMap = SqlRunnerAdapter.db().dynamicSelectOne(tableName, entity);
|
|
|
+ if(objectMap != null){
|
|
|
+ baseStudentDevelopment.setWorkCompany(objectMap.get("company_name").toString());
|
|
|
+ baseStudentDevelopment.setCompanyScale(objectMap.get("company_size").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
return RT.ok(developmentService.updateById(baseStudentDevelopment));
|
|
|
|
|
|
}
|
|
|
@@ -99,7 +126,6 @@ public class BaseStudentDevelopmentController {
|
|
|
@SaCheckPermission("basestudentdevelopment:delete")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
return RT.ok(developmentService.removeBatchByIds(ids));
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|