45 changed files with 1581 additions and 45 deletions
@ -0,0 +1,113 @@ |
|||
//package com.yxt.portal.apiwx;
|
|||
//
|
|||
//import com.yxt.common.base.config.component.FileUploadComponent;
|
|||
//import com.yxt.common.base.utils.StringUtils;
|
|||
//import com.yxt.common.core.result.ResultBean;
|
|||
//import com.yxt.portal.biz.banner.BannerService;
|
|||
//import com.yxt.portal.biz.banner.BannerVo;
|
|||
//import com.yxt.portal.biz.index.WxIndexService;
|
|||
//import com.yxt.portal.biz.index.WxIndexVo;
|
|||
//import com.yxt.portal.biz.index.WxSubsetVersionVo;
|
|||
//import com.yxt.portal.biz.sysnotice.NoticeAppListVo;
|
|||
//import com.yxt.portal.biz.sysnotice.SysNoticeService;
|
|||
//import com.yxt.portal.biz.sysuser.SysUserService;
|
|||
//import io.swagger.annotations.Api;
|
|||
//import io.swagger.annotations.ApiOperation;
|
|||
//import org.springframework.beans.factory.annotation.Autowired;
|
|||
//import org.springframework.web.bind.annotation.GetMapping;
|
|||
//import org.springframework.web.bind.annotation.RequestMapping;
|
|||
//import org.springframework.web.bind.annotation.ResponseBody;
|
|||
//import org.springframework.web.bind.annotation.RestController;
|
|||
//
|
|||
//import java.util.*;
|
|||
//
|
|||
///**
|
|||
// * @Description
|
|||
// * @Author liuguohui
|
|||
// * @Date 2021/9/26
|
|||
// */
|
|||
//@Api(tags = "Wx首页")
|
|||
//@RestController
|
|||
//@RequestMapping("v1/index")
|
|||
//public class WxIndexRest{
|
|||
//
|
|||
//
|
|||
// @Autowired
|
|||
// private SysUserService sysUserService;
|
|||
//
|
|||
// @Autowired
|
|||
// private FileUploadComponent fileUploadComponent;
|
|||
//
|
|||
// private String LINKSID = "147694bb-c765-4426-8f67-d19a66585f31";
|
|||
//
|
|||
// @Autowired
|
|||
// private WxIndexService wxIndexService;
|
|||
// @Autowired
|
|||
// private SysNoticeService sysNoticeService;
|
|||
// @Autowired
|
|||
// private BannerService bannerService;
|
|||
//
|
|||
//
|
|||
// @ApiOperation(value = "App首页 ")
|
|||
// @ResponseBody
|
|||
// @GetMapping("/index")
|
|||
// public ResultBean<WxIndexVo> index(String userSid) {
|
|||
// ResultBean<WxIndexVo> rb = ResultBean.fireFail();
|
|||
// WxIndexVo WxVo = new WxIndexVo();
|
|||
// Map<String, Object> map = new HashMap<String, Object>();
|
|||
// WxVo.setUserSid(userSid);
|
|||
// // 待办数量
|
|||
// WxVo.setNotWorkNum(0);
|
|||
// // 待阅数量
|
|||
// WxVo.setNotReadNum(0);
|
|||
//
|
|||
// // 通知公告列表
|
|||
// /* FormNoticeQuery formNoticeQuery = new FormNoticeQuery();
|
|||
// PagerQuery<FormNoticeQuery> formNoticeQueryPage = new PagerQuery<>();
|
|||
// formNoticeQueryPage.setParams(formNoticeQuery);
|
|||
// formNoticeQueryPage.getParams().setClosingDate(DateUtils.dateConvertStr(new Date()));
|
|||
// //取前6条
|
|||
// formNoticeQueryPage.setSize(6);
|
|||
// List<FormNoticeVo> formNoticeVoList = formNoticeService.pageList(formNoticeQueryPage).getRecords();*/
|
|||
// ResultBean<List<NoticeAppListVo>> listResultBean = sysNoticeService.getAppDetails();
|
|||
// List<NoticeAppListVo> sysNoticeListVoList = listResultBean.getData();
|
|||
// sysNoticeListVoList.removeAll(Collections.singleton(null));
|
|||
// map.put("tips", sysNoticeListVoList);
|
|||
//
|
|||
// // 子应用列表
|
|||
// String linkSid = LINKSID;
|
|||
// String path = fileUploadComponent.getUrlPrefix();
|
|||
// //查询用户的权限
|
|||
// //查询该用户是否有权限
|
|||
//// List<String> stringList = sysMobileMenuRoleService.selectWxSidList(userSid);
|
|||
// List<AppSubsetVersionVo> subsetVersionVoList = new ArrayList<>();
|
|||
// AppSubsetVersionVo vo=new WxSubsetVersionVo();
|
|||
// vo.setAppName("企业微信");
|
|||
// vo.setCornerNum("");
|
|||
// vo.setIconUrl("企业微信");
|
|||
// vo.setAppSid("");
|
|||
// subsetVersionVoList.add(vo);
|
|||
//// if (!stringList.isEmpty()) {
|
|||
//// subsetVersionVoList = WxSubsetVersionService.selectVersionListOne(linkSid, path, stringList);
|
|||
//// subsetVersionVoList.stream().forEach(item -> {
|
|||
//// item.setCornerNum("");
|
|||
//// });
|
|||
//// }
|
|||
//
|
|||
// map.put("apps", subsetVersionVoList);
|
|||
//
|
|||
// // 轮播图
|
|||
// List<BannerVo> bannerList = bannerService.selectBannerList();
|
|||
// for (BannerVo bannerVo : bannerList) {
|
|||
// String picUrl = fileUploadComponent.getUrlPrefix() + bannerVo.getPicUrl();
|
|||
// String url = fileUploadComponent.getUrlPrefix() + bannerVo.getUrl();
|
|||
// bannerVo.setPicUrl(picUrl);
|
|||
// bannerVo.setUrl(url);
|
|||
// }
|
|||
// map.put("banners", bannerList);
|
|||
//
|
|||
// WxVo.setMapExtra(map);
|
|||
// return rb.setData(WxVo).success();
|
|||
// }
|
|||
//
|
|||
//}
|
@ -0,0 +1,37 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: Banner.java <br/> |
|||
* Class: com.yxt.anrui.portal.api.banner.Banner <br/> |
|||
* Description: banner. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@ApiModel(value = "banner", description = "banner") |
|||
@TableName("banner") |
|||
@Data |
|||
public class Banner extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
@ApiModelProperty("地址") |
|||
private String url; |
|||
|
|||
@ApiModelProperty("图片") |
|||
private String picUrl; |
|||
|
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: BannerDto.java <br/> |
|||
* Class: com.yxt.anrui.portal.api.banner.BannerDto <br/> |
|||
* Description: banner 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@ApiModel(value = "banner 数据传输对象", description = "banner 数据传输对象") |
|||
@Data |
|||
public class BannerDto implements Dto { |
|||
|
|||
|
|||
@ApiModelProperty("地址") |
|||
private String url; |
|||
|
|||
@ApiModelProperty("图片") |
|||
private String picUrl; |
|||
|
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: BannerMapper.java <br/> |
|||
* Class: com.yxt.anrui.portal.biz.banner.BannerMapper <br/> |
|||
* Description: banner. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface BannerMapper extends BaseMapper<Banner> { |
|||
|
|||
public List<BannerVo> bannerVoList(); |
|||
|
|||
} |
@ -0,0 +1,10 @@ |
|||
<?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.yxt.portal.biz.banner.BannerMapper"> |
|||
|
|||
<select id="bannerVoList" resultType="com.yxt.portal.biz.banner.BannerVo"> |
|||
SELECT sid, url, picUrl |
|||
FROM banner |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,35 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: BannerQuery.java <br/> |
|||
* Class: com.yxt.anrui.portal.api.banner.BannerQuery <br/> |
|||
* Description: banner 查询条件. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@ApiModel(value = "banner 查询条件", description = "banner 查询条件") |
|||
@Data |
|||
public class BannerQuery implements Query { |
|||
|
|||
|
|||
@ApiModelProperty("地址") |
|||
private String url; |
|||
|
|||
@ApiModelProperty("图片") |
|||
private String picUrl; |
|||
|
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: BannerFeignFallback.java <br/> |
|||
* Class: com.yxt.anrui.portal.biz.banner.BannerRest <br/> |
|||
* Description: banner. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "轮播图") |
|||
@RestController |
|||
@RequestMapping("v1/banner") |
|||
public class BannerRest { |
|||
|
|||
@Autowired |
|||
private BannerService bannerService; |
|||
|
|||
|
|||
|
|||
public ResultBean<List<BannerVo>> selectBannerList() { |
|||
List<BannerVo> bannerVoList = bannerService.selectBannerList(); |
|||
return new ResultBean<List<BannerVo>>().success().setData(bannerVoList); |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: BannerService.java <br/> |
|||
* Class: com.yxt.anrui.portal.biz.banner.BannerService <br/> |
|||
* Description: banner 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class BannerService extends MybatisBaseService<BannerMapper, Banner> { |
|||
|
|||
public List<BannerVo> selectBannerList() { |
|||
return baseMapper.bannerVoList(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.yxt.portal.biz.banner; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: BannerVo.java <br/> |
|||
* Class: com.yxt.anrui.portal.api.banner.BannerVo <br/> |
|||
* Description: banner 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-26 09:50:25 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@ApiModel(value = "banner 视图数据对象", description = "banner 视图数据对象") |
|||
@Data |
|||
public class BannerVo implements Vo { |
|||
|
|||
@ApiModelProperty(value = "sid") |
|||
private String sid; |
|||
|
|||
@ApiModelProperty("地址") |
|||
private String url; |
|||
|
|||
@ApiModelProperty("图片") |
|||
private String picUrl; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/8/17 14:36 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class WxIndexAppNumVo implements Vo { |
|||
private static final long serialVersionUID = 8714208618340144189L; |
|||
|
|||
private String appSid; |
|||
|
|||
private String cornerNum; |
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/26 21:32 |
|||
* @Description |
|||
*/ |
|||
public class WxIndexEnum { |
|||
|
|||
@Getter |
|||
public static enum AppVersionSubAppSid { |
|||
/** |
|||
* 供应链 |
|||
*/ |
|||
GYL("98ff0724-5df4-4fc7-ab6d-3996e7706acd", "供应链"), |
|||
|
|||
YW("e25e13b5-f2ed-421f-bdb3-6f2eca2a3028", "业务"), |
|||
|
|||
FK("fec4e243-491a-11ec-94cd-fa163e0cb33c", "风控"); |
|||
/** |
|||
* code值 |
|||
*/ |
|||
private final String code; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private final String remarks; |
|||
|
|||
/** |
|||
* 构造器 |
|||
* |
|||
* @param code code值 |
|||
* @param remarks 备注 |
|||
*/ |
|||
private AppVersionSubAppSid(String code, String remarks) { |
|||
this.code = code; |
|||
this.remarks = remarks; |
|||
} |
|||
} |
|||
|
|||
@Getter |
|||
public static enum AppMenu { |
|||
/** |
|||
* 验车 |
|||
*/ |
|||
YC("1b993770-0f1f-475e-b153-756ac95f09cf", "验车"), |
|||
YK("25b3dfb2-d3df-47c3-b689-8c38a7785391", "移库"), |
|||
PK("608e72d3-9f34-4b44-85c4-d6be41de8f76", "盘库"), |
|||
XJ("ae160247-195e-4f2c-a167-ae50a2e50c81", "巡检"), |
|||
SC("92659535-38f6-4456-a45a-ab5e9ced3fac", "收车"), |
|||
HTSH("f4d75ebc-cbab-4c44-bf93-2d38f70c1c15", "合同审核"), |
|||
JZKHBA("6a80aa48-c988-4880-b0a0-f2a406d8cad5", "价值客户备案"), |
|||
JFKC("a204a3fa-c8ac-4795-966c-df1d0e131bcf", "家访考察"), |
|||
FKZLSC("65dc12e0-9213-4364-ae81-18afa9c7e1ee", "放款资料上传"), |
|||
DYBL("ab7df5a0-9708-48b1-b58a-60d7e024d0a2", "抵押办理"), |
|||
; |
|||
|
|||
/** |
|||
* code值 |
|||
*/ |
|||
private final String code; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private final String remarks; |
|||
|
|||
/** |
|||
* 构造器 |
|||
* |
|||
* @param code code值 |
|||
* @param remarks 备注 |
|||
*/ |
|||
private AppMenu(String code, String remarks) { |
|||
this.code = code; |
|||
this.remarks = remarks; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.cloud.openfeign.SpringQueryMap; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Api(tags = "app首页") |
|||
@FeignClient( |
|||
contextId = "anrui-portal-AppIndex", |
|||
name = "anrui-portal", |
|||
path = "v1/appIndex", |
|||
fallback = WxIndexFeignFallBack.class) |
|||
public interface WxIndexFeign { |
|||
|
|||
@ApiOperation(value = "App首页 ") |
|||
@ResponseBody |
|||
@GetMapping("/index") |
|||
public ResultBean<WxIndexVo> index(@RequestParam("userSid") String userSid); |
|||
|
|||
@ApiOperation(value = "App首页待办待阅的数量") |
|||
@ResponseBody |
|||
@GetMapping("/homeWorkBadge") |
|||
ResultBean<WxIndexWorkNumVo> selectHomeWorkNum(@RequestParam("userSid") String userSid, @RequestParam("orgPath") String orgPath); |
|||
|
|||
@ApiOperation(value = "App首页子应用的待办数量") |
|||
@ResponseBody |
|||
@GetMapping("/homeAppBadge") |
|||
ResultBean<List<WxIndexAppNumVo>> selectAppNum(@RequestParam("userSid") String userSid, @RequestParam(value = "orgPath", required = false) String orgPath); |
|||
|
|||
@ApiOperation(value = "移动端各插件的应用") |
|||
@ResponseBody |
|||
@GetMapping("/getBusinessList") |
|||
ResultBean<List<WxIndexNewVo>> getBusinessList(@RequestParam("userSid") String userSid, @RequestParam("appSid") String appSid, @RequestParam("orgPath")String orgPath); |
|||
|
|||
@ApiOperation(value = "移动端各插件的应用数量") |
|||
@ResponseBody |
|||
@GetMapping("/getBusinessNum") |
|||
ResultBean<List<WxIndexNumVo>> getBusinessNum(@SpringQueryMap WxIndexNumQuery query); |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author liuguohui |
|||
* @Date 2021/9/26 |
|||
*/ |
|||
@Component |
|||
public class WxIndexFeignFallBack implements WxIndexFeign { |
|||
|
|||
@Override |
|||
public ResultBean<WxIndexVo> index(String userSid) { |
|||
return new ResultBean<WxIndexVo>().success().setMsg("网站维护,请稍后再试"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<WxIndexWorkNumVo> selectHomeWorkNum(String userSid, String orgPath) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<WxIndexAppNumVo>> selectAppNum(String userSid, String orgPath) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<WxIndexNewVo>> getBusinessList(String userSid, String appSid, String orgPath) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<WxIndexNumVo>> getBusinessNum(WxIndexNumQuery query) { |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/26 14:38 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class WxIndexNewListVo implements Vo { |
|||
private static final long serialVersionUID = -2242568632369452117L; |
|||
@ApiModelProperty("菜单sid") |
|||
private String sid; |
|||
@ApiModelProperty("应用名称") |
|||
private String name; |
|||
@ApiModelProperty("图标") |
|||
private String icon; |
|||
@ApiModelProperty("待办数量") |
|||
private String num; |
|||
|
|||
@ApiModelProperty("跳转参数") |
|||
private String json; |
|||
@ApiModelProperty("排序") |
|||
private String sortNo; |
|||
|
|||
@ApiModelProperty("跳转路由") |
|||
private String moduleAction; |
|||
@ApiModelProperty("分类") |
|||
private String classification; |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/26 14:37 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class WxIndexNewVo implements Vo { |
|||
private static final long serialVersionUID = 3045438801481395314L; |
|||
@ApiModelProperty("应用分组") |
|||
private String title; |
|||
|
|||
private List<WxIndexNewListVo> apps; |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/26 17:48 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class WxIndexNumQuery { |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
@ApiModelProperty("组织机构sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("appSid") |
|||
private String appSid; |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/26 17:39 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class WxIndexNumVo implements Vo { |
|||
private static final long serialVersionUID = -5388012244856879195L; |
|||
@ApiModelProperty("应用sid") |
|||
private String sid; |
|||
@ApiModelProperty("数量") |
|||
private String num; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author liuguohui |
|||
* @Date 2021/9/26 |
|||
*/ |
|||
@Data |
|||
public class WxIndexQuery implements Query { |
|||
|
|||
private static final long serialVersionUID = -6256204643003327901L; |
|||
|
|||
@ApiModelProperty(value = "用户sid", required = true) |
|||
@NotBlank(message = "用户sid不能为空") |
|||
private String userSid; |
|||
|
|||
@ApiModelProperty(value = "linkSid") |
|||
private String linkSid="147694bb-c765-4426-8f67-d19a66585f31"; |
|||
} |
@ -0,0 +1,178 @@ |
|||
//package com.yxt.portal.biz.index;
|
|||
//
|
|||
//import cn.hutool.core.bean.BeanUtil;
|
|||
//import com.alibaba.fastjson.JSON;
|
|||
//import com.alibaba.fastjson.JSONObject;
|
|||
//import com.yxt.common.base.utils.StringUtils;
|
|||
//import com.yxt.common.core.result.ResultBean;
|
|||
//import com.yxt.portal.biz.sysuser.SysUserService;
|
|||
//import com.yxt.portal.biz.sysuserrole.SysUserRoleService;
|
|||
//import org.springframework.beans.factory.annotation.Autowired;
|
|||
//import org.springframework.stereotype.Service;
|
|||
//
|
|||
//import java.util.ArrayList;
|
|||
//import java.util.HashMap;
|
|||
//import java.util.List;
|
|||
//import java.util.Map;
|
|||
//import java.util.stream.Collectors;
|
|||
//
|
|||
///**
|
|||
// * @Author dimengzhe
|
|||
// * @Date 2022/10/26 14:43
|
|||
// * @Description
|
|||
// */
|
|||
//@Service
|
|||
//public class WxIndexService {
|
|||
// @Autowired
|
|||
// private SysUserRoleService sysUserRoleService;
|
|||
// @Autowired
|
|||
// private SysUserService sysUserService;
|
|||
//
|
|||
// public ResultBean<List<WxIndexNewVo>> getBusinessList(String userSid, String WxSid, String orgPath) {
|
|||
// ResultBean<List<WxIndexNewVo>> rb = ResultBean.fireFail();
|
|||
// if (StringUtils.isBlank(userSid) || StringUtils.isBlank(WxSid)) {
|
|||
// return rb.setData(new ArrayList<>());
|
|||
// }
|
|||
// //查询该用户的所有的角色
|
|||
// List<SysUserRoleVo> userRole = sysUserRoleService.selectByUserSid(userSid);
|
|||
// List<String> roleSids = userRole.stream().map(s -> s.getRoleSid()).collect(Collectors.toList());
|
|||
// //根据WxSid和角色sid查询移动端菜单
|
|||
// List<WxIndexNewVo> WxIndexNewVos = getWx(roleSids, WxSid);
|
|||
// for (WxIndexNewVo vo : WxIndexNewVos) {
|
|||
// List<WxIndexNewListVo> Wxs = vo.getWxs();
|
|||
// if(Wxs != null && Wxs.size()>0){
|
|||
// for (WxIndexNewListVo vv : Wxs) {
|
|||
// if ("移库".equals(vv.getName()) || "简易订单".equals(vv.getName()) || "销售订单".equals(vv.getName())) {
|
|||
// ResultBean resultBean = sysUserService.selectWxHaveMessage(vv.getSid(), orgPath);
|
|||
// String json = vv.getJson();
|
|||
// if (StringUtils.isNotBlank(json)) {
|
|||
// //将字符串json转为map
|
|||
// Map<String, Object> map = JSON.parseObject(json);
|
|||
// if (resultBean.getSuccess()) {
|
|||
// map.put("banCreate", false);
|
|||
// } else {
|
|||
// map.put("reason", resultBean.getMsg());
|
|||
// map.put("banCreate", true);
|
|||
// }
|
|||
// vv.setJson(JSONObject.toJSONString(map));
|
|||
// } else {
|
|||
// Map<String, Object> map = new HashMap<>();
|
|||
// if (resultBean.getSuccess()) {
|
|||
// map.put("banCreate", false);
|
|||
// } else {
|
|||
// map.put("reason", resultBean.getMsg());
|
|||
// map.put("banCreate", true);
|
|||
// }
|
|||
// vv.setJson(JSONObject.toJSONString(map));
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
//
|
|||
//
|
|||
// }
|
|||
// return rb.success().setData(WxIndexNewVos);
|
|||
// }
|
|||
//
|
|||
// private List<WxIndexNewVo> getWx(List<String> roleSids, String WxSid) {
|
|||
// return sysMobileMenuRoleService.getWx(roleSids, WxSid);
|
|||
// }
|
|||
//
|
|||
// public ResultBean<List<WxIndexNumVo>> getBusinessNum(WxIndexNumQuery query) {
|
|||
// ResultBean<List<WxIndexNumVo>> rb = ResultBean.fireFail();
|
|||
// String WxSid = query.getWxSid();
|
|||
// String userSid = query.getUserSid();
|
|||
// String orgPath = query.getOrgPath();
|
|||
// WxToDoNumQuery WxToDoNumQuery = new WxToDoNumQuery();
|
|||
// WxToDoNumQuery.setUserSid(userSid);
|
|||
// WxToDoNumQuery.setOrgPath(orgPath);
|
|||
// CommonToDoNumQuery commonToDoNumQuery = new CommonToDoNumQuery();
|
|||
// BusToDoNumQuery busToDoNumQuery = new BusToDoNumQuery();
|
|||
// RiskToDoNumQuery riskToDoNumQuery = new RiskToDoNumQuery();
|
|||
// BeanUtil.copyProperties(WxToDoNumQuery, commonToDoNumQuery);
|
|||
// BeanUtil.copyProperties(WxToDoNumQuery, busToDoNumQuery);
|
|||
// BeanUtil.copyProperties(WxToDoNumQuery, riskToDoNumQuery);
|
|||
// //根据WxSid查询菜单的信息
|
|||
// List<SysMobileMenu> sysMobileMenus = sysMobileMenuService.getMenu(WxSid);
|
|||
// List<WxIndexNumVo> list = new ArrayList<>();
|
|||
// if (WxIndexEnum.WxVersionSubWxSid.GYL.getCode().equals(WxSid)) {
|
|||
// //供应链
|
|||
// for (SysMobileMenu menu : sysMobileMenus) {
|
|||
// WxIndexNumVo WxIndexNumVo = new WxIndexNumVo();
|
|||
// WxIndexNumVo.setSid(menu.getSid());
|
|||
// //验车
|
|||
// if (WxIndexEnum.WxMenu.YC.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = scmVehicleExamineFeign.getToDoNum(WxToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //收车
|
|||
// if (WxIndexEnum.WxMenu.SC.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = scmVehicleEnterlibraryFeign.getToDoNum(WxToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //移库
|
|||
// if (WxIndexEnum.WxMenu.YK.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = scmVehicleGressionFeign.getToDoNum(WxToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //盘库
|
|||
// if (WxIndexEnum.WxMenu.PK.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = scmVehicleInventoryFeign.getToDoNum(WxToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //巡检
|
|||
// if (WxIndexEnum.WxMenu.XJ.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = scmVehiclePatrolinspectionFeign.getToDoNum(WxToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
//
|
|||
//
|
|||
// list.add(WxIndexNumVo);
|
|||
//
|
|||
//
|
|||
// }
|
|||
// } else if (WxIndexEnum.WxVersionSubWxSid.YW.getCode().equals(WxSid)) {
|
|||
// //业务
|
|||
// for (SysMobileMenu menu : sysMobileMenus) {
|
|||
// WxIndexNumVo WxIndexNumVo = new WxIndexNumVo();
|
|||
// WxIndexNumVo.setSid(menu.getSid());
|
|||
// //合同审核
|
|||
// if (WxIndexEnum.WxMenu.HTSH.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = commonContractFeign.getToDoNum(commonToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //价值客户
|
|||
// if (WxIndexEnum.WxMenu.JZKHBA.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = busValcustFilingFeign.getToDoNum(busToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// list.add(WxIndexNumVo);
|
|||
// }
|
|||
//
|
|||
// }else if (WxIndexEnum.WxVersionSubWxSid.FK.getCode().equals(WxSid)){
|
|||
// //风控
|
|||
// for (SysMobileMenu menu : sysMobileMenus) {
|
|||
// WxIndexNumVo WxIndexNumVo = new WxIndexNumVo();
|
|||
// WxIndexNumVo.setSid(menu.getSid());
|
|||
// //家访考察
|
|||
// if (WxIndexEnum.WxMenu.JFKC.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = loanHomevisitInvestigateFeign.getToDoNum(riskToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //放款资料上传
|
|||
// if (WxIndexEnum.WxMenu.FKZLSC.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = loanFileexamineFeign.getToDoNum(riskToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// //抵押办理
|
|||
// if (WxIndexEnum.WxMenu.DYBL.getRemarks().equals(menu.getTitle())) {
|
|||
// String num = loanMortgageInformationTransactFeign.getToDoNum(riskToDoNumQuery).getData();
|
|||
// WxIndexNumVo.setNum(num);
|
|||
// }
|
|||
// list.add(WxIndexNumVo);
|
|||
// }
|
|||
// }
|
|||
//
|
|||
// return rb.success().setData(list);
|
|||
// }
|
|||
//}
|
@ -0,0 +1,29 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author liuguohui |
|||
* @Date 2021/9/26 |
|||
*/ |
|||
@Data |
|||
public class WxIndexVo implements Vo { |
|||
|
|||
@ApiModelProperty(value = "用户sid") |
|||
private String userSid; |
|||
|
|||
@ApiModelProperty(value = "待阅数量") |
|||
private int notReadNum; |
|||
|
|||
@ApiModelProperty(value = "待办数量") |
|||
private int notWorkNum; |
|||
|
|||
@ApiModelProperty(value = "其他数据") |
|||
private Map<String,Object> mapExtra; |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/8/17 14:06 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class WxIndexWorkNumVo implements Vo { |
|||
private static final long serialVersionUID = 6450324108325744150L; |
|||
|
|||
@ApiModelProperty(value = "待阅数量") |
|||
private int notReadNum; |
|||
|
|||
@ApiModelProperty(value = "待办数量") |
|||
private int notWorkNum; |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.yxt.portal.biz.index; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: anrui-portal(门户建设) <br/> |
|||
* File: AppSubsetVersionVo.java <br/> |
|||
* Class: com.yxt.anrui.portal.api.appsubsetversion.AppSubsetVersionVo <br/> |
|||
* Description: 一级应用 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-09-13 14:16:33 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@ApiModel(value = "一级应用 视图数据对象", description = "一级应用 视图数据对象") |
|||
@Data |
|||
public class WxSubsetVersionVo implements Vo { |
|||
|
|||
|
|||
@ApiModelProperty("appSid") |
|||
private String appSid; |
|||
|
|||
@ApiModelProperty("应用名称") |
|||
private String appName; |
|||
|
|||
@ApiModelProperty("应用名称") |
|||
private String cornerNum; |
|||
|
|||
@ApiModelProperty("图标地址") |
|||
private String iconUrl; |
|||
|
|||
@ApiModelProperty("资源sid") |
|||
private String sourceSid; |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/2/1 |
|||
**/ |
|||
@Data |
|||
public class NoticeAppListVo { |
|||
|
|||
private PushNoticeAppVo pageInfo; |
|||
|
|||
private String title; |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty("移动端页面地址") |
|||
@JsonIgnore |
|||
private String moduleAction; |
|||
@ApiModelProperty("0.内置Activity 1.内置WebView 2.RePlugin插件") |
|||
@JsonIgnore |
|||
private String app_type; |
|||
@ApiModelProperty("参数(规则),json类型的传参(必须为 string、string)") |
|||
@JsonIgnore |
|||
private String args_json; |
|||
@ApiModelProperty("插件sid") |
|||
@JsonIgnore |
|||
private String moduleSid; |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/2/1 |
|||
**/ |
|||
@Data |
|||
public class PushNoticeAppVo { |
|||
|
|||
private String path; |
|||
|
|||
private String modulePluginName; |
|||
|
|||
private int moduleVersion; |
|||
|
|||
private String json; |
|||
|
|||
private String type; |
|||
|
|||
private String moduleAction; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/2/1 |
|||
**/ |
|||
@Data |
|||
public class PushNoticeQuery { |
|||
|
|||
@ApiModelProperty("移动端页面地址") |
|||
private String moduleAction; |
|||
@ApiModelProperty("0.内置Activity 1.内置WebView 2.RePlugin插件") |
|||
private String app_type; |
|||
@ApiModelProperty("参数(规则),json类型的传参(必须为 string、string)") |
|||
private String args_json; |
|||
@ApiModelProperty("插件sid") |
|||
private String moduleSid; |
|||
private String title; |
|||
private String sid; |
|||
private String pcUrl; |
|||
@ApiModelProperty("类别") |
|||
private String type; |
|||
@ApiModelProperty("类别key") |
|||
private String typeKey; |
|||
|
|||
private String createTime; |
|||
@ApiModelProperty("有效期至") |
|||
private String validityDate; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/30 |
|||
**/ |
|||
@Data |
|||
public class SysNotice extends BaseEntity { |
|||
|
|||
private static final long serialVersionUID = 8324297245354558865L; |
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
@ApiModelProperty("有效期至") |
|||
private String validityDate; |
|||
@ApiModelProperty("类别") |
|||
private String type; |
|||
@ApiModelProperty("类别key") |
|||
private String typeKey; |
|||
@ApiModelProperty("是否置顶") |
|||
private String topping; |
|||
@ApiModelProperty("内容") |
|||
private String content; |
|||
@ApiModelProperty("附件") |
|||
private String files; |
|||
@ApiModelProperty("生成类型0添加1自动") |
|||
private String createType; |
|||
|
|||
private String pcUrl; |
|||
@ApiModelProperty("移动端页面地址") |
|||
private String moduleAction; |
|||
@ApiModelProperty("0.内置Activity 1.内置WebView 2.RePlugin插件") |
|||
private String app_type; |
|||
@ApiModelProperty("参数(规则),json类型的传参(必须为 string、string)") |
|||
private String args_json; |
|||
@ApiModelProperty("插件sid") |
|||
private String moduleSid; |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/31 |
|||
**/ |
|||
@Data |
|||
public class SysNoticeDetailsVo { |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
@ApiModelProperty("有效期至") |
|||
private String validityDate; |
|||
@ApiModelProperty("类别") |
|||
private String type; |
|||
@ApiModelProperty("类别key") |
|||
private String typeKey; |
|||
@ApiModelProperty("是否置顶") |
|||
private String topping; |
|||
@ApiModelProperty("内容") |
|||
private String content; |
|||
@ApiModelProperty("附件") |
|||
private List<UrlQuery> filesList = new ArrayList<>(); |
|||
|
|||
private String createTime; |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/31 |
|||
**/ |
|||
@Data |
|||
public class SysNoticeDto implements Dto { |
|||
private static final long serialVersionUID = 8074080443156103663L; |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
@ApiModelProperty("有效期至") |
|||
private String validityDate; |
|||
@ApiModelProperty("类别") |
|||
private String type; |
|||
@ApiModelProperty("类别key") |
|||
private String typeKey; |
|||
@ApiModelProperty("是否置顶") |
|||
private String topping; |
|||
@ApiModelProperty("内容") |
|||
private String content; |
|||
@ApiModelProperty("附件") |
|||
private List<UrlQuery> filesList = new ArrayList<>(); |
|||
|
|||
private String createTime; |
|||
|
|||
private String userSid; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/30 |
|||
**/ |
|||
@Component |
|||
public class SysNoticeFeignFallback { |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/30 |
|||
**/ |
|||
@Mapper |
|||
public interface SysNoticeMapper extends BaseMapper<SysNotice> { |
|||
IPage<SysNoticeVo> selectPageVo(IPage<SysNotice> page, @Param(Constants.WRAPPER) QueryWrapper<SysNotice> qw); |
|||
|
|||
List<SysNoticeListVo> getLists(); |
|||
|
|||
List<NoticeAppListVo> getAppDetails(); |
|||
} |
@ -0,0 +1,37 @@ |
|||
<?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.yxt.portal.biz.sysnotice.SysNoticeMapper"> |
|||
<select id="selectPageVo" resultType="com.yxt.portal.biz.sysnotice.SysNoticeVo"> |
|||
select sn.sid, |
|||
sn.title, |
|||
DATE_FORMAT(sn.createTime, '%Y-%m-%d') as createDate, |
|||
sn.validityDate, |
|||
case state |
|||
when 1 |
|||
then '开启' |
|||
when 2 then '关闭' end as stateValue, |
|||
sn.topping |
|||
from sys_notice sn |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="getLists" resultType="com.yxt.portal.biz.sysnotice.SysNoticeListVo"> |
|||
select sid, title, DATE_FORMAT(createTime, '%Y-%m-%d') as createTime, pcUrl |
|||
from sys_notice |
|||
where state = 1 |
|||
and (validityDate is null or validityDate = '' or validityDate > NOW()) |
|||
order by topping desc, createTime desc |
|||
limit 4 |
|||
</select> |
|||
|
|||
<select id="getAppDetails" resultType="com.yxt.portal.biz.sysnotice.NoticeAppListVo"> |
|||
select sid, title, moduleAction, app_type, args_json, moduleSid |
|||
from sys_notice |
|||
where state = 1 |
|||
and (validityDate is null or validityDate = '' or validityDate > NOW()) |
|||
order by topping desc, createTime desc |
|||
limit 6 |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,237 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.date.DateUtil; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.config.component.FileUploadComponent; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/30 |
|||
**/ |
|||
@Service |
|||
public class SysNoticeService extends MybatisBaseService<SysNoticeMapper, SysNotice> { |
|||
|
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
|
|||
public PagerVo<SysNoticeVo> listPageVo(PagerQuery<SysNoticeQuery> pagerQuery) { |
|||
SysNoticeQuery query = pagerQuery.getParams(); |
|||
QueryWrapper<SysNotice> qw = new QueryWrapper<>(); |
|||
if (query != null) { |
|||
qw.eq("1", 1); |
|||
//标题
|
|||
if (StringUtils.isNotBlank(query.getTitle())) { |
|||
qw.like("sn.title", query.getTitle()); |
|||
} |
|||
qw.apply(StringUtils.isNotBlank(query.getCreateDateStart()), "date_format (sn.createTime,'%Y-%m-%d') >= date_format('" + query.getCreateDateStart() + "','%Y-%m-%d')"). |
|||
apply(StringUtils.isNotBlank(query.getCreateDateEnd()), "date_format (sn.createTime,'%Y-%m-%d') <= date_format('" + query.getCreateDateEnd() + "','%Y-%m-%d')" |
|||
); |
|||
if (StringUtils.isNotBlank(query.getTopping())) { |
|||
qw.like("sn.topping", query.getTopping()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getState())) { |
|||
qw.eq("sn.state", query.getState()); |
|||
} |
|||
qw.orderByDesc("sn.createTime"); |
|||
} |
|||
IPage<SysNotice> page = PagerUtil.queryToPage(pagerQuery); |
|||
IPage<SysNoticeVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<SysNoticeVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public ResultBean saveOrUpdateNotice(SysNoticeDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String sid = dto.getSid(); |
|||
if (StringUtils.isBlank(sid)) { |
|||
SysNotice sysNotice = new SysNotice(); |
|||
BeanUtil.copyProperties(dto, sysNotice, "sid"); |
|||
List<UrlQuery> filss = dto.getFilesList(); |
|||
filss.removeAll(Collections.singleton(null)); |
|||
if (!filss.isEmpty()) { |
|||
List<String> filesList = filss.stream().map(v -> v.getUrl()).collect(Collectors.toList()); |
|||
filesList.removeAll(Collections.singleton(null)); |
|||
} |
|||
sysNotice.setCreateBySid(dto.getUserSid()); |
|||
sysNotice.setApp_type("0"); |
|||
sysNotice.setModuleAction("com.anrui.android.activity.NoticeActivity"); |
|||
sysNotice.setModuleSid("fec4e243-491a-11ec-94cd-fa163e0cb33c"); |
|||
Map<String, Object> maps = new HashMap<>(); |
|||
maps.put("sid", sysNotice.getSid()); |
|||
sysNotice.setArgs_json(JSONObject.toJSONString(maps)); |
|||
sysNotice.setCreateType("0"); |
|||
baseMapper.insert(sysNotice); |
|||
} else { |
|||
SysNotice sysNotice = fetchBySid(sid); |
|||
if (sysNotice == null) { |
|||
return rb.setMsg("该通知公告不存在"); |
|||
} |
|||
BeanUtil.copyProperties(dto, sysNotice, "sid"); |
|||
sysNotice.setApp_type("0"); |
|||
sysNotice.setModuleAction("com.anrui.android.activity.NoticeActivity"); |
|||
sysNotice.setModuleSid("fec4e243-491a-11ec-94cd-fa163e0cb33c"); |
|||
Map<String, Object> maps = new HashMap<>(); |
|||
maps.put("sid", sysNotice.getSid()); |
|||
sysNotice.setArgs_json(JSONObject.toJSONString(maps)); |
|||
sysNotice.setCreateType("0"); |
|||
List<UrlQuery> filss = dto.getFilesList(); |
|||
filss.removeAll(Collections.singleton(null)); |
|||
baseMapper.updateById(sysNotice); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean<SysNoticeDetailsVo> getDetails(String sid) { |
|||
ResultBean<SysNoticeDetailsVo> rb = ResultBean.fireFail(); |
|||
SysNoticeDetailsVo sysNoticeDetailsVo = new SysNoticeDetailsVo(); |
|||
SysNotice sysNotice = fetchBySid(sid); |
|||
if (sysNotice == null) { |
|||
return rb.setMsg("该通知公告不存在"); |
|||
} |
|||
BeanUtil.copyProperties(sysNotice, sysNoticeDetailsVo); |
|||
sysNoticeDetailsVo.setCreateTime(DateUtil.format(sysNotice.getCreateTime(), "yyyy-MM-dd")); |
|||
String filesss = sysNotice.getFiles(); |
|||
List<UrlQuery> lists = new ArrayList<>(); |
|||
|
|||
return rb.success().setData(sysNoticeDetailsVo); |
|||
} |
|||
|
|||
public ResultBean setState(SysNoticesQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<String> sidsList = query.getSidsList(); |
|||
sidsList.removeAll(Collections.singleton(null)); |
|||
if (sidsList.isEmpty()) { |
|||
return rb.setMsg("请选择数据"); |
|||
} |
|||
String state = query.getState(); |
|||
for (String sid : sidsList) { |
|||
SysNotice sysNotice = fetchBySid(sid); |
|||
if (sysNotice == null) { |
|||
return rb.setMsg("操作的数据中包含不存在的数据,请刷新后操作"); |
|||
} |
|||
sysNotice.setState(Integer.valueOf(state).intValue()); |
|||
baseMapper.updateById(sysNotice); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean<List<SysNoticeListVo>> getLists() { |
|||
ResultBean<List<SysNoticeListVo>> rb = ResultBean.fireFail(); |
|||
List<SysNoticeListVo> list = baseMapper.getLists(); |
|||
list.removeAll(Collections.singleton(null)); |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
public ResultBean delAllBySids(String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
delBySids(sids); |
|||
return rb.success().setMsg("删除成功"); |
|||
} |
|||
|
|||
public ResultBean setTopping(SysNoticessQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<String> sidsList = query.getSidsList(); |
|||
sidsList.removeAll(Collections.singleton(null)); |
|||
if (sidsList.isEmpty()) { |
|||
return rb.setMsg("请选择数据"); |
|||
} |
|||
String topping = query.getTopping(); |
|||
for (String sid : sidsList) { |
|||
SysNotice sysNotice = fetchBySid(sid); |
|||
if (sysNotice == null) { |
|||
return rb.setMsg("操作的数据中包含不存在的数据,请刷新后操作"); |
|||
} |
|||
sysNotice.setTopping(topping); |
|||
baseMapper.updateById(sysNotice); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean savePushNotice(PushNoticeQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
SysNotice sysNotice = new SysNotice(); |
|||
BeanUtil.copyProperties(query, sysNotice); |
|||
sysNotice.setCreateBySid(query.getUserSid()); |
|||
sysNotice.setCreateType("1"); |
|||
sysNotice.setTopping("是"); |
|||
sysNotice.setType("公告"); |
|||
sysNotice.setTypeKey("02"); |
|||
baseMapper.insert(sysNotice); |
|||
return rb.success().setData(sysNotice); |
|||
} |
|||
|
|||
public ResultBean<List<NoticeAppListVo>> getAppDetails() { |
|||
ResultBean<List<NoticeAppListVo>> rb = ResultBean.fireFail(); |
|||
List<NoticeAppListVo> list = baseMapper.getAppDetails(); |
|||
list.removeAll(Collections.singleton(null)); |
|||
//定义的app的sid的index集合
|
|||
Map<String, List<Integer>> appVer = new HashMap<>(); |
|||
if (!list.isEmpty()) { |
|||
for (int i = 0; i < list.size(); i++) { |
|||
NoticeAppListVo noticeAppListVo = list.get(i); |
|||
PushNoticeAppVo pageInfo = new PushNoticeAppVo(); |
|||
pageInfo.setModuleAction(noticeAppListVo.getModuleAction()); |
|||
pageInfo.setType(noticeAppListVo.getApp_type()); |
|||
pageInfo.setJson(noticeAppListVo.getArgs_json()); |
|||
String moduleSid = noticeAppListVo.getModuleSid(); |
|||
List<Integer> integers = appVer.get(moduleSid); |
|||
if (integers == null) { |
|||
integers = new ArrayList<>(); |
|||
} |
|||
integers.add(i); |
|||
appVer.put(moduleSid, integers); |
|||
noticeAppListVo.setPageInfo(pageInfo); |
|||
} |
|||
// 循环取map:若为同一个app版本,则只查询一次
|
|||
// for (String key : appVer.keySet()) {
|
|||
// AppSubsetVersionVo appSubsetVersions = appSubsetVersionService.selectByAppSidOne(key);
|
|||
// if (appSubsetVersions != null) {
|
|||
// List<Integer> integers = appVer.get(key);
|
|||
// for (int i = 0; i < integers.size(); i++) {
|
|||
// Integer integer = integers.get(i);
|
|||
// String path = fileUploadComponent.getUrlPrefix();
|
|||
// list.get(integer).getPageInfo().setPath(path + appSubsetVersions.getUpdateUrl());
|
|||
// list.get(integer).getPageInfo().setModuleVersion(appSubsetVersions.getVersionCode());
|
|||
// list.get(integer).getPageInfo().setModulePluginName(appSubsetVersions.getModulePluginName());
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
} |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
public ResultBean<SysNoticeAppDetails> getDetailsApp(String sid) { |
|||
ResultBean<SysNoticeAppDetails> rb = ResultBean.fireFail(); |
|||
SysNoticeAppDetails sysNoticeAppDetails = new SysNoticeAppDetails(); |
|||
SysNotice sysNotice = fetchBySid(sid); |
|||
if (sysNotice == null) { |
|||
return rb.setMsg("该通知公告不存在"); |
|||
} |
|||
BeanUtil.copyProperties(sysNotice, sysNoticeAppDetails); |
|||
sysNoticeAppDetails.setCreateTime(DateUtil.format(sysNotice.getCreateTime(), "yyyy-MM-dd")); |
|||
String filesss = sysNotice.getFiles(); |
|||
if (StringUtils.isNotBlank(filesss)) { |
|||
List<String> fileList = Arrays.asList(filesss.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|||
fileList.removeAll(Collections.singleton(null)); |
|||
if (!fileList.isEmpty()) { |
|||
sysNoticeAppDetails.setFilesList(fileList); |
|||
} |
|||
} |
|||
return rb.success().setData(sysNoticeAppDetails); |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/30 |
|||
**/ |
|||
@Data |
|||
public class SysNoticeVo { |
|||
private String sid; |
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
@ApiModelProperty("发布时间") |
|||
private String createDate; |
|||
@ApiModelProperty("有效期至") |
|||
private String validityDate; |
|||
@ApiModelProperty("状态") |
|||
private String stateValue; |
|||
@ApiModelProperty("是否置顶") |
|||
private String topping; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/31 |
|||
**/ |
|||
@Data |
|||
public class SysNoticesQuery { |
|||
|
|||
@ApiModelProperty("sids") |
|||
private List<String> sidsList = new ArrayList<>(); |
|||
@ApiModelProperty("1开启、2关闭") |
|||
private String state; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.yxt.portal.biz.sysnotice; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/1/31 |
|||
**/ |
|||
@Data |
|||
public class UrlQuery { |
|||
|
|||
private String url; |
|||
|
|||
private String name; |
|||
|
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.portal.utils; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/5/17 14:15 |
|||
*/ |
|||
@Data |
|||
public class OrgPathQuery { |
|||
private String orgPath; |
|||
private String userOrgSid; |
|||
} |
Loading…
Reference in new issue