Browse Source

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

guq 7 years ago
parent
commit
d5a3f87daa
15 changed files with 72 additions and 47 deletions
  1. 1 1
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/repository/AccessControlRepository.java
  2. 0 0
      applications/device/device-client/src/main/resources/static/js/iconfont.js
  3. 1 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/IcCardMapper.java
  4. 2 1
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/IcCardServiceImpl.java
  5. 4 0
      applications/device/device-server/src/main/resources/mapper/IcCardMapper.xml
  6. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  7. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java
  8. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/HomeWorkServiceImpl.java
  9. 13 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/NoticeServiceImpl.java
  10. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/ScoreServiceImpl.java
  11. 8 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SchoolNoticer.java
  12. 3 2
      applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml
  13. 1 1
      frontend/pc-web/app/view/basic/student/StudentDetail.js
  14. 1 1
      frontend/pc-web/app/view/basic/student/StudentList.js
  15. 34 36
      frontend/wechat-web/src/modules/home/HomePage.jsx

+ 1 - 1
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/repository/AccessControlRepository.java

@@ -53,7 +53,7 @@ public class AccessControlRepository {
     @CacheEvict(value = "accessControl", key = "#accessControl.id")
     public boolean save(AccessControl accessControl) {
         int ret = jdbcTemplate.update("insert into access_control(id, name,ip,port,username,password,accessType) values " +
-                        "(?,?,?,?,?,?)", accessControl.getId(), accessControl.getName(), accessControl.getIp(), accessControl.getPort(),
+                        "(?,?,?,?,?,?,?)", accessControl.getId(), accessControl.getName(), accessControl.getIp(), accessControl.getPort(),
                 accessControl.getUsername(), accessControl.getPassword(), accessControl.getAccessType());
         return ret > 0;
     }

File diff suppressed because it is too large
+ 0 - 0
applications/device/device-client/src/main/resources/static/js/iconfont.js


+ 1 - 0
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/IcCardMapper.java

@@ -15,4 +15,5 @@ public interface IcCardMapper {
 
     SysSchoolDTO getSchoolIdByName(@Param("name") String name);
 
+    String selectTemplateId(@Param("schoolId") Long schoolId);
 }

+ 2 - 1
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/IcCardServiceImpl.java

@@ -49,6 +49,7 @@ public class IcCardServiceImpl implements IcCardService {
             String appId = sysSchoolDTO.getSchool_appid();
             String secret = sysSchoolDTO.getSchool_secret();
             Long schoolId = sysSchoolDTO.getSchool_id();
+            String templateId = icCardMapper.selectTemplateId(schoolId);
             StringBuilder sb = new StringBuilder();
             accTransDetailList.forEach(accTransDetail -> {
                 sb.append(accTransDetail.getGuid() + ",");
@@ -62,7 +63,7 @@ public class IcCardServiceImpl implements IcCardService {
                 messageInfo.setAppId(appId);
                 messageInfo.setSecret(secret);
                 //messageInfo.setUserType(2);
-                messageInfo.setTemplateId("FhtdzLdpzLLp4eJGtgvH4SUfIpSIF0kWwIpsWsSBp6c");
+                messageInfo.setTemplateId(templateId);
                 String accNo = accTransDetail.getAccNo();
                 String cardNo = StringUtils.isEmpty(accNo) ? null : accNo.substring(accTransDetail.getAccNo().length() - 4);
                 String header = "您好,您的小孩" + accTransDetail.getEmpName() + "在校的校园卡(卡号:*** " + cardNo + ")发生如下交易";

+ 4 - 0
applications/device/device-server/src/main/resources/mapper/IcCardMapper.xml

@@ -17,4 +17,8 @@
     and school_id=#{schoolId}
     and   ifnull(openid,'')  != ''  limit 0,1
   </select>
+
+  <select id="selectTemplateId" resultType="string">
+    SELECT st_templateid FROM school_template WHERE ST_SCHOOLID = #{schoolId} and st_code = 'iccard'
+  </select>
 </mapper>

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java

@@ -200,7 +200,7 @@ public class StudentServiceImpl implements StudentService{
                     if ("男".equals(json.get("stu_sex"))) {
                         json.put("stu_sex", 1);
                     }else if ("女".equals(json.get("stu_sex"))) {
-                        json.put("stu_sex", 2);
+                        json.put("stu_sex", 0);
                     }else if(!"男".equals(json.get("stu_sex")) && !"女".equals(json.get("stu_sex"))){
                         throw new BizException(BizExceptionCode.ILLEGAL_Gender);
                     }

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java

@@ -139,7 +139,7 @@ public class TeacherServiceImpl implements TeacherService{
                         if ("男".equals(json.get("teacher_sex"))) {
                             json.put("teacher_sex", 1);
                         }else if ("女".equals(json.get("teacher_sex"))) {
-                            json.put("teacher_sex", 2);
+                            json.put("teacher_sex", 0);
                         }else if(!"男".equals(json.get("teacher_sex")) && !"女".equals(json.get("teacher_sex"))){
                             throw new BizException(BizExceptionCode.ILLEGAL_Gender);
                         }

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/HomeWorkServiceImpl.java

@@ -137,7 +137,7 @@ public class HomeWorkServiceImpl implements HomeWorkService{
         List<HomeworkNoticer> noticers = homeWorkMapper.selectHomeworkNoticer(id);
         //模板信息
         SchoolTemplate template = schoolTemplateMapper.selectByCode(NoticeTemplate.HOMEWORK_NOTICE.getCode(), school.getSchool_id());
-        if (StringUtils.isEmpty(template.getSt_templateid())) {
+        if (StringUtils.isEmpty(template) || StringUtils.isEmpty(template.getSt_templateid())) {
             throw new BizException(BizExceptionCode.NULL_TEMPLATE);
         }
         //消息内容

+ 13 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/NoticeServiceImpl.java

@@ -24,6 +24,7 @@ import com.usoftchina.smartschool.wechat.api.WechatApi;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
 import com.usoftchina.smartschool.wechat.dto.TransferDTO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -49,6 +50,9 @@ public class NoticeServiceImpl implements NoticeService{
     @Autowired
     private SchoolTemplateMapper schoolTemplateMapper;
 
+    @Value("${smartschool.domain.wechat}")
+    private String baseWechatUrl;
+
 
     @Override
     public DocBaseDTO save(Notify formdata) {
@@ -132,11 +136,19 @@ public class NoticeServiceImpl implements NoticeService{
         List<SchoolNoticer> noticers = noticeMapper.selectNoticer(BaseContextHolder.getSchoolId());
         //模板信息
         SchoolTemplate template = schoolTemplateMapper.selectByCode(NoticeTemplate.HOMEWORK_NOTICE.getCode(), school.getSchool_id());
-        if (org.springframework.util.StringUtils.isEmpty(template.getSt_templateid())) {
+        if (StringUtils.isEmpty(template) || StringUtils.isEmpty(template.getSt_templateid())) {
             throw new BizException(BizExceptionCode.NULL_TEMPLATE);
         }
         noticers.forEach(noticer -> {
             MessageInfoDTO msg = new MessageInfoDTO();
+            String endUrl = null;
+            if (noticer.getType() == 1) {
+                endUrl = "/parent/" + id + "?stuId=" + noticer.getPersonId();
+            }else {
+                endUrl = "/teacher/" + id + "?teacherId=" + noticer.getPersonId();
+            }
+            String url = baseWechatUrl + endUrl;
+            msg.setUrl(url);
             msg.setTitle(data.getNotify_title());
             msg.setKeyword1(school.getSchool_name());
             msg.setKeyword2("校办公室");

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

@@ -247,7 +247,7 @@ public class ScoreServiceImpl implements ScoreService{
         List<MessageInfoDTO> msgs = new ArrayList<>();
         //模板信息
         SchoolTemplate template = schoolTemplateMapper.selectByCode(NoticeTemplate.HOMEWORK_NOTICE.getCode(), school.getSchool_id());
-        if (StringUtils.isEmpty(template.getSt_templateid())) {
+        if (StringUtils.isEmpty(template) || StringUtils.isEmpty(template.getSt_templateid())) {
             throw new BizException(BizExceptionCode.NULL_TEMPLATE);
         }
         noticers.forEach(noticer -> {

+ 8 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SchoolNoticer.java

@@ -19,4 +19,12 @@ public class SchoolNoticer implements Serializable{
      * 微信ID
      */
     private String openid;
+    /**
+     * 推送人ID
+     */
+    private Long personId;
+    /**
+     * 类型   1:家长   0:教师
+     */
+    private int type;
 }

+ 3 - 2
applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml

@@ -227,7 +227,8 @@
   </select>
 
     <select id="selectNoticer" parameterType="long" resultType="com.usoftchina.smartschool.school.po.SchoolNoticer">
-        select openid,parents_name noticer from sys_parents where school_id=#{schoolId} and ifnull(openid,'') != '' and parents_status=1 union
-				select openid,teacher_name noticer from sys_teacher where school_id=#{schoolId} and ifnull(openid,'') != '' and teacher_status=1;
+        select openid,parents_name noticer,parentstu.stu_id personId,'1' type from sys_parents parent left join sys_parents_stu parentstu on parent.parent_id = parentstu.parent_id where school_id=#{schoolId} and ifnull(openid,'') != '' and parents_status=1
+        union all
+        select openid,teacher_name noticer,teacher_id personId, '0' type from sys_teacher where school_id=#{schoolId} and ifnull(openid,'') != '' and teacher_status=1
     </select>
 </mapper>

+ 1 - 1
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -143,7 +143,7 @@ Ext.define('school.view.basic.student.StudentDetail', {
             }, {
                 xtype: 'textfield',
                 name: 'stu_cardNo',
-                fieldLabel: '校园通号',
+                fieldLabel: '校园通号',
             }, {
                 name: "parent",
                 xtype: "detailGridField",

+ 1 - 1
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -184,7 +184,7 @@ Ext.define('school.view.basic.student.StudentList', {
                     xtype: 'datecolumn',
                     format: 'Y-m-d'
                 }, {
-                    text: '校园通号',
+                    text: '校园通号',
                     dataIndex: 'stu_cardNo'
                 }]
             },

+ 34 - 36
frontend/wechat-web/src/modules/home/HomePage.jsx

@@ -20,6 +20,7 @@ import 'css/home-page.css'
 import {fetchGet, fetchPost} from "../../utils/fetchRequest";
 import {_baseURL, API} from "../../configs/api.config";
 import icon_home_change from "../../style/imgs/icon_home_change.png";
+
 let holly = 0
 const operation = Modal.operation;
 
@@ -30,7 +31,6 @@ class HomePage extends Component {
 
         this.state = {
             studentIndex: 0,
-            selectStuName:'',//被切换之后的选中的孩子
         }
     }
 
@@ -74,7 +74,6 @@ class HomePage extends Component {
                 if (this.props.userInfo.parent.student.stuId == item.stuId) {
                     this.setState({
                         studentIndex: index,
-                        selectStuName:this.props.userInfo.parent.student.stuName
                     })
                 }
             })
@@ -251,8 +250,8 @@ class HomePage extends Component {
                         }
                     })
 
-                    this.setState({studentIndex:studentIndex,
-                        selectStuName:this.props.userInfo.parent.students[studentIndex].stuName
+                    this.setState({
+                        studentIndex: studentIndex,
                     })
                 }
 
@@ -302,7 +301,7 @@ class HomePage extends Component {
             if (userInfo.parent) {
                 schoolName = userInfo.parent.schoolName
                 // userName = userInfo.parent.parentsName
-                userName = this.state.selectStuName
+                userName = userInfo.parent.student ? userInfo.parent.student.stuName : ''
             }
         } else if (userInfo.userRole === 2) {
             if (userInfo.teacher) {
@@ -319,11 +318,11 @@ class HomePage extends Component {
                 </div>
                 {
                     userInfo.userRole === 1 ?
-                        <div className='home-student-layout-root' style={{display:'flex',flexDirection:'column'}}>
-                            <div  className='home-top-msg-text'>{this.state.selectStuName +' | ' + schoolName}</div>
+                        <div className='home-student-layout-root' style={{display: 'flex', flexDirection: 'column'}}>
+                            <div className='home-top-msg-text'>{userName + ' | ' + schoolName}</div>
                         </div>
                         :
-                        <div className='home-top-msg-root' style={{paddingBottom:10}}>
+                        <div className='home-top-msg-root' style={{paddingBottom: 10}}>
                             {isObjEmpty(userInfo.userAvatar) ?
                                 <Avatar size={42} icon='user'/> :
                                 <img
@@ -332,7 +331,7 @@ class HomePage extends Component {
                                     style={{border: '3px solid #ffffff'}}/>
                             }
                             <span
-                                className='home-top-msg-text'>{userName +' | ' + schoolName}</span>
+                                className='home-top-msg-text'>{userName + ' | ' + schoolName}</span>
                         </div>
                 }
             </div>
@@ -416,38 +415,37 @@ class HomePage extends Component {
     }
 
     onStuSwitch = (stuIndex) => {
-        console.log("onStuSwitch",stuIndex)
-
-       /* if (stuIndex != 0) {
-            Toast.loading('学生切换中...', 0)
-            setTimeout(() => {
-                Toast.success('切换成功!', 1)
-                const studentList =  this.props.userInfo.parent.students
-                const centerStu = studentList[stuIndex]
-                studentList[stuIndex] = studentList[0]
-                studentList[0] = centerStu
-
-                switchUser({
-                    parent: {
-                        ...this.props.userInfo.parent,
-                        students:studentList,
-                        student: centerStu
-                    },
-                    user: {
-                        ...this.props.userInfo.parent,
-                        students:studentList,
-                        student: centerStu
-                    }
-                })()
-            }, 400)
-        }*/
+        console.log("onStuSwitch", stuIndex)
+
+        /* if (stuIndex != 0) {
+             Toast.loading('学生切换中...', 0)
+             setTimeout(() => {
+                 Toast.success('切换成功!', 1)
+                 const studentList =  this.props.userInfo.parent.students
+                 const centerStu = studentList[stuIndex]
+                 studentList[stuIndex] = studentList[0]
+                 studentList[0] = centerStu
+
+                 switchUser({
+                     parent: {
+                         ...this.props.userInfo.parent,
+                         students:studentList,
+                         student: centerStu
+                     },
+                     user: {
+                         ...this.props.userInfo.parent,
+                         students:studentList,
+                         student: centerStu
+                     }
+                 })()
+             }, 400)
+         }*/
         if (this.state.studentIndex !== stuIndex) {
             Toast.loading('学生切换中...', 0)
             setTimeout(() => {
                 Toast.success('切换成功!', 1)
                 this.setState({
                     studentIndex: stuIndex,
-                    selectStuName:this.props.userInfo.parent.students[stuIndex].stuName
                 })
                 switchUser({
                     parent: {
@@ -562,7 +560,7 @@ class StuItem extends Component {
                         <Avatar className={this.props.isSelect ? 'border-radius-50-blue' : 'border-radius-50'}
                                 size={30} icon='user'/>
                 }
-              {/*  <span
+                {/*  <span
                     className={this.props.isSelect ? "margin_left_5 color_blue text_bold"
                         : 'margin_left_5'}>{this.props.stuObj.stuName+','+this.props.isSelect}</span>*/}
             </div>

Some files were not shown because too many files changed in this diff