dzx 1 éve
szülő
commit
83d48aae50

+ 28 - 2
src/main/java/com/xjrsoft/module/student/controller/BaseStudentDevelopmentController.java

@@ -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));
-
     }
 
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentDevelopmentVo.java

@@ -109,6 +109,14 @@ public class BaseStudentDevelopmentVo {
     */
     @ApiModelProperty("升学渠道(xjr_dictionary_item[ascending_channels])")
     private String ascendingChannelsCn;
+
+    @ApiModelProperty("学生类型(xjr_dictionary_item[culture_type])")
+    private String cultureType;
+    /**
+     * 升学渠道(xjr_dictionary_item[ascending_channels])
+     */
+    @ApiModelProperty("升学渠道(xjr_dictionary_item[ascending_channels])")
+    private String ascendingChannels;
     /**
     * 学校名称
     */

+ 2 - 2
src/main/resources/mapper/student/BaseStudentDevelopmentMapper.xml

@@ -7,8 +7,8 @@
         SELECT t1.id,t1.is_entrepreneurship,t1.entrepreneurial_project,t1.is_flexible_work,t1.work_content,
                t1.is_company_coop,t1.work_company,t7.name AS company_industry,t8.name AS company_nature,t2.name AS company_scale_cn,t1.is_matching,
                t1.money,t1.work_date,t1.work_city,t3.name AS culture_type_cn,t4.name AS ascending_channels_cn,
-               t1.school,t1.admission_major,t1.score,t5.name AS ascending_arrangement_cn,t6.name AS unemployed_type_cn,t1.remark,t1.enroll_type
-
+               t1.school,t1.admission_major,t1.score,t5.name AS ascending_arrangement_cn,t6.name AS unemployed_type_cn,t1.remark,t1.enroll_type,
+               t1.culture_type,t1.ascending_channels
         FROM base_student_development t1
                  LEFT JOIN xjr_dictionary_detail t2 ON t1.company_scale = t2.code
                  LEFT JOIN xjr_dictionary_detail t3 ON t1.culture_type = t3.code