二期修改内容提交
This commit is contained in:
parent
5e01a4c707
commit
dc851417fa
|
|
@ -1,12 +1,12 @@
|
|||
package com.bonus.common.core.utils.uuid;
|
||||
|
||||
import com.bonus.common.core.exception.UtilException;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import com.bonus.common.core.exception.UtilException;
|
||||
import java.lang.StringBuilder;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -442,9 +442,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||
// can simply be numerically compared as two numbers
|
||||
return (this.mostSigBits < val.mostSigBits ? -1 :
|
||||
(this.mostSigBits > val.mostSigBits ? 1 :
|
||||
(this.leastSigBits < val.leastSigBits ? -1 :
|
||||
(this.leastSigBits > val.leastSigBits ? 1 :
|
||||
0))));
|
||||
(Long.compare(this.leastSigBits, val.leastSigBits))));
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,33 +1,23 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.bmw.domain.dto.AppFileDto;
|
||||
import com.bonus.bmw.domain.dto.BankCardBean;
|
||||
import com.bonus.bmw.domain.dto.BmWorkerEinUserVo;
|
||||
import com.bonus.bmw.domain.dto.IdCardBean;
|
||||
import com.bonus.bmw.domain.po.FaceRecognitionBean;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.bmw.service.AppRecognitionService;
|
||||
import com.bonus.bmw.service.AppService;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.BusinessType;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.system.api.domain.SysFile;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* app识别服务接口
|
||||
|
|
@ -59,8 +49,11 @@ public class AppRecognitionController extends BaseController {
|
|||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||
@PostMapping("/getFaceRecognition")
|
||||
@SysLog(title = "识别人脸", businessType = OperaType.QUERY, logType = 0, module = "识别服务接口->识别人脸", details = "识别人脸")
|
||||
public AjaxResult getFaceRecognition(@RequestPart(value = "file")MultipartFile facePhoto) {
|
||||
return service.getFaceRecognition(facePhoto);
|
||||
public AjaxResult getFaceRecognition(@RequestPart(value = "file")MultipartFile facePhoto, @RequestParam(value = "params")String params) {
|
||||
params= Sm4Utils.decrypt(params);
|
||||
JSONObject jsonObject = FastJsonHelper.jsonStrToJsonObj(params);
|
||||
String proId = jsonObject.getString("proId");
|
||||
return service.getFaceRecognition(facePhoto,proId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -96,7 +89,8 @@ public class AppRecognitionController extends BaseController {
|
|||
JSONObject jsonObject = FastJsonHelper.jsonStrToJsonObj(params);
|
||||
System.err.println(jsonObject);
|
||||
String idNumber = jsonObject.getString("idNumber");
|
||||
return service.appPlayCard(facePhoto,idNumber);
|
||||
String proId = jsonObject.getString("proId");
|
||||
return service.appPlayCard(facePhoto,idNumber,proId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
package com.bonus.bmw.controller;
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
|
||||
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerContract;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import com.bonus.bmw.service.PmWorkerService;
|
||||
import com.bonus.bmw.service.impl.PmWorkerServiceImpl;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.face.ArcFaceHelper;
|
||||
import com.bonus.common.core.utils.face.FaceResult;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
|
|
@ -20,12 +16,8 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -33,10 +25,8 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 人员入场
|
||||
|
|
@ -103,12 +93,12 @@ public class PmWorkerController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("worker:ein:query"))
|
||||
@PostMapping("/select/{id}")
|
||||
@PostMapping("/select/{id}/{proId}")
|
||||
@SysLog(title = "查询人员入场信息", businessType = OperaType.QUERY, logType = 0, module = "施工人员->出入场管理->人员入场管理", details = "查询人员入场信息")
|
||||
public AjaxResult select(@PathVariable("id") Integer id) {
|
||||
public AjaxResult select(@PathVariable("id") Integer id,@PathVariable("proId") Integer proId) {
|
||||
try {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
PmWorker worker = service.selectByPrimaryKey(id);
|
||||
PmWorker worker = service.selectByPrimaryKey(id,proId);
|
||||
ajax.put("data", worker);
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
|
|
@ -119,9 +109,7 @@ public class PmWorkerController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据身份证去获取详情数据
|
||||
* @param files
|
||||
* @param fileMsg
|
||||
* @param params
|
||||
* @param idNumber
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("worker:ein:query"))
|
||||
|
|
@ -261,5 +249,37 @@ public class PmWorkerController extends BaseController {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单人入过的所有工程列表信息列表
|
||||
* @param o
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("worker:ein:list"))
|
||||
@GetMapping("/einListByWorkerId")
|
||||
@SysLog(title = "单人入场列表", businessType = OperaType.QUERY, logType = 0, module = "施工人员->出入场管理->人员入场管理", details = "单人入场列表")
|
||||
public TableDataInfo einListByWorkerId(PmWorkerDto o) {
|
||||
try {
|
||||
startPage();
|
||||
List<PmWorker> list = service.selectEinListByWorkerId(o);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("worker:ein:insert"))
|
||||
@PostMapping("/insertProEin")
|
||||
@SysLog(title = "新增工程入场", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员入场管理", details = "新增工程入场")
|
||||
public AjaxResult insertProEin(@RequestBody PmWorker o) {
|
||||
try {
|
||||
return service.insertProEin(o);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public class CheckRecordDto {
|
|||
|
||||
private boolean isInRange;
|
||||
|
||||
private Integer isSamePro;
|
||||
|
||||
// 入场时间
|
||||
private String einDay;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.dto.BmWorkerEinUserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface AppRecognitionMapper {
|
||||
|
||||
|
|
@ -30,5 +31,5 @@ public interface AppRecognitionMapper {
|
|||
* @param idNumber
|
||||
* @return
|
||||
*/
|
||||
BmWorkerEinUserVo getOnUserInfoByIdNumber(String idNumber);
|
||||
BmWorkerEinUserVo getOnUserInfoByIdNumber(@Param("idNumber") String idNumber, @Param("proId") String proId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public interface PmWorkerExitMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int deleteEinMsgByWorkerId(Integer id);
|
||||
int deleteEinMsgByWorkerId(@Param("workerId") Integer id,@Param("proId") Integer proId);
|
||||
|
||||
/**
|
||||
* 修改入场记录表入场状态
|
||||
|
|
@ -40,4 +40,6 @@ public interface PmWorkerExitMapper {
|
|||
List<MapBeanVo> getContractIdAndWageCard(Integer workerId);
|
||||
|
||||
String getIdNumberByWorkerId(Integer workerId);
|
||||
}
|
||||
|
||||
Boolean getProLocationByProId(Integer proId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface PmWorkerMapper {
|
|||
* @param id primary key
|
||||
* @return object by primary key
|
||||
*/
|
||||
PmWorker selectByPrimaryKey(Integer id);
|
||||
PmWorker selectByPrimaryKey(@Param("id") Integer id,@Param("proId") Integer proId);
|
||||
|
||||
/**
|
||||
* 查询人员列表
|
||||
|
|
@ -134,4 +134,20 @@ public interface PmWorkerMapper {
|
|||
PmWorker selectByIdNumber(String idNumber);
|
||||
|
||||
List<MapBeanVo> getProListByWorkerId(Integer id);
|
||||
|
||||
/**
|
||||
* 根据人员id查询入场记录
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
List<PmWorker> selectEinListByWorkerId(PmWorkerDto o);
|
||||
|
||||
/**
|
||||
* 根据人员id查询合同id
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Integer getContractIdByWorkerId(Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.dto.*;
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -17,7 +18,7 @@ public interface RepairCardApplyMapper {
|
|||
|
||||
List<CheckRecordDto> getCheckRecord(CheckRecordDto checkRecordDto);
|
||||
|
||||
List<String> attPersonRecord(CheckRecordDto checkRecordDto);
|
||||
List<MapBeanPo> attPersonRecord(CheckRecordDto checkRecordDto);
|
||||
|
||||
List<WorkPersonDto> workPersonList(RepairCardApplyDto cardApply);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,11 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.AppFileDto;
|
||||
import com.bonus.bmw.domain.dto.BankCardBean;
|
||||
import com.bonus.bmw.domain.dto.BmWorkerEinUserVo;
|
||||
import com.bonus.bmw.domain.dto.IdCardBean;
|
||||
import com.bonus.bmw.domain.po.FaceRecognitionBean;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.api.domain.SysFile;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
public interface AppRecognitionService {
|
||||
|
||||
|
|
@ -21,11 +13,11 @@ public interface AppRecognitionService {
|
|||
|
||||
String uploadFaceRecognition(String facePhoto, FaceRecognitionBean bean);
|
||||
|
||||
AjaxResult getFaceRecognition(MultipartFile facePhoto);
|
||||
AjaxResult getFaceRecognition(MultipartFile facePhoto, String proId);
|
||||
|
||||
AjaxResult bankCardRecognition(BankCardBean bean);
|
||||
|
||||
AjaxResult appPlayCard(MultipartFile facePhoto, String idNumber);
|
||||
AjaxResult appPlayCard(MultipartFile facePhoto, String idNumber, String proId);
|
||||
|
||||
AjaxResult idCardRecognition(IdCardBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
|
|
@ -15,7 +13,7 @@ public interface PmWorkerService{
|
|||
|
||||
AjaxResult insert(PmWorker record, List<WebFileDto> listFile) throws Exception;
|
||||
|
||||
PmWorker selectByPrimaryKey(Integer id);
|
||||
PmWorker selectByPrimaryKey(Integer id,Integer proId);
|
||||
|
||||
AjaxResult updateByPrimaryKey(PmWorker record,List<WebFileDto> listFile) throws Exception;
|
||||
|
||||
|
|
@ -37,4 +35,13 @@ public interface PmWorkerService{
|
|||
* @return 用户对象信息
|
||||
*/
|
||||
PmWorker selectByIdNumber(String idNumber);
|
||||
|
||||
/**
|
||||
* 根据手机号查询施工人员
|
||||
*
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
List<PmWorker> selectEinListByWorkerId(PmWorkerDto o);
|
||||
|
||||
AjaxResult insertProEin(PmWorker o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.bmw.domain.dto.AppFileDto;
|
||||
import com.bonus.bmw.domain.dto.BankCardBean;
|
||||
import com.bonus.bmw.domain.dto.BmWorkerEinUserVo;
|
||||
import com.bonus.bmw.domain.dto.IdCardBean;
|
||||
|
|
@ -13,9 +12,7 @@ import com.bonus.bmw.mapper.AppRecognitionMapper;
|
|||
import com.bonus.bmw.service.AppRecognitionService;
|
||||
import com.bonus.bmw.utils.BaiduRecognitionUtils;
|
||||
import com.bonus.bmw.utils.FaceStatusCodeReturn;
|
||||
import com.bonus.bmw.utils.IpAndPathConfig;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
|
|
@ -151,7 +148,7 @@ public class AppRecognitionServiceImpl implements AppRecognitionService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getFaceRecognition(MultipartFile facePhoto) {
|
||||
public AjaxResult getFaceRecognition(MultipartFile facePhoto, String proId) {
|
||||
try {
|
||||
// 1. 获取文件字节数组
|
||||
byte[] bytes = facePhoto.getBytes();
|
||||
|
|
@ -178,7 +175,7 @@ public class AppRecognitionServiceImpl implements AppRecognitionService {
|
|||
JSONArray jsonArray = FastJsonHelper.jsonArrStrToJsonArr(data);
|
||||
String idNumber = (String) jsonArray.get(0);
|
||||
// 1. 获取用户信息
|
||||
sysFile = mapper.getOnUserInfoByIdNumber(idNumber);
|
||||
sysFile = mapper.getOnUserInfoByIdNumber(idNumber,proId);
|
||||
sysFile.setFaceResult(true);
|
||||
}
|
||||
return !"30000".equals(code) ? AjaxResult.error(FaceStatusCodeReturn.faceStatusCodeReturn(Integer.parseInt(code)))
|
||||
|
|
@ -231,9 +228,9 @@ public class AppRecognitionServiceImpl implements AppRecognitionService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult appPlayCard(MultipartFile facePhoto, String idNumber) {
|
||||
public AjaxResult appPlayCard(MultipartFile facePhoto, String idNumber, String proId) {
|
||||
// 1. 获取用户信息
|
||||
BmWorkerEinUserVo vo = mapper.getOnUserInfoByIdNumber(idNumber);
|
||||
BmWorkerEinUserVo vo = mapper.getOnUserInfoByIdNumber(idNumber, proId);
|
||||
if(vo != null && vo.getUserId() != null){
|
||||
saveAttData(vo,facePhoto);
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.bonus.bmw.domain.vo.*;
|
|||
import com.bonus.bmw.mapper.*;
|
||||
import com.bonus.bmw.service.AppRecognitionService;
|
||||
import com.bonus.bmw.service.AppService;
|
||||
import com.bonus.bmw.service.BmWorkerWageCardService;
|
||||
import com.bonus.bmw.service.UrkSendService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
|
|
@ -26,7 +25,6 @@ import javax.annotation.Resource;
|
|||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
|
|
@ -225,10 +223,14 @@ public class AppServiceImpl implements AppService {
|
|||
//查询合同工资卡是否齐全
|
||||
List<MapBeanVo> list = pmWorkerExitMapper.getContractIdAndWageCard(record.getWorkerId());
|
||||
if(Integer.parseInt(list.get(0).getValue())>0 && Integer.parseInt(list.get(1).getValue())>0){
|
||||
//删除合同
|
||||
int m = contractMapper.deleteByWorkerId(record.getWorkerId());
|
||||
//查询是否上海外
|
||||
Boolean isShangHai = pmWorkerExitMapper.getProLocationByProId(record.getProId());
|
||||
if(isShangHai == null || !isShangHai){
|
||||
int m = contractMapper.deleteByWorkerId(record.getWorkerId());
|
||||
}
|
||||
|
||||
//删除实时在场
|
||||
int n = pmWorkerExitMapper.deleteEinMsgByWorkerId(record.getWorkerId());
|
||||
int n = pmWorkerExitMapper.deleteEinMsgByWorkerId(record.getWorkerId(),record.getProId());
|
||||
//修改在场记录表状态
|
||||
int einStatus = 2;
|
||||
//是否上传文件
|
||||
|
|
|
|||
|
|
@ -59,10 +59,14 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
//查询合同工资卡是否齐全
|
||||
List<MapBeanVo> list = mapper.getContractIdAndWageCard(record.getWorkerId());
|
||||
if(Integer.parseInt(list.get(0).getValue())>0 && Integer.parseInt(list.get(1).getValue())>0){
|
||||
//删除合同
|
||||
int m = contractService.deleteByWorkerId(record.getWorkerId());
|
||||
//查询是否上海外
|
||||
Boolean isShangHai = mapper.getProLocationByProId(record.getProId());
|
||||
if(isShangHai == null || !isShangHai){
|
||||
//上海外删除合同
|
||||
int i = contractService.deleteByWorkerId(record.getWorkerId());
|
||||
}
|
||||
//删除实时在场
|
||||
int n = mapper.deleteEinMsgByWorkerId(record.getWorkerId());
|
||||
int n = mapper.deleteEinMsgByWorkerId(record.getWorkerId(), record.getProId());
|
||||
//修改在场记录表状态
|
||||
int einStatus = 2;
|
||||
//是否上传文件
|
||||
|
|
@ -118,10 +122,14 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
//查询合同工资卡是否齐全
|
||||
List<MapBeanVo> listData = mapper.getContractIdAndWageCard(bean.getWorkerId());
|
||||
if("1".equals(listData.get(0).getValue()) && "1".equals(listData.get(1).getValue())) {
|
||||
//删除合同
|
||||
int i = contractService.deleteByWorkerId(bean.getWorkerId());
|
||||
//查询是否上海外
|
||||
Boolean isShangHai = mapper.getProLocationByProId(bean.getProId());
|
||||
if(isShangHai == null || !isShangHai){
|
||||
//上海外删除合同
|
||||
int i = contractService.deleteByWorkerId(bean.getWorkerId());
|
||||
}
|
||||
//删除实时在场
|
||||
int j = mapper.deleteEinMsgByWorkerId(bean.getWorkerId());
|
||||
int j = mapper.deleteEinMsgByWorkerId(bean.getWorkerId(),bean.getProId());
|
||||
int einStatus = 2;
|
||||
//是否上传文件
|
||||
int isUploadFile = 0;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.bonus.bmw.domain.po.FaceRecognitionBean;
|
|||
import com.bonus.bmw.domain.vo.BmWorkerContract;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
||||
import com.bonus.bmw.domain.vo.MapBeanVo;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import com.bonus.bmw.mapper.PmWorkerMapper;
|
||||
import com.bonus.bmw.service.*;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -18,12 +20,8 @@ import com.bonus.system.api.model.UploadFileVo;
|
|||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.bonus.bmw.mapper.PmWorkerMapper;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
|
@ -32,7 +30,9 @@ import javax.validation.Validator;
|
|||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
|
|
@ -145,6 +145,11 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
private void addWorkerEinData(PmWorker record, List<WebFileDto> fileMsg) {
|
||||
//工资卡和合同数据
|
||||
addWorkerWageCardDataAndContract(record,fileMsg);
|
||||
//入场关联数据新增
|
||||
addEinRecord(record);
|
||||
}
|
||||
|
||||
private void addEinRecord(PmWorker record) {
|
||||
record.setEinTime(DateUtil.now());
|
||||
record.setEinStatus(1);
|
||||
//1.bm_worker_ein_msg
|
||||
|
|
@ -174,9 +179,9 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
}
|
||||
|
||||
@Override
|
||||
public PmWorker selectByPrimaryKey(Integer id) {
|
||||
public PmWorker selectByPrimaryKey(Integer id,Integer proId) {
|
||||
//人员数据
|
||||
PmWorker worker = mapper.selectByPrimaryKey(id);
|
||||
PmWorker worker = mapper.selectByPrimaryKey(id,proId);
|
||||
if(worker != null){
|
||||
worker.setFiles(fileUploadUtils.getFileList("", worker.getId().toString(), Constants.FILE_UPLOAD_WORKER, ""));
|
||||
}
|
||||
|
|
@ -186,13 +191,13 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
BmWorkerWageCard bmWorkerWageCard = wageCardService.selectWageCardByWorkerId(wageCard);
|
||||
assert worker != null;
|
||||
worker.setBmWorkerWageCard(bmWorkerWageCard);
|
||||
if(worker.getEinStatus() == 1){
|
||||
//查询合同数据 只有入场才会有合同
|
||||
// if(worker.getEinStatus() == 1){
|
||||
//查询合同数据 只有入场才会有合同(上海内可以在未入场有合同)
|
||||
BmWorkerContract contract = new BmWorkerContract();
|
||||
contract.setWorkerId(id);
|
||||
BmWorkerContract workerContract = contractService.selectContractListByWorkerIdAndValid(contract);
|
||||
worker.setBmWorkerContract(workerContract);
|
||||
}
|
||||
BmWorkerContract workerContract = contractService.selectContractListByWorkerIdAndValid(contract);
|
||||
worker.setBmWorkerContract(workerContract);
|
||||
// }
|
||||
return worker;
|
||||
}
|
||||
|
||||
|
|
@ -231,6 +236,25 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
return worker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmWorker> selectEinListByWorkerId(PmWorkerDto o) {
|
||||
return mapper.selectEinListByWorkerId(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加工程入场数据
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertProEin(PmWorker o) {
|
||||
//先查到现在的合同id
|
||||
Integer contractId = mapper.getContractIdByWorkerId(o.getId());
|
||||
o.setContractId(contractId);
|
||||
addEinRecord(o);
|
||||
return AjaxResult.success("添加成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入场数据
|
||||
* @param record
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.dto.*;
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.mapper.RepairCardApplyMapper;
|
||||
import com.bonus.bmw.service.RepairCardApplyService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
|
|
@ -9,19 +10,14 @@ import com.bonus.common.core.utils.uuid.UUID;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import org.apache.catalina.security.SecurityUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -95,13 +91,23 @@ public class RepairCardApplyServiceImpl implements RepairCardApplyService {
|
|||
}
|
||||
}
|
||||
// 获取该人员在该工程下的打卡记录
|
||||
List<String> attPersonRecord = repairCardApplyMapper.attPersonRecord(checkRecordDto);
|
||||
//由于可以入场多个工程的需求,只能改为查询所有打卡
|
||||
List<MapBeanPo> attPersonRecord = repairCardApplyMapper.attPersonRecord(checkRecordDto);
|
||||
// 遍历结果集,对存在于attPersonRecord中的记录设置标记
|
||||
for (Map.Entry<String, CheckRecordDto> entry : result.entrySet()) {
|
||||
String einDay = entry.getKey();
|
||||
CheckRecordDto record = entry.getValue();
|
||||
if (attPersonRecord.contains(einDay)) {
|
||||
record.setIsActive(1); // 或者根据实际需求设置其他字段为1
|
||||
// 检查attPersonRecord中是否有name字段包含einDay的记录
|
||||
Optional<MapBeanPo> matchingRecord = attPersonRecord.stream()
|
||||
.filter(mapBean -> {
|
||||
String name = mapBean.getName();
|
||||
return name != null && name.contains(einDay);
|
||||
})
|
||||
.findFirst();
|
||||
|
||||
if (matchingRecord.isPresent()) {
|
||||
record.setIsActive(1); // 设置为1表示存在打卡记录
|
||||
record.setIsSamePro(matchingRecord.get().getProId()); // 将匹配记录的proId赋值给isSamePro字段
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@
|
|||
LEFT JOIN bm_worker_contract bwc ON bwc.worker_id = bwem.worker_id
|
||||
AND bwc.is_active = 1
|
||||
WHERE
|
||||
pw.id_number = #{idNumber}
|
||||
pw.id_number = #{idNumber} AND bwem.pro_id = #{proId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
<result column="exit_time" property="exitTime" />
|
||||
<result column="is_upload_file" property="isUploadFile" />
|
||||
<result column="days_since_exit" property="daysSinceExit" />
|
||||
<result column="is_shanghai" property="isShanghai"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectWorkList" resultMap="BaseResultMap">
|
||||
|
|
@ -45,7 +46,8 @@
|
|||
bwepr.ein_status,
|
||||
bwepr.is_upload_file,
|
||||
if(is_upload_file=0,DATEDIFF(NOW(), exit_time),0) as days_since_exit,
|
||||
bwepr.exit_time
|
||||
bwepr.exit_time,
|
||||
pp.is_shanghai
|
||||
FROM
|
||||
pm_worker pw
|
||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||
|
|
@ -95,7 +97,7 @@
|
|||
</select>
|
||||
|
||||
<delete id="deleteEinMsgByWorkerId">
|
||||
DELETE FROM bm_worker_ein_msg WHERE worker_id = #{id}
|
||||
DELETE FROM bm_worker_ein_msg WHERE worker_id = #{workerId} and pro_id = #{proId}
|
||||
</delete>
|
||||
|
||||
<update id="updateEinProRecordStatus">
|
||||
|
|
@ -149,4 +151,11 @@
|
|||
FROM
|
||||
`pm_worker` where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="getProLocationByProId" resultType="Boolean">
|
||||
SELECT
|
||||
is_shanghai
|
||||
FROM
|
||||
`pm_project` where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
pw.id_number,
|
||||
pw.phone,
|
||||
bwem.post_name,
|
||||
bwem.pro_id,
|
||||
bwem.pro_name,
|
||||
bwem.sub_name,
|
||||
bwem.team_name,
|
||||
|
|
@ -315,4 +316,31 @@
|
|||
WHERE
|
||||
bmew.worker_id = #{workerId}
|
||||
</select>
|
||||
|
||||
<select id="selectEinListByWorkerId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
pw.id,
|
||||
pw.`name`,
|
||||
pw.phone,
|
||||
bmew.post_name,
|
||||
bmew.pro_name,
|
||||
bmew.team_name,
|
||||
bmew.sub_name,
|
||||
bmew.ein_time
|
||||
FROM
|
||||
bm_worker_ein_msg bmew
|
||||
LEFT JOIN pm_worker pw ON pw.id = bmew.worker_id
|
||||
where
|
||||
bmew.worker_id = #{workerId}
|
||||
</select>
|
||||
|
||||
<select id="getContractIdByWorkerId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
bwc.id
|
||||
FROM
|
||||
bm_worker_contract bwc
|
||||
WHERE
|
||||
bwc.worker_id = #{workerId} and bwc.is_active = 1
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -253,8 +253,14 @@
|
|||
where
|
||||
pw.is_active = 1 and bwepr.pro_id = #{proId}
|
||||
</select>
|
||||
<select id="attPersonRecord" resultType="java.lang.String">
|
||||
select att_day from bm_att_person where pro_id = #{proId} and worker_id = #{workerId} and team_id = #{teamId} and is_active = 1
|
||||
<select id="attPersonRecord" resultType="com.bonus.bmw.domain.po.MapBeanPo">
|
||||
SELECT
|
||||
att_day as name,
|
||||
if(pro_id = #{proId},1,0) as proId
|
||||
FROM
|
||||
bm_att_person
|
||||
WHERE
|
||||
is_active = 1 AND att_day BETWEEN #{startTime} and #{endTime}
|
||||
</select>
|
||||
<select id="getCardStatistics" resultType="com.bonus.bmw.domain.dto.CardStatisticsDto">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -2,14 +2,12 @@ package com.bonus.job.mapper;
|
|||
|
||||
import com.bonus.job.domain.BmWorkerBlackJob;
|
||||
import com.bonus.job.domain.PmWorkerJob;
|
||||
import com.bonus.job.domain.SysJob;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调度任务信息 数据层
|
||||
*
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public interface WorkerJobMapper {
|
||||
|
|
@ -30,7 +28,7 @@ public interface WorkerJobMapper {
|
|||
* 获取超30天出场未上传文件人员
|
||||
* @return
|
||||
*/
|
||||
List<BmWorkerBlackJob> getWorkeExitThan30Day();
|
||||
List<BmWorkerBlackJob> getWorkerExitThan30Day();
|
||||
|
||||
int insertWorkerBlack(List<BmWorkerBlackJob> list);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 定时任务调度测试
|
||||
*
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Component("workerEinDayTask")
|
||||
|
|
@ -76,7 +76,8 @@ public class WorkerEinDayRecordTask{
|
|||
*/
|
||||
public void updateExitWorkerToBreachOfTrust(){
|
||||
try{
|
||||
List<BmWorkerBlackJob> list = mapper.getWorkeExitThan30Day();
|
||||
//非上海内工程
|
||||
List<BmWorkerBlackJob> list = mapper.getWorkerExitThan30Day();
|
||||
int count = mapper.insertWorkerBlack(list);
|
||||
logger.info("更新超30天未上传离场文件人员去失信人员成功,{}",count);
|
||||
mapper.updateWorkerEinDayRecordBlackStatus(list);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getWorkeExitThan30Day" resultType="com.bonus.job.domain.BmWorkerBlackJob">
|
||||
<select id="getWorkerExitThan30Day" resultType="com.bonus.job.domain.BmWorkerBlackJob">
|
||||
SELECT
|
||||
bwepr.id,
|
||||
bwepr.worker_id,
|
||||
|
|
@ -75,9 +75,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM
|
||||
pm_worker pw
|
||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||
left join pm_project pp on bwepr.pro_id = pp.id
|
||||
WHERE
|
||||
if(is_upload_file=0,DATEDIFF(NOW(), exit_time),0) > 30
|
||||
and bwepr.is_go_black = 0
|
||||
and bwepr.is_go_black = 0 and pp.is_shanghai = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertWorkerBlack">
|
||||
|
|
@ -95,4 +96,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue