修改短信模板显示条数错误
This commit is contained in:
parent
bec524dfc4
commit
fb2c010927
@ -1,12 +1,9 @@
|
||||
package com.xinelu.manage.controller.servicepackage;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.constant.HttpStatus;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.PageDomain;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.core.page.TableSupport;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.servicepackage.ServicePackage;
|
||||
@ -21,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 服务包基础信息Controller
|
||||
@ -43,17 +39,7 @@ public class ServicePackageController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('manage:servicepackage:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ServicePackage servicePackage) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
List<ServicePackageVO> list = servicePackageService.selectServicePackageList(servicePackage);
|
||||
int num = list.size();
|
||||
list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(num);
|
||||
return rspData;
|
||||
return servicePackageService.selectServicePackageList(servicePackage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,9 +50,10 @@ public class ServicePackageController extends BaseController {
|
||||
@Log(title = "服务包基础信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ServicePackage servicePackage) {
|
||||
List<ServicePackageVO> list = servicePackageService.selectServicePackageList(servicePackage);
|
||||
TableDataInfo tableDataInfo = servicePackageService.selectServicePackageList(servicePackage);
|
||||
ExcelUtil<ServicePackageVO> util = new ExcelUtil<ServicePackageVO>(ServicePackageVO.class);
|
||||
util.exportExcel(response, list, "服务包基础信息数据");
|
||||
List<ServicePackageVO> voList = (List<ServicePackageVO>) tableDataInfo.getRows();
|
||||
util.exportExcel(response, voList, "服务包基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -48,6 +48,7 @@ public class TextMessageController extends BaseController {
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
List<TextMessageTaskVO> list = textMessageService.selectTextMessageList(textMessageDTO);
|
||||
//处理上面查询的list集合
|
||||
int num = list.size();
|
||||
list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
@ -65,9 +66,9 @@ public class TextMessageController extends BaseController {
|
||||
@Log(title = "短信模板信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TextMessageDTO textMessageDTO) {
|
||||
List<TextMessageTaskVO> list = textMessageService.selectTextMessageList(textMessageDTO);
|
||||
List<TextMessageTaskVO> voList = textMessageService.selectTextMessageList(textMessageDTO);
|
||||
ExcelUtil<TextMessageTaskVO> util = new ExcelUtil<TextMessageTaskVO>(TextMessageTaskVO.class);
|
||||
util.exportExcel(response, list, "短信模板信息数据");
|
||||
util.exportExcel(response, voList, "短信模板信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -47,6 +47,7 @@ public class WechatTemplateController extends BaseController {
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
List<WechatTemplateTaskVO> list = wechatTemplateService.selectWechatTemplateList(wechatTemplateDto);
|
||||
//处理上面查询的list集合
|
||||
int num = list.size();
|
||||
list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
@ -64,9 +65,9 @@ public class WechatTemplateController extends BaseController {
|
||||
@Log(title = "微信模板信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WechatTemplateDTO wechatTemplateDto) {
|
||||
List<WechatTemplateTaskVO> list = wechatTemplateService.selectWechatTemplateList(wechatTemplateDto);
|
||||
List<WechatTemplateTaskVO> voList = wechatTemplateService.selectWechatTemplateList(wechatTemplateDto);
|
||||
ExcelUtil<WechatTemplateTaskVO> util = new ExcelUtil<WechatTemplateTaskVO>(WechatTemplateTaskVO.class);
|
||||
util.exportExcel(response, list, "微信模板信息数据");
|
||||
util.exportExcel(response, voList, "微信模板信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -31,7 +31,7 @@ public class TextMessageSuitTask extends BaseEntity {
|
||||
* 短信模板id
|
||||
*/
|
||||
@ApiModelProperty(value = "短信模板id")
|
||||
private Long textMessageId;
|
||||
private Long messageId;
|
||||
|
||||
/**
|
||||
* 适用任务类型字典Id
|
||||
|
||||
@ -88,14 +88,6 @@ public interface TextMessageMapper {
|
||||
*/
|
||||
int insertTextMessageSuitTasks(List<TextMessageSuitTask> tasks);
|
||||
|
||||
/**
|
||||
* 批量修改短信模板适用任务类型
|
||||
*
|
||||
* @param tasks
|
||||
* @return
|
||||
*/
|
||||
int updateTextMessageSuitTasks(List<TextMessageSuitTask> tasks);
|
||||
|
||||
/**
|
||||
* 批量删除短信模板适用任务类型
|
||||
*
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.service.servicepackage;
|
||||
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.manage.domain.servicepackage.ServicePackage;
|
||||
import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO;
|
||||
import com.xinelu.manage.vo.servicepackage.ServicePackageDetailVO;
|
||||
@ -28,7 +29,7 @@ public interface IServicePackageService {
|
||||
* @param servicePackage 服务包基础信息
|
||||
* @return 服务包基础信息集合
|
||||
*/
|
||||
public List<ServicePackageVO> selectServicePackageList(ServicePackage servicePackage);
|
||||
public TableDataInfo selectServicePackageList(ServicePackage servicePackage);
|
||||
|
||||
/**
|
||||
* 新增服务包基础信息
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xinelu.manage.service.servicepackage.impl;
|
||||
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.PageServiceUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.manage.domain.servicepackage.ServicePackage;
|
||||
@ -35,6 +37,9 @@ public class ServicePackageServiceImpl implements IServicePackageService {
|
||||
@Resource
|
||||
private ServicePackageContentMapper servicePackageContentMapper;
|
||||
|
||||
@Resource
|
||||
private PageServiceUtil pageServiceUtil;
|
||||
|
||||
/**
|
||||
* 查询服务包基础信息
|
||||
*
|
||||
@ -59,14 +64,16 @@ public class ServicePackageServiceImpl implements IServicePackageService {
|
||||
* @return 服务包基础信息
|
||||
*/
|
||||
@Override
|
||||
public List<ServicePackageVO> selectServicePackageList(ServicePackage servicePackage) {
|
||||
public TableDataInfo selectServicePackageList(ServicePackage servicePackage) {
|
||||
pageServiceUtil.startPage();
|
||||
List<ServicePackageVO> voList = servicePackageMapper.selectServicePackageLists(servicePackage);
|
||||
return voList.stream().map(vo -> {
|
||||
voList.stream().map(vo -> {
|
||||
// 拼接服务包期限+服务包单位
|
||||
String packageTermAndUnit = vo.getPackageTerm() + vo.getPackageTermUnit();
|
||||
vo.setPackageTermAndUnit(packageTermAndUnit);
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return pageServiceUtil.getDataTable(voList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.service.textmessage;
|
||||
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.manage.dto.textmessage.TextMessageDTO;
|
||||
import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO;
|
||||
import com.xinelu.manage.vo.textmessage.TextMessageTaskVO;
|
||||
|
||||
@ -3,7 +3,6 @@ package com.xinelu.manage.service.textmessage.impl;
|
||||
import com.xinelu.common.core.domain.entity.SysDictData;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.PageServiceUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.manage.domain.textmessage.TextMessage;
|
||||
@ -143,7 +142,7 @@ public class TextMessageServiceImpl implements ITextMessageService {
|
||||
private TextMessageSuitTask createTextMessageSuitTask(Long suitTaskTypeId, Long textMessageId, String createdBy, Date createdAt) {
|
||||
SysDictData sysDictData = sysDictDataMapper.selectDictDataById(suitTaskTypeId);
|
||||
TextMessageSuitTask task = new TextMessageSuitTask();
|
||||
task.setTextMessageId(textMessageId);
|
||||
task.setMessageId(textMessageId);
|
||||
task.setSuitTaskTypeId(suitTaskTypeId);
|
||||
task.setSuitTaskTypeName(sysDictData.getDictLabel());
|
||||
task.setCreateBy(createdBy);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.service.wechattemplate;
|
||||
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
|
||||
import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO;
|
||||
import com.xinelu.manage.dto.wechattemplate.WechatTemplateTaskDTO;
|
||||
|
||||
@ -38,6 +38,9 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService {
|
||||
@Resource
|
||||
private SysDictDataMapper sysDictDataMapper;
|
||||
|
||||
@Resource
|
||||
private PageServiceUtil pageServiceUtil;
|
||||
|
||||
/**
|
||||
* 查询微信模板信息
|
||||
*
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<result column="text_message_remark" property="textMessageRemark"/>
|
||||
<collection property="suitTaskList" ofType="com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask">
|
||||
<id column="taskId" property="id"/>
|
||||
<result column="text_message_id" property="textMessageId"/>
|
||||
<result column="message_id" property="messageId"/>
|
||||
<result column="suit_task_type_id" property="suitTaskTypeId"/>
|
||||
<result column="suit_task_type_name" property="suitTaskTypeName"/>
|
||||
</collection>
|
||||
@ -85,12 +85,12 @@
|
||||
tm.text_message_sort,
|
||||
tm.text_message_remark,
|
||||
tmst.id AS taskId,
|
||||
tmst.text_message_id,
|
||||
tmst.message_id,
|
||||
tmst.suit_task_type_id,
|
||||
tmst.suit_task_type_name
|
||||
from text_message tm
|
||||
left join text_message_suit_task tmst on
|
||||
tm.id = tmst.text_message_id
|
||||
tm.id = tmst.message_id
|
||||
where tm.id = #{id}
|
||||
</select>
|
||||
|
||||
@ -109,12 +109,12 @@
|
||||
tm.text_message_sort,
|
||||
tm.text_message_remark,
|
||||
tmst.id AS taskId,
|
||||
tmst.text_message_id,
|
||||
tmst.message_id,
|
||||
tmst.suit_task_type_id,
|
||||
tmst.suit_task_type_name
|
||||
from text_message tm
|
||||
left join text_message_suit_task tmst on
|
||||
tm.id = tmst.text_message_id
|
||||
tm.id = tmst.message_id
|
||||
<where>
|
||||
<if test="departmentId != null">
|
||||
AND tm.department_id =
|
||||
@ -228,10 +228,10 @@
|
||||
|
||||
<insert id="insertTextMessageSuitTasks" parameterType="java.util.List">
|
||||
INSERT INTO text_message_suit_task
|
||||
(text_message_id, suit_task_type_id, suit_task_type_name, create_by, create_time)
|
||||
(message_id, suit_task_type_id, suit_task_type_name, create_by, create_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="task" index="index" separator=",">
|
||||
(#{task.textMessageId}, #{task.suitTaskTypeId}, #{task.suitTaskTypeName}, #{task.createBy},
|
||||
(#{task.messageId}, #{task.suitTaskTypeId}, #{task.suitTaskTypeName}, #{task.createBy},
|
||||
#{task.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
@ -288,17 +288,6 @@
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateTextMessageSuitTasks"
|
||||
parameterType="java.util.List">
|
||||
<foreach collection="list" item="task" separator=";">
|
||||
UPDATE text_message_suit_task
|
||||
SET suit_task_type_name = #{task.suitTaskTypeName},
|
||||
suit_task_type_id = #{task.suitTaskTypeId},
|
||||
update_by = #{task.updateBy},
|
||||
update_time = #{task.updateTime}
|
||||
WHERE text_message_id = #{task.textMessageId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateTextMessageSuitTask">
|
||||
update text_message_suit_task
|
||||
@ -333,7 +322,7 @@
|
||||
</delete>
|
||||
<delete id="deleteTextMessageSuitTasks">
|
||||
delete from text_message_suit_task
|
||||
where text_message_id in
|
||||
where message_id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@ -341,6 +330,6 @@
|
||||
<delete id="deleteTextMessageSuitTask">
|
||||
delete
|
||||
from text_message_suit_task
|
||||
where text_message_id = #{id}
|
||||
where message_id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user