Merge remote-tracking branch 'origin/origin/Three' into develop_master

This commit is contained in:
yuezhihang
2021-11-13 10:17:02 +08:00
11 changed files with 434 additions and 0 deletions
@@ -402,4 +402,7 @@ public interface workFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlock",method = RequestMethod.GET)
List<BusProcessNew> everyDayTenOlock();
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlockSAM",method = RequestMethod.GET)
List<BusProcessNew> everyDayTenOlockSAM();
}
@@ -11,6 +11,7 @@ import com.adc.da.sys.entity.UserEO;
import com.adc.da.sys.service.IUserEOService;
import com.adc.da.workFlow.controller.WorkFlowController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -185,10 +186,39 @@ public class ProcessTimer {
}
}
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
// @Scheduled(cron = "*/40 * * * * ? ")//20s
public void everyDayTenOlockScanSAM() {
List<BusProcessNew> busProcessNews=new ArrayList<>();
busProcessNews=workFlowFeignClient.everyDayTenOlockSAM();
if (!busProcessNews.isEmpty()){
for (BusProcessNew bus:busProcessNews) {
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
String taskInfo = bus.getTaskInfo();
String result = jsonObject.getJSONObject("roleList").getString("dockUser");
result = result.split(",")[0];
jsonObject.put("member",result);
if(taskInfo.equals("标准化活动参会流程-流程结束")){
jsonObject.put("auto","1");
ResponseMessage responseMessage = workFlowController.startProcessNew("22",result,null);
BusMes busMes=new BusMes();
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
busMes.setJson(jsonObject.toJSONString());
busMes.setUserId(result);
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
System.out.println("标准化活动会后流程自动发起");
}
}
}
}
public static void main(String[]args){
ProcessTimer processTimer = new ProcessTimer();
processTimer.everyDayTenOlockScan();
processTimer.everyDayTenOlockScanSAM();
}
}
@@ -0,0 +1,69 @@
package com.adc.da.slrs.sapMeetInfo.controller;
import com.adc.da.slrs.sapMeetInfo.service.ISapMeetingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.sapMeetInfo.entity.SapMeeting;
import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController;
import java.util.Date;
import java.util.List;
/**
* <p>
* 流程通过的 标准化活动会议信息表
standard_activity_pass
前端控制器
* </p>
*
* @author zcr
* @since 2021-11-09
*/
@RestController
@Api(description = "|SapMeeting|")
@RequestMapping("/api/sapMeetInfo")
public class SapMeetingController extends BaseController<SapMeeting> {
@Autowired
ISapMeetingService sapMeetingService;
@ApiOperation(value = "id查询会议信息")
@GetMapping("/getOneById")
public SapMeeting getOneById(String id){
return sapMeetingService.getMeetingById(id);
}
@ApiOperation(value = "获取日历显示会议信息")
@GetMapping("/getDateMeeting")
public int getDateMeeting(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date, String id,int type){
return sapMeetingService.getDateMeeting(date,id,type);
}
@ApiOperation(value = "获取当月")
@GetMapping("/getMeetingsByMonth")
public List<SapMeeting> getMeetingsByMonth(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date){
return sapMeetingService.getMeetingsByMonth(date);
}
@ApiOperation(value = "获取当月,根据标志位type区分 1标准活动和2政策课题")
@GetMapping("/getMeetingsByMonthType")
public List<SapMeeting> getMeetingsByMonthType(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date,int type){
return sapMeetingService.getMeetingsByMonth(date, type);
}
@ApiOperation(value = "获取当天")
@GetMapping("/getMeetingsByDate")
public List<SapMeeting> getMeetingsByDate(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date,int type){
return sapMeetingService.getMeetingsByDate(date,type);
}
@ApiOperation(value = "插入")
@PostMapping("/addMeeting")
public int addMeeting(@RequestBody SapMeeting sapMeeting){
return sapMeetingService.addMeeting(sapMeeting);
}
}
@@ -0,0 +1,43 @@
package com.adc.da.slrs.sapMeetInfo.dao;
import com.adc.da.slrs.sapMeetInfo.entity.SapMeeting;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* 流程通过的 标准化活动会议信息表
standard_activity_pass
Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-11-09
*/
@Repository
public interface SapMeetingDao extends BaseMapper<SapMeeting> {
int insertMeeting(SapMeeting sapMeeting);//参会流程结束--插入
List<SapMeeting> selectMeetingsByDate(Map map);//根据日期查找-当日所有会议(时间正序)
List<SapMeeting> selectMeetingsByMonth(Date date);//根据年,月查找
List<SapMeeting> selectMeetingsByMonthType(Map map);//根据年,月查找,type标志位 1标准化活动 2政策课题组
SapMeeting selectMeetingById(String id);
int deleteById(String id);
int deleteByDate(Date date);
int updateMeeting(SapMeeting sapMeeting);
}
@@ -0,0 +1,47 @@
package com.adc.da.slrs.sapMeetInfo.entity;
import com.adc.da.base.entity.BaseEntity;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
/**
* <p>
* 流程通过的 标准化活动会议信息表
standard_activity_pass
* </p>
*
* @author super_liu
* @since 2021-11-09
*/
@Data
@Accessors(chain = true)
@ToString
@ApiModel(value="SapMeeting对象", description="流程通过的 标准化活动会议信息表 standard_activity_pass")
public class SapMeeting{
private static final long serialVersionUID = 1L;
private String id;//主键-会议id
private String title;//会议标题
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date date;//会议开始时间
private String content;//会议内容大纲
private int type;//标志位--1标准化活动会议,0政策组会议
private String attend;//参与人 {id,name} json
private String files;//附件 json
}
@@ -0,0 +1,38 @@
package com.adc.da.slrs.sapMeetInfo.service;
import com.adc.da.slrs.sapMeetInfo.entity.SapMeeting;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Date;
import java.util.List;
/**
* <p>
* 流程通过的 标准化活动会议信息表
standard_activity_pass
服务类
* </p>
*
* @author super_liu
* @since 2021-11-09
*/
public interface ISapMeetingService extends IService<SapMeeting> {
int addMeeting(SapMeeting sapMeeting);//参会流程结束--插入
List<SapMeeting> getMeetingsByDate(Date date,int type);//根据日期查找-当日所有会议(时间正序)
List<SapMeeting> getMeetingsByMonth(Date date);//根据年,月查找
List<SapMeeting> getMeetingsByMonth(Date date,int type);//根据年,月查找
int getDateMeeting(Date date,String id,int type);
SapMeeting getMeetingById(String id);
int delById(String id);
int delByDate(Date date);
int modMeeting(SapMeeting sapMeeting);
}
@@ -0,0 +1,112 @@
package com.adc.da.slrs.sapMeetInfo.service.impl;
import com.adc.da.slrs.sapMeetInfo.entity.SapMeeting;
import com.adc.da.slrs.sapMeetInfo.dao.SapMeetingDao;
import com.adc.da.slrs.sapMeetInfo.service.ISapMeetingService;
import com.adc.da.util.UUIDUtils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 流程通过的 标准化活动会议信息表
standard_activity_pass
服务实现类
* </p>
*
* @author super_liu
* @since 2021-11-09
*/
@Service
public class SapMeetingServiceImpl extends ServiceImpl<SapMeetingDao, SapMeeting> implements ISapMeetingService {
@Autowired
SapMeetingDao sapMeetingDao;
@Override
public int addMeeting(SapMeeting sapMeeting) {
sapMeeting.setId(UUIDUtils.randomUUID(30));
return sapMeetingDao.insertMeeting(sapMeeting);
}
@Override
public List<SapMeeting> getMeetingsByDate(Date date,int type) {
Map map = new HashMap();
map.put("date",date);
map.put("type",type);
return sapMeetingDao.selectMeetingsByDate(map);
}
@Override
public List<SapMeeting> getMeetingsByMonth(Date date) {
List<SapMeeting> sapMeetings = sapMeetingDao.selectMeetingsByMonth(date);
return sapMeetings;
}
@Override
public List<SapMeeting> getMeetingsByMonth(Date date, int type) {
Map map = new HashMap();
map.put("date",date);
map.put("type",type);
return sapMeetingDao.selectMeetingsByMonthType(map);
}
@Override
public int getDateMeeting(Date date,String id,int type) {
Map map = new HashMap();
map.put("type",type);
map.put("date",date);
List<SapMeeting> sapMeetings = sapMeetingDao.selectMeetingsByDate(map);
int rat = 0;//标志位 0无会议;1有会议;2有会议且有自己参会的会议
if(sapMeetings.isEmpty()){
rat = 1;
}else if(hasOwnMeeting(id,sapMeetings)){
rat = 2;
}
return rat;
}
@Override
public SapMeeting getMeetingById(String id) {
return sapMeetingDao.selectMeetingById(id);
}
@Override
public int delById(String id) {
return sapMeetingDao.deleteById(id);
}
@Override
public int delByDate(Date date) {
return sapMeetingDao.deleteByDate(date);
}
@Override
public int modMeeting(SapMeeting sapMeeting) {
return sapMeetingDao.updateMeeting(sapMeeting);
}
boolean hasOwnMeeting(String id,List<SapMeeting> sapMeetings){
for(SapMeeting sapMeeting : sapMeetings){
JSONObject jsonObject = JSONObject.parseObject(sapMeeting.getAttend());
String a = jsonObject.getString("id");
if(a.contains("[") && a.contains("]")){
a.substring(1,a.length()-1);
}
String[] split = a.trim().split(",");
for (String s : split) {
if (s.equals(id)) {
return true;
}
}
}
return false;
}
}
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sapMeetInfo.dao.SapMeetingDao">
<sql id="BaseSelect">
id,title,date,content,type,attend,files
</sql>
<sql id="Search">
type = #{type}
</sql>
<insert id="insertMeeting" parameterType="com.adc.da.slrs.sapMeetInfo.entity.SapMeeting">
insert into sap_meeting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="title != null">title,</if>
<if test="date != null">date,</if>
<if test="content != null">content,</if>
<if test="type != null">type,</if>
<if test="attend != null">attend,</if>
<if test="files != null">files,</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="title != null">#{title},</if>
<if test="date != null">#{date},</if>
<if test="content != null">#{content},</if>
<if test="type != null">#{type},</if>
<if test="attend != null">#{attend},</if>
<if test="files != null">#{files},</if>
</trim>
</insert>
<select id="selectMeetingsByDate" resultType="com.adc.da.slrs.sapMeetInfo.entity.SapMeeting" parameterType="java.util.Map">
select <include refid="BaseSelect"></include>
from sap_meeting
where date_format(date,'%Y%m%d') = date_format(#{date},'%Y%m%d')
and <include refid="Search"></include>
order by date
</select>
<select id="selectMeetingsByMonth" resultType="com.adc.da.slrs.sapMeetInfo.entity.SapMeeting" parameterType="java.util.Date">
select <include refid="BaseSelect"></include>
from sap_meeting
where DATE_FORMAT(date,'%Y-%m')=DATE_FORMAT(#{date},'%Y-%m')
and type = 1
</select>
<select id="selectMeetingsByMonthType" resultType="com.adc.da.slrs.sapMeetInfo.entity.SapMeeting" parameterType="java.util.Map">
select <include refid="BaseSelect"></include>
from sap_meeting
where DATE_FORMAT(date,'%Y-%m')=DATE_FORMAT(#{date},'%Y-%m')
and <include refid="Search"></include>
</select>
<select id="selectMeetingById" resultType="com.adc.da.slrs.sapMeetInfo.entity.SapMeeting" parameterType="java.lang.String">
select <include refid="BaseSelect"></include>
from sap_meeting
where id = #{id}
and <include refid="Search"></include>
</select>
<delete id="deleteById">
</delete>
<delete id="deleteByDate">
</delete>
<update id="updateMeeting">
</update>
</mapper>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.spaMeetInfo.dao.SapAttendeeDao">
</mapper>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.spaMeetInfo.dao.SapFilesDao">
</mapper>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.spaMeetInfo.dao.SapMeetingDao">
</mapper>