Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 před 1 rokem
rodič
revize
923a920c61

+ 1 - 1
src/main/java/com/xjrsoft/common/page/PageInput.java

@@ -28,7 +28,7 @@ public class PageInput implements Serializable {
 
     @ApiModelProperty(value = "每页大小")
     @Min(value = 1,message = "每页大小必须大于0")
-    @Max(value = 100,message = "每页大小必须小于100")
+    @Max(value = 500,message = "每页大小必须小于100")
     private Integer size = 15;
 
     @ApiModelProperty(value = "关键词")

+ 11 - 1
src/main/java/com/xjrsoft/module/ledger/controller/LedgerConfigController.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.ledger.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.xjrsoft.common.model.result.RT;
@@ -50,12 +51,21 @@ public class LedgerConfigController {
     @SaCheckPermission("ledgerconfig:detail")
     public RT<PageOutput<LedgerConfigPageVo>> page(@Valid LedgerConfigPageDto dto){
         LambdaQueryWrapper<LedgerConfig> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.orderByDesc(LedgerConfig::getId).select(LedgerConfig.class,x -> VoToColumnUtil.fieldsToColumns(LedgerConfigPageVo.class).contains(x.getProperty()));
+        queryWrapper
+        .like(StrUtil.isNotEmpty(dto.getName()), LedgerConfig::getName, dto.getName())
+        .orderByDesc(LedgerConfig::getId)
+        .select(LedgerConfig.class,x -> VoToColumnUtil.fieldsToColumns(LedgerConfigPageVo.class).contains(x.getProperty()));
         IPage<LedgerConfig> page = ledgerConfigService.page(ConventPage.getPage(dto), queryWrapper);
         PageOutput<LedgerConfigPageVo> pageOutput = ConventPage.getPageOutput(page, LedgerConfigPageVo.class);
         return RT.ok(pageOutput);
     }
 
+    @GetMapping(value = "/getPorcessId")
+    @ApiOperation(value="获取processId")
+    @SaCheckPermission("ledgerconfig:detail")
+    public RT<String> getPorcessId(@RequestParam Long dto){
+        return RT.ok("pageOutput");
+    }
 //    @GetMapping(value = "/list")
 //    @ApiOperation(value = "学生考核项目列表(不分页)")
 //    @SaCheckPermission("basestudentassessmentproject:detail")

+ 3 - 1
src/main/java/com/xjrsoft/module/ledger/dto/LedgerConfigPageDto.java

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.ledger.dto;
 
 import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -15,5 +16,6 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = false)
 public class LedgerConfigPageDto extends PageInput {
 
-
+    @ApiModelProperty("台账名称")
+    private String name;
 }

+ 3 - 1
src/main/java/com/xjrsoft/module/ledger/dto/LedgerConfigReleasePageDto.java

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.ledger.dto;
 
 import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -15,5 +16,6 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = false)
 public class LedgerConfigReleasePageDto extends PageInput {
 
-
+    @ApiModelProperty("台账名称")
+    private String name;
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/ledger/vo/LedgerConfigPageVo.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.ledger.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 /**
 * @title: 台账配置表分页列表出参
 * @Author dzx
@@ -33,4 +35,7 @@ public class LedgerConfigPageVo {
     @ApiModelProperty("台账配置信息")
     private String configJson;
 
+    @ApiModelProperty("台账配置信息")
+    private Date createDate;
+
 }

+ 79 - 0
src/main/java/com/xjrsoft/module/student/controller/ConsumptionController.java

@@ -0,0 +1,79 @@
+package com.xjrsoft.module.student.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
+import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
+import com.xjrsoft.module.student.service.impl.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+* @title: 学生职务设置
+* @Author dzx
+* @Date: 2023-11-13
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/consumption")
+@Api(value = "/student"  + "/consumption",tags = "学生消费管理")
+@AllArgsConstructor
+public class ConsumptionController {
+
+
+    private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
+
+    @GetMapping(value = "/mobile-page")
+    @ApiOperation(value="学生列表(分页)")
+    @SaCheckPermission("basestudentpost:detail")
+    public RT<PageOutput<BaseStudentInfoPageVo>> mobilePage(@Valid BaseStudentInfoPageDto dto){
+        Page<BaseStudentInfoPageVo> mobilePage = baseStudentSchoolRollService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(mobilePage, BaseStudentInfoPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/mobile-page-statistics")
+    @ApiOperation(value="学生列表人数统计")
+    @SaCheckPermission("basestudentpost:detail")
+    public RT<BaseStudentInfoPageDataVo> mobilePageStatistics(@Valid BaseStudentInfoPageDto dto){
+        BaseStudentInfoPageDataVo result = baseStudentSchoolRollService.getMobilePageStatistics(dto);
+        return RT.ok(result);
+    }
+
+
+    @PutMapping
+    @ApiOperation(value = "修改学生信息")
+    @SaCheckPermission("basestudentpost:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentInfoDto dto){
+        return RT.ok(baseStudentSchoolRollService.updateInfo(dto));
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询详情信息")
+    @SaCheckPermission("room:detail")
+    public RT<BaseStudentInfoDetailVo> info(@RequestParam Long id){
+        BaseStudentInfoDetailVo detailVo = baseStudentSchoolRollService.getInfoById(id);
+        if (detailVo == null) {
+            return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(detailVo, BaseStudentInfoDetailVo.class));
+    }
+
+
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentAssessmentProjectDto.java

@@ -109,4 +109,7 @@ public class AddBaseStudentAssessmentProjectDto implements Serializable {
     @ApiModelProperty("备注")
     private String remark;
 
+    @ApiModelProperty("考核对象(class:班级 personal:个人)")
+    private String assessmentType;
+
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/student/entity/BaseStudentAssessmentProject.java

@@ -160,5 +160,6 @@ public class BaseStudentAssessmentProject implements Serializable {
     @ApiModelProperty("备注")
     private String remark;
 
-
+    @ApiModelProperty("考核对象(class:班级 personal:个人)")
+    private String assessmentType;
 }

+ 36 - 11
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -40,13 +40,21 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
 
     @Override
     public Page<BaseStudentInfoPageVo> getMobilePage(Page<BaseStudentInfoPageVo> page, BaseStudentInfoPageDto dto) {
+
+        List<String> roleList = StpUtil.getRoleList();
+
         long teacherId = StpUtil.getLoginIdAsLong();
         List<BaseClass> classList = baseClassMapper.selectList(
             new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getTeacherId, teacherId)
         );
-
-        if(classList != null && !classList.isEmpty()){
-            dto.setTeacherId(teacherId);
+        if(roleList.size() == 1 && roleList.contains("CLASSTE")){
+            if(classList != null && !classList.isEmpty()){
+                dto.setTeacherId(teacherId);
+            }
+        }else{
+            if(classList != null && !classList.isEmpty() &&  dto.getClassId() == null){
+                dto.setClassId(classList.get(0).getId());
+            }
         }
         return baseStudentSchoolRollMapper.getMobilePage(page, dto);
     }
@@ -76,7 +84,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
                 new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getTeacherId, teacherId)
         );
 
-        if(classList != null && !classList.isEmpty()){
+        if (classList != null && !classList.isEmpty()) {
             dto.setTeacherId(teacherId);
         }
 
@@ -86,22 +94,39 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
         BaseStudentInfoPageDataVo result = new BaseStudentInfoPageDataVo();
         for (BaseStudentInfoCategoryVo categoryVo : genderCount) {
             totalCount = totalCount + categoryVo.getNumber();
-            if("男".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))){
+            if ("男".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))) {
                 result.setMaleCount(categoryVo.getNumber());
-            }else if("女".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))){
+            } else if ("女".equals(GenderDictionaryEnum.getValue(categoryVo.getCategory()))) {
                 result.setFemaleCount(categoryVo.getNumber());
             }
         }
         result.setTotalCount(totalCount);
         List<BaseStudentInfoCategoryVo> studyStatusCount = baseStudentSchoolRollMapper.getStudyStatusCount(dto);
+        int stayCount = 0;
+        int notStayCount = 0;
         for (BaseStudentInfoCategoryVo categoryVo : studyStatusCount) {
-            if(StudyStatusEnum.InResidence.getCode().equals(categoryVo.getCategory())){
-                result.setStayCount(categoryVo.getNumber());
-            }else if(StudyStatusEnum.AttendDaySchool.getCode().equals(categoryVo.getCategory())){
-                result.setNotStayCount(categoryVo.getNumber());
+            if (StudyStatusEnum.InResidence.getCode().equals(categoryVo.getCategory())) {
+                stayCount = stayCount + categoryVo.getNumber();
+
+                if ("男".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
+                    result.setMaleStayCount(categoryVo.getNumber());
+                } else if ("女".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
+                    result.setFemaleStayCount(categoryVo.getNumber());
+                }
+
+            } else if (StudyStatusEnum.AttendDaySchool.getCode().equals(categoryVo.getCategory())) {
+                notStayCount = notStayCount + categoryVo.getNumber();
+
+                if ("男".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
+                    result.setMaleNotStayCount(categoryVo.getNumber());
+                } else if ("女".equals(GenderDictionaryEnum.getValue(categoryVo.getGender()))) {
+                    result.setFemaleNotStayCount(categoryVo.getNumber());
+                }
             }
         }
-        
+        result.setStayCount(stayCount);
+        result.setNotStayCount(notStayCount);
+
         return result;
     }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentAssessmentProjectPageVo.java

@@ -145,4 +145,7 @@ public class BaseStudentAssessmentProjectPageVo {
     @ApiModelProperty("备注")
     private String remark;
 
+    @ApiModelProperty("考核对象(class:班级 personal:个人)")
+    private String assessmentType;
+
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentAssessmentProjectVo.java

@@ -108,6 +108,9 @@ public class BaseStudentAssessmentProjectVo {
     @ApiModelProperty("备注")
     private String remark;
 
+    @ApiModelProperty("考核对象(class:班级 personal:个人)")
+    private String assessmentType;
+
 
 
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoCategoryVo.java

@@ -21,4 +21,7 @@ public class BaseStudentInfoCategoryVo {
     @ApiModelProperty("数量")
     private Integer number;
 
+    @ApiModelProperty("性别")
+    private String gender;
+
 }

+ 16 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoPageDataVo.java

@@ -29,8 +29,24 @@ public class BaseStudentInfoPageDataVo {
     @ApiModelProperty("住校数量")
     private Integer stayCount;
 
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("住校男生人数")
+    private Integer maleStayCount;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("住校女生人数")
+    private Integer femaleStayCount;
+
     @ContentStyle(dataFormat = 49)
     @ApiModelProperty("走读数量")
     private Integer notStayCount;
 
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("走读男生人数")
+    private Integer maleNotStayCount;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("走读女生人数")
+    private Integer femaleNotStayCount;
+
 }

+ 3 - 0
src/main/resources/mapper/ledger/LedgerConfigReleaseMapper.xml

@@ -8,6 +8,9 @@
         LEFT JOIN xjr_menu t2 ON t1.menu_id = t2.id
         LEFT JOIN ledger_config t3 ON t1.ledger_config_id = t3.id
         WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and (t3.name like concat('%',#{dto.name},'%') or t2.title like concat('%',#{dto.name},'%'))
+        </if>
     </select>
 
 </mapper>

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

@@ -123,7 +123,7 @@
         group by t2.gender
     </select>
     <select id="getStudyStatusCount" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoCategoryVo">
-        SELECT t3.stduy_status as category,COUNT(*) as number FROM base_student t1
+        SELECT t3.stduy_status as category,COUNT(*) as number,t2.gender FROM base_student t1
         INNER JOIN xjr_user t2 ON t1.user_id = t2.id
         INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
         LEFT JOIN base_class t4 ON t3.class_id = t4.id
@@ -153,6 +153,6 @@
             or t6.mobile LIKE concat('%', #{dto.keyWord}, '%')
             )
         </if>
-        group by t3.stduy_status
+        group by t3.stduy_status,t2.gender
     </select>
 </mapper>