feat: 首页复制
							parent
							
								
									c268e0d067
								
							
						
					
					
						commit
						4cfe42b996
					
				| @ -0,0 +1,20 @@ | ||||
| package com.glxp.api.dao.system; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.glxp.api.entity.system.SysMsgTodoEntity; | ||||
| import com.glxp.api.req.system.SysMsgTodoQuery; | ||||
| import com.glxp.api.vo.system.SysMsgTodoVo; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 针对表【sys_msg_todo】的数据库操作Mapper | ||||
|  */ | ||||
| public interface SysMsgTodoMapper extends BaseMapper<SysMsgTodoEntity> { | ||||
| 
 | ||||
|     List<SysMsgTodoVo> pageOfVo(SysMsgTodoQuery query); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| @ -0,0 +1,34 @@ | ||||
| package com.glxp.api.entity.system; | ||||
| 
 | ||||
| import cn.hutool.core.bean.BeanUtil; | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import com.glxp.api.req.system.SysMsgTodoQuery; | ||||
| import com.glxp.api.res.PageSimpleResponse; | ||||
| import com.glxp.api.service.system.SysMsgTodoService; | ||||
| import com.glxp.api.vo.system.SysMsgTodoVo; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @RestController | ||||
| @RequiredArgsConstructor | ||||
| public class SysMsgTodoController { | ||||
| 
 | ||||
|     private final SysMsgTodoService sysMsgTodoService; | ||||
| 
 | ||||
|     @PostMapping("/spms/sysMsgTodo/page") | ||||
|     public BaseResponse page(@RequestBody SysMsgTodoQuery query) { | ||||
|         List<SysMsgTodoVo> msgTodoVos = sysMsgTodoService.pageOfVo(query); | ||||
|         PageInfo<SysMsgTodoVo> page = new PageInfo<>(msgTodoVos); | ||||
|         PageSimpleResponse<SysMsgTodoVo> simpleResponse = new PageSimpleResponse<>(); | ||||
|         simpleResponse.setTotal(page.getTotal()); | ||||
|         simpleResponse.setList(BeanUtil.copyToList(msgTodoVos, SysMsgTodoVo.class)); | ||||
|         return ResultVOUtils.success(simpleResponse); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,20 @@ | ||||
| package com.glxp.api.enums; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.EnumValue; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
| 
 | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum DealStatusEnum { | ||||
| 
 | ||||
|     NOT_CONFIRMED("not_confirmed", 1, "未处理"), | ||||
| 
 | ||||
|     CONFIRMED("confirmed", 2, "已处理"), | ||||
|     ; | ||||
| 
 | ||||
|     final String key; | ||||
|     @EnumValue | ||||
|     final Integer value; | ||||
|     final String desc; | ||||
| } | ||||
| @ -0,0 +1,23 @@ | ||||
| package com.glxp.api.enums; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.EnumValue; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
| 
 | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum PushStatusEnum { | ||||
| 
 | ||||
|     NOT_PUSHED("not_pushed", 1, "未推送"), | ||||
| 
 | ||||
|     PUSH_SUCCESS("push_success", 2, "推送成功"), | ||||
|     PUSH_FAIL("push_fail", 3, "推送失败"), | ||||
|     ; | ||||
| 
 | ||||
|     final String key; | ||||
|     @EnumValue | ||||
|     final Integer value; | ||||
|     final String desc; | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,27 @@ | ||||
| package com.glxp.api.enums; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.EnumValue; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
| 
 | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum TodoMsgTypeEnum { | ||||
| 
 | ||||
|     PUT_IN_APPLY("put_in_apply", 1, "入院物资申请"), | ||||
| 
 | ||||
|     ORDER_AUDIT("order_audit", 2, "单据审核"), | ||||
|     INVOICE_CONFIRM("invoice_confirm", 3, "单据发票确认"), | ||||
|     CERT_AUDIT("cert_audit", 5, "资质审核"), | ||||
|     USE_AUDIT("use_audit", 6, "领用单审核"), | ||||
|     BUY_APPLY_AUDIT("buy_audit", 7, "申购单审核"), | ||||
|     PROCUREMENT_AUDIT("procurement_audit", 8, "采购单审核"), | ||||
|     ; | ||||
| 
 | ||||
|     final String key; | ||||
|     @EnumValue | ||||
|     final Integer value; | ||||
|     final String desc; | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| package com.glxp.api.req.system; | ||||
| 
 | ||||
| import com.glxp.api.enums.DealStatusEnum; | ||||
| import com.glxp.api.enums.PushStatusEnum; | ||||
| import com.glxp.api.enums.TodoMsgTypeEnum; | ||||
| import com.glxp.api.util.page.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Data | ||||
| public class SysMsgTodoQuery extends ListPageRequest { | ||||
| 
 | ||||
|     TodoMsgTypeEnum msgType; | ||||
|     PushStatusEnum pushStatus; | ||||
|     DealStatusEnum dealStatus; | ||||
| 
 | ||||
|     String invCode; | ||||
| 
 | ||||
|     String deptCode; | ||||
| } | ||||
| @ -0,0 +1,16 @@ | ||||
| package com.glxp.api.service.system; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.glxp.api.entity.system.SysMsgTodoEntity; | ||||
| import com.glxp.api.req.system.SysMsgTodoQuery; | ||||
| import com.glxp.api.vo.system.SysMsgTodoVo; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 针对表【sys_msg_todo】的数据库操作Service | ||||
|  */ | ||||
| public interface SysMsgTodoService extends IService<SysMsgTodoEntity> { | ||||
| 
 | ||||
|     List<SysMsgTodoVo> pageOfVo(SysMsgTodoQuery query); | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package com.glxp.api.service.system.impl; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.dao.system.SysMsgTodoMapper; | ||||
| import com.glxp.api.entity.system.SysMsgTodoEntity; | ||||
| import com.glxp.api.req.system.SysMsgTodoQuery; | ||||
| import com.glxp.api.service.system.SysMsgTodoService; | ||||
| import com.glxp.api.vo.system.SysMsgTodoVo; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 针对表【sys_msg_todo】的数据库操作Service实现 | ||||
|  */ | ||||
| @Service | ||||
| public class SysMsgTodoServiceImpl extends ServiceImpl<SysMsgTodoMapper, SysMsgTodoEntity> | ||||
|         implements SysMsgTodoService { | ||||
| 
 | ||||
|     @Override | ||||
|     public List<SysMsgTodoVo> pageOfVo(SysMsgTodoQuery query) { | ||||
| 
 | ||||
|         PageHelper.startPage(query.getPage(), query.getLimit(), true); | ||||
|         return super.baseMapper.pageOfVo(query); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| @ -0,0 +1,37 @@ | ||||
| package com.glxp.api.vo.system; | ||||
| 
 | ||||
| import com.glxp.api.entity.system.SysMsgTodoEntity; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Data | ||||
| public class SysMsgTodoVo extends SysMsgTodoEntity { | ||||
| 
 | ||||
|     String msgTypeName; | ||||
|     String pushStatusName; | ||||
|     String dealStatusName; | ||||
| 
 | ||||
|     String invName; | ||||
| 
 | ||||
|     String deptName; | ||||
| 
 | ||||
|     public String getMsgTypeName() { | ||||
|         if (super.getMsgType() != null) { | ||||
|             return super.getMsgType().getDesc(); | ||||
|         } | ||||
|         return msgTypeName; | ||||
|     } | ||||
| 
 | ||||
|     public String getPushStatusName() { | ||||
|         if (super.getPushStatus() != null) { | ||||
|             return super.getPushStatus().getDesc(); | ||||
|         } | ||||
|         return pushStatusName; | ||||
|     } | ||||
| 
 | ||||
|     public String getDealStatusName() { | ||||
|         if (super.getDealStatus() != null) { | ||||
|             return super.getDealStatus().getDesc(); | ||||
|         } | ||||
|         return dealStatusName; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,30 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper | ||||
|         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.glxp.api.dao.system.SysMsgTodoMapper"> | ||||
|     <select id="pageOfVo" resultType="com.glxp.api.vo.system.SysMsgTodoVo"> | ||||
|         select *,aw.name invName,ad.name deptName | ||||
|         from sys_msg_todo smt | ||||
|         left join auth_warehouse aw on aw.code = smt.invCode | ||||
|         left join auth_dept ad on ad.code = smt.deptCode | ||||
|         <where> | ||||
|             <if test="msgType!=null"> | ||||
|                 and smt.msgType = #{msgType} | ||||
|             </if> | ||||
|             <if test="pushStatus!=null"> | ||||
|                 and smt.pushStatus = #{pushStatus} | ||||
|             </if> | ||||
|             <if test="dealStatus!=null"> | ||||
|                 and smt.dealStatus = #{dealStatus} | ||||
|             </if> | ||||
|             <if test="invCode!=null and invCode!=''"> | ||||
|                 and smt.invCode = #{invCode} | ||||
|             </if> | ||||
|             <if test="deptCode!=null and deptCode!=''"> | ||||
|                 and smt.deptCode = #{deptCode} | ||||
|             </if> | ||||
|         </where> | ||||
|         order by smt.createTime desc | ||||
|     </select> | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue