wzy пре 1 година
родитељ
комит
c5502b06e3

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
mjava-shantai/src/main/java/com/malk/shantai/controller/StYkbController.java


+ 3 - 0
mjava-shantai/src/main/java/com/malk/shantai/entity/Shantai.java

@@ -1,10 +1,13 @@
 package com.malk.shantai.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 @TableName(value = "shantai")
 @Data
 public class Shantai {
+    @TableId(value = "id", type = IdType.AUTO)
     private String id;
 
     //单据id

+ 13 - 6
mjava-shantai/src/main/java/com/malk/shantai/service/impl/StDingProcServiceImpl.java

@@ -267,17 +267,24 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
         //新增评论
         comment(dentries,state,userId,procInstId);
 
-        //更新表中同步状态
-        if (dentries.isEmpty()){
-            shantai.setState("2");
-        }else {
-            shantai.setState("1");
-        }
         if (Objects.isNull(shantai)){
+            //更新表中同步状态
+            shantai = new Shantai();
+            if (dentries.isEmpty()){
+                shantai.setState("2");
+            }else {
+                shantai.setState("1");
+            }
             shantai.setFlowId(flowId);
             shantai.setProcInstId(procInstId);
             shantaiMapper.insert(shantai);
         }else {
+            //更新表中同步状态
+            if (dentries.isEmpty()){
+                shantai.setState("2");
+            }else {
+                shantai.setState("1");
+            }
             //更新评论状态
             shantaiMapper.updateById(shantai);
         }

+ 18 - 0
mjava-shantai/src/main/resources/application-prod.yml

@@ -3,6 +3,12 @@ server:
   servlet:
     context-path: /shantai
 
+spring:
+  datasource:
+    url: jdbc:mysql://127.0.0.1:3306/shantai?serverTimezone=GMT%2B8
+    username: root
+    password: ST-cloudpure2024
+    driver-class-name: com.mysql.cj.jdbc.Driver
 enable:
   scheduling: false
 logging:
@@ -11,6 +17,18 @@ logging:
   level:
     com.malk.*: debug
 
+mybatis-plus:
+  configuration:
+    #开启驼峰命名自动映射
+    map-underscore-to-camel-case: true
+    #开启日志打印
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  type-aliases-package: com.malk.shantai.entity
+  #扫描mapper文件
+  mapper-locations: classpath:mapper/*.xml
+
+
+
 # dingtalk
 dingtalk:
   agentId: 3088485347

+ 1 - 1
mjava-shantai/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: dev
+    active: prod
   servlet:
     multipart:
       max-file-size: 100MB