3.20优化
This commit is contained in:
		@ -368,7 +368,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		int insert = baseMapper.insert(bgtProjectRecruitApply);
 | 
			
		||||
		//4、发送消息
 | 
			
		||||
		if (insert > 0) {
 | 
			
		||||
			SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", byId.getTypeOfWork());
 | 
			
		||||
			SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", appById.getTypeOfWork());
 | 
			
		||||
			Map<String, String> mp = new HashMap<>();
 | 
			
		||||
			mp.put("projectName", appById.getRecruitName());
 | 
			
		||||
			mp.put("userName", byId.getUsername());
 | 
			
		||||
@ -634,9 +634,9 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		BgtProjectRecruitApply apply = new BgtProjectRecruitApply();
 | 
			
		||||
		apply.setId(req.getRecruitApplyId());
 | 
			
		||||
		apply.setStatus(req.getStatus());
 | 
			
		||||
		if (req.getStatus().equals("3")){
 | 
			
		||||
			apply.setStatus("5");
 | 
			
		||||
		}
 | 
			
		||||
//		if (req.getStatus().equals("3")){
 | 
			
		||||
//			apply.setStatus("5");
 | 
			
		||||
//		}
 | 
			
		||||
		int up = baseMapper.updateById(apply);
 | 
			
		||||
		if (up == 0) {
 | 
			
		||||
			throw new RuntimeException("修改招工申请信息失败!");
 | 
			
		||||
 | 
			
		||||
@ -138,7 +138,8 @@ public class AnnexServiceImpl extends ServicePlusImpl<AnnexMapper, Annex> implem
 | 
			
		||||
		Annex annex = baseMapper.selectById(id);
 | 
			
		||||
		//2、删除对应的数据,并删除相对应的资源
 | 
			
		||||
		if (baseMapper.deleteById(id)>0){
 | 
			
		||||
			boolean b = fileDeletionService.deleteFileByPath(annex.getAnnexUrl());
 | 
			
		||||
			String s = annex.getAnnexUrl().replaceAll("/profile", "ruoyi/uploadPath");
 | 
			
		||||
			boolean b = fileDeletionService.deleteFileByPath(s);
 | 
			
		||||
			if(!b){
 | 
			
		||||
				throw new RuntimeException("附件删除失败!");
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@ import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.Min;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ -14,6 +15,9 @@ import java.io.Serializable;
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("申请工资结算(列表)请求对象")
 | 
			
		||||
public class WgzAppApplyForPayrollSettlementListReq extends PageReq {
 | 
			
		||||
	@ApiModelProperty("0申请中 1已结算 2未通过 3未结算(申请中+未通过)")
 | 
			
		||||
	@ApiModelProperty(value = "用户id",hidden = true)
 | 
			
		||||
	private Long userId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("0申请中 1已通过 2未通过 3全部")
 | 
			
		||||
	private String auditorType;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -21,7 +21,10 @@ public class WgzAppDailyRecordReq extends PageReq {
 | 
			
		||||
	@ApiModelProperty(value = "0正常 1补卡 2全部 ")
 | 
			
		||||
	private String types;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty(value = "日期(格式:年-月-日)")
 | 
			
		||||
	@ApiModelProperty(value = "日期(格式:年-月-日),不填查全部")
 | 
			
		||||
	@DateTimeFormat(pattern = "yyyy-MM-dd")
 | 
			
		||||
	private LocalDate rq;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty(value = "招工ID,不填查全部")
 | 
			
		||||
	private Long recruitId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2,9 +2,13 @@ package com.ruoyi.wgz.bo.req;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.bo.PageReq;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
import org.springframework.format.annotation.DateTimeFormat;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ -13,4 +17,13 @@ import lombok.experimental.Accessors;
 | 
			
		||||
@ApiModel("请假·历史请假记录请求对象")
 | 
			
		||||
public class WgzAppLeaveHistoryListPageReq extends PageReq {
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty(value = "当前用户ID",hidden = true)
 | 
			
		||||
	private Long userId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty(value = "招工ID,不填查全部")
 | 
			
		||||
	private Long recruitId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty(value = "日期(格式:年-月-日),不填查全部")
 | 
			
		||||
	@DateTimeFormat(pattern = "yyyy-MM-dd")
 | 
			
		||||
	private LocalDate rq;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -74,6 +74,7 @@ public class WgzAppRealNameAuthenticationReq implements Serializable {
 | 
			
		||||
//	private List<Annex> annex;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("工种,多个逗号分隔")
 | 
			
		||||
	@NotBlank(message = "工种不能为空")
 | 
			
		||||
	private String typeOfWork;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -25,6 +25,9 @@ public class WgzAppUnderwayRes implements Serializable {
 | 
			
		||||
	@ApiModelProperty("项目ID")
 | 
			
		||||
	private Long projectId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工申请ID")
 | 
			
		||||
	private Long recruitApplyId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工名称")
 | 
			
		||||
	private String recruitName;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -110,7 +110,7 @@ public class WgzApplyForPayrollSettlementAddRes implements Serializable {
 | 
			
		||||
	private Integer num;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("总的金额")
 | 
			
		||||
	private BigDecimal TotalAmount;
 | 
			
		||||
	private BigDecimal totalAmount;
 | 
			
		||||
 | 
			
		||||
	//---------
 | 
			
		||||
	//---------
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@ public interface WgzLeaveMapper extends BaseMapperPlus<WgzLeave> {
 | 
			
		||||
     * @param page 分页对象
 | 
			
		||||
     * @return 分页查询结果
 | 
			
		||||
     */
 | 
			
		||||
    Page<WgzAppLeaveHistoryListPageRes> userLeaveHistoryListPage(@Param("page") Page<WgzAppLeaveHistoryListPageReq> page);
 | 
			
		||||
    Page<WgzAppLeaveHistoryListPageRes> userLeaveHistoryListPage(@Param("page") Page<WgzAppLeaveHistoryListPageReq> page,@Param("req") WgzAppLeaveHistoryListPageReq req);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	@Select("SELECT\n" +
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ import org.apache.ibatis.annotations.Param;
 | 
			
		||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
 | 
			
		||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
 | 
			
		||||
public interface WgzPayCalculationMapper extends BaseMapperPlus<WgzPayCalculation> {
 | 
			
		||||
	Page<WgzAppApplyForPayrollSettlementListRes> userApplyForPayrollSettlementList (@Param("page") Page<WgzAppApplyForPayrollSettlementListReq> page);
 | 
			
		||||
	Page<WgzAppApplyForPayrollSettlementListRes> userApplyForPayrollSettlementList (@Param("page") Page<WgzAppApplyForPayrollSettlementListReq> page,@Param("req") WgzAppApplyForPayrollSettlementListReq req);
 | 
			
		||||
 | 
			
		||||
	Page<WgzAppApplyForPayrollSettlementListRes> appQueryPageList (@Param("page") Page<BgtPayCalculationListDTO> page, @Param("dto") BgtPayCalculationListDTO dto);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -225,10 +225,11 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public TableDataInfo<WgzAppLeaveHistoryListPageRes> userLeaveHistoryListPage(WgzAppLeaveHistoryListPageReq req) {
 | 
			
		||||
		req.setUserId(SecurityUtils.getAppUserId());
 | 
			
		||||
		Page<WgzAppLeaveHistoryListPageReq> queryDTOPage = new Page<>();
 | 
			
		||||
		queryDTOPage.setCurrent(req.getPageNum());
 | 
			
		||||
		queryDTOPage.setSize(req.getPageSize());
 | 
			
		||||
		return PageUtils.buildDataInfo(baseMapper.userLeaveHistoryListPage(queryDTOPage));
 | 
			
		||||
		return PageUtils.buildDataInfo(baseMapper.userLeaveHistoryListPage(queryDTOPage,req));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
 | 
			
		||||
@ -3,6 +3,7 @@ package com.ruoyi.wgz.service.impl;
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
 | 
			
		||||
import com.ruoyi.bgt.mapper.BgtProjectRecruitMapper;
 | 
			
		||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
 | 
			
		||||
@ -36,12 +37,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import com.ruoyi.wgz.bo.WgzMessageQueryBo;
 | 
			
		||||
import com.ruoyi.wgz.mapper.WgzMessageMapper;
 | 
			
		||||
import com.ruoyi.wgz.service.IWgzMessageService;
 | 
			
		||||
import org.springframework.transaction.annotation.Propagation;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
@ -69,6 +69,9 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IBgtProjectRecruitService iBgtProjectRecruitService;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public WgzMessage queryById(Long id){
 | 
			
		||||
        return getById(id);
 | 
			
		||||
@ -147,13 +150,16 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public WgzAppMessageTypeStatisticsRes userMessageTypeStatistics(Long id) {
 | 
			
		||||
		Long appUserId = SecurityUtils.getAppUserId();
 | 
			
		||||
		BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
 | 
			
		||||
		BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
 | 
			
		||||
 | 
			
		||||
        WgzAppMessageTypeStatisticsRes res = new WgzAppMessageTypeStatisticsRes();
 | 
			
		||||
		Map<String, Integer> mp = new HashMap<>();
 | 
			
		||||
//        List<WgzAppMessageTypeStatisticsTwo> list = new ArrayList<>();
 | 
			
		||||
        //1、获取字典类型
 | 
			
		||||
        List<SysDictData> data = dictTypeService.selectDictDataByType("message_large_type");
 | 
			
		||||
        for (SysDictData datum : data) {
 | 
			
		||||
            //2、统计数据
 | 
			
		||||
            //1-2、统计数据
 | 
			
		||||
            LambdaQueryWrapper<WgzMessage> wp = new LambdaQueryWrapper<WgzMessage>().
 | 
			
		||||
                    eq(WgzMessage::getRecipientId, id).
 | 
			
		||||
                    eq(WgzMessage::getRecipientType, "1").
 | 
			
		||||
@ -161,7 +167,17 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
 | 
			
		||||
                    eq(WgzMessage::getMessageLargeType, datum.getDictValue());
 | 
			
		||||
			mp.put(datum.getDictValue(),baseMapper.selectCount(wp));
 | 
			
		||||
        }
 | 
			
		||||
        return res.setMp(mp);
 | 
			
		||||
		//2、单独获取待办中的消息
 | 
			
		||||
		Integer daiBanCount = baseMapper.selectCount(
 | 
			
		||||
			new LambdaQueryWrapper<WgzMessage>().
 | 
			
		||||
				eq(WgzMessage::getSenderType, USERTYPE_BGT).
 | 
			
		||||
				eq(WgzMessage::getSenderId, appById.getUserId()).
 | 
			
		||||
				eq(WgzMessage::getRecipientType, USERTYPE_WGZ).
 | 
			
		||||
				eq(WgzMessage::getRecipientId, appUserId).
 | 
			
		||||
				eq(WgzMessage::getIsOperation, "1")
 | 
			
		||||
		);
 | 
			
		||||
		mp.put("daiban",daiBanCount);
 | 
			
		||||
		return res.setMp(mp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
@ -172,6 +188,10 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
 | 
			
		||||
		Page<WgzAppGetMessageListReq> queryDTOPage = new Page<>();
 | 
			
		||||
		queryDTOPage.setCurrent(req.getPageNum());
 | 
			
		||||
		queryDTOPage.setSize(req.getPageSize());
 | 
			
		||||
		//0、待办的查询
 | 
			
		||||
		if (req.getLargeType().equals("daiban")){
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
		//1、分页查询出所有的小类型,然后循环查询小类型对应标题数据
 | 
			
		||||
		if(req.getLargeType() !=null && req.getLargeType().equals("3") && req.getSmallType()==null){
 | 
			
		||||
			Page<WgzAppGetMessageListRes> pe = baseMapper.pagingQueryTheMessageList(queryDTOPage, req);
 | 
			
		||||
 | 
			
		||||
@ -179,7 +179,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
		//1、获取当前人
 | 
			
		||||
		SysUser user = SecurityUtils.getLoginUser().getUser();
 | 
			
		||||
		BgtProjectRecruitApply recruitApply = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(user.getUserId());
 | 
			
		||||
		BgtProjectRecruit recruit = iBgtProjectRecruitService.getAppById(recruitApply.getId());
 | 
			
		||||
		BgtProjectRecruit recruit = iBgtProjectRecruitService.getAppById(recruitApply.getRecruitId());
 | 
			
		||||
		//2、查看当前申请结算的天数是否大于剩余天数
 | 
			
		||||
		LambdaQueryWrapper<WgzAttendance> attWra = new LambdaQueryWrapper<WgzAttendance>().
 | 
			
		||||
			eq(WgzAttendance::getUserId, user.getUserId()).
 | 
			
		||||
@ -219,13 +219,15 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
		if (!save) {
 | 
			
		||||
			throw new RuntimeException("结算新增失败!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		req.getPayCalculation().forEach(data -> {
 | 
			
		||||
			data.setCalculationId(wgzPayCalculation.getId());
 | 
			
		||||
		});
 | 
			
		||||
		boolean fjSave = iWgzPayCalculationFilesService.saveBatch(req.getPayCalculation());
 | 
			
		||||
		if (!fjSave) {
 | 
			
		||||
			throw new RuntimeException("附件新增失败!");
 | 
			
		||||
		List<WgzPayCalculationFiles> payCalculation = req.getPayCalculation();
 | 
			
		||||
		if(payCalculation!=null){
 | 
			
		||||
			req.getPayCalculation().forEach(data -> {
 | 
			
		||||
				data.setCalculationId(wgzPayCalculation.getId());
 | 
			
		||||
			});
 | 
			
		||||
			boolean fjSave = iWgzPayCalculationFilesService.saveBatch(req.getPayCalculation());
 | 
			
		||||
			if (!fjSave) {
 | 
			
		||||
				throw new RuntimeException("附件新增失败!");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//5、将修改标识符的数据存放到中间表
 | 
			
		||||
@ -354,10 +356,13 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public TableDataInfo<WgzAppApplyForPayrollSettlementListRes> userApplyForPayrollSettlementList(WgzAppApplyForPayrollSettlementListReq req) {
 | 
			
		||||
		//1、获取当前人
 | 
			
		||||
		Long appUserId = SecurityUtils.getAppUserId();
 | 
			
		||||
		req.setUserId(appUserId);
 | 
			
		||||
		Page<WgzAppApplyForPayrollSettlementListReq> pe = new Page<>();
 | 
			
		||||
		pe.setCurrent(req.getPageNum());
 | 
			
		||||
		pe.setSize(req.getPageSize());
 | 
			
		||||
		return PageUtils.buildDataInfo(baseMapper.userApplyForPayrollSettlementList(pe));
 | 
			
		||||
		return PageUtils.buildDataInfo(baseMapper.userApplyForPayrollSettlementList(pe,req));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
 | 
			
		||||
@ -206,7 +206,15 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
		if(!ValidUtil.isValidBankCard(req.getCardNo())){
 | 
			
		||||
			throw new RuntimeException("请检查银行卡!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//0、查询当前用户是否实名了,如若已实名就无法再次实名
 | 
			
		||||
		Integer count = baseMapper.selectCount(
 | 
			
		||||
			new LambdaQueryWrapper<WgzUser>()
 | 
			
		||||
				.eq(WgzUser::getUserId, req.getUserId())
 | 
			
		||||
				.isNotNull(WgzUser::getIdentityCard)
 | 
			
		||||
		);
 | 
			
		||||
		if (count>0){
 | 
			
		||||
			throw new RuntimeException("当前用户已实名!");
 | 
			
		||||
		}
 | 
			
		||||
		//1、对指定用户进行实名认证
 | 
			
		||||
		WgzUser user = new WgzUser();
 | 
			
		||||
		BeanUtils.copyProperties(req, user);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user