1、日报补卡 2消息日报补卡
This commit is contained in:
		| @ -19,10 +19,11 @@ public class WgzAndBgtMessageConstant { | ||||
| 	public static final  String LARGE_APPLY = "0"; //大类型-报名 | ||||
| 	public static final  String LARGE_SALARY = "1"; //大类型-工资 | ||||
| 	public static final  String LARGE_OTHER = "2";	//大类型-其它 | ||||
| 	public static final  String SMALL_CARD = "0"; //小类型-补卡 | ||||
| 	public static final  String SMALL_CARD = "0"; //小类型-考勤补卡 | ||||
| 	public static final  String SMALL_SYSTEM = "1"; //小类型-系统 | ||||
| 	public static final  String SMALL_EXIT = "2"; //小类型-退场 | ||||
| 	public static final  String SMALL_LEAVE = "3"; //小类型-请假 | ||||
| 	public static final  String SMALL_DAILY = "4"; //小类型-日报补卡 | ||||
|  | ||||
|  | ||||
| 	/** | ||||
| @ -61,6 +62,9 @@ public class WgzAndBgtMessageConstant { | ||||
| 	//【请假超时】17-18 | ||||
| 	public static final String WGZ_SYSTEM_HEADLINE_TIMEOUT = "您【%s】的请假审批已超时未审核!"; | ||||
| 	public static final String WGZ_SYSTEM_SUBHEADING_TIMEOUT = "您在【%s】的请假审批流程未走完,现已超时取消,请注意核对!"; | ||||
| 	//【日报补卡】19-20 | ||||
| 	public static final String WGZ_SYSTEM_HEADLINE_DAILY = "您成功发送【%s】日的日报补卡!"; | ||||
| 	public static final String WGZ_SYSTEM_SUBHEADING_DAILY = "您在【%s】日的日报补卡已成功发起!"; | ||||
| 	/** | ||||
| 	 * 务工者给包工头提示 | ||||
| 	 */ | ||||
| @ -79,6 +83,9 @@ public class WgzAndBgtMessageConstant { | ||||
| 	//【工资结算】9-10 | ||||
| 	public static final String WGZ_HEADLINE_PAYCALCULATION = "务工者【%s】正在向你发起工资结算!"; | ||||
| 	public static final String WGZ__SUBHEADING_PAYCALCULATION = "务工者【%s】向你发起为期【%s】天,金额为【%s】圆整的工资结算操作!"; | ||||
| 	//【日报补卡】11-12 | ||||
| 	public static final String WGZ_HEADLINE_DAILY = "务工者【%s】正在向你发起【%s】日的日报补卡!"; | ||||
| 	public static final String WGZ__SUBHEADING_DAILY = "务工者【%s】向你发起【%s】日的日报补卡,请注意查收处理!"; | ||||
|  | ||||
| 	//务工者消息返回 | ||||
| 	public static String wgzMessage(Map<String, String> mp, String type) { | ||||
| @ -125,6 +132,10 @@ public class WgzAndBgtMessageConstant { | ||||
| 				return String.format(WGZ_SYSTEM_HEADLINE_TIMEOUT,mp.get("data")); | ||||
| 			case "118": | ||||
| 				return String.format(WGZ_SYSTEM_SUBHEADING_TIMEOUT, mp.get("data")); | ||||
| 			case "119": | ||||
| 				return String.format(WGZ_SYSTEM_HEADLINE_DAILY,mp.get("data")); | ||||
| 			case "120": | ||||
| 				return String.format(WGZ_SYSTEM_SUBHEADING_DAILY, mp.get("data")); | ||||
| 			//务工者向包工头申请报名 | ||||
| 			case "201": | ||||
| 				return String.format(WGZ_HEADLINE_APPLY, mp.get("userName"), mp.get("post")); | ||||
| @ -150,6 +161,11 @@ public class WgzAndBgtMessageConstant { | ||||
| 				return String.format(WGZ_HEADLINE_PAYCALCULATION, mp.get("userName")); | ||||
| 			case "210": | ||||
| 				return String.format(WGZ__SUBHEADING_PAYCALCULATION, mp.get("userName"),mp.get("num"),mp.get("money")); | ||||
| 			//务工者向包工头发起日报补卡 | ||||
| 			case "211": | ||||
| 				return String.format(WGZ_HEADLINE_DAILY, mp.get("userName"),mp.get("data")); | ||||
| 			case "212": | ||||
| 				return String.format(WGZ__SUBHEADING_DAILY, mp.get("userName"),mp.get("data")); | ||||
| 			default: | ||||
| 				return "未知类型"; | ||||
| 		} | ||||
|  | ||||
| @ -19,6 +19,8 @@ import java.time.LocalDateTime; | ||||
| @Accessors(chain = true) | ||||
| @ApiModel("日报打卡请求对象") | ||||
| public class WgzAppDailyClockReq implements Serializable { | ||||
| 	@ApiModelProperty("日报状态(0正常 1补卡)") | ||||
| 	private String status; | ||||
|  | ||||
| 	@ApiModelProperty("今日完成工作") | ||||
| 	private String finishToday; | ||||
|  | ||||
| @ -106,6 +106,11 @@ public class WgzDailyClock implements Serializable { | ||||
|     @ApiModelProperty("未审核|审核时间") | ||||
|     private LocalDateTime auditorTime; | ||||
|  | ||||
| 	/** 日报状态(0正常 1补卡) */ | ||||
| 	@Excel(name = "日报状态(0正常 1补卡)" , readConverterExp = "0=正常,1=补卡") | ||||
| 	@ApiModelProperty("日报状态(0正常 1补卡)") | ||||
| 	private String status; | ||||
|  | ||||
|     /** 删除标志(0代表存在 2代表删除) */ | ||||
|     @Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除") | ||||
|     @ApiModelProperty("删除标志(0代表存在 2代表删除)") | ||||
|  | ||||
| @ -6,15 +6,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; | ||||
| import com.ruoyi.bgt.domain.BgtMessage; | ||||
| import com.ruoyi.bgt.domain.BgtProjectRecruit; | ||||
| import com.ruoyi.bgt.domain.BgtProjectRecruitApply; | ||||
| import com.ruoyi.bgt.domain.dto.BgtDailyClockListDTO; | ||||
| import com.ruoyi.bgt.domain.dto.BgtDailyClockUpdateDTO; | ||||
| import com.ruoyi.bgt.domain.vo.BgtDailyClockDetailVO; | ||||
| import com.ruoyi.bgt.domain.vo.BgtDailyClockListVO; | ||||
| import com.ruoyi.bgt.service.IBgtMessageService; | ||||
| import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; | ||||
| import com.ruoyi.bgt.service.IBgtProjectRecruitService; | ||||
| import com.ruoyi.bgt.service.IBgtUserService; | ||||
| import com.ruoyi.common.constants.WgzAndBgtMessageConstant; | ||||
| import com.ruoyi.common.core.domain.entity.BgtUser; | ||||
| import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; | ||||
| import com.ruoyi.common.core.page.TableDataInfo; | ||||
| @ -29,18 +33,29 @@ import com.ruoyi.wgz.bo.res.WgzAppUserDailyRecordRes; | ||||
| import com.ruoyi.wgz.bo.res.WgzUserDailyCalendarRes; | ||||
| import com.ruoyi.wgz.bo.rests.WgzAppAttachmentAcquisitionTwo; | ||||
| import com.ruoyi.wgz.domain.WgzDailyClock; | ||||
| import com.ruoyi.wgz.domain.WgzMessage; | ||||
| import com.ruoyi.wgz.domain.WgzReissueacard; | ||||
| import com.ruoyi.wgz.domain.WgzUser; | ||||
| import com.ruoyi.wgz.mapper.WgzDailyClockMapper; | ||||
| import com.ruoyi.wgz.service.IWgzDailyClockService; | ||||
| import com.ruoyi.wgz.service.IWgzLeaveService; | ||||
| import com.ruoyi.wgz.service.IWgzMessageService; | ||||
| import com.ruoyi.wgz.service.IWgzUserService; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.time.LocalDate; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.temporal.TemporalAdjusters; | ||||
| import java.util.*; | ||||
|  | ||||
| import static com.ruoyi.common.constants.BgtMessageConstant.BGT_SMALL_MAKE_UP; | ||||
| import static com.ruoyi.common.constants.BgtMessageConstant.BGT_TYPE_SIGN_UP; | ||||
| import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*; | ||||
| import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.USERTYPE_BGT; | ||||
|  | ||||
| /** | ||||
|  * 日报打卡Service业务层处理 | ||||
|  * | ||||
| @ -67,6 +82,15 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe | ||||
| 	@Autowired | ||||
| 	private IBgtUserService iBgtUserService; | ||||
|  | ||||
| 	@Autowired | ||||
| 	private IWgzUserService wgzUserService; | ||||
|  | ||||
| 	@Autowired | ||||
| 	private IWgzMessageService iWgzMessageService; | ||||
|  | ||||
| 	@Autowired | ||||
| 	private IBgtMessageService iBgtMessageService; | ||||
|  | ||||
|     @Override | ||||
|     public WgzDailyClock queryById(Long id){ | ||||
|         return getById(id); | ||||
| @ -196,6 +220,7 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	@Transactional | ||||
| 	public Boolean userDailyClock(WgzAppDailyClockReq req) { | ||||
| 		//1、获取当前人、当前工的上下班时间范围 | ||||
| 		Long appUserId = SecurityUtils.getAppUserId(); | ||||
| @ -204,11 +229,48 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe | ||||
| 		//1、组装数据 | ||||
| 		WgzDailyClock dc = new WgzDailyClock(); | ||||
| 		BeanUtils.copyProperties(req,dc); | ||||
| 		dc.setStatus(req.getStatus()); | ||||
| 		dc.setRecruitId(appUserId); | ||||
| 		dc.setUserId(appUserId); | ||||
| 		dc.setDilyTime(LocalDateTime.now()); | ||||
| 		dc.setAuditorUserId(appById.getUserId()); | ||||
| 		return baseMapper.insert(dc) > 0; | ||||
| 		int insert = baseMapper.insert(dc); | ||||
| 		//2、插入成功,且状态为1,那么就需要发送消息给【补日报】的人和上级【招工】 | ||||
| 		if ( insert > 0 && req.getStatus().equals("1")){ | ||||
| 			WgzUser byId = wgzUserService.findByUserId(appUserId); | ||||
| 			Map<String, String> mp = new HashMap<>(); | ||||
| 			mp.put("data",String.valueOf(LocalDate.now())); | ||||
| 			WgzMessage wgzMessage = new WgzMessage(). | ||||
| 				setSenderType(USERTYPE_SYSTEM). | ||||
| 				setRecipientType(USERTYPE_WGZ). | ||||
| 				setRecipientId(appUserId). | ||||
| 				setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"119")). | ||||
| 				setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"120")). | ||||
| 				setTableId(dc.getId()). | ||||
| 				setTableName(SqlHelper.table(WgzDailyClock.class).getTableName()). | ||||
| 				setMessageLargeType(LARGE_OTHER). | ||||
| 				setMessageSmallType(SMALL_DAILY); | ||||
| 			if (!iWgzMessageService.sendAMessage(wgzMessage)){ | ||||
| 				throw new RuntimeException("系统日报补卡消息发送失败!"); | ||||
| 			} | ||||
| 			BgtMessage bgtMessage = new BgtMessage(). | ||||
| 				setSenderType(USERTYPE_WGZ). | ||||
| 				setSenderId(appUserId). | ||||
| 				setRecipientType(USERTYPE_BGT). | ||||
| 				setRecipientId(appById.getUserId()). | ||||
| 				setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"211")). | ||||
| 				setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"212")). | ||||
| 				setTableId(dc.getId()). | ||||
| 				setTableName(SqlHelper.table(WgzDailyClock.class).getTableName()). | ||||
| 				setMessageLargeType(BGT_TYPE_SIGN_UP). | ||||
| 				setMessageSmallType(BGT_SMALL_MAKE_UP); | ||||
| 			if (!iBgtMessageService.sendAMessage(bgtMessage)){ | ||||
| 				throw new RuntimeException("发送日报补卡消息失败!"); | ||||
| 			} | ||||
| 			return true; | ||||
| 		}else{ | ||||
| 			return false; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
|  | ||||
| @ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             bgt_project_recruit as b | ||||
|             LEFT JOIN fbs_project_task as c ON (c.id = b.task_id) | ||||
|         WHERE | ||||
|             b.recruit_end_time <=  DATE_FORMAT(now(),'%Y-%m-%d') AND | ||||
|             DATE_FORMAT(NOW(), '%Y-%m-%d') BETWEEN b.recruit_begin_time AND b.recruit_end_time and | ||||
|             b.id not in (SELECT recruit_id FROM bgt_project_recruit_apply WHERE user_id = #{req.userId})and | ||||
|             b.del_flag = 0 | ||||
|         order by b.create_time desc | ||||
|  | ||||
		Reference in New Issue
	
	Block a user