Sfoglia il codice sorgente

模板+账号相关接口优化

leon 4 anni fa
parent
commit
d9f4d81270

+ 3 - 2
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashTaskListController.java

@@ -6,6 +6,7 @@ import com.mokamrp.privates.constant.HttpStatus;
 import com.mokamrp.privates.entity.AddHandle;
 import com.mokamrp.privates.entity.AddHandle;
 import com.mokamrp.privates.entity.DelHandle;
 import com.mokamrp.privates.entity.DelHandle;
 import com.mokamrp.privates.entity.PostBasePageHandle;
 import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.mokamrp.privates.entity.pangu.FosterwxCashTaskListHandle;
 import com.mokamrp.privates.help.AjaxResult;
 import com.mokamrp.privates.help.AjaxResult;
 import com.mokamrp.privates.entity.ResHandle;
 import com.mokamrp.privates.entity.ResHandle;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskTemplate;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskTemplate;
@@ -48,11 +49,11 @@ public class FosterwxCashTaskListController extends BaseController<FosterwxCashT
      */
      */
 
 
     @PostMapping("/list")
     @PostMapping("/list")
-    public Object list(@Valid @RequestBody PostBasePageHandle postBasePageHandle, BindingResult bindingResult){
+    public Object list(@Valid @RequestBody FosterwxCashTaskListHandle handle, BindingResult bindingResult){
         if (bindingResult.hasErrors()) {
         if (bindingResult.hasErrors()) {
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
         }
         }
-        ResHandle<List<FosterwxCashTaskList>> res = fosterwxCashTaskListService.getList(postBasePageHandle);
+        ResHandle<List<FosterwxCashTaskList>> res = fosterwxCashTaskListService.getList(handle);
         return AjaxResult.success(res);
         return AjaxResult.success(res);
     }
     }
 
 

+ 8 - 2
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashTaskTemplateController.java

@@ -8,7 +8,9 @@ import com.mokamrp.privates.entity.DelHandle;
 import com.mokamrp.privates.entity.PostBasePageHandle;
 import com.mokamrp.privates.entity.PostBasePageHandle;
 import com.mokamrp.privates.help.AjaxResult;
 import com.mokamrp.privates.help.AjaxResult;
 import com.mokamrp.privates.entity.ResHandle;
 import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.interceptor.AuthUser;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
+import com.mokamrp.privates.mapper.pojo.User;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
 import org.apache.tomcat.jni.Local;
 import org.apache.tomcat.jni.Local;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -78,18 +80,22 @@ public class FosterwxCashTaskTemplateController extends BaseController<FosterwxC
         return AjaxResult.success(res);
         return AjaxResult.success(res);
     }
     }
 
 
-    @PostMapping("/add")
-    public Object add(@Valid @RequestBody AddHandle<FosterwxCashTaskTemplate> addHandle, BindingResult bindingResult) {
+    @PostMapping("/addPro")
+    public Object addPro(@Valid @RequestBody AddHandle<FosterwxCashTaskTemplate> addHandle, @AuthUser User authUser, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
         if (bindingResult.hasErrors()) {
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
         }
         }
         this.onInsert(addHandle.getRaw());
         this.onInsert(addHandle.getRaw());
         FosterwxCashTaskTemplate add = addHandle.getRaw();
         FosterwxCashTaskTemplate add = addHandle.getRaw();
+        add.setCreateUid(authUser.getId());
+        add.setUpdateUid(authUser.getId());
         Boolean res = service.save(add);
         Boolean res = service.save(add);
         for (FosterwxCashTaskList fosterwxCashTaskList : add.getTaskList()){
         for (FosterwxCashTaskList fosterwxCashTaskList : add.getTaskList()){
             fosterwxCashTaskList.setTemplateId(add.getId());
             fosterwxCashTaskList.setTemplateId(add.getId());
             fosterwxCashTaskList.setCreateAt(LocalDateTime.now());
             fosterwxCashTaskList.setCreateAt(LocalDateTime.now());
             fosterwxCashTaskList.setUpdateAt(LocalDateTime.now());
             fosterwxCashTaskList.setUpdateAt(LocalDateTime.now());
+            fosterwxCashTaskList.setCreateUid(authUser.getId());
+            fosterwxCashTaskList.setUpdateUid(authUser.getId());
             fosterwxCashTaskListService.save(fosterwxCashTaskList);
             fosterwxCashTaskListService.save(fosterwxCashTaskList);
         }
         }
         if (res) {
         if (res) {

+ 30 - 0
src/main/java/com/mokamrp/privates/entity/pangu/FosterwxCashTaskListHandle.java

@@ -0,0 +1,30 @@
+package com.mokamrp.privates.entity.pangu;
+
+import lombok.Data;
+
+@Data
+public class FosterwxCashTaskListHandle {
+    private Integer page;
+    private Integer pagesize;
+    private Integer id;
+    private Integer groupId;
+    private String name;
+    private Integer templateId;
+
+    public Integer getPage() {
+        return page;
+    }
+
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    public Integer getPagesize() {
+        return pagesize;
+    }
+
+    public void setPagesize(Integer pagesize) {
+        this.pagesize = pagesize;
+    }
+}
+

+ 3 - 1
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashTaskListMapper.java

@@ -1,5 +1,7 @@
 package com.mokamrp.privates.mapper.pangu;
 package com.mokamrp.privates.mapper.pangu;
 
 
+import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.mokamrp.privates.entity.pangu.FosterwxCashTaskListHandle;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -17,5 +19,5 @@ import java.util.List;
  */
  */
 @Component
 @Component
 public interface FosterwxCashTaskListMapper extends BaseMapper<FosterwxCashTaskList> {
 public interface FosterwxCashTaskListMapper extends BaseMapper<FosterwxCashTaskList> {
-    public List<FosterwxCashTaskList> getList(Page<FosterwxCashTaskList> pageObj);
+    public List<FosterwxCashTaskList> getList(Page<FosterwxCashTaskList> pageObj,@Param("params") FosterwxCashTaskListHandle handle);
 }
 }

+ 3 - 1
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashTaskListMapper.xml

@@ -30,6 +30,8 @@
         id, template_id, task_type, task_name, title, image, box_type, video_id, tag_id, card_image, url, rich_txt_body, remark, send_at, del_flg, create_uid, update_uid, create_at, update_at
         id, template_id, task_type, task_name, title, image, box_type, video_id, tag_id, card_image, url, rich_txt_body, remark, send_at, del_flg, create_uid, update_uid, create_at, update_at
     </sql>
     </sql>
     <select id="getList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList">
     <select id="getList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList">
-        SELECT * FROM pan_fosterwx_cash_task_list where del_flg = 1
+        SELECT * FROM pan_fosterwx_cash_task_list
+        where del_flg = 1
+        <if test="params.templateId != null">and template_id = #{params.templateId}</if>
     </select>
     </select>
 </mapper>
 </mapper>

+ 1 - 1
src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashOasBoxService.java

@@ -18,7 +18,7 @@ public interface FosterwxCashOasBoxService extends IService<FosterwxCashOasBox>
     //.@leon 获取数据列表
     //.@leon 获取数据列表
     public ResHandle<List<FosterwxCashOasBox>> getList(PostBasePageHandle handle);
     public ResHandle<List<FosterwxCashOasBox>> getList(PostBasePageHandle handle);
     //.@leon 增加发文数量记录
     //.@leon 增加发文数量记录
-    public Boolean addSendTextCnt(String ghId);
+    public Boolean addSendTextCnt(Integer groupId,String ghId);
     //.@leon 获取一个正常状态的小程序
     //.@leon 获取一个正常状态的小程序
     public FosterwxCashOasBox getRandBox(Integer groupId);
     public FosterwxCashOasBox getRandBox(Integer groupId);
     //.@leon 获取一个正常状态的公众号
     //.@leon 获取一个正常状态的公众号

+ 2 - 1
src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashTaskListService.java

@@ -1,5 +1,6 @@
 package com.mokamrp.privates.service.pangu;
 package com.mokamrp.privates.service.pangu;
 
 
+import com.mokamrp.privates.entity.pangu.FosterwxCashTaskListHandle;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.mokamrp.privates.entity.PostBasePageHandle;
 import com.mokamrp.privates.entity.PostBasePageHandle;
@@ -16,5 +17,5 @@ import java.util.Map;
  */
  */
 public interface FosterwxCashTaskListService extends IService<FosterwxCashTaskList> {
 public interface FosterwxCashTaskListService extends IService<FosterwxCashTaskList> {
     //.@leon 获取数据列表
     //.@leon 获取数据列表
-    public ResHandle<List<FosterwxCashTaskList>> getList(PostBasePageHandle handle);
+    public ResHandle<List<FosterwxCashTaskList>> getList(FosterwxCashTaskListHandle handle);
 }
 }

+ 2 - 1
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashOasBoxServiceImpl.java

@@ -49,9 +49,10 @@ public class FosterwxCashOasBoxServiceImpl extends ServiceImpl<FosterwxCashOasBo
     }
     }
 
 
     @Transactional(isolation = Isolation.READ_COMMITTED)
     @Transactional(isolation = Isolation.READ_COMMITTED)
-    public Boolean addSendTextCnt(String ghId) {
+    public Boolean addSendTextCnt(Integer groupId,String ghId) {
         FosterwxCashOasBox fosterwxCashOasBox = this.getOne(new QueryWrapper<FosterwxCashOasBox>()
         FosterwxCashOasBox fosterwxCashOasBox = this.getOne(new QueryWrapper<FosterwxCashOasBox>()
                 .eq("gh_id", ghId)
                 .eq("gh_id", ghId)
+                .eq("group_id",groupId)
                 .last("for update"));
                 .last("for update"));
         if (fosterwxCashOasBox == null){
         if (fosterwxCashOasBox == null){
             return false;
             return false;

+ 3 - 2
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashTaskListServiceImpl.java

@@ -1,5 +1,6 @@
 package com.mokamrp.privates.service.pangu.impl;
 package com.mokamrp.privates.service.pangu.impl;
 
 
+import com.mokamrp.privates.entity.pangu.FosterwxCashTaskListHandle;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.mokamrp.privates.mapper.pangu.FosterwxCashTaskListMapper;
 import com.mokamrp.privates.mapper.pangu.FosterwxCashTaskListMapper;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
@@ -30,11 +31,11 @@ public class FosterwxCashTaskListServiceImpl extends ServiceImpl<FosterwxCashTas
      * @param handle
      * @param handle
      * @return
      * @return
      */
      */
-    public ResHandle<List<FosterwxCashTaskList>> getList(PostBasePageHandle handle) {
+    public ResHandle<List<FosterwxCashTaskList>> getList(FosterwxCashTaskListHandle handle) {
         Integer pagesize = handle.getPagesize();
         Integer pagesize = handle.getPagesize();
         Integer page = handle.getPage();
         Integer page = handle.getPage();
         Page<FosterwxCashTaskList> pageObj = new Page<FosterwxCashTaskList>(page, pagesize);
         Page<FosterwxCashTaskList> pageObj = new Page<FosterwxCashTaskList>(page, pagesize);
-        List<FosterwxCashTaskList> list = fosterwxCashTaskListMapper.getList(pageObj);
+        List<FosterwxCashTaskList> list = fosterwxCashTaskListMapper.getList(pageObj,handle);
         ResHandle<List<FosterwxCashTaskList>> res = new ResHandle<>();
         ResHandle<List<FosterwxCashTaskList>> res = new ResHandle<>();
         res.setList(list);
         res.setList(list);
         res.setTotal(pageObj.getTotal());
         res.setTotal(pageObj.getTotal());