62 files added
11 files modified
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取时间Id,后四位常量 |
| | | * @return String |
| | | */ |
| | | public synchronized static String getNewTimeId(){ |
| | | String timeId = getNowTime() + (COUNT_NUM++); |
| | | if(COUNT_NUM > 99999){ |
| | | COUNT_NUM = 10000; |
| | | } |
| | | timeId=timeId.substring(2, timeId.length()); |
| | | return timeId; |
| | | } |
| | | |
| | | /** |
| | | * 获取时间Id,后四位常量 |
| | | * @return String |
| | | */ |
| | | public synchronized static String getNowTime(){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String nowTime = sdf.format(new Date()); |
| | | return nowTime; |
| | | } |
| | | } |
| | | /** |
| | | * -------------------_ooOoo_------------------- |
New file |
| | |
| | | package cn.huge.module.mediate.constant; |
| | | |
| | | /** |
| | | * @title: 消息通知相关常量类 |
| | | * @description: 消息通知相关常量类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2021-11-05 16:51:48 |
| | | * @version: 1.0.0 |
| | | */ |
| | | public class NoticeBaseConsts { |
| | | |
| | | /** |
| | | * 消息类型,1:系统通知,2:平台公告 |
| | | */ |
| | | public static final String NOTICE_TYPE_1 = "1"; |
| | | public static final String NOTICE_TYPE_2 = "2"; |
| | | |
| | | /** |
| | | * 已读状态,1:未读(默认值),2:已读 |
| | | */ |
| | | public static final String READ_STATUS_1 = "1"; |
| | | public static final String READ_STATUS_2 = "2"; |
| | | |
| | | /** |
| | | * 模板类型,1:调解预约模板 |
| | | */ |
| | | public static final String MODE_TYPE_1 = "1"; |
| | | } |
| | | /** |
| | | * -------------------_ooOoo_------------------- |
| | | * ------------------o8888888o------------------ |
| | | * ------------------88" . "88------------------ |
| | | * ------------------(| -_- |)------------------ |
| | | * ------------------O\ = /O------------------ |
| | | * ---------------____/`---'\____--------------- |
| | | * -------------.' \\| |// `.------------- |
| | | * ------------/ \\||| : |||// \------------ |
| | | * -----------/ _||||| -:- |||||- \----------- |
| | | * -----------| | \\\ - /// | |----------- |
| | | * -----------| \_| ''\---/'' | |----------- |
| | | * -----------\ .-\__ `-` ___/-. /----------- |
| | | * ---------___`. .' /--.--\ `. . __---------- |
| | | * ------."" '< `.___\_<|>_/___.' >'"".------- |
| | | * -----| | : `- \`.;`\ _ /`;.`/ - ` : | |----- |
| | | * -----\ \ `-. \_ __\ /__ _/ .-` / /----- |
| | | * ======`-.____`-.___\_____/___.-`____.-'====== |
| | | * -------------------`=---=' |
| | | * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| | | * ---------佛祖保佑---hugeinfo---永无BUG---------- |
| | | */ |
New file |
| | |
| | | package cn.huge.module.mediate.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: 当事人小程序-注册绑定已有案件数据传输对象 |
| | | * @description: 当事人小程序-注册绑定已有案件数据传输对象 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-03-11 11:43:25 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Data |
| | | public class WechatBindCaseDTO { |
| | | |
| | | /** |
| | | * 用户编号 |
| | | */ |
| | | private String userId; |
| | | |
| | | /** |
| | | * 用户姓名 |
| | | */ |
| | | private String trueName; |
| | | |
| | | /** |
| | | * 用户手机号码 |
| | | */ |
| | | private String mobile; |
| | | |
| | | /** |
| | | * 用户身份证号码 |
| | | */ |
| | | private String idcard; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | private String custId; |
| | | } |
New file |
| | |
| | | package cn.huge.module.oper.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 客户微信小程序配置数据传输对象 |
| | | * @description: 客户微信小程序配置数据传输对象 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-12 15:28:22 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Data |
| | | public class SeCustWechatDTO { |
| | | |
| | | /** |
| | | * 客户微信小程序信息编号 |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | private String custId; |
| | | |
| | | /** |
| | | * 小程序主体id |
| | | */ |
| | | private String mainId; |
| | | |
| | | /** |
| | | * 小程序主体名称 |
| | | */ |
| | | private String mainName; |
| | | |
| | | /** |
| | | * 小程序主体登录账号 |
| | | */ |
| | | private String mainAcc; |
| | | |
| | | /** |
| | | * 小程序主体登录密码 |
| | | */ |
| | | private String mainPower; |
| | | |
| | | /** |
| | | * 小程序appid |
| | | */ |
| | | private String appid; |
| | | |
| | | /** |
| | | * 小程序secret |
| | | */ |
| | | private String secret; |
| | | |
| | | /** |
| | | * 小程序token |
| | | */ |
| | | private String token; |
| | | |
| | | /** |
| | | * 小程序aeskey |
| | | */ |
| | | private String aeskey; |
| | | |
| | | /** |
| | | * 小程序msgDataFormat |
| | | */ |
| | | private String msgDataFormat; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 状态时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.aop; |
| | | |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import com.alibaba.fastjson.JSON; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author zhouxiantao |
| | | * @create 2024-08-30 11:46 |
| | | */ |
| | | @Component |
| | | @Aspect |
| | | @Slf4j |
| | | public class LogAop { |
| | | @Around("execution(* cn.huge.module.*.controller.*.*.*(..))") |
| | | public Object aroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | long starttime = System.currentTimeMillis(); |
| | | Object[] objs = joinPoint.getArgs(); |
| | | try{ |
| | | log.info("start to {} {}", joinPoint.getSignature().getName(), JSON.toJSONString(objs)); |
| | | }catch (Exception e){ |
| | | log.info("start to {} 参数不能转成字符串,忽略不处理", joinPoint.getSignature().getName()); |
| | | } |
| | | Object result = joinPoint.proceed(objs); |
| | | long endtime = System.currentTimeMillis(); |
| | | try { |
| | | String resultJson = JSON.toJSONString(result); |
| | | if(ObjectUtils.isNotEmpty(result) && resultJson.length() > 1000) { |
| | | log.info("finish to {} 日志过长不打印 {}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | }else { |
| | | log.info("finish to {} {} {}ms", joinPoint.getSignature().getName(), resultJson,endtime-starttime); |
| | | } |
| | | }catch (Exception e){ |
| | | log.info("finish to {} 不能转成字符串,忽略不处理 {}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Around("execution(* cn.huge.module.*.dao.mapper.*.*(..))") |
| | | public Object aroundAdviceDao(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | long starttime = System.currentTimeMillis(); |
| | | Object[] objs = joinPoint.getArgs(); |
| | | Object result = joinPoint.proceed(objs); |
| | | long endtime = System.currentTimeMillis(); |
| | | Long times = endtime-starttime; |
| | | if(times > 2000){ |
| | | log.info("Executing sql consumes time more than 1s {} ,{}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | }else{ |
| | | log.info("Executing sql consumes time {} ,{}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
New file |
| | |
| | | package cn.huge.module.ctuser.controller.wechat; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.ctuser.domain.po.CtUnit; |
| | | import cn.huge.module.ctuser.service.CtUnitService; |
| | | import cn.huge.module.ctuser.service.CtUserService; |
| | | import com.google.common.collect.Lists; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 客户组织信息表接口api-微服务调用 |
| | | * @description: 客户组织信息表接口api-微服务调用 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/wechat/ctUnit") |
| | | public class CtUnitWechatController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private CtUnitService service; |
| | | |
| | | /** |
| | | * 获取请求URL参数 |
| | | * @return Map<String, Object> |
| | | */ |
| | | private Map<String, Object> getParameter() { |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | String keyword = request.getParameter("keyword"); |
| | | if (StringUtils.isNotBlank(keyword)){ |
| | | terms.put("keyword", keyword); |
| | | } |
| | | // 组织地址省 |
| | | String prov = request.getParameter("prov"); |
| | | if (StringUtils.isNotBlank(prov)){ |
| | | terms.put("prov", prov); |
| | | } |
| | | // 组织地址省名称 |
| | | String provName = request.getParameter("provName"); |
| | | if (StringUtils.isNotBlank(provName)){ |
| | | terms.put("provName", provName); |
| | | } |
| | | // 组织地址市 |
| | | String city = request.getParameter("city"); |
| | | if (StringUtils.isNotBlank(city)){ |
| | | terms.put("city", city); |
| | | } |
| | | // 组织地址市名称 |
| | | String cityName = request.getParameter("cityName"); |
| | | if (StringUtils.isNotBlank(cityName)){ |
| | | terms.put("cityName", cityName); |
| | | } |
| | | // 组织地址区 |
| | | String area = request.getParameter("area"); |
| | | if (StringUtils.isNotBlank(area)){ |
| | | terms.put("area", area); |
| | | } |
| | | // 组织地址区名称 |
| | | String areaName = request.getParameter("areaName"); |
| | | if (StringUtils.isNotBlank(areaName)){ |
| | | terms.put("areaName", areaName); |
| | | } |
| | | // 组织地址街道 |
| | | String road = request.getParameter("road"); |
| | | if (StringUtils.isNotBlank(road)){ |
| | | terms.put("road", road); |
| | | } |
| | | // 组织地址街道名称 |
| | | String roadName = request.getParameter("roadName"); |
| | | if (StringUtils.isNotBlank(roadName)){ |
| | | terms.put("roadName", roadName); |
| | | } |
| | | // 组织地址社区 |
| | | String village = request.getParameter("village"); |
| | | if (StringUtils.isNotBlank(village)){ |
| | | terms.put("village", village); |
| | | } |
| | | // 组织地址社区名称 |
| | | String villageName = request.getParameter("villageName"); |
| | | if (StringUtils.isNotBlank(villageName)){ |
| | | terms.put("villageName", villageName); |
| | | } |
| | | return terms; |
| | | } |
| | | |
| | | /** |
| | | * 统计机构数量 |
| | | * @url {ctx}/api/wechat/ctUnit/countUnit |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/countUnit") |
| | | public Object countUnit() { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(service.wechatCountUnit()); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[CtUnitWechatController.countUnit]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 综治中心查询 |
| | | * @url {ctx}/api/wechat/ctUnit/pageZzQuery |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/pageZzQuery") |
| | | public Object pageZzQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | terms.put("unitType",1); |
| | | Sort sort = Sort.by(Sort.Direction.DESC, "create_time"); |
| | | PageRequest pageRequest = PageRequest.of(page-1, size, sort); |
| | | Page<CtUnit> ctUnitPage = service.pageQuery(pageRequest, terms); |
| | | return ReturnSucUtils.getRepInfo( "处理成功", ctUnitPage); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[CtUnitWechatController.pageZzQuery]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 调解组织查询 |
| | | * @url {ctx}/api/wechat/ctUnit/pageZzQuery |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/pageTjQuery") |
| | | public Object pageTjQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | List<Integer> unitTypes = Arrays.asList(2,3,4,5); |
| | | terms.put("unitTypes",unitTypes); |
| | | Sort sort = Sort.by(Sort.Direction.DESC, "create_time"); |
| | | PageRequest pageRequest = PageRequest.of(page-1, size, sort); |
| | | Page<CtUnit> ctUnitPage = service.pageQuery(pageRequest, terms); |
| | | return ReturnSucUtils.getRepInfo( "处理成功", ctUnitPage); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[CtUnitWechatController.pageTjQuery]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 组织详情 |
| | | * @url {ctx}/api/wechat/ctUnit/getById |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/getById") |
| | | public Object getById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(service.getById(id)); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[CtUnitWechatController.getById]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | } |
| | |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="postalCode" column="postal_code"/> |
| | | <result property="telephone" column="telephone"/> |
| | | <result property="workTimeWeek" column="work_time_week"/> |
| | | <result property="workTimeAm" column="work_time_am"/> |
| | | <result property="workTimePm" column="work_time_pm"/> |
| | | |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_ct_unit</sql> |
| | |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | update_time, |
| | | postal_code, |
| | | telephone, |
| | | work_time_week, |
| | | work_time_am, |
| | | work_time_pm |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime},</if> |
| | | <if test="entity.postalCode != null">postal_code = #{entity.postalCode},</if> |
| | | <if test="entity.telephone != null">telephone = #{entity.telephone},</if> |
| | | <if test="entity.workTimeWeek != null">work_time_week = #{entity.workTimeWeek},</if> |
| | | <if test="entity.workTimeAm != null">work_time_am = #{entity.workTimeAm},</if> |
| | | <if test="entity.workTimePm != null">work_time_pm = #{entity.workTimePm},</if> |
| | | |
| | | |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.keyword != null and terms.keyword !=''"> |
| | | and unit_name like CONCAT('%', #{terms.keyword}, '%') |
| | | </if> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | |
| | | <if test="terms.unitType != null and terms.unitType !=''"> |
| | | and unit_type = #{terms.unitType} |
| | | </if> |
| | | <if test="terms.unitTypes != null and terms.unitTypes.size > 0 "> |
| | | and unit_type in |
| | | <foreach item="unitType" collection="terms.unitTypes" separator="," open="(" close=")" index=""> |
| | | #{unitType} |
| | | </foreach> |
| | | </if> |
| | | <if test="terms.unitCode != null and terms.unitCode !=''"> |
| | | and unit_code = #{terms.unitCode} |
| | | </if> |
| | |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 邮政编码 |
| | | */ |
| | | @TableField(value = "postal_code") |
| | | private String postalCode; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @TableField(value = "telephone") |
| | | private String telephone; |
| | | |
| | | /** |
| | | * 办公时间,周 |
| | | */ |
| | | @TableField(value = "work_time_week") |
| | | private String workTimeWeek; |
| | | |
| | | /** |
| | | * 办公时间,上午 |
| | | */ |
| | | @TableField(value = "work_time_am") |
| | | private String workTimeAm; |
| | | |
| | | /** |
| | | * 办公时间,下午 |
| | | */ |
| | | @TableField(value = "work_time_pm") |
| | | private String workTimePm; |
| | | |
| | | /** |
| | | * 子部门 |
| | | */ |
| | | @TableField(exist = false) |
New file |
| | |
| | | package cn.huge.module.ctuser.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhouxiantao |
| | | * @create 2024-08-30 9:25 |
| | | */ |
| | | @Data |
| | | public class CtUnitWeChatCountDTO { |
| | | /** |
| | | * 综治数量 |
| | | */ |
| | | private Integer zzUnitNum; |
| | | /** |
| | | * 调解组织数量 |
| | | */ |
| | | private Integer tzUnitNum; |
| | | } |
| | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.constant.BaseConsts; |
| | | import cn.huge.module.ctuser.dao.mapper.CtUnitMapper; |
| | | import cn.huge.module.ctuser.domain.po.CtDept; |
| | | import cn.huge.module.ctuser.domain.po.CtUnit; |
| | | import cn.huge.module.ctuser.domain.po.CtUser; |
| | | import cn.huge.module.ctuser.dto.CtUnitWeChatCountDTO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public void updateTerms(CtUnit ctUnit) { |
| | | mapper.updateTerms(ctUnit); |
| | | } |
| | | |
| | | /** |
| | | * 小程序统计机构数量 |
| | | * */ |
| | | public CtUnitWeChatCountDTO wechatCountUnit(){ |
| | | CtUnitWeChatCountDTO ctUnitWeChatCountDTO = new CtUnitWeChatCountDTO(); |
| | | QueryWrapper<CtUnit> unitQueryWrapper = new QueryWrapper<>(); |
| | | unitQueryWrapper.eq("unit_type", 1); |
| | | Integer zzUnitNum = mapper.selectCount(unitQueryWrapper); |
| | | if(ObjectUtils.isEmpty(zzUnitNum)){ |
| | | zzUnitNum = 0; |
| | | } |
| | | ctUnitWeChatCountDTO.setZzUnitNum(zzUnitNum); |
| | | List<Integer> unitTypeList = Arrays.asList(2,3,4,5); |
| | | QueryWrapper<CtUnit> unitQueryWrapper1 = new QueryWrapper<>(); |
| | | unitQueryWrapper1.in("unit_type", unitTypeList); |
| | | Integer tzUnitNum = mapper.selectCount(unitQueryWrapper1); |
| | | if(ObjectUtils.isEmpty(tzUnitNum)){ |
| | | tzUnitNum = 0; |
| | | } |
| | | ctUnitWeChatCountDTO.setTzUnitNum(tzUnitNum); |
| | | return ctUnitWeChatCountDTO; |
| | | } |
| | | } |
New file |
| | |
| | | package cn.huge.module.pauser.controller.wechat; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.pauser.dto.WeChatEmpowerDTO; |
| | | import cn.huge.module.pauser.service.PaAccountService; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 公众用户账号表接口api-wechat端 |
| | | * @description: 公众用户账号表接口api-wechat端 |
| | | * @company: hugeinfo |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/wechat/paAccount") |
| | | public class PaAccountWechatController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private PaAccountService service; |
| | | |
| | | /** |
| | | * 获取请求URL参数 |
| | | * @return Map<String, Object> |
| | | */ |
| | | private Map<String, Object> getParameter(){ |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 账号编号 |
| | | String id = request.getParameter("id"); |
| | | if (StringUtils.isNotBlank(id)){ |
| | | terms.put("id", id); |
| | | } |
| | | // 当事人编号 |
| | | String userId = request.getParameter("userId"); |
| | | if (StringUtils.isNotBlank(userId)){ |
| | | terms.put("userId", userId); |
| | | } |
| | | // 帐号类型,1:平台web端,2:平台小程序 |
| | | String accType = request.getParameter("accType"); |
| | | if (StringUtils.isNotBlank(accType)){ |
| | | terms.put("accType", accType); |
| | | } |
| | | // 身份唯一标识(存储唯一标识,比如账号、邮箱、手机号、第三方获取的唯一标识等) |
| | | String acc = request.getParameter("acc"); |
| | | if (StringUtils.isNotBlank(acc)){ |
| | | terms.put("acc", acc); |
| | | } |
| | | // 授权凭证(比如密码 、第三方登录的token、授权账号等) |
| | | String cipher = request.getParameter("cipher"); |
| | | if (StringUtils.isNotBlank(cipher)){ |
| | | terms.put("cipher", cipher); |
| | | } |
| | | // 授权凭证明文 |
| | | String cipherOpen = request.getParameter("cipherOpen"); |
| | | if (StringUtils.isNotBlank(cipherOpen)){ |
| | | terms.put("cipherOpen", cipherOpen); |
| | | } |
| | | // 密码最新更新时间 |
| | | String cipherTime = request.getParameter("cipherTime"); |
| | | if (StringUtils.isNotBlank(cipherTime)){ |
| | | terms.put("cipherTime", cipherTime); |
| | | } |
| | | // 最新登录时间 |
| | | String loginTime = request.getParameter("loginTime"); |
| | | if (StringUtils.isNotBlank(loginTime)){ |
| | | terms.put("loginTime", loginTime); |
| | | } |
| | | // 限制登录时间(密码错误次数超过限制,默认30分钟) |
| | | String limitTime = request.getParameter("limitTime"); |
| | | if (StringUtils.isNotBlank(limitTime)){ |
| | | terms.put("limitTime", limitTime); |
| | | } |
| | | // 删除状态,0:未删除,1:已删除 |
| | | String deleteStatus = request.getParameter("deleteStatus"); |
| | | if (StringUtils.isNotBlank(deleteStatus)){ |
| | | terms.put("deleteStatus", deleteStatus); |
| | | } |
| | | // 客户编号 |
| | | String custId = request.getParameter("custId"); |
| | | if (StringUtils.isNotBlank(custId)){ |
| | | terms.put("custId", custId); |
| | | } |
| | | // 创建时间区间 |
| | | String createStart = request.getParameter("createStart"); |
| | | String createEnd = request.getParameter("createEnd"); |
| | | if(StringUtils.isNotBlank(createStart) && StringUtils.isNotBlank(createEnd)) { |
| | | terms.put("createStart", createStart); |
| | | terms.put("createEnd", createEnd); |
| | | } |
| | | // 更新时间区间 |
| | | String updateStart = request.getParameter("updateStart"); |
| | | String updateEnd = request.getParameter("updateEnd"); |
| | | if(StringUtils.isNotBlank(updateStart) && StringUtils.isNotBlank(updateEnd)) { |
| | | terms.put("updateStart", updateStart); |
| | | terms.put("updateEnd", updateEnd); |
| | | } |
| | | return terms; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当事人小程序-微信用户授权 |
| | | * url: {ctx}/api/weChat/paAccount/empower |
| | | * type: post |
| | | */ |
| | | @PostMapping(value = "/empower") |
| | | public Object empower(@RequestBody WeChatEmpowerDTO weChatEmpowerDTO) { |
| | | if (StringUtils.isBlank(weChatEmpowerDTO.getCode())) { |
| | | return ReturnSucUtils.getRepInfo("code不能为空!"); |
| | | } |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(service.wechatEmpower(weChatEmpowerDTO)); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[PaAccountWechatController.empower]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-微信用户授权获取手机号码 |
| | | * url: {ctx}/api/wechat/paAccount/getUserPhone |
| | | * type: post |
| | | */ |
| | | @PostMapping(value = "/getUserPhone") |
| | | public Object getUserPhone(@RequestBody WeChatEmpowerDTO weChatEmpowerDTO) { |
| | | if (StringUtils.isBlank(weChatEmpowerDTO.getCode())) { |
| | | return ReturnSucUtils.getRepInfo("code不能为空!"); |
| | | } |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(service.wechatGetPhone(weChatEmpowerDTO)); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[WeChatPaAccountController.wechatGetPhone]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.huge.module.pauser.controller.web; |
| | | package cn.huge.module.pauser.controller.wechat; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.base.config.CurrentUser; |
| | | import cn.huge.module.pauser.domain.po.PaUser; |
| | | import cn.huge.module.pauser.service.PaUserService; |
| | | import com.google.common.collect.Maps; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @title: 公众用户表接口api-web端 |
| | | * @description: 公众用户表接口api-web端 |
| | | * @title: 公众用户表接口api-wechat端 |
| | | * @description: 公众用户表接口api-wechat端 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | |
| | | return terms; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 条件查询多个 |
| | | * @url {ctx}/api/web/paUser/listQuery |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/listQuery") |
| | | public Object listQuery() { |
| | | * 当事人小程序-个人中心 |
| | | * url: {ctx}/api/wechat/paUser/personal |
| | | * type: post |
| | | */ |
| | | @GetMapping(value = "/personal") |
| | | public Object personal(@CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | return ReturnSucUtils.getRepInfo(service.listTerms(terms)); |
| | | return ReturnSucUtils.getRepInfo(service.wechatPersonal(userId)); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | log.error("Controller接口[PaUserWechatController.personal]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件分页查询 |
| | | * @url {ctx}/api/web/paUser/pageQuery |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/pageQuery") |
| | | public Object pageQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) { |
| | | * 当事人小程序-查询当前登录人个人信息 |
| | | * url: {ctx}/api/wechat/paUser/getUserInfo |
| | | * type: post |
| | | */ |
| | | @GetMapping(value = "/getUserInfo") |
| | | public Object getUserInfo(@CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | Sort sort = Sort.by(Sort.Direction.DESC, "create_time"); |
| | | PageRequest pageRequest = PageRequest.of(page-1, size, sort); |
| | | Page<PaUser> paUserPage = service.pageQuery(pageRequest, terms); |
| | | return ReturnSucUtils.getRepInfo( "处理成功", paUserPage); |
| | | PaUser paUser = service.getById(userId); |
| | | return ReturnSucUtils.getRepInfo(paUser); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | log.error("Controller接口[PaUserWechatController.getUserInfo]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号查询单个 |
| | | * @url {ctx}/api/web/paUser/getById |
| | | * @param id 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/getById") |
| | | public Object getById(@RequestParam(value = "id") String id) { |
| | | * 当事人小程序-完善资料 |
| | | * url: {ctx}/api/wechat/paUser/perfectInfo |
| | | * type: post |
| | | */ |
| | | @PostMapping(value = "/perfectInfo") |
| | | public Object perfectInfo(@CurrentUser String userId, @RequestBody PaUser paUser) { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(service.getById(id)); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/paUser/deleteById |
| | | * @param id 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | service.removeById(id); |
| | | paUser.setId(userId); |
| | | service.perfectInfo(paUser); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | log.error("Controller接口[PaUserWechatController.perfectInfo]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @url {ctx}/api/web/paUser/savePaUser |
| | | * @param paUser 实体对象 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/savePaUser") |
| | | public Object savePaUser(@RequestBody PaUser paUser) { |
| | | * 当事人小程序-实名认证 |
| | | * url: {ctx}/api/weChat/paUser/realAuth |
| | | * type: post |
| | | */ |
| | | @PostMapping(value = "/realAuth") |
| | | public Object realAuth(@CurrentUser String userId, @RequestBody PaUser paUser) { |
| | | try { |
| | | service.savePaUser(paUser); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | paUser.setId(userId); |
| | | service.wechatRealAuth(paUser); |
| | | Map<String, Object> result = Maps.newHashMap(); |
| | | result.put("userId", paUser.getId()); |
| | | result.put("trueName", paUser.getTrueName()); |
| | | result.put("realStatus", paUser.getRealStatus()); |
| | | // result.put("faceStatus", paUser.getFaceStatus()); |
| | | return ReturnSucUtils.getRepInfo(result); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | log.error("Controller接口[PaUserWechatController.realAuth]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | package cn.huge.module.pauser.dao.mapper; |
| | | |
| | | import cn.huge.module.pauser.domain.po.PaAccount; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | |
| | | */ |
| | | List<PaAccount> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据appid查询小程序配置 |
| | | * @param appid 小程序appid |
| | | * @return SeCustWechatDTO |
| | | */ |
| | | SeCustWechatDTO getSeCustWechatByAppid(@Param("appid") String appid); |
| | | |
| | | } |
| | |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | <!-- SeCustWechatDTO结果集 --> |
| | | <resultMap id="seCustWechatDTO" type="cn.huge.module.oper.dto.SeCustWechatDTO"> |
| | | <result property="id" column="id"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="mainId" column="main_id"/> |
| | | <result property="mainName" column="main_name"/> |
| | | <result property="mainAcc" column="main_acc"/> |
| | | <result property="mainPower" column="main_power"/> |
| | | <result property="appid" column="appid"/> |
| | | <result property="secret" column="secret"/> |
| | | <result property="token" column="token"/> |
| | | <result property="aeskey" column="aeskey"/> |
| | | <result property="msgDataFormat" column="msg_data_format"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 根据appid查询小程序配置 --> |
| | | <select id="getSeCustWechatByAppid" resultMap="seCustWechatDTO"> |
| | | SELECT |
| | | * |
| | | FROM dyh_se_cust_wechat |
| | | WHERE appid = #{appid} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package cn.huge.module.pauser.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: 微信授权登录数据传输类 |
| | | * @description: 微信授权登录数据传输类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-02-22 15:24:51 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Data |
| | | public class WeChatEmpowerDTO { |
| | | |
| | | /** |
| | | * 小程序appid |
| | | */ |
| | | private String appid; |
| | | |
| | | /** |
| | | * 小程序code |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mobile; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | private String avatar; |
| | | |
| | | /** |
| | | * 用户加密信息 |
| | | */ |
| | | String encryptedData; |
| | | |
| | | /** |
| | | * 加密算法的初始向量 |
| | | */ |
| | | String ivStr; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.pauser.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 微信小程序登录后返回前端用户实体类 |
| | | * @description: 微信小程序登录后返回前端用户实体类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-02-22 15:24:51 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Data |
| | | public class WeChatLoginDTO { |
| | | |
| | | /** |
| | | * JWT token |
| | | */ |
| | | private String token; |
| | | |
| | | /** |
| | | * 微信sessionKey |
| | | */ |
| | | private String sessionKey; |
| | | |
| | | /** |
| | | * 微信openId |
| | | */ |
| | | private String openId; |
| | | |
| | | /** |
| | | * 用户编号 |
| | | */ |
| | | private String userId; |
| | | |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String trueName; |
| | | |
| | | /** |
| | | * 上一次登录时间 |
| | | */ |
| | | private Date lastLoginTime; |
| | | |
| | | /** |
| | | * 实名认证状态,1:通过,0:未通过(默认) |
| | | */ |
| | | private Integer realStatus; |
| | | |
| | | /** |
| | | * 人脸认证状态,1:已认证,0:未认证(默认) |
| | | */ |
| | | private Integer faceStatus; |
| | | |
| | | /** |
| | | * 多码合一,用户注册状态,0:未注册,1:已注册 |
| | | */ |
| | | private String state; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.pauser.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 微信小程序个人中心数据传输类 |
| | | * @description: 微信小程序个人中心数据传输类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-02-22 15:24:51 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Data |
| | | public class WeChatPersonalDTO { |
| | | |
| | | /** |
| | | * 用户编号 |
| | | */ |
| | | private String userId; |
| | | |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String trueName; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | private String avatar; |
| | | |
| | | /** |
| | | * 实名认证状态,1:通过,99:未通过(默认) |
| | | */ |
| | | private Integer realStatus; |
| | | |
| | | /** |
| | | * 人脸认证状态,1:已认证,99:未认证(默认) |
| | | */ |
| | | private Integer faceStatus; |
| | | |
| | | /** |
| | | * 我的消息数量 |
| | | */ |
| | | private Integer msgCount; |
| | | |
| | | /** |
| | | * 反馈意见数量 |
| | | */ |
| | | private Integer opinionCount; |
| | | /** |
| | | * 最新登录时间 |
| | | */ |
| | | private Date loginTime; |
| | | |
| | | } |
| | |
| | | package cn.huge.module.pauser.service; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.base.common.utils.*; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.constant.BaseConsts; |
| | | import cn.huge.module.cust.constant.UserBaseConsts; |
| | | import cn.huge.module.pauser.dao.mapper.PaAccountMapper; |
| | | import cn.huge.module.pauser.domain.po.PaAccount; |
| | | import cn.huge.module.pauser.domain.po.PaUser; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import cn.huge.module.pauser.dto.WeChatEmpowerDTO; |
| | | import cn.huge.module.pauser.dto.WeChatLoginDTO; |
| | | import cn.huge.module.utils.JwtUtils; |
| | | import cn.huge.module.wechat.miniapp.service.WeixinMaService; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Maps; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | @Autowired |
| | | private WeixinMaService weixinMaService; |
| | | |
| | | @Autowired |
| | | private WxMaService wxMaService; |
| | | |
| | | @Autowired |
| | | private PaUserService paUserService; |
| | | |
| | | /** |
| | | * 更新对象 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-微信用户授权 |
| | | * @param weChatEmpowerDTO 微信用户授权信息 |
| | | * @return WeChatLoginDTO |
| | | */ |
| | | public WeChatLoginDTO wechatEmpower(WeChatEmpowerDTO weChatEmpowerDTO) { |
| | | try{ |
| | | Date nowDate = new Date(); |
| | | WeChatLoginDTO weChatLoginDTO = new WeChatLoginDTO(); |
| | | SeCustWechatDTO seCustWechatDTO = mapper.getSeCustWechatByAppid(weChatEmpowerDTO.getAppid()); |
| | | weixinMaService.createConfig(seCustWechatDTO); |
| | | WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(weChatEmpowerDTO.getCode()); |
| | | weChatLoginDTO.setSessionKey(session.getSessionKey()); |
| | | weChatLoginDTO.setOpenId(session.getOpenid()); |
| | | PaUser paUser = null; |
| | | PaAccount account = this.getByTypeAndAcc(UserBaseConsts.ACC_TYPE_2, session.getOpenid(), seCustWechatDTO.getCustId()); |
| | | // 是否新注册 |
| | | if (ObjectUtils.isEmpty(account)) { |
| | | weChatLoginDTO.setLastLoginTime(nowDate); |
| | | // 新建用户信息 |
| | | paUser = new PaUser(); |
| | | paUser.setId(utilsClient.getNewTimeId()); |
| | | paUser.setAvatar(weChatEmpowerDTO.getAvatar()); |
| | | paUser.setRealStatus(UserBaseConsts.REAL_STATUS_0); |
| | | // paUser.setFaceStatus(UserBaseConsts.REAL_STATUS_0); |
| | | paUser.setStatus(UserBaseConsts.USER_STATUS_1); |
| | | paUser.setDeleteStatus(BaseConsts.DELETE_STATUS_0); |
| | | paUser.setCustId(seCustWechatDTO.getCustId()); |
| | | paUser.setCreateTime(nowDate); |
| | | paUser.setUpdateTime(nowDate); |
| | | paUserService.save(paUser); |
| | | // 新增账号信息 |
| | | account = new PaAccount(); |
| | | account.setId(utilsClient.getNewTimeId()); |
| | | account.setUserId(paUser.getId()); |
| | | account.setAccType(UserBaseConsts.ACC_TYPE_2); |
| | | account.setAcc(session.getOpenid()); |
| | | account.setCipher(DigestUtils.md5DigestAsHex(session.getOpenid().getBytes())); |
| | | account.setCipherOpen(session.getOpenid()); |
| | | account.setLoginTime(nowDate); |
| | | account.setCustId(seCustWechatDTO.getCustId()); |
| | | account.setCreateTime(nowDate); |
| | | account.setUpdateTime(nowDate); |
| | | mapper.insert(account); |
| | | }else { |
| | | weChatLoginDTO.setLastLoginTime(account.getLoginTime()); |
| | | // 更新登录时间 |
| | | account.setLoginTime(nowDate); |
| | | mapper.updatePaAccount(account); |
| | | // 获取用户信息 |
| | | paUser = paUserService.getById(account.getUserId()); |
| | | } |
| | | // 封装用户信息 |
| | | weChatLoginDTO.setUserId(paUser.getId()); |
| | | weChatLoginDTO.setTrueName(paUser.getTrueName()); |
| | | weChatLoginDTO.setRealStatus(paUser.getRealStatus()); |
| | | // weChatLoginDTO.setFaceStatus(paUser.getFaceStatus()); |
| | | //生成JWT |
| | | String token = JwtUtils.buildJWT(account.getCustId(), account.getUserId()); |
| | | weChatLoginDTO.setToken(token); |
| | | return weChatLoginDTO; |
| | | }catch (Exception e){ |
| | | log.error("service方法[PaAccountService.wechatEmpower]调用异常:"+e, e); |
| | | throw new ServiceException("PaAccountService.wechatEmpower", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过账号类型和授权凭证查询 |
| | | * @param accType 账户类型 |
| | | * @param acc 账号 |
| | | * @param custId 客户编号 |
| | | * @return PaAccount |
| | | */ |
| | | public PaAccount getByTypeAndAcc(Integer accType, String acc, String custId){ |
| | | QueryWrapper<PaAccount> paAccountQueryWrapper = new QueryWrapper<>(); |
| | | paAccountQueryWrapper.eq("acc_type", accType).eq("acc", acc).eq("cust_id", custId); |
| | | PaAccount paAccount = mapper.selectOne(paAccountQueryWrapper); |
| | | return paAccount; |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-获取手机号码 |
| | | * @param weChatEmpowerDTO 请求信息 |
| | | * @return String |
| | | */ |
| | | public String wechatGetPhone(WeChatEmpowerDTO weChatEmpowerDTO) { |
| | | try{ |
| | | SeCustWechatDTO seCustWechatDTO = mapper.getSeCustWechatByAppid(weChatEmpowerDTO.getAppid()); |
| | | weixinMaService.createConfig(seCustWechatDTO); |
| | | String accessToken = wxMaService.getAccessToken(); |
| | | String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token="+accessToken; |
| | | Map<String, String> map = Maps.newHashMap(); |
| | | map.put("code", weChatEmpowerDTO.getCode()); |
| | | JsonMapper jsonMapper = new JsonMapper(); |
| | | String jsonStr = jsonMapper.toJson(map); |
| | | String result = HttpClientUtils.httpPostRaw(url, jsonStr, null, null); |
| | | JSONObject resultJson = JSONObject.parseObject(new String(result)); |
| | | int errcode = resultJson.getIntValue("errcode"); |
| | | if (errcode == 0){ |
| | | JSONObject phoneInfoJson = resultJson.getJSONObject("phone_info"); |
| | | String phoneNumber = phoneInfoJson.getString("phoneNumber"); |
| | | return phoneNumber; |
| | | }else { |
| | | throw new ServiceException("errcode:"+errcode+";errmsg:"+resultJson.getIntValue("errmsg")); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[PaAccountService.wechatGetPhone]调用异常:"+e, e); |
| | | throw new ServiceException("PaAccountService.wechatGetPhone", e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.cust.constant.UserBaseConsts; |
| | | import cn.huge.module.mediate.dto.WechatBindCaseDTO; |
| | | import cn.huge.module.pauser.dao.mapper.PaAccountMapper; |
| | | import cn.huge.module.pauser.dao.mapper.PaUserMapper; |
| | | import cn.huge.module.pauser.domain.po.PaAccount; |
| | | import cn.huge.module.pauser.domain.po.PaUser; |
| | | import cn.huge.module.pauser.dto.WeChatPersonalDTO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | @Autowired |
| | | private PaAccountMapper paAccountMapper; |
| | | |
| | | /** |
| | | * 更新对象 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-个人中心 |
| | | * @param userId 用户编号 |
| | | * @return WeChatPersonalDTO |
| | | */ |
| | | public WeChatPersonalDTO wechatPersonal(String userId){ |
| | | WeChatPersonalDTO weChatPersonalDTO = new WeChatPersonalDTO(); |
| | | PaUser paUser = this.getById(userId); |
| | | BeanUtils.copyProperties(paUser, weChatPersonalDTO); |
| | | weChatPersonalDTO.setUserId(paUser.getId()); |
| | | // TODO: 2022/4/13 我的消息 |
| | | weChatPersonalDTO.setMsgCount(0); |
| | | // TODO: 2022/4/13 反馈意见 |
| | | weChatPersonalDTO.setOpinionCount(0); |
| | | |
| | | QueryWrapper<PaAccount> paAccountWrapper = new QueryWrapper<>(); |
| | | paAccountWrapper.eq("user_id", userId); |
| | | PaAccount paAccount = paAccountMapper.selectOne(paAccountWrapper); |
| | | if(ObjectUtils.isNotEmpty(paAccount)){ |
| | | weChatPersonalDTO.setLoginTime(paAccount.getLoginTime()); |
| | | } |
| | | |
| | | return weChatPersonalDTO; |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-完善资料 |
| | | * @param paUser 用户信息 |
| | | */ |
| | | public void perfectInfo(PaUser paUser){ |
| | | try{ |
| | | Date nowDate = new Date(); |
| | | paUser.setStatus(UserBaseConsts.USER_STATUS_1); |
| | | paUser.setUpdateTime(nowDate); |
| | | mapper.updatePaUser(paUser); |
| | | // 绑定案件 |
| | | // WechatBindCaseDTO wechatBindCaseDTO = new WechatBindCaseDTO(); |
| | | // wechatBindCaseDTO.setUserId(paUser.getId()); |
| | | // wechatBindCaseDTO.setMobile(paUser.getMobile()); |
| | | // wechatBindCaseDTO.setTrueName(paUser.getTrueName()); |
| | | // wechatBindCaseDTO.setIdcard(paUser.getIdcard()); |
| | | // wechatBindCaseDTO.setCustId(paUser.getCustId()); |
| | | // mediateClient.bindCase(wechatBindCaseDTO); |
| | | }catch (Exception e){ |
| | | log.error("service方法[PaUserService.perfectInfo]调用异常:"+e, e); |
| | | throw new ServiceException("PaUserService.perfectInfo", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-实名认证 |
| | | * @param paUser 用户信息 |
| | | */ |
| | | public void wechatRealAuth(PaUser paUser){ |
| | | try{ |
| | | Date nowDate = new Date(); |
| | | paUser.setRealStatus(UserBaseConsts.REAL_STATUS_1); |
| | | // paUser.setFaceStatus(UserBaseConsts.FACE_STATUS_1); |
| | | paUser.setStatus(UserBaseConsts.USER_STATUS_1); |
| | | paUser.setUpdateTime(nowDate); |
| | | mapper.updatePaUser(paUser); |
| | | // 绑定案件 |
| | | // WechatBindCaseDTO wechatBindCaseDTO = new WechatBindCaseDTO(); |
| | | // wechatBindCaseDTO.setUserId(paUser.getId()); |
| | | // wechatBindCaseDTO.setMobile(paUser.getMobile()); |
| | | // wechatBindCaseDTO.setTrueName(paUser.getTrueName()); |
| | | // wechatBindCaseDTO.setIdcard(paUser.getIdcard()); |
| | | // wechatBindCaseDTO.setCustId(paUser.getCustId()); |
| | | // mediateClient.bindCase(wechatBindCaseDTO); |
| | | }catch (Exception e){ |
| | | log.error("service方法[PaUserService.wechatRealAuth]调用异常:"+e, e); |
| | | throw new ServiceException("PaUserService.wechatRealAuth", e); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import cn.binarywang.wx.miniapp.bean.WxMaMessage; |
| | | import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; |
| | | import cn.binarywang.wx.miniapp.message.WxMaMessageRouter; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import cn.huge.module.wechat.miniapp.handler.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | /** |
| | | * @title: 小程序服务 |
| | |
| | | // this.refreshRouter(); |
| | | // } |
| | | |
| | | public void createConfig(SeCustWechatDTO seCustWechatDTO) { |
| | | final WxMaInMemoryConfig config = new WxMaInMemoryConfig(); |
| | | config.setAppid(seCustWechatDTO.getAppid());// 设置微信公众号的appid |
| | | config.setSecret(seCustWechatDTO.getSecret());// 设置微信公众号的app corpSecret |
| | | config.setToken(seCustWechatDTO.getToken());// 设置微信公众号的token |
| | | config.setAesKey(seCustWechatDTO.getAeskey());// 设置消息加解密密钥 |
| | | super.setWxMaConfig(config); |
| | | |
| | | this.refreshRouter(); |
| | | } |
| | | |
| | | private void refreshRouter() { |
| | | final WxMaMessageRouter newRouter = new WxMaMessageRouter(this); |
| | | |
New file |
| | |
| | | package cn.huge.module.notice.controller.wechat; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.base.config.CurrentUser; |
| | | import cn.huge.module.mediate.constant.NoticeBaseConsts; |
| | | import cn.huge.module.notice.domain.po.NoticeParty; |
| | | import cn.huge.module.notice.service.NoticePartyService; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 当事人消息通知表接口api |
| | | * @description: 当事人消息通知表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/wechat/noticeParty") |
| | | public class NoticePartyWechatController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private NoticePartyService service; |
| | | |
| | | /** |
| | | * 获取请求URL参数 |
| | | * @return Map<String, Object> |
| | | */ |
| | | private Map<String, Object> getParameter(){ |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 我申请的消息通知编号 |
| | | String id = request.getParameter("id"); |
| | | if (StringUtils.isNotBlank(id)){ |
| | | terms.put("id", id); |
| | | } |
| | | // 纠纷编号 |
| | | String caseId = request.getParameter("caseId"); |
| | | if (StringUtils.isNotBlank(caseId)){ |
| | | terms.put("caseId", caseId); |
| | | } |
| | | // 消息类型,1:系统通知,2:平台公告 |
| | | String noticeType = request.getParameter("noticeType"); |
| | | if (StringUtils.isNotBlank(noticeType)){ |
| | | terms.put("noticeType", noticeType); |
| | | } |
| | | // 标题 |
| | | String title = request.getParameter("title"); |
| | | if (StringUtils.isNotBlank(title)){ |
| | | terms.put("title", title); |
| | | } |
| | | // 消息内容 |
| | | String content = request.getParameter("content"); |
| | | if (StringUtils.isNotBlank(content)){ |
| | | terms.put("content", content); |
| | | } |
| | | // 接收人编号 |
| | | String userId = request.getParameter("userId"); |
| | | if (StringUtils.isNotBlank(userId)){ |
| | | terms.put("userId", userId); |
| | | } |
| | | // 接收人名称 |
| | | String userName = request.getParameter("userName"); |
| | | if (StringUtils.isNotBlank(userName)){ |
| | | terms.put("userName", userName); |
| | | } |
| | | // 跳转url |
| | | String visitUrl = request.getParameter("visitUrl"); |
| | | if (StringUtils.isNotBlank(visitUrl)){ |
| | | terms.put("visitUrl", visitUrl); |
| | | } |
| | | // 已读状态,1:未读(默认值),2:已读 |
| | | String readStatus = request.getParameter("readStatus"); |
| | | if (StringUtils.isNotBlank(readStatus)){ |
| | | terms.put("readStatus", readStatus); |
| | | } |
| | | // 阅读时间 |
| | | String readTime = request.getParameter("readTime"); |
| | | if (StringUtils.isNotBlank(readTime)){ |
| | | terms.put("readTime", readTime); |
| | | } |
| | | // 删除状态,1:未删除(默认值),99:已删除 |
| | | String deleteStatus = request.getParameter("deleteStatus"); |
| | | if (StringUtils.isNotBlank(deleteStatus)){ |
| | | terms.put("deleteStatus", deleteStatus); |
| | | } |
| | | // 客户编号 |
| | | String custId = request.getParameter("custId"); |
| | | if (StringUtils.isNotBlank(custId)){ |
| | | terms.put("custId", custId); |
| | | } |
| | | // 创建时间区间 |
| | | String createStart = request.getParameter("createStart"); |
| | | String createEnd = request.getParameter("createEnd"); |
| | | if(StringUtils.isNotBlank(createStart) && StringUtils.isNotBlank(createEnd)) { |
| | | terms.put("createStart", createStart); |
| | | terms.put("createEnd", createEnd); |
| | | } |
| | | // 更新时间区间 |
| | | String updateStart = request.getParameter("updateStart"); |
| | | String updateEnd = request.getParameter("updateEnd"); |
| | | if(StringUtils.isNotBlank(updateStart) && StringUtils.isNotBlank(updateEnd)) { |
| | | terms.put("updateStart", updateStart); |
| | | terms.put("updateEnd", updateEnd); |
| | | } |
| | | return terms; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 我的消息-分页查询 |
| | | * @url {ctx}/api/weChat/noticeParty/pageMyNotice |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @param readStatus 每页数量 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/pageMyNotice") |
| | | public Object pageMyNotice(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, |
| | | @RequestParam(value = "readStatus") String readStatus, @CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | terms.put("userId", userId); |
| | | terms.put("readStatus", readStatus); |
| | | Sort sort = Sort.by(Sort.Direction.DESC, "create_time"); |
| | | PageRequest pageRequest = PageRequest.of(page-1, size, sort); |
| | | Page<NoticeParty> noticePartyPage = service.pageQuery(pageRequest, terms); |
| | | return ReturnSucUtils.getRepInfo( "处理成功", noticePartyPage); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[NoticePartyController.pageMyNotice]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 我的消息-阅读消息 |
| | | * @url {ctx}/api/weChat/noticeParty/readNotice |
| | | * @param id 消息编号 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/readNotice") |
| | | public Object readNotice(@RequestParam(value = "id") String id, @CurrentUser String userId) { |
| | | try { |
| | | Date nowDate = new Date(); |
| | | NoticeParty noticeParty = new NoticeParty(); |
| | | noticeParty.setReadStatus(NoticeBaseConsts.READ_STATUS_2); |
| | | noticeParty.setReadTime(nowDate); |
| | | noticeParty.setUpdateTime(nowDate); |
| | | noticeParty.setId(id); |
| | | service.updateNoticeParty(noticeParty); |
| | | return ReturnSucUtils.getRepInfo( ); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[NoticePartyController.readNotice]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeApply; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 我申请的消息通知表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:32 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticeApplyMapper extends BaseMapper<NoticeApply>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeApply(@Param("entity") NoticeApply entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticeApplyTerms(@Param("entity") NoticeApply entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeApply(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeApply> |
| | | */ |
| | | List<NoticeApply> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeApply> |
| | | */ |
| | | List<NoticeApply> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeHandle; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 我负责的消息通知表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:33 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticeHandleMapper extends BaseMapper<NoticeHandle>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeHandle(@Param("entity") NoticeHandle entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticeHandleTerms(@Param("entity") NoticeHandle entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeHandle(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeHandle> |
| | | */ |
| | | List<NoticeHandle> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeHandle> |
| | | */ |
| | | List<NoticeHandle> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeJoin; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 我参与的消息通知表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticeJoinMapper extends BaseMapper<NoticeJoin>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeJoin(@Param("entity") NoticeJoin entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticeJoinTerms(@Param("entity") NoticeJoin entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeJoin(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeJoin> |
| | | */ |
| | | List<NoticeJoin> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeJoin> |
| | | */ |
| | | List<NoticeJoin> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeMode; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 短信通知模板表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticeModeMapper extends BaseMapper<NoticeMode>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeMode(@Param("entity") NoticeMode entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticeModeTerms(@Param("entity") NoticeMode entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeMode(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeMode> |
| | | */ |
| | | List<NoticeMode> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeMode> |
| | | */ |
| | | List<NoticeMode> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeParty; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 当事人消息通知表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticePartyMapper extends BaseMapper<NoticeParty>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeParty(@Param("entity") NoticeParty entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticePartyTerms(@Param("entity") NoticeParty entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeParty(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeParty> |
| | | */ |
| | | List<NoticeParty> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeParty> |
| | | */ |
| | | List<NoticeParty> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeShort; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 短信通知表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:35 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticeShortMapper extends BaseMapper<NoticeShort>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeShort(@Param("entity") NoticeShort entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticeShortTerms(@Param("entity") NoticeShort entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeShort(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeShort> |
| | | */ |
| | | List<NoticeShort> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeShort> |
| | | */ |
| | | List<NoticeShort> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.dao.mapper; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeSys; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 系统公告消息通知表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:35 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface NoticeSysMapper extends BaseMapper<NoticeSys>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateNoticeSys(@Param("entity") NoticeSys entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateNoticeSysTerms(@Param("entity") NoticeSys entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteNoticeSys(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeSys> |
| | | */ |
| | | List<NoticeSys> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<NoticeSys> |
| | | */ |
| | | List<NoticeSys> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 我申请的消息通知表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:32 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticeApplyMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeApply"> |
| | | <result property="id" column="id"/> |
| | | <result property="caseId" column="case_id"/> |
| | | <result property="taskId" column="task_id"/> |
| | | <result property="title" column="title"/> |
| | | <result property="applyType" column="apply_type"/> |
| | | <result property="applyTime" column="apply_time"/> |
| | | <result property="applyReason" column="apply_reason"/> |
| | | <result property="helpNames" column="help_names"/> |
| | | <result property="applyStatus" column="apply_status"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="visitUrl" column="visit_url"/> |
| | | <result property="readStatus" column="read_status"/> |
| | | <result property="readTime" column="read_time"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_apply</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | case_id, |
| | | task_id, |
| | | title, |
| | | apply_type, |
| | | apply_time, |
| | | apply_reason, |
| | | help_names, |
| | | apply_status, |
| | | user_id, |
| | | user_name, |
| | | visit_url, |
| | | read_status, |
| | | read_time, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.caseId != null">case_id = #{entity.caseId},</if> |
| | | <if test="entity.taskId != null">task_id = #{entity.taskId},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.applyType != null">apply_type = #{entity.applyType},</if> |
| | | <if test="entity.applyTime != null">apply_time = #{entity.applyTime},</if> |
| | | <if test="entity.applyReason != null">apply_reason = #{entity.applyReason},</if> |
| | | <if test="entity.helpNames != null">help_names = #{entity.helpNames},</if> |
| | | <if test="entity.applyStatus != null">apply_status = #{entity.applyStatus},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.visitUrl != null">visit_url = #{entity.visitUrl},</if> |
| | | <if test="entity.readStatus != null">read_status = #{entity.readStatus},</if> |
| | | <if test="entity.readTime != null">read_time = #{entity.readTime},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.caseId != null and terms.caseId !=''"> |
| | | and case_id = #{terms.caseId} |
| | | </if> |
| | | <if test="terms.taskId != null and terms.taskId !=''"> |
| | | and task_id = #{terms.taskId} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.applyType != null and terms.applyType !=''"> |
| | | and apply_type = #{terms.applyType} |
| | | </if> |
| | | <if test="terms.applyTime != null and terms.applyTime !=''"> |
| | | and apply_time = #{terms.applyTime} |
| | | </if> |
| | | <if test="terms.applyReason != null and terms.applyReason !=''"> |
| | | and apply_reason = #{terms.applyReason} |
| | | </if> |
| | | <if test="terms.helpNames != null and terms.helpNames !=''"> |
| | | and help_names = #{terms.helpNames} |
| | | </if> |
| | | <if test="terms.applyStatus != null and terms.applyStatus !=''"> |
| | | and apply_status = #{terms.applyStatus} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.visitUrl != null and terms.visitUrl !=''"> |
| | | and visit_url = #{terms.visitUrl} |
| | | </if> |
| | | <if test="terms.readStatus != null and terms.readStatus !=''"> |
| | | and read_status = #{terms.readStatus} |
| | | </if> |
| | | <if test="terms.readTime != null and terms.readTime !=''"> |
| | | and read_time = #{terms.readTime} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = '1' |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeApply"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticeApplyTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeApply"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 我负责的消息通知表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:33 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticeHandleMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeHandle"> |
| | | <result property="id" column="id"/> |
| | | <result property="caseId" column="case_id"/> |
| | | <result property="taskId" column="task_id"/> |
| | | <result property="title" column="title"/> |
| | | <result property="taskName" column="task_name"/> |
| | | <result property="taskTime" column="task_time"/> |
| | | <result property="expireTime" column="expire_time"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="visitUrl" column="visit_url"/> |
| | | <result property="readStatus" column="read_status"/> |
| | | <result property="readTime" column="read_time"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_handle</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | case_id, |
| | | task_id, |
| | | title, |
| | | task_name, |
| | | task_time, |
| | | expire_time, |
| | | user_id, |
| | | user_name, |
| | | visit_url, |
| | | read_status, |
| | | read_time, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.caseId != null">case_id = #{entity.caseId},</if> |
| | | <if test="entity.taskId != null">task_id = #{entity.taskId},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.taskName != null">task_name = #{entity.taskName},</if> |
| | | <if test="entity.taskTime != null">task_time = #{entity.taskTime},</if> |
| | | <if test="entity.expireTime != null">expire_time = #{entity.expireTime},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.visitUrl != null">visit_url = #{entity.visitUrl},</if> |
| | | <if test="entity.readStatus != null">read_status = #{entity.readStatus},</if> |
| | | <if test="entity.readTime != null">read_time = #{entity.readTime},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.caseId != null and terms.caseId !=''"> |
| | | and case_id = #{terms.caseId} |
| | | </if> |
| | | <if test="terms.taskId != null and terms.taskId !=''"> |
| | | and task_id = #{terms.taskId} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.taskName != null and terms.taskName !=''"> |
| | | and task_name = #{terms.taskName} |
| | | </if> |
| | | <if test="terms.taskTime != null and terms.taskTime !=''"> |
| | | and task_time = #{terms.taskTime} |
| | | </if> |
| | | <if test="terms.expireTime != null and terms.expireTime !=''"> |
| | | and expire_time = #{terms.expireTime} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.visitUrl != null and terms.visitUrl !=''"> |
| | | and visit_url = #{terms.visitUrl} |
| | | </if> |
| | | <if test="terms.readStatus != null and terms.readStatus !=''"> |
| | | and read_status = #{terms.readStatus} |
| | | </if> |
| | | <if test="terms.readTime != null and terms.readTime !=''"> |
| | | and read_time = #{terms.readTime} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = '1' |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeHandle"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticeHandleTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeHandle"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 我参与的消息通知表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticeJoinMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeJoin"> |
| | | <result property="id" column="id"/> |
| | | <result property="taskId" column="task_id"/> |
| | | <result property="caseId" column="case_id"/> |
| | | <result property="title" column="title"/> |
| | | <result property="taskName" column="task_name"/> |
| | | <result property="taskTime" column="task_time"/> |
| | | <result property="expireTime" column="expire_time"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="visitUrl" column="visit_url"/> |
| | | <result property="readStatus" column="read_status"/> |
| | | <result property="readTime" column="read_time"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_join</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | task_id, |
| | | case_id, |
| | | title, |
| | | task_name, |
| | | task_time, |
| | | expire_time, |
| | | user_id, |
| | | user_name, |
| | | visit_url, |
| | | read_status, |
| | | read_time, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.taskId != null">task_id = #{entity.taskId},</if> |
| | | <if test="entity.caseId != null">case_id = #{entity.caseId},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.taskName != null">task_name = #{entity.taskName},</if> |
| | | <if test="entity.taskTime != null">task_time = #{entity.taskTime},</if> |
| | | <if test="entity.expireTime != null">expire_time = #{entity.expireTime},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.visitUrl != null">visit_url = #{entity.visitUrl},</if> |
| | | <if test="entity.readStatus != null">read_status = #{entity.readStatus},</if> |
| | | <if test="entity.readTime != null">read_time = #{entity.readTime},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.taskId != null and terms.taskId !=''"> |
| | | and task_id = #{terms.taskId} |
| | | </if> |
| | | <if test="terms.caseId != null and terms.caseId !=''"> |
| | | and case_id = #{terms.caseId} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.taskName != null and terms.taskName !=''"> |
| | | and task_name = #{terms.taskName} |
| | | </if> |
| | | <if test="terms.taskTime != null and terms.taskTime !=''"> |
| | | and task_time = #{terms.taskTime} |
| | | </if> |
| | | <if test="terms.expireTime != null and terms.expireTime !=''"> |
| | | and expire_time = #{terms.expireTime} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.visitUrl != null and terms.visitUrl !=''"> |
| | | and visit_url = #{terms.visitUrl} |
| | | </if> |
| | | <if test="terms.readStatus != null and terms.readStatus !=''"> |
| | | and read_status = #{terms.readStatus} |
| | | </if> |
| | | <if test="terms.readTime != null and terms.readTime !=''"> |
| | | and read_time = #{terms.readTime} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = '1' |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeJoin"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticeJoinTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeJoin"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 短信通知模板表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticeModeMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeMode"> |
| | | <result property="id" column="id"/> |
| | | <result property="modeTyep" column="mode_tyep"/> |
| | | <result property="name" column="name"/> |
| | | <result property="noticeTypeName" column="notice_type_name"/> |
| | | <result property="content" column="content"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userMobile" column="user_mobile"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_mode</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | mode_tyep, |
| | | name, |
| | | notice_type_name, |
| | | content, |
| | | user_id, |
| | | user_mobile, |
| | | user_name, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.modeTyep != null">mode_tyep = #{entity.modeTyep},</if> |
| | | <if test="entity.name != null">name = #{entity.name},</if> |
| | | <if test="entity.noticeTypeName != null">notice_type_name = #{entity.noticeTypeName},</if> |
| | | <if test="entity.content != null">content = #{entity.content},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userMobile != null">user_mobile = #{entity.userMobile},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.modeTyep != null and terms.modeTyep !=''"> |
| | | and mode_tyep = #{terms.modeTyep} |
| | | </if> |
| | | <if test="terms.name != null and terms.name !=''"> |
| | | and name = #{terms.name} |
| | | </if> |
| | | <if test="terms.noticeTypeName != null and terms.noticeTypeName !=''"> |
| | | and notice_type_name = #{terms.noticeTypeName} |
| | | </if> |
| | | <if test="terms.content != null and terms.content !=''"> |
| | | and content = #{terms.content} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userMobile != null and terms.userMobile !=''"> |
| | | and user_mobile = #{terms.userMobile} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeMode"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticeModeTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeMode"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 当事人消息通知表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticePartyMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeParty"> |
| | | <result property="id" column="id"/> |
| | | <result property="caseId" column="case_id"/> |
| | | <result property="noticeType" column="notice_type"/> |
| | | <result property="title" column="title"/> |
| | | <result property="content" column="content"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="visitUrl" column="visit_url"/> |
| | | <result property="readStatus" column="read_status"/> |
| | | <result property="readTime" column="read_time"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_party</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | case_id, |
| | | notice_type, |
| | | title, |
| | | content, |
| | | user_id, |
| | | user_name, |
| | | visit_url, |
| | | read_status, |
| | | read_time, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.caseId != null">case_id = #{entity.caseId},</if> |
| | | <if test="entity.noticeType != null">notice_type = #{entity.noticeType},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.content != null">content = #{entity.content},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.visitUrl != null">visit_url = #{entity.visitUrl},</if> |
| | | <if test="entity.readStatus != null">read_status = #{entity.readStatus},</if> |
| | | <if test="entity.readTime != null">read_time = #{entity.readTime},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.caseId != null and terms.caseId !=''"> |
| | | and case_id = #{terms.caseId} |
| | | </if> |
| | | <if test="terms.noticeType != null and terms.noticeType !=''"> |
| | | and notice_type = #{terms.noticeType} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.content != null and terms.content !=''"> |
| | | and content = #{terms.content} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.visitUrl != null and terms.visitUrl !=''"> |
| | | and visit_url = #{terms.visitUrl} |
| | | </if> |
| | | <if test="terms.readStatus != null and terms.readStatus !=''"> |
| | | and read_status = #{terms.readStatus} |
| | | </if> |
| | | <if test="terms.readTime != null and terms.readTime !=''"> |
| | | and read_time = #{terms.readTime} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = '1' |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeParty"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticePartyTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeParty"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 短信通知表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:35 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticeShortMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeShort"> |
| | | <result property="id" column="id"/> |
| | | <result property="caseId" column="case_id"/> |
| | | <result property="noticeType" column="notice_type"/> |
| | | <result property="noticeTypeName" column="notice_type_name"/> |
| | | <result property="title" column="title"/> |
| | | <result property="content" column="content"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userMobile" column="user_mobile"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="status" column="status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_short</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | case_id, |
| | | notice_type, |
| | | notice_type_name, |
| | | title, |
| | | content, |
| | | user_id, |
| | | user_mobile, |
| | | user_name, |
| | | status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.caseId != null">case_id = #{entity.caseId},</if> |
| | | <if test="entity.noticeType != null">notice_type = #{entity.noticeType},</if> |
| | | <if test="entity.noticeTypeName != null">notice_type_name = #{entity.noticeTypeName},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.content != null">content = #{entity.content},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userMobile != null">user_mobile = #{entity.userMobile},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.status != null">status = #{entity.status},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.caseId != null and terms.caseId !=''"> |
| | | and case_id = #{terms.caseId} |
| | | </if> |
| | | <if test="terms.noticeType != null and terms.noticeType !=''"> |
| | | and notice_type = #{terms.noticeType} |
| | | </if> |
| | | <if test="terms.noticeTypeName != null and terms.noticeTypeName !=''"> |
| | | and notice_type_name = #{terms.noticeTypeName} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.content != null and terms.content !=''"> |
| | | and content = #{terms.content} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userMobile != null and terms.userMobile !=''"> |
| | | and user_mobile = #{terms.userMobile} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.status != null and terms.status !=''"> |
| | | and status = #{terms.status} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeShort"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticeShortTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeShort"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 系统公告消息通知表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-11-24 10:34:35 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.notice.dao.mapper.NoticeSysMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.notice.domain.po.NoticeSys"> |
| | | <result property="id" column="id"/> |
| | | <result property="caseId" column="case_id"/> |
| | | <result property="title" column="title"/> |
| | | <result property="content" column="content"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="visitUrl" column="visit_url"/> |
| | | <result property="readStatus" column="read_status"/> |
| | | <result property="readTime" column="read_time"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_notice_sys</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | case_id, |
| | | title, |
| | | content, |
| | | user_id, |
| | | user_name, |
| | | visit_url, |
| | | read_status, |
| | | read_time, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.caseId != null">case_id = #{entity.caseId},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.content != null">content = #{entity.content},</if> |
| | | <if test="entity.userId != null">user_id = #{entity.userId},</if> |
| | | <if test="entity.userName != null">user_name = #{entity.userName},</if> |
| | | <if test="entity.visitUrl != null">visit_url = #{entity.visitUrl},</if> |
| | | <if test="entity.readStatus != null">read_status = #{entity.readStatus},</if> |
| | | <if test="entity.readTime != null">read_time = #{entity.readTime},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.caseId != null and terms.caseId !=''"> |
| | | and case_id = #{terms.caseId} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.content != null and terms.content !=''"> |
| | | and content = #{terms.content} |
| | | </if> |
| | | <if test="terms.userId != null and terms.userId !=''"> |
| | | and user_id = #{terms.userId} |
| | | </if> |
| | | <if test="terms.userName != null and terms.userName !=''"> |
| | | and user_name = #{terms.userName} |
| | | </if> |
| | | <if test="terms.visitUrl != null and terms.visitUrl !=''"> |
| | | and visit_url = #{terms.visitUrl} |
| | | </if> |
| | | <if test="terms.readStatus != null and terms.readStatus !=''"> |
| | | and read_status = #{terms.readStatus} |
| | | </if> |
| | | <if test="terms.readTime != null and terms.readTime !=''"> |
| | | and read_time = #{terms.readTime} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = '1' |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateNoticeSys"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateNoticeSysTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteNoticeSys"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeApply; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | /** |
| | | * @title: 我申请的消息通知表 |
| | | * @description: 我申请的消息通知表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:32 |
| | | * @version: 1.0.0 |
| | | * @see NoticeApply |
| | | */ |
| | | public class NoticeApplyBO extends NoticeApply { |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeHandle; |
| | | |
| | | /** |
| | | * @title: 我负责的消息通知表 |
| | | * @description: 我负责的消息通知表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:33 |
| | | * @version: 1.0.0 |
| | | * @see NoticeHandle |
| | | */ |
| | | public class NoticeHandleBO extends NoticeHandle { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeJoin; |
| | | |
| | | /** |
| | | * @title: 我参与的消息通知表 |
| | | * @description: 我参与的消息通知表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version: 1.0.0 |
| | | * @see NoticeJoin |
| | | */ |
| | | public class NoticeJoinBO extends NoticeJoin { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeMode; |
| | | |
| | | /** |
| | | * @title: 短信通知模板表 |
| | | * @description: 短信通知模板表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version: 1.0.0 |
| | | * @see NoticeMode |
| | | */ |
| | | public class NoticeModeBO extends NoticeMode { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeParty; |
| | | |
| | | /** |
| | | * @title: 当事人消息通知表 |
| | | * @description: 当事人消息通知表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version: 1.0.0 |
| | | * @see NoticeParty |
| | | */ |
| | | public class NoticePartyBO extends NoticeParty { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeShort; |
| | | |
| | | /** |
| | | * @title: 短信通知表 |
| | | * @description: 短信通知表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:35 |
| | | * @version: 1.0.0 |
| | | * @see NoticeShort |
| | | */ |
| | | public class NoticeShortBO extends NoticeShort { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.bo; |
| | | |
| | | import cn.huge.module.notice.domain.po.NoticeSys; |
| | | |
| | | /** |
| | | * @title: 系统公告消息通知表 |
| | | * @description: 系统公告消息通知表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:35 |
| | | * @version: 1.0.0 |
| | | * @see NoticeSys |
| | | */ |
| | | public class NoticeSysBO extends NoticeSys { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 我负责的消息通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:33 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Data |
| | | public class NoticeHandleDTO { |
| | | |
| | | /** |
| | | * 纠纷编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 任务编号 |
| | | */ |
| | | @TableField(value = "task_id") |
| | | private String taskId; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | } |
New file |
| | |
| | | { |
| | | "id": "我申请的消息通知编号", |
| | | "caseId": "纠纷编号", |
| | | "taskId": "任务编号", |
| | | "title": "标题", |
| | | "applyType": "申请类型", |
| | | "applyTime": "申请时间", |
| | | "applyReason": "申请理由", |
| | | "helpNames": "协助名单,多个用,隔开", |
| | | "applyStatus": "申请进度", |
| | | "userId": "接收人编号", |
| | | "userName": "接收人名称", |
| | | "visitUrl": "跳转url", |
| | | "readStatus": "已读状态,1:未读(默认值),2:已读", |
| | | "readTime": "阅读时间", |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "我负责的消息通知编号", |
| | | "caseId": "纠纷编号", |
| | | "taskId": "任务编号", |
| | | "title": "标题", |
| | | "taskName": "任务名称", |
| | | "taskTime": "任务下达时间", |
| | | "expireTime": "任务到期时间", |
| | | "userId": "接收人编号", |
| | | "userName": "接收人名称", |
| | | "visitUrl": "跳转url", |
| | | "readStatus": "已读状态,1:未读(默认值),2:已读", |
| | | "readTime": "阅读时间", |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "我参与的消息通知编号", |
| | | "taskId": "任务编号", |
| | | "caseId": "纠纷编号", |
| | | "title": "标题", |
| | | "taskName": "任务名称", |
| | | "taskTime": "任务下达时间", |
| | | "expireTime": "任务到期时间", |
| | | "userId": "接收人编号", |
| | | "userName": "接收人名称", |
| | | "visitUrl": "跳转url", |
| | | "readStatus": "已读状态,1:未读(默认值),2:已读", |
| | | "readTime": "阅读时间", |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "短信通知模板编号", |
| | | "modeTyep": "模板类型,1:调解预约模板", |
| | | "name": "模板名称", |
| | | "noticeTypeName": "通知类型名称", |
| | | "content": "模板内容", |
| | | "userId": "操作人编号", |
| | | "userMobile": "操作人手机号码", |
| | | "userName": "操作人名称", |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "我申请的消息通知编号", |
| | | "caseId": "纠纷编号", |
| | | "noticeType": "消息类型,1:系统通知,2:平台公告", |
| | | "title": "标题", |
| | | "content": "消息内容", |
| | | "userId": "接收人编号", |
| | | "userName": "接收人名称", |
| | | "visitUrl": "跳转url", |
| | | "readStatus": "已读状态,1:未读(默认值),2:已读", |
| | | "readTime": "阅读时间", |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "短信通知表编号", |
| | | "caseId": "案件编号", |
| | | "noticeType": "通消息类型,1:系统通知,2:平台公告", |
| | | "noticeTypeName": "通知类型名称", |
| | | "title": "标题", |
| | | "content": "内容", |
| | | "userId": "接收人编号", |
| | | "userMobile": "接收人手机号码", |
| | | "userName": "接收人名称", |
| | | "status": 0, |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "系统公告消息通知编号", |
| | | "caseId": "纠纷编号", |
| | | "title": "标题", |
| | | "content": "内容", |
| | | "userId": "接收人编号", |
| | | "userName": "接收人名称", |
| | | "visitUrl": "跳转url", |
| | | "readStatus": "已读状态,1:未读(默认值),2:已读", |
| | | "readTime": "阅读时间", |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 我申请的消息通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:32 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_apply") |
| | | @Data |
| | | public class NoticeApply { |
| | | |
| | | /** |
| | | * 我申请的消息通知编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 纠纷编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 任务编号 |
| | | */ |
| | | @TableField(value = "task_id") |
| | | private String taskId; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 申请类型 |
| | | */ |
| | | @TableField(value = "apply_type") |
| | | private String applyType; |
| | | |
| | | /** |
| | | * 申请时间 |
| | | */ |
| | | @TableField(value = "apply_time") |
| | | private Date applyTime; |
| | | |
| | | /** |
| | | * 申请理由 |
| | | */ |
| | | @TableField(value = "apply_reason") |
| | | private String applyReason; |
| | | |
| | | /** |
| | | * 协助名单,多个用,隔开 |
| | | */ |
| | | @TableField(value = "help_names") |
| | | private String helpNames; |
| | | |
| | | /** |
| | | * 申请进度 |
| | | */ |
| | | @TableField(value = "apply_status") |
| | | private String applyStatus; |
| | | |
| | | /** |
| | | * 接收人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 接收人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @TableField(value = "visit_url") |
| | | private String visitUrl; |
| | | |
| | | /** |
| | | * 已读状态,1:未读(默认值),2:已读 |
| | | */ |
| | | @TableField(value = "read_status") |
| | | private String readStatus; |
| | | |
| | | /** |
| | | * 阅读时间 |
| | | */ |
| | | @TableField(value = "read_time") |
| | | private Date readTime; |
| | | |
| | | /** |
| | | * 删除状态,1:未删除(默认值),99:已删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "delete_status") |
| | | private String deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 我负责的消息通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:33 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_handle") |
| | | @Data |
| | | public class NoticeHandle { |
| | | |
| | | /** |
| | | * 我负责的消息通知编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 纠纷编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 任务编号 |
| | | */ |
| | | @TableField(value = "task_id") |
| | | private String taskId; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 任务名称 |
| | | */ |
| | | @TableField(value = "task_name") |
| | | private String taskName; |
| | | |
| | | /** |
| | | * 任务下达时间 |
| | | */ |
| | | @TableField(value = "task_time") |
| | | private Date taskTime; |
| | | |
| | | /** |
| | | * 任务到期时间 |
| | | */ |
| | | @TableField(value = "expire_time") |
| | | private Date expireTime; |
| | | |
| | | /** |
| | | * 接收人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 接收人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @TableField(value = "visit_url") |
| | | private String visitUrl; |
| | | |
| | | /** |
| | | * 已读状态,1:未读(默认值),2:已读 |
| | | */ |
| | | @TableField(value = "read_status") |
| | | private String readStatus; |
| | | |
| | | /** |
| | | * 阅读时间 |
| | | */ |
| | | @TableField(value = "read_time") |
| | | private Date readTime; |
| | | |
| | | /** |
| | | * 删除状态,1:未删除(默认值),99:已删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "delete_status") |
| | | private String deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 我参与的消息通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_join") |
| | | @Data |
| | | public class NoticeJoin { |
| | | |
| | | /** |
| | | * 我参与的消息通知编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 任务编号 |
| | | */ |
| | | @TableField(value = "task_id") |
| | | private String taskId; |
| | | |
| | | /** |
| | | * 纠纷编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 任务名称 |
| | | */ |
| | | @TableField(value = "task_name") |
| | | private String taskName; |
| | | |
| | | /** |
| | | * 任务下达时间 |
| | | */ |
| | | @TableField(value = "task_time") |
| | | private Date taskTime; |
| | | |
| | | /** |
| | | * 任务到期时间 |
| | | */ |
| | | @TableField(value = "expire_time") |
| | | private Date expireTime; |
| | | |
| | | /** |
| | | * 接收人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 接收人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @TableField(value = "visit_url") |
| | | private String visitUrl; |
| | | |
| | | /** |
| | | * 已读状态,1:未读(默认值),2:已读 |
| | | */ |
| | | @TableField(value = "read_status") |
| | | private String readStatus; |
| | | |
| | | /** |
| | | * 阅读时间 |
| | | */ |
| | | @TableField(value = "read_time") |
| | | private Date readTime; |
| | | |
| | | /** |
| | | * 删除状态,1:未删除(默认值),99:已删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "delete_status") |
| | | private String deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 短信通知模板表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_mode") |
| | | @Data |
| | | public class NoticeMode { |
| | | |
| | | /** |
| | | * 短信通知模板编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 模板类型,1:调解预约模板 |
| | | */ |
| | | @TableField(value = "mode_tyep") |
| | | private String modeTyep; |
| | | |
| | | /** |
| | | * 模板名称 |
| | | */ |
| | | @TableField(value = "name") |
| | | private String name; |
| | | |
| | | /** |
| | | * 通知类型名称 |
| | | */ |
| | | @TableField(value = "notice_type_name") |
| | | private String noticeTypeName; |
| | | |
| | | /** |
| | | * 模板内容 |
| | | */ |
| | | @TableField(value = "content") |
| | | private String content; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 操作人手机号码 |
| | | */ |
| | | @TableField(value = "user_mobile") |
| | | private String userMobile; |
| | | |
| | | /** |
| | | * 操作人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 当事人消息通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_party") |
| | | @Data |
| | | public class NoticeParty { |
| | | |
| | | /** |
| | | * 我申请的消息通知编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 纠纷编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 消息类型,1:系统通知,2:平台公告 |
| | | */ |
| | | @TableField(value = "notice_type") |
| | | private String noticeType; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 消息内容 |
| | | */ |
| | | @TableField(value = "content") |
| | | private String content; |
| | | |
| | | /** |
| | | * 接收人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 接收人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @TableField(value = "visit_url") |
| | | private String visitUrl; |
| | | |
| | | /** |
| | | * 已读状态,1:未读(默认值),2:已读 |
| | | */ |
| | | @TableField(value = "read_status") |
| | | private String readStatus; |
| | | |
| | | /** |
| | | * 阅读时间 |
| | | */ |
| | | @TableField(value = "read_time") |
| | | private Date readTime; |
| | | |
| | | /** |
| | | * 删除状态,1:未删除(默认值),99:已删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "delete_status") |
| | | private String deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 短信通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:35 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_short") |
| | | @Data |
| | | public class NoticeShort { |
| | | |
| | | /** |
| | | * 短信通知表编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 案件编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 通消息类型,1:系统通知,2:平台公告 |
| | | */ |
| | | @TableField(value = "notice_type") |
| | | private String noticeType; |
| | | |
| | | /** |
| | | * 通知类型名称 |
| | | */ |
| | | @TableField(value = "notice_type_name") |
| | | private String noticeTypeName; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @TableField(value = "content") |
| | | private String content; |
| | | |
| | | /** |
| | | * 接收人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 接收人手机号码 |
| | | */ |
| | | @TableField(value = "user_mobile") |
| | | private String userMobile; |
| | | |
| | | /** |
| | | * 接收人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 状态,1:发送成功,2:发送失败 |
| | | */ |
| | | @TableField(value = "status") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 系统公告消息通知表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-11-24 10:34:35 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_notice_sys") |
| | | @Data |
| | | public class NoticeSys { |
| | | |
| | | /** |
| | | * 系统公告消息通知编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 纠纷编号 |
| | | */ |
| | | @TableField(value = "case_id") |
| | | private String caseId; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @TableField(value = "content") |
| | | private String content; |
| | | |
| | | /** |
| | | * 接收人编号 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 接收人名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @TableField(value = "visit_url") |
| | | private String visitUrl; |
| | | |
| | | /** |
| | | * 已读状态,1:未读(默认值),2:已读 |
| | | */ |
| | | @TableField(value = "read_status") |
| | | private String readStatus; |
| | | |
| | | /** |
| | | * 阅读时间 |
| | | */ |
| | | @TableField(value = "read_time") |
| | | private Date readTime; |
| | | |
| | | /** |
| | | * 删除状态,1:未删除(默认值),99:已删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "delete_status") |
| | | private String deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.notice.service; |
| | | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.notice.dao.mapper.NoticePartyMapper; |
| | | import cn.huge.module.notice.domain.po.NoticeParty; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 当事人消息通知表业务逻辑处理 |
| | | * @Description JPA的单表数据查询以由BaseService完成 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2022-11-24 10:34:34 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class NoticePartyService extends ServiceImpl<NoticePartyMapper, NoticeParty>{ |
| | | |
| | | @Autowired |
| | | private NoticePartyMapper mapper; |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | public void updateNoticeParty(NoticeParty entity){ |
| | | try{ |
| | | mapper.updateNoticeParty(entity); |
| | | }catch (Exception e){ |
| | | log.error("service方法[NoticePartyService.updateNoticeParty]调用异常:"+e, e); |
| | | throw new ServiceException("NoticePartyService.updateNoticeParty", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | public void updateNoticePartyTerms(NoticeParty entity, Map<String, Object> terms){ |
| | | try{ |
| | | mapper.updateNoticePartyTerms(entity, terms); |
| | | }catch (Exception e){ |
| | | log.error("service方法[NoticePartyService.updateNoticePartyTerms]调用异常:"+e, e); |
| | | throw new ServiceException("NoticePartyService.updateNoticePartyTerms", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | public void deleteNoticeParty(String id){ |
| | | try{ |
| | | mapper.deleteNoticeParty(id); |
| | | }catch (Exception e){ |
| | | log.error("service方法[NoticePartyService.deleteNoticeParty]调用异常:"+e, e); |
| | | throw new ServiceException("NoticePartyService.deleteNoticeParty", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 按条件查询 |
| | | * @param terms 条件 |
| | | * @return List |
| | | */ |
| | | public List<NoticeParty> listTerms(Map<String, Object> terms){ |
| | | return mapper.listTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件统计 |
| | | * @param terms 条件 |
| | | * @return long |
| | | */ |
| | | public long countTerms(Map<String, Object> terms){ |
| | | return mapper.countTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件分页查询 |
| | | * @param page 分页对象 |
| | | * @param terms 条件 |
| | | * @return Page |
| | | */ |
| | | public Page<NoticeParty> pageQuery(PageRequest page, Map<String, Object> terms){ |
| | | long total = mapper.countTerms(terms); |
| | | List<NoticeParty> content = mapper.pageTerms(page, terms); |
| | | return new PageImpl<NoticeParty>(content, page, total); |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @param noticeParty 实体对象 |
| | | */ |
| | | public void saveNoticeParty(NoticeParty noticeParty){ |
| | | try{ |
| | | Date nowDate = new Date(); |
| | | // 判断是否新增 |
| | | if (IdUtils.checkNewId(noticeParty.getId())){ |
| | | noticeParty.setId(utilsClient.getNewTimeId()); |
| | | noticeParty.setCreateTime(nowDate); |
| | | } |
| | | noticeParty.setUpdateTime(nowDate); |
| | | this.saveOrUpdate(noticeParty); |
| | | }catch (Exception e){ |
| | | log.error("service方法[NoticePartyService.saveNoticeParty]调用异常:"+e, e); |
| | | throw new ServiceException("NoticePartyService.saveNoticeParty", e); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.aop; |
| | | |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import com.alibaba.fastjson.JSON; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author zhouxiantao |
| | | * @create 2024-08-30 11:46 |
| | | */ |
| | | @Component |
| | | @Aspect |
| | | @Slf4j |
| | | public class LogAop { |
| | | @Around("execution(* cn.huge.module.*.controller.*.*.*(..))") |
| | | public Object aroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | long starttime = System.currentTimeMillis(); |
| | | Object[] objs = joinPoint.getArgs(); |
| | | try{ |
| | | log.info("start to {} {}", joinPoint.getSignature().getName(), JSON.toJSONString(objs)); |
| | | }catch (Exception e){ |
| | | log.info("start to {} 参数不能转成字符串,忽略不处理", joinPoint.getSignature().getName()); |
| | | } |
| | | Object result = joinPoint.proceed(objs); |
| | | long endtime = System.currentTimeMillis(); |
| | | try { |
| | | String resultJson = JSON.toJSONString(result); |
| | | if(ObjectUtils.isNotEmpty(result) && resultJson.length() > 1000) { |
| | | log.info("finish to {} 日志过长不打印 {}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | }else { |
| | | log.info("finish to {} {} {}ms", joinPoint.getSignature().getName(), resultJson,endtime-starttime); |
| | | } |
| | | }catch (Exception e){ |
| | | log.info("finish to {} 不能转成字符串,忽略不处理 {}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Around("execution(* cn.huge.module.*.dao.mapper.*.*(..))") |
| | | public Object aroundAdviceDao(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | long starttime = System.currentTimeMillis(); |
| | | Object[] objs = joinPoint.getArgs(); |
| | | Object result = joinPoint.proceed(objs); |
| | | long endtime = System.currentTimeMillis(); |
| | | Long times = endtime-starttime; |
| | | if(times > 2000){ |
| | | log.info("Executing sql consumes time more than 1s {} ,{}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | }else{ |
| | | log.info("Executing sql consumes time {} ,{}ms", joinPoint.getSignature().getName(),endtime-starttime); |
| | | } |
| | | return result; |
| | | } |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.controller.wechat; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.hot.domain.po.HotNews; |
| | | import cn.huge.module.hot.domain.po.HotVideo; |
| | | import cn.huge.module.hot.service.HotNewsService; |
| | | import cn.huge.module.hot.service.HotVideoService; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 热门资讯表接口api |
| | | * @description: 热门资讯表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:39 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/wechat/paHotNews") |
| | | public class PaHotNewsWechatController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private HotNewsService service; |
| | | @Autowired |
| | | private HotVideoService hotVideoService; |
| | | |
| | | /** |
| | | * 获取请求URL参数 |
| | | * @return Map<String, Object> |
| | | */ |
| | | private Map<String, Object> getParameter(){ |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 热门视频编号 |
| | | String id = request.getParameter("id"); |
| | | if (StringUtils.isNotBlank(id)){ |
| | | terms.put("id", id); |
| | | } |
| | | // 关键词 |
| | | String keyword = request.getParameter("keyword"); |
| | | if (StringUtils.isNotBlank(keyword)){ |
| | | terms.put("keyword", keyword); |
| | | } |
| | | // 标题 |
| | | String title = request.getParameter("title"); |
| | | if (StringUtils.isNotBlank(title)){ |
| | | terms.put("title", title); |
| | | } |
| | | // 内容 |
| | | String content = request.getParameter("content"); |
| | | if (StringUtils.isNotBlank(content)){ |
| | | terms.put("content", content); |
| | | } |
| | | // 来源 |
| | | String source = request.getParameter("source"); |
| | | if (StringUtils.isNotBlank(source)){ |
| | | terms.put("source", source); |
| | | } |
| | | // 查看连接 |
| | | String showUrl = request.getParameter("showUrl"); |
| | | if (StringUtils.isNotBlank(showUrl)){ |
| | | terms.put("showUrl", showUrl); |
| | | } |
| | | // 发布时间 |
| | | String pushTime = request.getParameter("pushTime"); |
| | | if (StringUtils.isNotBlank(pushTime)){ |
| | | terms.put("pushTime", pushTime); |
| | | } |
| | | // 播放量 |
| | | String playNum = request.getParameter("playNum"); |
| | | if (StringUtils.isNotBlank(playNum)){ |
| | | terms.put("playNum", playNum); |
| | | } |
| | | // 点赞量 |
| | | String goodNum = request.getParameter("goodNum"); |
| | | if (StringUtils.isNotBlank(goodNum)){ |
| | | terms.put("goodNum", goodNum); |
| | | } |
| | | // 删除状态,1:未删除,2已删除 |
| | | String deleteStatus = request.getParameter("deleteStatus"); |
| | | if (StringUtils.isNotBlank(deleteStatus)){ |
| | | terms.put("deleteStatus", deleteStatus); |
| | | } |
| | | // 客户编号 |
| | | String custId = request.getParameter("custId"); |
| | | if (StringUtils.isNotBlank(custId)){ |
| | | terms.put("custId", custId); |
| | | } |
| | | // 创建时间区间 |
| | | String createStart = request.getParameter("createStart"); |
| | | String createEnd = request.getParameter("createEnd"); |
| | | if(StringUtils.isNotBlank(createStart) && StringUtils.isNotBlank(createEnd)) { |
| | | terms.put("createStart", createStart); |
| | | terms.put("createEnd", createEnd); |
| | | } |
| | | // 更新时间区间 |
| | | String updateStart = request.getParameter("updateStart"); |
| | | String updateEnd = request.getParameter("updateEnd"); |
| | | if(StringUtils.isNotBlank(updateStart) && StringUtils.isNotBlank(updateEnd)) { |
| | | terms.put("updateStart", updateStart); |
| | | terms.put("updateEnd", updateEnd); |
| | | } |
| | | return terms; |
| | | } |
| | | |
| | | /** |
| | | * 当事人小程序-首页-查询热门资讯 |
| | | * @url {ctx}/api/weChat/paHotNews/listShow |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/listShow") |
| | | public Object listShow(@RequestParam(value = "appid") String appid) { |
| | | try { |
| | | SeCustWechatDTO seCustWechatDTO = service.getSeCustWechatByAppid(appid); |
| | | // TODO: 2022/4/29 条件 |
| | | Map<String, Object> result = Maps.newHashMap(); |
| | | Map<String, Object> terms = getParameter(); |
| | | terms.put("custId", seCustWechatDTO.getCustId()); |
| | | List<HotNews> hotNewsList = service.listTerms(terms); |
| | | result.put("hotNewsList", hotNewsList); |
| | | List<HotVideo> hotVideoList = hotVideoService.listTerms(terms); |
| | | result.put("hotVideoList", hotVideoList); |
| | | return ReturnSucUtils.getRepInfo(result); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[HotNewsController.listQuery]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.dao.mapper; |
| | | |
| | | import cn.huge.module.hot.domain.po.HotNews; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 热门资讯表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:39 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface HotNewsMapper extends BaseMapper<HotNews>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateHotNews(@Param("entity") HotNews entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateHotNewsTerms(@Param("entity") HotNews entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteHotNews(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<HotNews> |
| | | */ |
| | | List<HotNews> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<HotNews> |
| | | */ |
| | | List<HotNews> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据appid查询小程序配置 |
| | | * @param appid 小程序appid |
| | | * @return SeCustWechatDTO |
| | | */ |
| | | SeCustWechatDTO getSeCustWechatByAppid(@Param("appid") String appid); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.dao.mapper; |
| | | |
| | | import cn.huge.module.hot.domain.po.HotVideo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 热门视频表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:38 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface HotVideoMapper extends BaseMapper<HotVideo>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateHotVideo(@Param("entity") HotVideo entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateHotVideoTerms(@Param("entity") HotVideo entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteHotVideo(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<HotVideo> |
| | | */ |
| | | List<HotVideo> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<HotVideo> |
| | | */ |
| | | List<HotVideo> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 热门资讯表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-04-29 10:12:39 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.hot.dao.mapper.HotNewsMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.hot.domain.po.HotNews"> |
| | | <result property="id" column="id"/> |
| | | <result property="keyword" column="keyword"/> |
| | | <result property="title" column="title"/> |
| | | <result property="content" column="content"/> |
| | | <result property="source" column="source"/> |
| | | <result property="showUrl" column="show_url"/> |
| | | <result property="pushTime" column="push_time"/> |
| | | <result property="playNum" column="play_num"/> |
| | | <result property="goodNum" column="good_num"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_hot_news</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | keyword, |
| | | title, |
| | | content, |
| | | source, |
| | | show_url, |
| | | push_time, |
| | | play_num, |
| | | good_num, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.keyword != null">keyword = #{entity.keyword},</if> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.content != null">content = #{entity.content},</if> |
| | | <if test="entity.source != null">source = #{entity.source},</if> |
| | | <if test="entity.showUrl != null">show_url = #{entity.showUrl},</if> |
| | | <if test="entity.pushTime != null">push_time = #{entity.pushTime},</if> |
| | | <if test="entity.playNum != null">play_num = #{entity.playNum},</if> |
| | | <if test="entity.goodNum != null">good_num = #{entity.goodNum},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.keyword != null and terms.keyword !=''"> |
| | | and keyword = #{terms.keyword} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.content != null and terms.content !=''"> |
| | | and content = #{terms.content} |
| | | </if> |
| | | <if test="terms.source != null and terms.source !=''"> |
| | | and source = #{terms.source} |
| | | </if> |
| | | <if test="terms.showUrl != null and terms.showUrl !=''"> |
| | | and show_url = #{terms.showUrl} |
| | | </if> |
| | | <if test="terms.pushTime != null and terms.pushTime !=''"> |
| | | and push_time = #{terms.pushTime} |
| | | </if> |
| | | <if test="terms.playNum != null and terms.playNum !=''"> |
| | | and play_num = #{terms.playNum} |
| | | </if> |
| | | <if test="terms.goodNum != null and terms.goodNum !=''"> |
| | | and good_num = #{terms.goodNum} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = 0 |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateHotNews"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateHotNewsTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteHotNews"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | order by push_time desc |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | <!-- SeCustWechatDTO结果集 --> |
| | | <resultMap id="seCustWechatDTO" type="cn.huge.module.oper.dto.SeCustWechatDTO"> |
| | | <result property="id" column="id"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="mainId" column="main_id"/> |
| | | <result property="mainName" column="main_name"/> |
| | | <result property="mainAcc" column="main_acc"/> |
| | | <result property="mainPower" column="main_power"/> |
| | | <result property="appid" column="appid"/> |
| | | <result property="secret" column="secret"/> |
| | | <result property="token" column="token"/> |
| | | <result property="aeskey" column="aeskey"/> |
| | | <result property="msgDataFormat" column="msg_data_format"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 根据appid查询小程序配置 --> |
| | | <select id="getSeCustWechatByAppid" resultMap="seCustWechatDTO"> |
| | | SELECT |
| | | * |
| | | FROM dyh_se_cust_wechat |
| | | WHERE appid = #{appid} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 热门视频表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2022-04-29 10:12:38 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.hot.dao.mapper.HotVideoMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.hot.domain.po.HotVideo"> |
| | | <result property="id" column="id"/> |
| | | <result property="title" column="title"/> |
| | | <result property="showUrl" column="show_url"/> |
| | | <result property="pushTime" column="push_time"/> |
| | | <result property="playNum" column="play_num"/> |
| | | <result property="goodNum" column="good_num"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_hot_video</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | title, |
| | | show_url, |
| | | push_time, |
| | | play_num, |
| | | good_num, |
| | | delete_status, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.title != null">title = #{entity.title},</if> |
| | | <if test="entity.showUrl != null">show_url = #{entity.showUrl},</if> |
| | | <if test="entity.pushTime != null">push_time = #{entity.pushTime},</if> |
| | | <if test="entity.playNum != null">play_num = #{entity.playNum},</if> |
| | | <if test="entity.goodNum != null">good_num = #{entity.goodNum},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.title != null and terms.title !=''"> |
| | | and title = #{terms.title} |
| | | </if> |
| | | <if test="terms.showUrl != null and terms.showUrl !=''"> |
| | | and show_url = #{terms.showUrl} |
| | | </if> |
| | | <if test="terms.pushTime != null and terms.pushTime !=''"> |
| | | and push_time = #{terms.pushTime} |
| | | </if> |
| | | <if test="terms.playNum != null and terms.playNum !=''"> |
| | | and play_num = #{terms.playNum} |
| | | </if> |
| | | <if test="terms.goodNum != null and terms.goodNum !=''"> |
| | | and good_num = #{terms.goodNum} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = 0 |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateHotVideo"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateHotVideoTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteHotVideo"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | order by push_time desc |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package cn.huge.module.hot.domain.bo; |
| | | |
| | | import cn.huge.module.hot.domain.po.HotNews; |
| | | |
| | | /** |
| | | * @title: 热门资讯表 |
| | | * @description: 热门资讯表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:39 |
| | | * @version: 1.0.0 |
| | | * @see HotNews |
| | | */ |
| | | public class HotNewsBO extends HotNews { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.domain.bo; |
| | | |
| | | import cn.huge.module.hot.domain.po.HotVideo; |
| | | |
| | | /** |
| | | * @title: 热门视频表 |
| | | * @description: 热门视频表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:38 |
| | | * @version: 1.0.0 |
| | | * @see HotVideo |
| | | */ |
| | | public class HotVideoBO extends HotVideo { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | { |
| | | "id": "热门视频编号", |
| | | "keyword": "关键词", |
| | | "title": "标题", |
| | | "content": "内容", |
| | | "source": "来源", |
| | | "showUrl": "查看连接", |
| | | "pushTime": "发布时间", |
| | | "playNum": 0, |
| | | "goodNum": 0, |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | { |
| | | "id": "热门视频编号", |
| | | "title": "标题", |
| | | "showUrl": "查看连接", |
| | | "pushTime": "发布时间", |
| | | "playNum": 0, |
| | | "goodNum": 0, |
| | | "custId": "客户编号", |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 热门资讯表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:39 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_hot_news") |
| | | @Data |
| | | public class HotNews { |
| | | |
| | | /** |
| | | * 热门视频编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 关键词 |
| | | */ |
| | | @TableField(value = "keyword") |
| | | private String keyword; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @TableField(value = "content") |
| | | private String content; |
| | | |
| | | /** |
| | | * 来源 |
| | | */ |
| | | @TableField(value = "source") |
| | | private String source; |
| | | |
| | | /** |
| | | * 查看连接 |
| | | */ |
| | | @TableField(value = "show_url") |
| | | private String showUrl; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @TableField(value = "push_time") |
| | | private Date pushTime; |
| | | |
| | | /** |
| | | * 播放量 |
| | | */ |
| | | @TableField(value = "play_num") |
| | | private Integer playNum; |
| | | |
| | | /** |
| | | * 点赞量 |
| | | */ |
| | | @TableField(value = "good_num") |
| | | private Integer goodNum; |
| | | |
| | | /** |
| | | * 删除状态,0:未删除,1已删除 |
| | | */ |
| | | @TableLogic(value = "0",delval = "1") |
| | | @TableField(value = "delete_status") |
| | | private Integer deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 热门视频表 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2022-04-29 10:12:38 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_hot_video") |
| | | @Data |
| | | public class HotVideo { |
| | | |
| | | /** |
| | | * 热门视频编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 查看连接 |
| | | */ |
| | | @TableField(value = "show_url") |
| | | private String showUrl; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @TableField(value = "push_time") |
| | | private Date pushTime; |
| | | |
| | | /** |
| | | * 播放量 |
| | | */ |
| | | @TableField(value = "play_num") |
| | | private Integer playNum; |
| | | |
| | | /** |
| | | * 点赞量 |
| | | */ |
| | | @TableField(value = "good_num") |
| | | private Integer goodNum; |
| | | |
| | | /** |
| | | * 删除状态,0:未删除,1已删除 |
| | | */ |
| | | @TableLogic(value = "0",delval = "1") |
| | | @TableField(value = "delete_status") |
| | | private Integer deleteStatus; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.service; |
| | | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.hot.dao.mapper.HotNewsMapper; |
| | | import cn.huge.module.hot.domain.po.HotNews; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 热门资讯表业务逻辑处理 |
| | | * @Description JPA的单表数据查询以由BaseService完成 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2022-04-29 10:12:39 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class HotNewsService extends ServiceImpl<HotNewsMapper, HotNews>{ |
| | | |
| | | @Autowired |
| | | private HotNewsMapper mapper; |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | public void updateHotNews(HotNews entity){ |
| | | try{ |
| | | mapper.updateHotNews(entity); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotNewsService.updateHotNews]调用异常:"+e, e); |
| | | throw new ServiceException("HotNewsService.updateHotNews", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | public void updateHotNewsTerms(HotNews entity, Map<String, Object> terms){ |
| | | try{ |
| | | mapper.updateHotNewsTerms(entity, terms); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotNewsService.updateHotNewsTerms]调用异常:"+e, e); |
| | | throw new ServiceException("HotNewsService.updateHotNewsTerms", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | public void deleteHotNews(String id){ |
| | | try{ |
| | | mapper.deleteHotNews(id); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotNewsService.deleteHotNews]调用异常:"+e, e); |
| | | throw new ServiceException("HotNewsService.deleteHotNews", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 按条件查询 |
| | | * @param terms 条件 |
| | | * @return List |
| | | */ |
| | | public List<HotNews> listTerms(Map<String, Object> terms){ |
| | | return mapper.listTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件统计 |
| | | * @param terms 条件 |
| | | * @return long |
| | | */ |
| | | public long countTerms(Map<String, Object> terms){ |
| | | return mapper.countTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件分页查询 |
| | | * @param page 分页对象 |
| | | * @param terms 条件 |
| | | * @return Page |
| | | */ |
| | | public Page<HotNews> pageQuery(PageRequest page, Map<String, Object> terms){ |
| | | long total = mapper.countTerms(terms); |
| | | List<HotNews> content = mapper.pageTerms(page, terms); |
| | | return new PageImpl<HotNews>(content, page, total); |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @param hotNews 实体对象 |
| | | */ |
| | | public void saveHotNews(HotNews hotNews){ |
| | | try{ |
| | | Date nowDate = new Date(); |
| | | // 判断是否新增 |
| | | if (IdUtils.checkNewId(hotNews.getId())){ |
| | | hotNews.setId(utilsClient.getNewTimeId()); |
| | | hotNews.setCreateTime(nowDate); |
| | | } |
| | | hotNews.setUpdateTime(nowDate); |
| | | this.saveOrUpdate(hotNews); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotNewsService.saveHotNews]调用异常:"+e, e); |
| | | throw new ServiceException("HotNewsService.saveHotNews", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据appid查询小程序配置 |
| | | * @param appid 小程序appid |
| | | * @return SeCustWechatDTO |
| | | */ |
| | | public SeCustWechatDTO getSeCustWechatByAppid(@Param("appid") String appid){ |
| | | return mapper.getSeCustWechatByAppid(appid); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.hot.service; |
| | | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.hot.dao.mapper.HotVideoMapper; |
| | | import cn.huge.module.hot.domain.po.HotVideo; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 热门视频表业务逻辑处理 |
| | | * @Description JPA的单表数据查询以由BaseService完成 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2022-04-29 10:12:38 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class HotVideoService extends ServiceImpl<HotVideoMapper, HotVideo>{ |
| | | |
| | | @Autowired |
| | | private HotVideoMapper mapper; |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | public void updateHotVideo(HotVideo entity){ |
| | | try{ |
| | | mapper.updateHotVideo(entity); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotVideoService.updateHotVideo]调用异常:"+e, e); |
| | | throw new ServiceException("HotVideoService.updateHotVideo", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | public void updateHotVideoTerms(HotVideo entity, Map<String, Object> terms){ |
| | | try{ |
| | | mapper.updateHotVideoTerms(entity, terms); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotVideoService.updateHotVideoTerms]调用异常:"+e, e); |
| | | throw new ServiceException("HotVideoService.updateHotVideoTerms", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | public void deleteHotVideo(String id){ |
| | | try{ |
| | | mapper.deleteHotVideo(id); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotVideoService.deleteHotVideo]调用异常:"+e, e); |
| | | throw new ServiceException("HotVideoService.deleteHotVideo", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 按条件查询 |
| | | * @param terms 条件 |
| | | * @return List |
| | | */ |
| | | public List<HotVideo> listTerms(Map<String, Object> terms){ |
| | | return mapper.listTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件统计 |
| | | * @param terms 条件 |
| | | * @return long |
| | | */ |
| | | public long countTerms(Map<String, Object> terms){ |
| | | return mapper.countTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件分页查询 |
| | | * @param page 分页对象 |
| | | * @param terms 条件 |
| | | * @return Page |
| | | */ |
| | | public Page<HotVideo> pageQuery(PageRequest page, Map<String, Object> terms){ |
| | | long total = mapper.countTerms(terms); |
| | | List<HotVideo> content = mapper.pageTerms(page, terms); |
| | | return new PageImpl<HotVideo>(content, page, total); |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @param hotVideo 实体对象 |
| | | */ |
| | | public void saveHotVideo(HotVideo hotVideo){ |
| | | try{ |
| | | Date nowDate = new Date(); |
| | | // 判断是否新增 |
| | | if (IdUtils.checkNewId(hotVideo.getId())){ |
| | | hotVideo.setId(utilsClient.getNewTimeId()); |
| | | hotVideo.setCreateTime(nowDate); |
| | | } |
| | | hotVideo.setUpdateTime(nowDate); |
| | | this.saveOrUpdate(hotVideo); |
| | | }catch (Exception e){ |
| | | log.error("service方法[HotVideoService.saveHotVideo]调用异常:"+e, e); |
| | | throw new ServiceException("HotVideoService.saveHotVideo", e); |
| | | } |
| | | } |
| | | |
| | | } |