Kaynağa Gözat

Merge branch 'dev-lqc' into test

lqc 4 yıl önce
ebeveyn
işleme
4cdeb7e883

+ 7 - 0
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashAccountScheduleController.java

@@ -13,6 +13,7 @@ import com.mokamrp.privates.mapper.pojo.User;
 import com.mokamrp.privates.service.pangu.FosterwxCashAccountScheduleService;
 import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.BindingResult;
@@ -55,6 +56,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
      */
 
     @PostMapping("/list")
+    @ApiOperation(value = "获取列表信息")
     public Object list(@Valid @RequestBody FosterwxCashAccountScheduleHandle handle, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
@@ -64,6 +66,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
     }
 
     @PostMapping("/addPro")
+    @ApiOperation(value = "新建按钮")
     @Transactional(rollbackFor = Exception.class)
     public Object addPro(@RequestBody FosterwxCashAccountSchedule fosterwxCashAccountSchedule, @AuthUser User user) {
         this.onInsert(fosterwxCashAccountSchedule);
@@ -79,6 +82,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
         return AjaxResult.success("新建成功");
     }
 
+    @ApiOperation(value = "导入排期按钮")
     @PostMapping("/importSchedule")
     @Transactional(rollbackFor = Exception.class)
     public Object importSchedule(@RequestBody MultipartFile file, @AuthUser User user) {
@@ -114,6 +118,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
 
     @PostMapping("/immediateCreate")
     @Transactional(rollbackFor = Exception.class)
+    @ApiOperation(value = "立即生成----缺少typer的接口")
     public Object immediateCreate(FosterwxCashAccountScheduleHandle handle) {
         Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> fosterwxCashAccountScheduleService.createTask(Integer.valueOf(id)));
 
@@ -121,6 +126,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
     }
 
     @PostMapping("/preview")
+    @ApiOperation(value = "预览按钮---缺少老王的方法")
     public Object priview(FosterwxCashAccountScheduleHandle handle) {
         // TODO 等老王的接口
 
@@ -128,6 +134,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
     }
 
     @PostMapping("/cancelTask")
+    @ApiOperation(value = "取消任务按钮")
     public Object cancelTask(FosterwxCashAccountScheduleHandle handle, @AuthUser User user) {
         Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> fosterwxCashScheduleTaskListService.cancelTask(Integer.valueOf(id), user.getId()));
 

+ 4 - 4
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashAccountScheduleMapper.java

@@ -1,11 +1,11 @@
 package com.mokamrp.privates.mapper.pangu;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.springframework.stereotype.Component;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
+
 import java.util.List;
 
 /**
@@ -18,5 +18,5 @@ import java.util.List;
  */
 @Component
 public interface FosterwxCashAccountScheduleMapper extends BaseMapper<FosterwxCashAccountSchedule> {
-    public List<FosterwxCashAccountSchedule> getList(@Param("ew") LambdaQueryWrapper<FosterwxCashAccountSchedule> pageObj);
+    public List<FosterwxCashAccountSchedule> getList(@Param("ew") LambdaQueryWrapper<FosterwxCashAccountSchedule> querryWraper, @Param("pagesize") Integer pagesize, @Param("i") int i);
 }

+ 5 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashAccountScheduleMapper.xml

@@ -47,5 +47,10 @@
             pan_fosterwx_cash_account_schedule account_schedule
         LEFT JOIN pan_fosterwx_cash_task_template task_template ON account_schedule.template_id = task_template.id
         LEFT JOIN pan_fosterwx_cash_mobile_group mobile_group ON account_schedule.group_id = mobile_group.id
+        <where>
+            ${ew.sqlSegment}
+        </where>
+        order by account_schedule.id desc
+        limit #{pagesize} offset #{i}
     </select>
 </mapper>

+ 7 - 4
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashAccountScheduleServiceImpl.java

@@ -38,15 +38,18 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
         Integer page = handle.getPage();
         LambdaQueryWrapper<FosterwxCashAccountSchedule> fosterwxCashAccountScheduleLambdaQueryWrapper = new LambdaQueryWrapper<>();
         // 任务模板
-        fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getTemplateId, handle.getTemplateId());
+        if (null != handle.getTemplateId())
+            fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getTemplateId, handle.getTemplateId());
         // 创建人
-        fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getCreateUid, handle.getCreateUid());
+        if (null != handle.getCreateUid())
+            fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getCreateUid, handle.getCreateUid());
         // 账号组别
-        fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getGroupId, handle.getGroupId());
+        if (null != handle.getGroupId())
+            fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getGroupId, handle.getGroupId());
         // 获取总件数
         Long maxCount = Long.valueOf(fosterwxCashAccountScheduleMapper.selectCount(fosterwxCashAccountScheduleLambdaQueryWrapper));
 
-        List<FosterwxCashAccountSchedule> list = fosterwxCashAccountScheduleMapper.getList(fosterwxCashAccountScheduleLambdaQueryWrapper);
+        List<FosterwxCashAccountSchedule> list = fosterwxCashAccountScheduleMapper.getList(fosterwxCashAccountScheduleLambdaQueryWrapper, pagesize, (page - 1) * pagesize);
         ResHandle<List<FosterwxCashAccountSchedule>> res = new ResHandle<>();
         res.setList(list);
         res.setTotal(maxCount);