瀏覽代碼

杉泰v2.0

wzy 11 月之前
父節點
當前提交
162e6532cf

+ 2 - 4
mjava-shantai/src/main/java/com/malk/shantai/controller/StYkbController.java

@@ -6,10 +6,7 @@ import com.malk.shantai.service.StDingProcService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 import java.util.Map;
@@ -49,6 +46,7 @@ public class StYkbController {
 
     //每小时定时同步评论水单
     @Scheduled(cron = "0 0 0/1 * * ? ")
+    @GetMapping("syncComment")
     public McR syncComment() {
         log.info("开始同步评论水单, time:{}",new Date().getTime());
 

+ 16 - 8
mjava-shantai/src/main/java/com/malk/shantai/service/impl/StDingProcServiceImpl.java

@@ -231,18 +231,25 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
                 .eq(Shantai::getValidFlag,"1");
         Shantai shantai = shantaiMapper.selectOne(shantaiLambdaQueryWrapper);
 
-        if (Objects.nonNull(shantai) && shantai.getState().equals("1")){
-            log.info("该单据Id:{}已同步过水单,本次不进行同步",flowId);
-            return McR.success();
+        //获取提交人
+        String userId = "";
+
+        if (Objects.nonNull(shantai)){
+            if (shantai.getState().equals("1")){
+                log.info("该单据Id:{}已同步过水单,本次不进行同步",flowId);
+                return McR.success();
+            }
+            userId = shantai.getUserId();
+        }
+        if (Objects.isNull(userId)){
+            userId = map.get("userId").toString();
         }
 
-        //获取提交人
-        String userId = map.get("userId").toString();
         DDR_New ddrNew = (DDR_New) UtilHttp.doPost("https://oapi.dingtalk.com/topapi/v2/user/get", null, ddClient.initTokenParams(), UtilMap.map("userid", userId), DDR_New.class);
         Map result = (Map) ddrNew.getResult();
-        String unionId = "";
+        String unionId = "4SLghmRuGL3Gii2DHXENHlwiEiE";
         if (Objects.nonNull(result)){
-            unionId = result.get("unionid").toString();
+//            unionId = result.get("unionid").toString();
         }else {
             unionId = "4SLghmRuGL3Gii2DHXENHlwiEiE";//李溯unionId
             userId = "16278700718435315";//李溯userId
@@ -285,6 +292,7 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
             }
             shantai.setFlowId(flowId);
             shantai.setProcInstId(procInstId);
+            shantai.setUserId(userId);
             shantaiMapper.insert(shantai);
         }else {
             //更新表中同步状态
@@ -387,7 +395,7 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
     public void commentSyncAll() {
         //获取所有评论未同步水单的单据列表
         LambdaQueryWrapper<Shantai> shantaiLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        shantaiLambdaQueryWrapper.eq(Shantai::getState,"2")
+        shantaiLambdaQueryWrapper.ne(Shantai::getState,"1")
                 .eq(Shantai::getValidFlag,"1");
         List<Shantai> shantaiList = shantaiMapper.selectList(shantaiLambdaQueryWrapper);
         for (Shantai shantai : shantaiList) {

+ 2 - 2
mjava-shantai/src/main/resources/application-dev.yml

@@ -64,5 +64,5 @@ ekb:
 
 #附件文件下载路径
 download:
-#  path: d:\\附件\\
-  path: /home/server/shantai/file/
+  path: d:\\附件\\
+#  path: /home/server/shantai/file/

+ 1 - 1
mjava-shantai/src/test/java/com/malk/shantai/DdTest.java

@@ -40,7 +40,7 @@ public class DdTest {
 //        stDingProcService.fkdSync("_ynuK9h3RYW4oE06B-D44A06971715048029");
 //        stDingProcService.fkdSync("lReoTnLiRbSreZKodGsyRg06971715650847");
 //        stDingProcService.fkdSync("o2zdfQO-TP6ipxqzZh9cjA06971715405894");
-        stDingProcService.fkdSync("XCjqMX0gQ-yyacyP6RpZEw06971717501752");
+        stDingProcService.fkdSync("y5D3GSA0S923ppCDNDDS-w06971719558034");
 
 
     }