Browse Source

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

chenw 7 years ago
parent
commit
5691aefdc9
18 changed files with 293 additions and 20 deletions
  1. 3 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/DeviceClientApplication.java
  2. 1 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/config/WebMvcConfig.java
  3. 6 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/controller/AccessControlController.java
  4. 44 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/controller/IcCardController.java
  5. 41 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/controller/SchoolController.java
  6. 18 11
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/AccessControlService.java
  7. 10 6
      applications/device/device-client/src/main/resources/static/css/iconfont.css
  8. BIN
      applications/device/device-client/src/main/resources/static/css/iconfont.eot
  9. 3 0
      applications/device/device-client/src/main/resources/static/css/iconfont.svg
  10. BIN
      applications/device/device-client/src/main/resources/static/css/iconfont.ttf
  11. BIN
      applications/device/device-client/src/main/resources/static/css/iconfont.woff
  12. 37 0
      applications/device/device-client/src/main/resources/static/iccard.html
  13. 3 0
      applications/device/device-client/src/main/resources/static/index.html
  14. 47 0
      applications/device/device-client/src/main/resources/static/js/iccard.js
  15. 18 0
      applications/device/device-client/src/main/resources/static/js/index.js
  16. 42 0
      applications/device/device-client/src/main/resources/static/js/school.js
  17. 17 0
      applications/device/device-client/src/main/resources/static/school.html
  18. 3 3
      applications/school/school-server/src/main/resources/mapper/CurriculumMapper.xml

+ 3 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/DeviceClientApplication.java

@@ -5,6 +5,8 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
@@ -13,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
  */
 @SpringBootApplication
 @EnableAsync
+@EnableTransactionManagement
 @EnableConfigurationProperties(DeviceServerProperties.class)
 @EnableScheduling
 public class DeviceClientApplication {

+ 1 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/config/WebMvcConfig.java

@@ -17,5 +17,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
         registry.addViewController("/").setViewName("index.html");
         registry.addViewController("/login").setViewName("/login.html");
         registry.addViewController("/iccard").setViewName("/iccard.html");
+        registry.addViewController("/school").setViewName("/school.html");
     }
 }

+ 6 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/controller/AccessControlController.java

@@ -40,4 +40,10 @@ public class AccessControlController {
         accessControlService.save(accessControl);
         return Result.success();
     }
+
+    @DeleteMapping("/{id}")
+    public Result delete(@PathVariable("id") String id) {
+        accessControlService.delete(id);
+        return Result.success();
+    }
 }

+ 44 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/controller/IcCardController.java

@@ -0,0 +1,44 @@
+package com.usoftchina.smartschool.device.client.controller;
+
+import com.usoftchina.smartschool.device.base.Result;
+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.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author yingp
+ * @date 2019/3/11
+ */
+@RestController
+@RequestMapping("/api/iccard")
+public class IcCardController {
+
+    @Autowired
+    private IcCardService icCardService;
+
+    /**
+     * 查询消费卡配置
+     *
+     * @return
+     */
+    @GetMapping
+    public Result<IcCard> find() {
+        return Result.success(icCardService.find());
+    }
+
+    /**
+     * 保存消费卡配置
+     *
+     * @param icCard
+     * @return
+     */
+    @PostMapping
+    public Result save(IcCard icCard) {
+        icCardService.save(icCard);
+        return Result.success();
+    }
+}

+ 41 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/controller/SchoolController.java

@@ -0,0 +1,41 @@
+package com.usoftchina.smartschool.device.client.controller;
+
+import com.usoftchina.smartschool.device.base.Result;
+import com.usoftchina.smartschool.device.client.po.School;
+import com.usoftchina.smartschool.device.client.service.SchoolService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author yingp
+ * @date 2019/3/11
+ */
+@RestController
+@RequestMapping("/api/school")
+public class SchoolController {
+
+    @Autowired
+    private SchoolService schoolService;
+
+    /**
+     * 查询学校信息
+     *
+     * @return
+     */
+    @GetMapping
+    public Result<School> find() {
+        return Result.success(schoolService.find());
+    }
+
+    /**
+     * 保存学校信息
+     *
+     * @param school
+     * @return
+     */
+    @PostMapping
+    public Result save(School school) {
+        schoolService.save(school);
+        return Result.success();
+    }
+}

+ 18 - 11
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/AccessControlService.java

@@ -49,27 +49,34 @@ public class AccessControlService {
     public void save(AccessControl accessControl) {
         AccessControl oldOne = accessControlRepository.findByIpAndPort(accessControl.getIp(),
                 accessControl.getPort());
+        boolean isNew = StringUtils.isEmpty(accessControl.getId());
         if (null != oldOne) {
-            if (StringUtils.isEmpty(accessControl.getId())) {
+            if (isNew) {
                 accessControl.setId(oldOne.getId());
             } else if (!accessControl.getId().equals(oldOne.getId())) {
                 ExceptionCode.ERROR_IP_PORT_EXIST.occur();
             }
-            accessControlRepository.update(accessControl);
+        } else {
+            if (isNew) {
+                accessControl.setId(RandomUtils.randomString());
+            }
+        }
+
+        if (isNew) {
+            // 调用设备接口监听
+            deviceApi.add(accessControl);
+            accessControlRepository.save(accessControl);
+        } else {
+            oldOne = accessControlRepository.findById(accessControl.getId());
             if (!oldOne.getIp().equals(accessControl.getIp()) || oldOne.getPort() != accessControl.getPort() ||
                     !oldOne.getUsername().equals(accessControl.getUsername()) ||
-                            !oldOne.getPassword().equals(accessControl.getPassword())) {
-                // 先调用设备接口停止监听
-                deviceApi.remove(accessControl);
+                    !oldOne.getPassword().equals(accessControl.getPassword())) {
                 // 调用设备接口监听
                 deviceApi.add(accessControl);
+                // 调用设备接口停止监听
+                deviceApi.remove(oldOne);
             }
-
-        } else {
-            accessControl.setId(RandomUtils.randomString());
-            accessControlRepository.save(accessControl);
-            // 调用设备接口监听
-            deviceApi.add(accessControl);
+            accessControlRepository.update(accessControl);
         }
     }
 

+ 10 - 6
applications/device/device-client/src/main/resources/static/css/iconfont.css

@@ -1,10 +1,10 @@
 @font-face {font-family: "iconfont";
-  src: url('iconfont.eot?t=1552350156920'); /* IE9 */
-  src: url('iconfont.eot?t=1552350156920#iefix') format('embedded-opentype'), /* IE6-IE8 */
-  url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMIAAsAAAAAByQAAAK8AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAqCMIF+ATYCJAMICwYABCAFhG0HLhsiBhEVlA9kHwm5Kc2foji2NKFqzMQD31z5J5m9pgAMsqz2VAnIAQuLYMuy8t7e/1o7EYsT0jn6+m1H4+r8FZ8/aKdTKskqoR4hEgoeGgZcjv8r8XlAOa05aG0MMN4a0N4YRVYgCcTWhzjslXmfgDIaaCcMGzFumkxkLQsI61avXCzL+UVRSGWCopq9UdgvJ0t2JFvsCz8f/ugSMhK5lJU3acXwZQb9qGkvyOcLefPSYvn5rBAOkaIdImFarX2CNI63kyqjxaMm7Cs78KPmf8E3Cnv984QiVmY5UA/59yRwhbeamYCIw/OxetRPSqxXr3K1Ladfduvcf92geO5Nz7YKl6/XKpy40bx77VYolo31Zy469qSmfay4xujozmrW4dvVTjZVf8i3ii9+2Ozk8tW656fu1bRv7RrwV7/0tvMt7rdlL+G4eot6k57El/R1UAvotLrsKmnNx5f/029unfuv+fewktYl0fk3JvefjGuWH/p17Nctc0v+9LhtvdNxSsubKU/w4Lzfkw0ChXzMpsU/+ztar5/TSq3Y739WNoKPd+ptQ2E/J9ktOQK/tiaiUIhBFFmq5CL55EjMz3glIFd0KbDcVXwfq67+HukgU/1tnKXUT5HKNCMirR1yyuqGIhnSQJTRlnK4rKpIXoil0cYdIKjkEYkKXiBVyRsRae/IqeEbRSqFPMqYEaqeWVaL4NaGEuqMFhg34JpxJBwT16LsI7QvAp2yopB+hiTdECym82JKwQhpjg3y0l4yCxAUh7CBxzAIYkgo9tDkqcOcHM5mou5FUzMOMzVDEaRjyAIMN4DLFIsIvz2rld5/BNkuBHTU0lTjPIOI5I4OFqbmPQhFHvVqupdnpEu2JcYEIJBYCGzAigI7HgNJ/SwPMrEpZ0Q0cWhGrURf+XR9Zfh1O6AMS5MEuzgVl1suZzI=') format('woff2'),
-  url('iconfont.woff?t=1552350156920') format('woff'),
-  url('iconfont.ttf?t=1552350156920') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
-  url('iconfont.svg?t=1552350156920#iconfont') format('svg'); /* iOS 4.1- */
+  src: url('iconfont.eot?t=1552353178223'); /* IE9 */
+  src: url('iconfont.eot?t=1552353178223#iefix') format('embedded-opentype'), /* IE6-IE8 */
+  url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAOMAAsAAAAACEAAAAM/AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDBgqEKIM+ATYCJAMMCwgABCAFhG0HNxsFBxHVm3PIfiTGtmjyzpmhr6KJ9maCB6rzfbMzSfcbqOSkpG/2iTr+JgBMmnPARkVNluQsevQP99BympHPczluPQ9sfstymmPZsrJF8QEFtDceRVYgAXnD2JUX8RwCsMafWERpeW0rdBTGOgGIQf37dkdPmVE1tQIdgbHkqEIswYCuzdVuAYv974svJAsdNAwS46XGPmW9KHx/94OHNFlMdJJmTOM5AXYKJBALKBBdSt3tkGE6Fom1olb1pUYUAm2smMWCL1a1xpX+8TQQRoxqWwAioVHjpCQ2HwI+eIighvM/BUZAB04ANyDDlaRC+QbZ2fn6OrkOtj/1wN9g3j9/L8q018Zh/n6Ratxwr6v1PPf8VdYu0zV3RcM+834bm4LVpx3H/Kg8u3avaU+/eftEv749NonU+A33Uh1H3bX5YYYD9jv2eKq1e8Ocdo88qo0qv7Lb6vMefVeb3d1XzXPtteKAa6uxbntNkeHtZ0Jb7djl03b9YY++++dbCkyt9UJ7J18ne9dtj70vSs3UW7f5/8527c219vPtkNn2XdGch8Fv8lzmR14Ifpi0NE1tr/bFXQ8SM8n/6Wc1e0v4ktn6MX+ab5Jv43l1TJ4vDAdE3UamjCzf8vnlv9b7JnT8FvattCmqKbh+b/M8z9pQWfKq5tX4jk1f0idEpSW0iBjf4jzc2elzc7oBYLkit8hCnDUpIc3/9Tf0WZW6satD7j/dRgHw7GDkOiht5wX9rj0C/mKTAiwWJbjMsEgli22x7pF0TgTRAAq5hn9XD+DMm/5at9bVINBxi6HRDD9IdEIpihELAzakwohOAayJoeK0DS6MQCKUFRDNTACBI4ehYc9lSBy5TVGM1zDgzjcYcRQS1rQRLlfaoO5F3B0ZSmBJ/ymarnWWTXZB7Q3+XStOynzWCzzGGOVJls1d0YLH2DF+fCHiyHHX0AW8hrruqOeuhJEkiPSHNHVlb0pM10x2HBlKYAn9J6LpWueOl13u8zf4d624pqMi+AKPcXIiJyFrQbmq21Yd10Jm/PgCEUc47hriApyozXRH9OWLShhJCD2S/YEU9XJt1cn82ub5EgBrjDul0IQUilUv1BAsYKNMJgA=') format('woff2'),
+  url('iconfont.woff?t=1552353178223') format('woff'),
+  url('iconfont.ttf?t=1552353178223') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
+  url('iconfont.svg?t=1552353178223#iconfont') format('svg'); /* iOS 4.1- */
 }
 
 .iconfont {
@@ -15,6 +15,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-delete:before {
+  content: "\e6cf";
+}
+
 .icon-edit:before {
   content: "\e717";
 }

BIN
applications/device/device-client/src/main/resources/static/css/iconfont.eot


+ 3 - 0
applications/device/device-client/src/main/resources/static/css/iconfont.svg

@@ -20,6 +20,9 @@ Created by iconfont
   />
     <missing-glyph />
     
+    <glyph glyph-name="delete" unicode="&#59087;" d="M768-64H256c-52.8 0-96 43.2-96 96V608c0 17.6 14.4 32 32 32s32-14.4 32-32v-576c0-17.6 14.4-32 32-32h512c17.6 0 32 14.4 32 32V608c0 17.6 14.4 32 32 32s32-14.4 32-32v-576c0-52.8-43.2-96-96-96zM896 704H672c-8 0-16 3.2-22.4 9.6l-44.8 44.8c-6.4 6.4-14.4 9.6-24 9.6h-139.2c-8 0-16-3.2-22.4-9.6l-44.8-44.8c-6.4-6.4-14.4-9.6-22.4-9.6H128c-17.6 0-32 14.4-32 32s14.4 32 32 32h211.2l35.2 35.2C392 822.4 417.6 832 443.2 832h139.2c25.6 0 49.6-9.6 67.2-28.8L684.8 768H896c17.6 0 32-14.4 32-32s-14.4-32-32-32zM400 64c-17.6 0-32 14.4-32 32V608c0 17.6 14.4 32 32 32s32-14.4 32-32v-512c0-17.6-14.4-32-32-32zM624 64c-17.6 0-32 14.4-32 32V608c0 17.6 14.4 32 32 32s32-14.4 32-32v-512c0-17.6-14.4-32-32-32z"  horiz-adv-x="1024" />
+
+    
     <glyph glyph-name="edit" unicode="&#59159;" d="M1006.592-29.39392c0-54.311936-44.859392-98.60608-100.196352-98.60608H100.196352C45.207552-128 0-83.994624 0-29.710336V660.494336C0 714.807296 45.125632 758.784 100.79232 758.784h539.76576v-49.265664H100.79232c-27.92448 0-50.46272-21.972992-50.46272-49.024v-690.204672c0-26.954752 22.550528-49.024 49.866752-49.024h806.199296c27.416576 0 49.866752 22.116352 49.866752 49.340416v626.944H1006.592v-626.944z m0 0c0-54.311936-44.859392-98.60608-100.196352-98.60608H100.196352C45.207552-128 0-83.994624 0-29.710336V660.494336C0 714.807296 45.125632 758.784 100.79232 758.784h539.76576v-49.265664H100.79232c-27.92448 0-50.46272-21.972992-50.46272-49.024v-690.204672c0-26.954752 22.550528-49.024 49.866752-49.024h806.199296c27.416576 0 49.866752 22.116352 49.866752 49.340416v626.944H1006.592v-626.944zM516.465664 378.235904c19.206144 6.542336 50.36032 24.948736 64.864256 38.288384l378.635264 348.248064c19.523584 17.956864 19.503104 47.152128-0.088064 65.272832l-5.225472 4.83328c-20.186112 18.670592-52.790272 18.783232-72.92928 0.260096L503.044096 486.852608c-13.686784-12.589056-31.880192-40.728576-37.430272-57.837568l-24.835072-76.560384 75.685888 25.781248zM989.96224 868.345856l5.225472-4.83328c39.458816-36.49536 39.602176-95.865856-0.011264-132.3008L616.539136 382.96576c-19.570688-18.000896-56.854528-40.067072-82.895872-48.93696l-123.001856-41.897984c-26.315776-8.964096-40.638464 4.017152-32.60416 28.78464l39.502848 121.772032c7.969792 24.57088 30.553088 59.567104 50.295808 77.725696L846.512128 868.698112c39.836672 36.63872 103.842816 36.28032 143.449088-0.352256z"  horiz-adv-x="1024" />
 
     

BIN
applications/device/device-client/src/main/resources/static/css/iconfont.ttf


BIN
applications/device/device-client/src/main/resources/static/css/iconfont.woff


+ 37 - 0
applications/device/device-client/src/main/resources/static/iccard.html

@@ -24,4 +24,41 @@
         </ul>
     </div>
 </nav>
+<div class="container">
+    <div class="row justify-content-md-center">
+        <div class="col-md-auto">
+            <form id="form">
+                <div class="form-group">
+                    <label for="ipInput">IP</label>
+                    <input type="text" class="form-control" id="ipInput" name="ip" required
+                           aria-describedby="ipHelp" placeholder="ip地址,例如192.168.1.100">
+                </div>
+                <div class="form-group">
+                    <label for="portInput">端口</label>
+                    <input type="text" class="form-control" id="portInput" name="port" required
+                           aria-describedby="portHelp" placeholder="tcp端口,例如37777">
+                </div>
+                <div class="form-group">
+                    <label for="usernameInput">账号</label>
+                    <input type="text" class="form-control" id="usernameInput" name="username"
+                           value="admin" required aria-describedby="usernameHelp" placeholder="数据库账号,例如sa">
+                </div>
+                <div class="form-group">
+                    <label for="passwordInput">密码</label>
+                    <input type="password" class="form-control" id="passwordInput" name="password"
+                           required aria-describedby="passwordHelp" placeholder="数据库密码">
+                </div>
+                <div class="form-group">
+                    <label for="databaseNameInput">数据库</label>
+                    <input type="text" class="form-control" id="databaseNameInput" name="databaseName"
+                           required aria-describedby="databaseNameHelp" placeholder="数据库名称">
+                </div>
+                <button type="button" class="btn btn-primary btn-save">保存</button>
+            </form>
+        </div>
+    </div>
+</div>
+<script src="/js/jquery.min.js"></script>
+<script src="/js/bootstrap.min.js"></script>
+<script src="/js/school.js"></script>
 </body>

+ 3 - 0
applications/device/device-client/src/main/resources/static/index.html

@@ -100,6 +100,9 @@
                     data-toggle="modal" data-target="#formModal">
                 <span class="iconfont icon-edit"></span>
             </button>
+            <button type="button" class="btn btn-link btn-delete" data-index="<%=i%>" title="删除">
+                <span class="iconfont icon-delete"></span>
+            </button>
         </td>
     </tr>
     <%}%>

+ 47 - 0
applications/device/device-client/src/main/resources/static/js/iccard.js

@@ -0,0 +1,47 @@
+$(document).ready(function () {
+    var app = {
+        methods: {
+            get: function () {
+                $.ajax({
+                    url: '/api/iccard',
+                    method: 'GET',
+                    success: function (content) {
+                        if (content.success) {
+                            var card = content.data;
+                            $('#ipInput').val(card.ip);
+                            $('#portInput').val(card.port);
+                            $('#usernameInput').val(card.username);
+                            $('#passwordInput').val(card.password);
+                            $('#databaseNameInput').val(card.databaseName);
+                        } else {
+                            alert(content.message);
+                        }
+                    }
+                });
+            },
+            save: function () {
+                $.ajax({
+                    url: '/api/iccard',
+                    method: 'POST',
+                    data: $('#form').serialize(),
+                    success: function (content) {
+                        if (content.success) {
+                            window.location.reload();
+                        } else {
+                            alert(content.message);
+                        }
+                    }
+                });
+            }
+        },
+        init: function () {
+            $('.btn-save').click(function(){
+                app.methods.save();
+            });
+
+            app.methods.get();
+        }
+    };
+
+    app.init();
+});

+ 18 - 0
applications/device/device-client/src/main/resources/static/js/index.js

@@ -22,6 +22,11 @@ $(document).ready(function () {
                                 $('#usernameInput').val(accessControl.username);
                                 $('#passwordInput').val(accessControl.password);
                             });
+                            $('.btn-delete').click(function(){
+                                var index = $(this).data('index'),
+                                    accessControl = app.data.accessControls[index];
+                                app.methods.remove(accessControl.id);
+                            });
                         } else {
                             alert(content.message);
                         }
@@ -41,6 +46,19 @@ $(document).ready(function () {
                         }
                     }
                 });
+            },
+            remove: function (id) {
+                $.ajax({
+                    url: '/api/accesscontrol/' + id,
+                    method: 'DELETE',
+                    success: function (content) {
+                        if (content.success) {
+                            window.location.reload();
+                        } else {
+                            alert(content.message);
+                        }
+                    }
+                });
             }
         },
         init: function () {

+ 42 - 0
applications/device/device-client/src/main/resources/static/js/school.js

@@ -0,0 +1,42 @@
+$(document).ready(function () {
+    var app = {
+        methods: {
+            get: function () {
+                $.ajax({
+                    url: '/api/school',
+                    method: 'GET',
+                    success: function (content) {
+                        if (content.success) {
+                            $('#nameInput').val(content.data.name);
+                        } else {
+                            alert(content.message);
+                        }
+                    }
+                });
+            },
+            save: function () {
+                $.ajax({
+                    url: '/api/school',
+                    method: 'POST',
+                    data: $('#form').serialize(),
+                    success: function (content) {
+                        if (content.success) {
+                            window.location.reload();
+                        } else {
+                            alert(content.message);
+                        }
+                    }
+                });
+            }
+        },
+        init: function () {
+            $('.btn-save').click(function(){
+                app.methods.save();
+            });
+
+            app.methods.get();
+        }
+    };
+
+    app.init();
+});

+ 17 - 0
applications/device/device-client/src/main/resources/static/school.html

@@ -24,4 +24,21 @@
         </ul>
     </div>
 </nav>
+<div class="container">
+    <div class="row justify-content-md-center">
+        <div class="col-md-auto">
+            <form id="form">
+                <div class="form-group">
+                    <label for="nameInput">名称</label>
+                    <input type="text" class="form-control" id="nameInput" name="name" required
+                           aria-describedby="nameHelp" placeholder="学校名称">
+                </div>
+                <button type="button" class="btn btn-primary btn-save">保存</button>
+            </form>
+        </div>
+    </div>
+</div>
+<script src="/js/jquery.min.js"></script>
+<script src="/js/bootstrap.min.js"></script>
+<script src="/js/school.js"></script>
 </body>

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

@@ -264,10 +264,10 @@
   </select>
 
   <update id="updateByPublish" parameterType="java.lang.Long">
-    update clazz_main_curriculum
-    set mcur_status = 1 ,
+    update clazz_main_curriculum,clazz_curriculum
+    set clazz_main_curriculum.mcur_status = 1 ,clazz_curriculum.cur_status = 1 ,
       createTime = now()
-    where id = #{id,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT} and clazz_curriculum.cur_id=id
   </update>
 
   <update id="updateByRepublish" parameterType="java.lang.Long">