Explorar o código

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

chenw %!s(int64=7) %!d(string=hai) anos
pai
achega
33fcd9e97b

+ 44 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/ScoreController.java

@@ -0,0 +1,44 @@
+package com.usoftchina.smartschool.school.business.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.page.PageDefault;
+import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.business.service.ScoreService;
+import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
+import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.po.StuScore;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author: guq
+ * @create: 2019-02-25 08:54
+ **/
+@RequestMapping("/score")
+@RestController
+public class ScoreController {
+
+    @Autowired
+    private ScoreService scoreService;
+
+    @GetMapping("/list")
+    public Result getList(@PageDefault PageRequest page, ListReqDTO listReqDTO) {
+        PageInfo<StuScore> record = scoreService.getListData(page, listReqDTO);
+        return Result.success(record);
+    }
+
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id) {
+        scoreService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs) {
+        scoreService.batchDelete(baseDTOs);
+        return Result.success();
+    }
+
+}

+ 20 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/ScoreService.java

@@ -0,0 +1,20 @@
+package com.usoftchina.smartschool.school.business.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
+import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.po.StuScore;
+import com.usoftchina.smartschool.school.po.StuScoreDO;
+
+/**
+ * @author: guq
+ * @create: 2019-02-25 08:55
+ **/
+public interface ScoreService {
+    PageInfo<StuScore> getListData(PageRequest page, ListReqDTO listReqDTO);
+
+    void delete(Long id);
+
+    void batchDelete(BatchDealBaseDTO baseDTOs);
+}

+ 66 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/ScoreServiceImpl.java

@@ -0,0 +1,66 @@
+package com.usoftchina.smartschool.school.business.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.context.BaseContextHolder;
+import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.business.service.ScoreService;
+import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
+import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.mapper.ScoreMapper;
+import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.StuScore;
+import com.usoftchina.smartschool.school.po.StuScoreDO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2019-02-25 08:56
+ **/
+@Service
+public class ScoreServiceImpl implements ScoreService{
+
+
+    @Autowired
+    private ScoreMapper scoreMapper;
+
+    @Override
+    public PageInfo<StuScore> getListData(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        Long schoolId = BaseContextHolder.getSchoolId();
+        schoolId = 1l;
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        List<StuScore> data = scoreMapper.selectByConditon(condition, schoolId);
+        PageInfo<StuScore> list = new PageInfo<StuScore>(data);
+        return list;
+    }
+
+    @Override
+    public void delete(Long id) {
+        if (StringUtils.isEmpty(id) || "0".equals(id)) {
+            return;
+        }
+        scoreMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            delete(base.getId());
+        }
+    }
+}

+ 25 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/ScoreMapper.java

@@ -0,0 +1,25 @@
+package com.usoftchina.smartschool.school.mapper;
+
+import com.usoftchina.smartschool.school.po.StuScore;
+import com.usoftchina.smartschool.school.po.StuScoreDO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ScoreMapper {
+    int deleteByPrimaryKey(Long score_id);
+
+    int insert(StuScoreDO record);
+
+    int insertSelective(StuScoreDO record);
+
+    StuScoreDO selectByPrimaryKey(Long score_id);
+
+    int updateByPrimaryKeySelective(StuScoreDO record);
+
+    int updateByPrimaryKey(StuScoreDO record);
+
+    List<StuScore> selectByConditon(@Param("con") String con, @Param("school_id") Long schoolId);
+}

+ 119 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScore.java

@@ -0,0 +1,119 @@
+package com.usoftchina.smartschool.school.po;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2019-02-25 09:09
+ **/
+public class StuScore {
+    private Long score_id;
+
+    private String score_type;
+
+    private String score_name;
+
+    private Long stu_id;
+
+    private Double score_total;
+
+    private Double score_num;
+
+    private String score_scope;
+
+    private Date score_date;
+
+    private String score_remarks;
+
+    private Long school_id;
+
+    private Long subject_id;
+
+    public Long getScore_id() {
+        return score_id;
+    }
+
+    public void setScore_id(Long score_id) {
+        this.score_id = score_id;
+    }
+
+    public String getScore_type() {
+        return score_type;
+    }
+
+    public void setScore_type(String score_type) {
+        this.score_type = score_type == null ? null : score_type.trim();
+    }
+
+    public String getScore_name() {
+        return score_name;
+    }
+
+    public void setScore_name(String score_name) {
+        this.score_name = score_name == null ? null : score_name.trim();
+    }
+
+    public Long getStu_id() {
+        return stu_id;
+    }
+
+    public void setStu_id(Long stu_id) {
+        this.stu_id = stu_id;
+    }
+
+    public Double getScore_total() {
+        return score_total;
+    }
+
+    public void setScore_total(Double score_total) {
+        this.score_total = score_total;
+    }
+
+    public Double getScore_num() {
+        return score_num;
+    }
+
+    public void setScore_num(Double score_num) {
+        this.score_num = score_num;
+    }
+
+    public String getScore_scope() {
+        return score_scope;
+    }
+
+    public void setScore_scope(String score_scope) {
+        this.score_scope = score_scope == null ? null : score_scope.trim();
+    }
+
+    public Date getScore_date() {
+        return score_date;
+    }
+
+    public void setScore_date(Date score_date) {
+        this.score_date = score_date;
+    }
+
+    public String getScore_remarks() {
+        return score_remarks;
+    }
+
+    public void setScore_remarks(String score_remarks) {
+        this.score_remarks = score_remarks == null ? null : score_remarks.trim();
+    }
+
+    public Long getSchool_id() {
+        return school_id;
+    }
+
+    public void setSchool_id(Long school_id) {
+        this.school_id = school_id;
+    }
+
+    public Long getSubject_id() {
+        return subject_id;
+    }
+
+    public void setSubject_id(Long subject_id) {
+        this.subject_id = subject_id;
+    }
+}

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxVoteServiceImpl.java

@@ -108,7 +108,7 @@ public class WxVoteServiceImpl implements WxVoteService {
                         wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
                                 "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持", schoolDO.getSchoolName(),
                                 teacherName, format.format(new Date()), vote.getVoteName()
-                                , "点击查看详情", "https://school-wechat.ubtob.com/voteDetail/" + vote.getVoteId()+"?teacherId="+ll);
+                                , "点击查看详情", "https://school-wechat.ubtob.com/voteDetail/teacher/" + vote.getVoteId()+"?teacherId="+ll);
                     }catch (Exception e){
                         e.printStackTrace();
                     }
@@ -130,7 +130,7 @@ public class WxVoteServiceImpl implements WxVoteService {
                                     , "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持",
                                     schoolDO.getSchoolName(),teacherName ,
                                     format.format(new Date()), vote.getVoteName(), "点击查看详情",
-                                    "https://school-wechat.ubtob.com/voteDetail/" + vote.getVoteId()+"?stuId="+l);
+                                    "https://school-wechat.ubtob.com/voteDetail/parent/" + vote.getVoteId()+"?stuId="+l);
                         }catch (Exception e){
                             e.printStackTrace();
                         }

+ 176 - 0
applications/school/school-server/src/main/resources/mapper/ScoreMapper.xml

@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.smartschool.school.mapper.ScoreMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.StuScore" >
+    <id column="score_id" property="score_id" jdbcType="BIGINT" />
+    <result column="score_type" property="score_type" jdbcType="VARCHAR" />
+    <result column="score_name" property="score_name" jdbcType="VARCHAR" />
+    <result column="stu_id" property="stu_id" jdbcType="BIGINT" />
+    <result column="score_total" property="score_total" jdbcType="DOUBLE" />
+    <result column="score_num" property="score_num" jdbcType="DOUBLE" />
+    <result column="score_scope" property="score_scope" jdbcType="VARCHAR" />
+    <result column="score_date" property="score_date" jdbcType="TIMESTAMP" />
+    <result column="score_remarks" property="score_remarks" jdbcType="VARCHAR" />
+    <result column="school_id" property="school_id" jdbcType="BIGINT" />
+    <result column="subject_id" property="subject_id" jdbcType="BIGINT" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    score_id, score_type, score_name, stu_id, score_total, score_num, score_scope, score_date,
+    score_remarks, school_id, subject_id
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select
+    <include refid="Base_Column_List" />
+    from stu_score
+    where score_id = #{score_id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from stu_score
+    where score_id = #{score_id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
+    insert into stu_score (score_id, score_type, score_name,
+    stu_id, score_total, score_num,
+    score_scope, score_date, score_remarks,
+    school_id, subject_id)
+    values (#{score_id,jdbcType=BIGINT}, #{score_type,jdbcType=VARCHAR}, #{score_name,jdbcType=VARCHAR},
+    #{stu_id,jdbcType=BIGINT}, #{score_total,jdbcType=DOUBLE}, #{score_num,jdbcType=DOUBLE},
+    #{score_scope,jdbcType=VARCHAR}, #{score_date,jdbcType=TIMESTAMP}, #{score_remarks,jdbcType=VARCHAR},
+    #{school_id,jdbcType=BIGINT}, #{subject_id,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
+    insert into stu_score
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="score_id != null" >
+        score_id,
+      </if>
+      <if test="score_type != null" >
+        score_type,
+      </if>
+      <if test="score_name != null" >
+        score_name,
+      </if>
+      <if test="stu_id != null" >
+        stu_id,
+      </if>
+      <if test="score_total != null" >
+        score_total,
+      </if>
+      <if test="score_num != null" >
+        score_num,
+      </if>
+      <if test="score_scope != null" >
+        score_scope,
+      </if>
+      <if test="score_date != null" >
+        score_date,
+      </if>
+      <if test="score_remarks != null" >
+        score_remarks,
+      </if>
+      <if test="school_id != null" >
+        school_id,
+      </if>
+      <if test="subject_id != null" >
+        subject_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="score_id != null" >
+        #{score_id,jdbcType=BIGINT},
+      </if>
+      <if test="score_type != null" >
+        #{score_type,jdbcType=VARCHAR},
+      </if>
+      <if test="score_name != null" >
+        #{score_name,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_id != null" >
+        #{stu_id,jdbcType=BIGINT},
+      </if>
+      <if test="score_total != null" >
+        #{score_total,jdbcType=DOUBLE},
+      </if>
+      <if test="score_num != null" >
+        #{score_num,jdbcType=DOUBLE},
+      </if>
+      <if test="score_scope != null" >
+        #{score_scope,jdbcType=VARCHAR},
+      </if>
+      <if test="score_date != null" >
+        #{score_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="score_remarks != null" >
+        #{score_remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="school_id != null" >
+        #{school_id,jdbcType=BIGINT},
+      </if>
+      <if test="subject_id != null" >
+        #{subject_id,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
+    update stu_score
+    <set >
+      <if test="score_type != null" >
+        score_type = #{score_type,jdbcType=VARCHAR},
+      </if>
+      <if test="score_name != null" >
+        score_name = #{score_name,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_id != null" >
+        stu_id = #{stu_id,jdbcType=BIGINT},
+      </if>
+      <if test="score_total != null" >
+        score_total = #{score_total,jdbcType=DOUBLE},
+      </if>
+      <if test="score_num != null" >
+        score_num = #{score_num,jdbcType=DOUBLE},
+      </if>
+      <if test="score_scope != null" >
+        score_scope = #{score_scope,jdbcType=VARCHAR},
+      </if>
+      <if test="score_date != null" >
+        score_date = #{score_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="score_remarks != null" >
+        score_remarks = #{score_remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="school_id != null" >
+        school_id = #{school_id,jdbcType=BIGINT},
+      </if>
+      <if test="subject_id != null" >
+        subject_id = #{subject_id,jdbcType=BIGINT},
+      </if>
+    </set>
+    where score_id = #{score_id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
+    update stu_score
+    set score_type = #{score_type,jdbcType=VARCHAR},
+    score_name = #{score_name,jdbcType=VARCHAR},
+    stu_id = #{stu_id,jdbcType=BIGINT},
+    score_total = #{score_total,jdbcType=DOUBLE},
+    score_num = #{score_num,jdbcType=DOUBLE},
+    score_scope = #{score_scope,jdbcType=VARCHAR},
+    score_date = #{score_date,jdbcType=TIMESTAMP},
+    score_remarks = #{score_remarks,jdbcType=VARCHAR},
+    school_id = #{school_id,jdbcType=BIGINT},
+    subject_id = #{subject_id,jdbcType=BIGINT}
+    where score_id = #{score_id,jdbcType=BIGINT}
+  </update>
+
+  <select id="selectByConditon" resultMap="BaseResultMap">
+    select * from stu_score <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="school_id != null">
+        and  school_id = #{school_id}
+      </if>
+    </where>
+    order by score_id DESC
+  </select>
+</mapper>

+ 2 - 2
frontend/wechat-web/src/modules/hiPages/res_apply/UserItem.js

@@ -30,7 +30,7 @@ export default class UserItem extends Component{
                 <div className="comhline_sty1"></div>
                 <div className="item_sty">
                     <div className="left_title">数量</div>
-                    <input   ref='itemnumber' className="text-right right_input" type="number" placeholder="请输入" maxLength={3} value={this.props.itemata.artCount} />
+                    <input   ref='itemnumber' className="text-right right_input" type="number" placeholder="请输入" maxLength={6} value={this.props.itemata.artCount} />
                 </div>
                 <div className="comhline_sty1"></div>
             </div>
@@ -49,7 +49,7 @@ export default class UserItem extends Component{
         console.log('itemnumber%1 === 0',itemnumber%1 == 0)
         if(itemnumber.length > 0){
             if(itemnumber%1 == 0 && itemnumber > 0){
-                if(itemnumber.length > 3){
+                if(itemnumber.length > 6){
                     Toast.show('可申请数量有限',1)
                     this.props.handelRItem({
                         artName:itemuser,