Просмотр исходного кода

任务发送时间格式改为TIME

leon 4 лет назад
Родитель
Сommit
f9627e8a1a

+ 22 - 0
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashTaskTemplateController.java

@@ -7,6 +7,8 @@ import com.mokamrp.privates.entity.DelHandle;
 import com.mokamrp.privates.entity.PostBasePageHandle;
 import com.mokamrp.privates.help.AjaxResult;
 import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
+import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
 import org.apache.tomcat.jni.Local;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
@@ -40,6 +42,9 @@ public class FosterwxCashTaskTemplateController extends BaseController<FosterwxC
     @Autowired
     public FosterwxCashTaskTemplateService fosterwxCashTaskTemplateService;
 
+    @Autowired
+    public FosterwxCashTaskListService fosterwxCashTaskListService;
+
     /*
      * @fast
      * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
@@ -55,6 +60,23 @@ public class FosterwxCashTaskTemplateController extends BaseController<FosterwxC
         return AjaxResult.success(res);
     }
 
+    @PostMapping("/listPro")
+    public Object listPro(@Valid @RequestBody PostBasePageHandle postBasePageHandle, BindingResult bindingResult){
+        if (bindingResult.hasErrors()) {
+            return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
+        }
+        ResHandle<List<FosterwxCashTaskTemplate>> res = fosterwxCashTaskTemplateService.getList(postBasePageHandle);
+        for (FosterwxCashTaskTemplate fosterwxCashTaskTemplate : res.getList()){
+            List<FosterwxCashTaskList> taskList =  fosterwxCashTaskListService.list(
+                    new QueryWrapper<FosterwxCashTaskList>()
+                            .eq("template_id",fosterwxCashTaskTemplate.getId())
+                            .last("limit 6")
+            );
+            fosterwxCashTaskTemplate.setTaskList(taskList);
+        }
+        return AjaxResult.success(res);
+    }
+
     /**
      * 软删除
      * @param delHandle

+ 6 - 8
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashTaskList.java

@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.sql.Time;
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.time.LocalTime;
 
 /**
  * <p>
@@ -15,6 +19,7 @@ import java.io.Serializable;
  * @author leon
  * @since 2021-10-08
  */
+@Data
 @TableName("pan_fosterwx_cash_task_list")
 public class FosterwxCashTaskList extends Model<FosterwxCashTaskList> {
 
@@ -89,7 +94,7 @@ public class FosterwxCashTaskList extends Model<FosterwxCashTaskList> {
     /**
      * 发送时间
      */
-    private LocalDateTime sendAt;
+    private LocalTime sendAt;
 
     /**
      * 删除标志
@@ -221,13 +226,6 @@ public class FosterwxCashTaskList extends Model<FosterwxCashTaskList> {
         this.remark = remark;
     }
 
-    public LocalDateTime getSendAt() {
-        return sendAt;
-    }
-
-    public void setSendAt(LocalDateTime sendAt) {
-        this.sendAt = sendAt;
-    }
 
     public Integer getDelFlg() {
         return delFlg;

+ 8 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashTaskTemplate.java

@@ -1,11 +1,15 @@
 package com.mokamrp.privates.mapper.pangu.pojo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -15,6 +19,7 @@ import java.io.Serializable;
  * @author leon
  * @since 2021-10-08
  */
+@Data
 @TableName("pan_fosterwx_cash_task_template")
 public class FosterwxCashTaskTemplate extends Model<FosterwxCashTaskTemplate> {
 
@@ -51,6 +56,9 @@ public class FosterwxCashTaskTemplate extends Model<FosterwxCashTaskTemplate> {
      */
     private Integer updateUid;
 
+    @TableField(exist = false)
+    private List<FosterwxCashTaskList> taskList;
+
     /**
      * 创建时间
      */

+ 6 - 2
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxMobileServiceImpl.java

@@ -55,6 +55,9 @@ public class FosterwxMobileServiceImpl extends ServiceImpl<FosterwxMobileMapper,
     public FosterwxMobilePoolService fosterwxMobilePoolService;
 
     @Autowired
+    public FosterwxCashMobileService fosterwxCashMobileService;
+
+    @Autowired
     public FosterwxMobileTaskTimeListService fosterwxMobileTaskTimeListService;
 
     /**
@@ -259,7 +262,8 @@ public class FosterwxMobileServiceImpl extends ServiceImpl<FosterwxMobileMapper,
         LocalDateTime now = LocalDateTime.now();
         for (Integer id : mobileIds) {
             FosterwxMobile fosterwxMobile = this.getOne(new QueryWrapper<FosterwxMobile>().eq("id", id));
-            if (fosterwxMobile != null) {
+            FosterwxCashMobile fosterwxCashMobile = fosterwxCashMobileService.getOne(new QueryWrapper<FosterwxCashMobile>().eq("mobile_id",id));
+            if (fosterwxCashMobile != null){
                 continue;
             }
             FosterwxCashMobile add = new FosterwxCashMobile();
@@ -267,7 +271,7 @@ public class FosterwxMobileServiceImpl extends ServiceImpl<FosterwxMobileMapper,
             add.setStationId(fosterwxMobile.getStationId());
             add.setCreateAt(now);
             add.setUpdateAt(now);
-            this.save(fosterwxMobile);
+            fosterwxCashMobileService.save(add);
         }
         return true;
     }

+ 1 - 1
src/main/resources/application-local.properties

@@ -30,7 +30,7 @@ spring.datasource.dynamic.datasource.datadb.password=YangPeng_Data_War666$%Yp
 
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 spring.jpa.properties.hibernate.hbm2ddl.auto=update
-mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
+#mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
 mybatis-plus.configuration.map-underscore-to-camel-case=true
 spring.redis.host=172.18.71.26
 spring.redis.port=6379