Browse Source

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

zhaoy 6 years ago
parent
commit
c0706cc2d4

+ 2 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/init/IcCardInitializer.java

@@ -5,11 +5,13 @@ import com.usoftchina.smartschool.device.client.po.IcCard;
 import com.usoftchina.smartschool.device.client.service.IcCardService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
 
 /**
  * @author yingp
  * @date 2019/3/11
  */
+@Component
 public class IcCardInitializer implements CommandLineRunner {
 
     @Autowired

+ 3 - 3
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/IcCardService.java

@@ -82,14 +82,14 @@ public class IcCardService {
         if (null != card && dynamicDataSourceRegister.contains(card) && null != school) {
             DynamicDataSourceContextHolder.set(card);
             try {
-                doTask();
+                doTask(school.getName());
             } finally {
                 DynamicDataSourceContextHolder.clear();
             }
         }
     }
 
-    private void doTask(){
+    private void doTask(String schoolName){
         //1.准备本次需要传输的数据->转移至中间表
         jdbcTemplate.execute(insertSql);
         //2.获取本次传输的数据
@@ -99,7 +99,7 @@ public class IcCardService {
         headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
         MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
         requestEntity.add("data", JSON.toJSONString(resultList));
-        requestEntity.add("school", schoolService.find().getName());
+        requestEntity.add("school", schoolName);
         HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity<>(requestEntity, headers);
         ResponseEntity<Result> response = restTemplate.postForEntity(targetURL, resultList, Result.class);
         if (response.getStatusCode() == HttpStatus.OK) {

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

@@ -11,6 +11,7 @@ import com.usoftchina.smartschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.utils.http.HmacUtils;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.*;
 import org.springframework.stereotype.Service;
 import org.springframework.util.LinkedMultiValueMap;
@@ -38,7 +39,8 @@ public class IcCardServiceImpl implements IcCardService {
     @Autowired
     private IcCardMapper icCardMapper;
 
-    private final String targetURL = "https://school-api.ydyhz.com/api/wechat/send/Messages";
+    @Value("${smartschool.wechat.pushUrl}")
+    private String targetURL;
 
     public String consumePush(List<AccTransDetail> accTransDetailList, String school){
         List<MessageInfoDTO> messageInfoList = new ArrayList<MessageInfoDTO>();

+ 4 - 1
applications/device/device-server/src/main/resources/application.yml

@@ -73,4 +73,7 @@ hystrix:
                         timeoutInMilliseconds: 4000
 mybatis:
   type-aliases-package: com.usoftchina.smartschool.device.po
-  mapper-locations: classpath:mapper/*.xml
+  mapper-locations: classpath:mapper/*.xml
+smartschool:
+  wechat:
+    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages

+ 4 - 1
applications/device/device-server/src/main/resources/config/application-docker-cloud.yml

@@ -20,4 +20,7 @@ spring:
         maximum-pool-size: 50
         idle-timeout: 30000
         max-lifetime: 1800000
-        connection-timeout: 30000
+        connection-timeout: 30000
+smartschool:
+  wechat:
+    pushUrl: https://school-api.ydyhz.com/api/wechat/send/Messages

+ 4 - 1
applications/device/device-server/src/main/resources/config/application-docker-prod.yml

@@ -12,4 +12,7 @@ spring:
     password: select111***
   redis:
     host: 10.10.100.166
-    port: 6379
+    port: 6379
+smartschool:
+  wechat:
+    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages

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

@@ -146,9 +146,9 @@ public class TeacherServiceImpl implements TeacherService{
 
                         if ("已婚".equals(json.get("teacher_marriage"))) {
                             json.put("teacher_marriage", 0);
-                        }else if ("".equals(json.get("teacher_marriage"))) {
+                        }else if ("未婚".equals(json.get("teacher_marriage"))) {
                             json.put("teacher_marriage", 1);
-                        }else if (!"已婚".equals(json.get("teacher_marriage")) && !"".equals(json.get("teacher_marriage"))) {
+                        }else if (!"已婚".equals(json.get("teacher_marriage")) && !"未婚".equals(json.get("teacher_marriage"))) {
                             throw new BizException(BizExceptionCode.ILLEGAL_MARRIAGE);
                         }
                     }

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/exception/BizExceptionCode.java

@@ -33,7 +33,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     COURSE_RELEASE_STATUS(600006, "课程表已生效,无法删除"),
     NOTICE_RELEASE_STATUS(600007, "学校通知已生效,无法删除"),
     ILLEGAL_Gender(600007, "无效性别"),
-    ILLEGAL_MARRIAGE(600008, "婚姻状态无效"),
+    ILLEGAL_MARRIAGE(600008, "婚姻状态无效,应为:已婚或未婚"),
     NOT_EXISTS_SUBJECT(60005, "科目<u>%s</u>不存在");
 
 

+ 2 - 4
frontend/wechat-web/src/components/PhonesItem.jsx

@@ -44,13 +44,11 @@ export default class PhonesItem extends Component {
                             phonesBean.phone.length <= 1 ?
                                 <a href={'tel:' + phonesBean.phone[0]} style={{display: 'flex', alignItems: 'center'}}>
                                     <div className='phones-item-phone'>{phonesBean.phone[0]}</div>
-                                    <span style={{widths:10,background:'#FFFFFF',color:'#FFFFFF'}}>22</span>
-                                    <img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/>
+                                    <div><img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/></div>
                                 </a> :
                                 <div style={{display: 'flex', alignItems: 'center'}} onClick={this.onPhoneSelect}>
                                     <div className='phones-item-phone'>{phonesBean.phone[0]}</div>
-                                    <span style={{widths:10,background:'#FFFFFF',color:'#FFFFFF'}}>22</span>
-                                    <img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/>
+                                   <div> <img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/></div>
                                 </div>)}
                     </div>
 

+ 1 - 0
frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

@@ -175,6 +175,7 @@ class SendVote extends Component {
                 </div>
 
                 <div className="comhline_sty"></div>
+
                 <div className="common-column-layout">
                     <Picker
                         data={this.state.typeVote} title='投票类型' extra='请选择'

+ 1 - 1
frontend/wechat-web/src/modules/leave/LeaveAddCPage.js

@@ -96,7 +96,7 @@ class LeaveAddCPage extends Component {
                         dismissText: '取消'
                     }}
                     onChange={date => this.setState({startValue: date})}>
-                    <List.Item arrow="horizontal"></List.Item>
+                    <List.Item arrow="horizontal">开始时间</List.Item>
                 </DatePicker>
 
                 <div className="comhline_sty1"></div>

+ 6 - 0
frontend/wechat-web/src/modules/leave/LeaveListPage.css

@@ -12,4 +12,10 @@
     margin: 5px;
     border: #f5f5f5;
     background-color: #0098FD
+}
+
+.no_data{
+    background: #F4F4F4;
+    background-size: 100% 100%;
+    height: 100vh;
 }

+ 16 - 11
frontend/wechat-web/src/modules/leave/LeaveListPage.js

@@ -20,6 +20,7 @@ import RefreshLayout from "../../components/RefreshLayout";
 import {saveListState} from "../../redux/actions/listState";
 import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
 import {Toast} from 'antd-mobile';
+import nodata_img from '../../style/imgs/no_data.png';
 
 let LEAVE_LIST_URL = ''
 let mPageIndex = 0
@@ -67,25 +68,29 @@ class LeaveListPage extends React.Component{
 
     render(){
         return <div   style={{background: '#F2F2F2'}}>
-
-            <RefreshLayout
+            {
+                this.state.data.length > 0 ?
+                    <RefreshLayout
                         refreshing={this.state.isRefreshing}
-                         ref={el => {
-                             this.container = el
+                        ref={el => {
+                            this.container = el
                         }}
                         onRefresh={this.getListData}>
                         <Skeleton loading={this.state.isLoading} active paragraph={{rows: 3}}>
-                            {/*{this.state.selectContentArray.map((itemata,index) => <UserItem index ={index} itemata = {itemata} handelRItem={this.handelRItem} removeSItem={this.removeSItem}></UserItem>)}*/}
                             {this.state.data.map((itemdata,index) =>  <LeaveItem itemdata={itemdata} role={this.state.role} index = {index} onItemClick={this.onItemClick.bind(this)}></LeaveItem>
                             )}
-                            {/*<List dataSource={this.state.data}*/}
-                                  {/*renderItem={(itemdata,index) =>(*/}
-                                      {/*<List.Item  >*/}
-                                          {/*<LeaveItem itemdata={itemdata} role={this.state.role} index = {index} onItemClick={this.onItemClick.bind(this)}></LeaveItem>*/}
-                                      {/*</List.Item>*/}
-                                  {/*)}/>*/}
+                            {/*  <List dataSource={this.state.data}
+                                  renderItem={(itemdata,index) =>(
+                                      <List.Item  >
+                                          <LeaveItem itemdata={itemdata} role={this.state.role} index = {index} onItemClick={this.onItemClick.bind(this)}></LeaveItem>
+                                      </List.Item>
+                                  )}/>*/}
                         </Skeleton>
                     </RefreshLayout>
+                    :
+                    <div className="no_data"><img src={nodata_img} alt="" style={{width:'100%',height:'auto'}}/></div>
+            }
+
                     {
                         this.state.role=="teacher"?(""):(<Icon type="plus-circle" theme='filled' className='common-add-icon'
                                                                onClick={this.onAddAction} />)

+ 0 - 1
frontend/wechat-web/src/style/css/phones.css

@@ -61,7 +61,6 @@
 }
 
 .phones-item-phone {
-    width: 100px;
     font-family: PingFangSC-Regular;
     font-size: 15px;
     color: #666666;

BIN
frontend/wechat-web/src/style/imgs/no_data.png