parent
13e48ebc09
commit
ecb1115217
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.system.api.domain;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
|
@ -9,6 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class SysFile
|
||||
{
|
||||
|
|
@ -22,26 +26,6 @@ public class SysFile
|
|||
*/
|
||||
private String url;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ public class SysUser extends BaseEntity {
|
|||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 旧密码
|
||||
*/
|
||||
private String oldPassword;
|
||||
|
||||
@Excel(name = "角色")
|
||||
private String roleName;
|
||||
|
||||
|
|
@ -281,6 +286,16 @@ public class SysUser extends BaseEntity {
|
|||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public String getOldPassword() {
|
||||
return oldPassword;
|
||||
}
|
||||
|
||||
public void setOldPassword(String oldPassword) {
|
||||
this.oldPassword = oldPassword;
|
||||
}
|
||||
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,6 @@
|
|||
<systemPath>${project.basedir}/lib/arcsoft-sdk-face-lin.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>arcsoft</groupId>-->
|
||||
<!-- <artifactId>arcsoft</artifactId>-->
|
||||
<!-- <version>3.0</version>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/lib/arcsoft-sdk-face-3.0.0.0.jar</systemPath>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- SpringCloud Openfeign -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
|
@ -182,4 +174,5 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -180,4 +180,15 @@ public class Constants
|
|||
* 分包班组入场信息
|
||||
*/
|
||||
public static final String PM_SUB_TEAM_CONTRACT = "pm_sub_team_contract";
|
||||
|
||||
/**
|
||||
* 人员打卡照片
|
||||
*/
|
||||
public static final String FILE_UPLOAD_ATT_PHOTO = "bm_att_person";
|
||||
|
||||
/**
|
||||
* 人员记录表照片
|
||||
*/
|
||||
public static final String FILE_UPLOAD_ATT_RECORD_PHOTO = "bm_att_record";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,12 @@
|
|||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– bonus Common core –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.bonus</groupId>-->
|
||||
<!-- <artifactId>bonus-common-core</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
|
|
@ -116,6 +122,9 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
|||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.bmw.service.AppService;
|
||||
import com.bonus.bmw.service.BmSubContractService;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
|
|
@ -16,6 +17,7 @@ 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.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -40,5 +42,46 @@ public class AppController extends BaseController {
|
|||
@Resource
|
||||
private AppService service;
|
||||
|
||||
//, requiresPermissions = @RequiresPermissions("app:password:validate")
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||
@PostMapping("/validatePassword")
|
||||
@SysLog(title = "旧密码校验", businessType = OperaType.QUERY, logType = 0, module = "APP->修改密码->旧手机号校验", details = "旧手机号校验")
|
||||
public AjaxResult validatePassword(@RequestBody SysUser sysUser) {
|
||||
try {
|
||||
return service.validatePassword(sysUser);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
//, requiresPermissions = @RequiresPermissions("app:password:update")
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||
@PostMapping("/updatePassword")
|
||||
@SysLog(title = "新密码修改", businessType = OperaType.UPDATE, logType = 0, module = "APP->修改密码->新密码修改", details = "新密码修改")
|
||||
public AjaxResult updatePassword(@RequestBody SysUser sysUser) {
|
||||
try {
|
||||
return service.updatePassword(sysUser);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("app:worker:tree"))
|
||||
@PostMapping("/getComWorkerTree")
|
||||
@SysLog(title = "组织人员树", businessType = OperaType.UPDATE, logType = 0, module = "APP->人员检查->组织人员树", details = "组织人员树")
|
||||
public AjaxResult getComWorkerTree(TreeVo vo) {
|
||||
try {
|
||||
return service.getComWorkerTree(vo);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.dto.AppFileDto;
|
||||
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.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* app部分接口
|
||||
* @author fly
|
||||
* @date 2025/8/23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/appRecognition")
|
||||
public class AppRecognitionController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private AppRecognitionService service;
|
||||
|
||||
/**
|
||||
* 人脸识别-人脸照片采集入库
|
||||
*/
|
||||
@PostMapping("/collectFacialData")
|
||||
public R<AppFileDto> collectFacialData(MultipartFile facePhoto, FaceRecognitionBean bean) {
|
||||
return service.uploadFaceRecognition(facePhoto, bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸识别-识别人脸
|
||||
*/
|
||||
@PostMapping("/getFaceRecognition")
|
||||
public R<AppFileDto> getFaceRecognition(MultipartFile facePhoto) {
|
||||
return service.getFaceRecognition(facePhoto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.bmw.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 文件信息
|
||||
*
|
||||
* @author fly
|
||||
*/
|
||||
@Data
|
||||
public class AppFileDto {
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 文件大小KB
|
||||
*/
|
||||
private Integer fileSize = 0;
|
||||
|
||||
/**
|
||||
* 是否上传成功 1:成功 0:失败
|
||||
*/
|
||||
private Integer isSuccess;
|
||||
/**
|
||||
* 压缩文件名称
|
||||
*/
|
||||
private String ysName;
|
||||
|
||||
/**
|
||||
* 压缩文件地址
|
||||
*/
|
||||
private String ysUrl;
|
||||
|
||||
/**
|
||||
* 压缩文件大小KB
|
||||
*/
|
||||
private Integer ysFileSize = 0;
|
||||
|
||||
private String gtId;
|
||||
|
||||
private String gtName;
|
||||
|
||||
private String personData;
|
||||
|
||||
private boolean isFace;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("url", getUrl())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.bonus.bmw.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 当前工程在场的人员
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class BmWorkerEinUserVo {
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String devCode;
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private String teamId;
|
||||
/**
|
||||
* 分包名称
|
||||
*/
|
||||
private String subName;
|
||||
/**
|
||||
* 分包id
|
||||
*/
|
||||
private String subId;
|
||||
/**
|
||||
* 项目部id
|
||||
*/
|
||||
private String orgId;
|
||||
/**
|
||||
* 岗位id
|
||||
*/
|
||||
private String postId;
|
||||
/**
|
||||
* 项目部名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
private String attMonth;
|
||||
/**
|
||||
* 日
|
||||
*/
|
||||
private String attDay;
|
||||
/**
|
||||
* 日薪
|
||||
*/
|
||||
private String dailyWage;
|
||||
/**
|
||||
* 是否补卡
|
||||
*/
|
||||
private String isRepair="0";
|
||||
|
||||
private String image;
|
||||
/**
|
||||
* 考勤时间
|
||||
*/
|
||||
private String attTime;
|
||||
/**
|
||||
* 考前突破
|
||||
*/
|
||||
private String attPhoto;
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idNumber;
|
||||
/**
|
||||
* 合同信息
|
||||
*/
|
||||
private String contractId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
* 考勤设备名称
|
||||
*/
|
||||
private String devName;
|
||||
|
||||
}
|
||||
|
|
@ -38,6 +38,15 @@ public class PmWorkerDto {
|
|||
* 分包名称
|
||||
*/
|
||||
private Integer subId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String proName;
|
||||
/**
|
||||
* 分包名称
|
||||
*/
|
||||
private String subName;
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 人脸识别
|
||||
* @author fly
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FaceRecognitionBean {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 图片base
|
||||
*/
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 操作类型 add delete replace
|
||||
*/
|
||||
private String optMode;
|
||||
|
||||
/**
|
||||
* 人员标识
|
||||
*/
|
||||
private String uniqueKey;
|
||||
|
||||
/**
|
||||
* 人脸照片路径
|
||||
*/
|
||||
private String facePath;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String idNumber;
|
||||
|
||||
public FaceRecognitionBean(String img, String idNumber) {
|
||||
this.img = img;
|
||||
this.idNumber = idNumber;
|
||||
}
|
||||
|
||||
public FaceRecognitionBean(String img, String optMode, String uniqueKey) {
|
||||
this.img = img;
|
||||
this.optMode = optMode;
|
||||
this.uniqueKey = uniqueKey;
|
||||
}
|
||||
|
||||
public FaceRecognitionBean(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
}
|
||||
|
|
@ -55,4 +55,6 @@ public class HomePagePo {
|
|||
|
||||
private Integer postId;
|
||||
|
||||
private String idNumber;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,13 +65,13 @@ public class BmWorkerBlack extends BaseEntity {
|
|||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Excel(name = "开始日期", sort = 8)
|
||||
@Excel(name = "开始日期(yyyy-MM-dd)", sort = 8)
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Excel(name = "结束日期", sort = 9)
|
||||
@Excel(name = "结束日期(yyyy-MM-dd)", sort = 9)
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -104,8 +104,24 @@ public class HomePagePmWorkerVo {
|
|||
|
||||
|
||||
/**
|
||||
* 人脸照片
|
||||
* 创建时间
|
||||
*/
|
||||
private Integer wageCardId;
|
||||
|
||||
private String bankName;
|
||||
|
||||
private String bankBranchName;
|
||||
|
||||
private String bankCardCode;
|
||||
|
||||
/**
|
||||
* 合同照片
|
||||
*/
|
||||
private List<UploadFileVo> files;
|
||||
|
||||
/**
|
||||
* 工资卡照片
|
||||
*/
|
||||
private List<UploadFileVo> wageFiles;
|
||||
|
||||
}
|
||||
|
|
@ -50,4 +50,6 @@ public class HomePageSubProVo {
|
|||
private String idNumber;
|
||||
private String daysSinceExit;
|
||||
|
||||
private String attTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.bmw.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class TreeVo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 子级菜单
|
||||
*/
|
||||
private List<TreeVo> childList;
|
||||
}
|
||||
|
|
@ -1,13 +1,17 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AppMapper {
|
||||
/**
|
||||
* 分包商合同信息列表
|
||||
*/
|
||||
|
||||
String getMm(SysUser sysUser);
|
||||
|
||||
int updatePassword(SysUser sysUser);
|
||||
|
||||
List<TreeVo> getComList(TreeVo vo);
|
||||
|
||||
List<TreeVo> getSubComList(TreeVo company);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.dto.BmWorkerEinUserVo;
|
||||
|
||||
public interface AppRecognitionMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 获取今日是否已签到
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
Integer getTodayIsExit(BmWorkerEinUserVo vo);
|
||||
|
||||
/**
|
||||
* 插入签到人员信息
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
void insertAttPerson(BmWorkerEinUserVo vo);
|
||||
|
||||
/**
|
||||
* 插入签到人员记录
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
void insertAttRecord(BmWorkerEinUserVo vo);
|
||||
|
||||
/**
|
||||
* 获取今日是否已签退
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
BmWorkerEinUserVo getOnUserInfoByIdNumber(String idNumber);
|
||||
}
|
||||
|
|
@ -59,4 +59,12 @@ public interface BmWorkerWageCardMapper {
|
|||
* @return object by id
|
||||
*/
|
||||
BmWorkerWageCard selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* delete by primary key
|
||||
*
|
||||
* @param id primary key
|
||||
* @return deleteCount
|
||||
*/
|
||||
void deleteByWorkerId(Integer workerId);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.AppFileDto;
|
||||
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 {
|
||||
|
||||
R<AppFileDto> uploadFaceRecognition(MultipartFile facePhoto, FaceRecognitionBean bean);
|
||||
|
||||
R<AppFileDto> getFaceRecognition(MultipartFile facePhoto);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,9 @@ package com.bonus.bmw.service;
|
|||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -10,4 +13,20 @@ import java.util.Map;
|
|||
public interface AppService {
|
||||
|
||||
|
||||
/**
|
||||
* 旧手机号校验
|
||||
* @param sysUser
|
||||
* @return
|
||||
*/
|
||||
AjaxResult validatePassword(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 新密码修改
|
||||
* @param sysUser
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updatePassword(SysUser sysUser);
|
||||
|
||||
|
||||
AjaxResult getComWorkerTree(TreeVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,5 +64,12 @@ public interface BmWorkerWageCardService {
|
|||
* @return
|
||||
*/
|
||||
BmWorkerWageCard selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* 删除人员工资卡
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteByWorkerId(Integer workerId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,139 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
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.BmWorkerEinUserVo;
|
||||
import com.bonus.bmw.domain.po.FaceRecognitionBean;
|
||||
import com.bonus.bmw.mapper.AppRecognitionMapper;
|
||||
import com.bonus.bmw.service.AppRecognitionService;
|
||||
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.file.FileUtils;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/14
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AppRecognitionServiceImpl implements AppRecognitionService {
|
||||
|
||||
@Resource
|
||||
private AppRecognitionMapper appMapper;
|
||||
|
||||
@Autowired
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
/**
|
||||
* 人脸识别-人脸照片采集入库
|
||||
* @param facePhoto
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<AppFileDto> uploadFaceRecognition(MultipartFile facePhoto, FaceRecognitionBean bean) {
|
||||
try {
|
||||
// 1. 获取文件字节数组
|
||||
byte[] bytes = facePhoto.getBytes();
|
||||
// 2. 使用 Base64 编码
|
||||
String fileBase64 = Base64.getEncoder().encodeToString(bytes);
|
||||
bean.setImg(fileBase64);
|
||||
String body = HttpUtil.post(IpAndPathConfig.getFaceRecognitionUrl() + "/updatedb",
|
||||
FastJsonHelper.beanToJsonStr(bean));
|
||||
log.error(body);
|
||||
JSONObject jsonObject = FastJsonHelper.jsonStrToJsonObj(body);
|
||||
String code = jsonObject.getString("code");
|
||||
return body.contains("30002") ? R.ok()
|
||||
: R.fail(FaceStatusCodeReturn.faceStatusCodeReturn(Integer.parseInt(code)));
|
||||
} catch (Exception e) {
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<AppFileDto> getFaceRecognition(MultipartFile facePhoto) {
|
||||
try {
|
||||
// 1. 获取文件字节数组
|
||||
byte[] bytes = facePhoto.getBytes();
|
||||
// 2. 使用 Base64 编码
|
||||
String fileBase64 = Base64.getEncoder().encodeToString(bytes);
|
||||
String body = HttpUtil.post(IpAndPathConfig.getFaceRecognitionUrl() + "/facerecognition",
|
||||
FastJsonHelper.beanToJsonStr(new FaceRecognitionBean(fileBase64)));
|
||||
log.error(body);
|
||||
JSONObject jsonObject = FastJsonHelper.jsonStrToJsonObj(body);
|
||||
String code = jsonObject.getString("code");
|
||||
AppFileDto sysFile = new AppFileDto();
|
||||
if(!"30000".equals(code)){
|
||||
sysFile.setFace(false);
|
||||
}else{
|
||||
String data = jsonObject.getString("data");
|
||||
JSONArray jsonArray = FastJsonHelper.jsonArrStrToJsonArr(data);
|
||||
String idNumber = (String) jsonArray.get(0);
|
||||
sysFile.setFace(true);
|
||||
// 1. 获取用户信息
|
||||
BmWorkerEinUserVo vo = appMapper.getOnUserInfoByIdNumber(idNumber);
|
||||
if(vo != null && vo.getId() != null){
|
||||
saveAttData(vo,facePhoto);
|
||||
}else {
|
||||
return R.fail("人脸识别成功,但未找到入场人员信息");
|
||||
}
|
||||
}
|
||||
return !"30000".equals(code) ? R.fail(FaceStatusCodeReturn.faceStatusCodeReturn(Integer.parseInt(code)))
|
||||
:R.ok();
|
||||
} catch (Exception e) {
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String saveAttData(BmWorkerEinUserVo vo,MultipartFile facePhoto) {
|
||||
vo.setAttTime(DateUtil.now());
|
||||
vo.setDevCode("app打卡");
|
||||
vo.setDevName("app打卡设备");
|
||||
String id= StringUtils.randomUUID();
|
||||
vo.setId(id);
|
||||
vo.setAttMonth(DateUtils.getCurrentMonth());
|
||||
vo.setAttDay(DateUtils.getDate());
|
||||
vo.setCreateTime(DateUtils.getTime());
|
||||
Integer num= appMapper.getTodayIsExit(vo);
|
||||
//每日新增一条考勤信息
|
||||
if(num==null || num ==0){
|
||||
UploadFileVo uploadFileVo=fileUploadUtils.uploadFile(facePhoto, Constants.FILE_UPLOAD_ATT_PHOTO, vo.getId(),"APP考勤打卡照片","app_att",null);
|
||||
if(uploadFileVo!=null){
|
||||
vo.setImage(uploadFileVo.getPath());
|
||||
appMapper.insertAttPerson(vo);
|
||||
}
|
||||
}
|
||||
UploadFileVo uploadFileVo=fileUploadUtils.uploadFile(facePhoto, Constants.FILE_UPLOAD_ATT_RECORD_PHOTO, vo.getId(),"APP考勤打卡照片","app_att",null);
|
||||
if(uploadFileVo!=null){
|
||||
vo.setImage(uploadFileVo.getPath());
|
||||
appMapper.insertAttRecord(vo);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import com.bonus.bmw.domain.dto.WebFileDto;
|
|||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.bmw.mapper.AppMapper;
|
||||
import com.bonus.bmw.mapper.BmSubContractMapper;
|
||||
import com.bonus.bmw.service.AppService;
|
||||
|
|
@ -12,7 +13,9 @@ import com.bonus.bmw.service.BmSubContractService;
|
|||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -37,4 +40,42 @@ public class AppServiceImpl implements AppService {
|
|||
private AppMapper appMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult validatePassword(SysUser sysUser) {
|
||||
String mm = appMapper.getMm(sysUser);
|
||||
if (StringUtils.isNotEmpty(mm)) {
|
||||
if (mm.equals(SecurityUtils.encryptPassword(sysUser.getOldPassword()))) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
return AjaxResult.error("密码错误");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult updatePassword(SysUser sysUser) {
|
||||
String mm = appMapper.getMm(sysUser);
|
||||
if (StringUtils.isNotEmpty(mm)) {
|
||||
if (mm.equals(SecurityUtils.encryptPassword(sysUser.getOldPassword()))) {
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPassword()));
|
||||
int i = appMapper.updatePassword(sysUser);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.error("密码错误");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getComWorkerTree(TreeVo vo) {
|
||||
//先查公司
|
||||
List<TreeVo> companyList = appMapper.getComList(vo);
|
||||
companyList.forEach(company -> {
|
||||
List<TreeVo> subComList = appMapper.getSubComList(company);
|
||||
company.setChildList(subComList);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,19 +82,24 @@ public class BmWorkerBlackServiceImpl implements BmWorkerBlackService{
|
|||
// 添加员工时,判断员工编号是否已存在
|
||||
BmWorkerBlack w = mapper.getWorkerBlackByNumber(worker.getIdNumber());
|
||||
if (StringUtils.isNull(w)) {
|
||||
BeanValidators.validateWithException(validator, worker);
|
||||
worker.setCreateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||
int isRemove = 0;
|
||||
if(!"永久".equals(worker.getEndTime())){
|
||||
boolean beforeToday = isBeforeToday(worker.getEndTime());
|
||||
if(beforeToday){
|
||||
isRemove = 2;
|
||||
if(StringUtils.isNull(worker.getIdNumber())){
|
||||
BeanValidators.validateWithException(validator, worker);
|
||||
worker.setCreateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||
int isRemove = 0;
|
||||
if(!"永久".equals(worker.getEndTime())){
|
||||
boolean beforeToday = isBeforeToday(worker.getEndTime());
|
||||
if(beforeToday){
|
||||
isRemove = 2;
|
||||
}
|
||||
}
|
||||
worker.setIsRemove(isRemove);
|
||||
mapper.insert(worker);
|
||||
successNum++;
|
||||
successMsg.append("<br/>").append(successNum).append("、失信人员信息 ").append(worker.getName()).append(" 导入成功");
|
||||
}else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>").append(failureNum).append("、失信人员信息 ").append("必要字段不能为空");
|
||||
}
|
||||
worker.setIsRemove(isRemove);
|
||||
mapper.insert(worker);
|
||||
successNum++;
|
||||
successMsg.append("<br/>").append(successNum).append("、失信人员信息 ").append(worker.getName()).append(" 导入成功");
|
||||
} else if (isUpdateSupport) {
|
||||
BeanValidators.validateWithException(validator, worker);
|
||||
worker.setUpdateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||
|
|
|
|||
|
|
@ -157,6 +157,11 @@ public class BmWorkerWageCardServiceImpl implements BmWorkerWageCardService {
|
|||
return wageCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByWorkerId(Integer workerId) {
|
||||
mapper.deleteByWorkerId(workerId);
|
||||
}
|
||||
|
||||
private int selectWageCardAndContract(Integer id) {
|
||||
return mapper.selectWageCardAndContract(id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,10 @@ public class HomePageSubServiceImpl implements HomePageSubService {
|
|||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", worker.getContractId().toString(), Constants.FILE_UPLOAD_CONTRACT, "");
|
||||
worker.setFiles(contractFile);
|
||||
}
|
||||
|
||||
if (worker.getWageCardId() != null) {
|
||||
List<UploadFileVo> wageFile = fileUploadUtils.getFileList("", worker.getWageCardId().toString(), Constants.FILE_UPLOAD_WAGE_CARD, "");
|
||||
worker.setWageFiles(wageFile);
|
||||
}
|
||||
return AjaxResult.success("查询成功", worker);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
//删除工资卡
|
||||
wageCardService.deleteByWorkerId(id);
|
||||
return mapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
|
@ -266,7 +268,7 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
try {
|
||||
//是否以前人员,但被删除了
|
||||
PmWorker delWorker = mapper.getWorkerByNumber(worker.getIdNumber(),0);
|
||||
if(delWorker.getId() != null){
|
||||
if(delWorker != null && delWorker.getId() != null){
|
||||
mapper.updateIsActiveById(delWorker.getId(),1);
|
||||
BeanValidators.validateWithException(validator, worker);
|
||||
worker.setId(delWorker.getId());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
package com.bonus.bmw.utils;
|
||||
|
||||
/**
|
||||
* 人脸识别返回结果
|
||||
* @author zys
|
||||
*/
|
||||
public class FaceStatusCodeReturn {
|
||||
|
||||
public static String faceStatusCodeReturn(int code){
|
||||
String result = "";
|
||||
switch (code) {
|
||||
case 30000:
|
||||
result = "已知个体的人脸识别";
|
||||
break;
|
||||
case 30001:
|
||||
result = "未知个体的人脸识别";
|
||||
break;
|
||||
case 30002:
|
||||
result = "图像处理成功";
|
||||
break;
|
||||
case 30003:
|
||||
result = "没有找到人脸数据库";
|
||||
break;
|
||||
case 30004:
|
||||
result = "文件路径无效";
|
||||
break;
|
||||
case 30005:
|
||||
result = "文件后缀无效";
|
||||
break;
|
||||
case 30006:
|
||||
result = "不支持的输入文件类型;仅支持:base64,URL,本地路径";
|
||||
break;
|
||||
case 30007:
|
||||
result = "不支持的数据库更新类型";
|
||||
break;
|
||||
case 30008:
|
||||
result = "图像中发现多张人脸";
|
||||
break;
|
||||
case 30009:
|
||||
result = "光照条件差影响图像质量";
|
||||
break;
|
||||
case 30010:
|
||||
result = "人脸部分在画面外,向左或向右移动";
|
||||
break;
|
||||
case 30011:
|
||||
result = "人脸部分在画面外,向上或向下移动";
|
||||
break;
|
||||
case 30012:
|
||||
result = "图像中人脸向右旋转";
|
||||
break;
|
||||
case 30013:
|
||||
result = "图像中人脸向左旋转";
|
||||
break;
|
||||
case 30014:
|
||||
result = "图像中人脸向上旋转";
|
||||
break;
|
||||
case 30015:
|
||||
result = "图像中人脸向下旋转径";
|
||||
break;
|
||||
case 30016:
|
||||
result = "图像中人脸分辨率低";
|
||||
break;
|
||||
case 30017:
|
||||
result = "图像中人脸清晰度差";
|
||||
break;
|
||||
case 30018:
|
||||
result = "图像中未检测到人脸";
|
||||
break;
|
||||
case 30019:
|
||||
result = "身份已存在";
|
||||
break;
|
||||
default:
|
||||
result = "";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.bmw.utils;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* 外部接口地址
|
||||
*/
|
||||
public class IpAndPathConfig {
|
||||
|
||||
/**
|
||||
* 当前环境
|
||||
* 其他 本地
|
||||
* test 测试
|
||||
* prod 固定
|
||||
*/
|
||||
public static String environment = "test";
|
||||
|
||||
/**
|
||||
* 人脸检测后端相关
|
||||
*/
|
||||
public static String faceTestUrl = "http://192.168.0.14:1909/file";
|
||||
public static String faceProdUrl = "http://112.29.103.165:1617/file";
|
||||
|
||||
/**
|
||||
* 相关配置
|
||||
*/
|
||||
public static String getFaceRecognitionUrl(){
|
||||
if(environment.contains("prod")){
|
||||
return faceProdUrl;
|
||||
}else if(environment.contains("test")){
|
||||
return faceTestUrl;
|
||||
}else{
|
||||
return faceTestUrl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,4 +2,22 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.bmw.mapper.AppMapper">
|
||||
|
||||
<select id="getMm" resultType="java.lang.String">
|
||||
|
||||
select password from sys_user where user_name = #{phonenumber}
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updatePassword">
|
||||
update sys_user set password = #{password} where user_name = #{phonenumber}
|
||||
</update>
|
||||
|
||||
<select id="getComList" resultType="com.bonus.bmw.domain.vo.TreeVo">
|
||||
select id,pm_company.company_name as name from pm_company where is_active = 1 and is_enable = 1
|
||||
</select>
|
||||
|
||||
<select id="getSubComList" resultType="com.bonus.bmw.domain.vo.TreeVo">
|
||||
|
||||
select id,sub_company_name as name from pm_sub_company where is_active = 1 and is_enable = 1 and com_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
<?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.bonus.bmw.mapper.AppRecognitionMapper">
|
||||
|
||||
<select id="getTodayIsExit" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from bm_att_person
|
||||
where worker_id=#{userId} and is_active=1 and att_day=#{attDay}
|
||||
</select>
|
||||
|
||||
<!--人员考勤数据-->
|
||||
<insert id="insertAttPerson">
|
||||
insert into bm_att_person(
|
||||
id, worker_id, device_code,dev_name, id_number, name, pro_id, pro_name, sub_id, sub_name, team_id, team_name,org_id, org_name,
|
||||
att_month, att_day, daily_wage, att_time, att_photo, is_repair, create_time, is_active,contract_id
|
||||
)values (#{id},#{userId},#{devCode},#{devName},#{idNumber},#{userName},#{proId},#{proName},#{subId},#{subName},#{teamId},#{teamName},#{orgId},#{orgName},
|
||||
#{attMonth},#{attDay},#{dailyWage},#{attTime},#{image},#{isRepair},#{createTime},1,#{contractId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertAttRecord">
|
||||
insert into bm_att_record(
|
||||
id, worker_id, device_code, id_number, dev_name,name, pro_id, pro_name, sub_id, sub_name, team_id, team_name,org_id, org_name,
|
||||
att_month, att_day, daily_wage, att_time, att_photo, is_repair, create_time, is_active,contract_id
|
||||
)values (#{id},#{userId},#{devCode},#{idNumber},#{devName},#{userName},#{proId},#{proName},#{subId},#{subName},#{teamId},#{teamName},#{orgId},#{orgName},
|
||||
#{attMonth},#{attDay},#{dailyWage},#{attTime},#{image},#{isRepair},#{createTime},1,#{contractId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="getOnUserInfoByIdNumber" resultType="com.bonus.bmw.domain.dto.BmWorkerEinUserVo">
|
||||
SELECT
|
||||
bwem.worker_id userId,
|
||||
bwem.pro_name proName,
|
||||
bwem.pro_id proId,
|
||||
pw.`name` userName,
|
||||
bwem.team_name teamName,
|
||||
bwem.team_id teamId,
|
||||
pw.id_number idNumber,
|
||||
bwem.sub_id subId,
|
||||
bwem.sub_name subName,
|
||||
bwem.post_id postId,
|
||||
bwem.contract_id,
|
||||
bwc.day_rate dailyWage
|
||||
FROM
|
||||
bm_worker_ein_msg bwem
|
||||
INNER JOIN pm_worker pw ON pw.id = bwem.worker_id
|
||||
LEFT JOIN bm_worker_contract bwc ON bwc.worker_id = bwem.worker_id
|
||||
AND bwc.is_active = 1
|
||||
WHERE
|
||||
pw.id_number = #{idNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
AND pw.id_number LIKE CONCAT('%', #{idNumber}, '%')
|
||||
</if>
|
||||
<if test="workerId != null and workerId != ''">
|
||||
AND bwwc.worker_id LIKE CONCAT('%', #{workerId}, '%')
|
||||
AND bwwc.worker_id = #{workerId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
@ -145,4 +145,9 @@
|
|||
WHERE
|
||||
bwwc.id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByWorkerId">
|
||||
delete from bm_worker_wage_card
|
||||
where worker_id = #{workerId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -34,6 +34,9 @@
|
|||
<result column="exit_time" property="exitTime" />
|
||||
<result column="id_number" property="idNumber" />
|
||||
<result column="days_since_exit" property="daysSinceExit" />
|
||||
<result column="att_time" property="attTime" />
|
||||
<result column="wage_card_id" property="wageCardId" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="getMainProMsg" resultMap="BaseResultMap">
|
||||
|
|
@ -239,6 +242,7 @@
|
|||
<select id="getWorkerMsg" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
pw.id as worker_id,
|
||||
pw.id_number,
|
||||
pw.name as worker_name,
|
||||
pw.sex,
|
||||
pw.age,
|
||||
|
|
@ -249,7 +253,8 @@
|
|||
bwem.sub_name,
|
||||
psc.sub_company_name,
|
||||
bwem.light_status,
|
||||
if(bap.att_day is null ,0,1) as isAtt
|
||||
if(bap.att_day is null ,0,1) as isAtt,
|
||||
bap.att_time
|
||||
from pm_worker pw
|
||||
inner JOIN bm_worker_ein_msg bwem ON pw.id = bwem.worker_id and bwem.is_active = 1
|
||||
left join bm_att_person bap ON pw.id = bap.worker_id and bap.is_active = 1 and bap.att_day = #{currentDay}
|
||||
|
|
@ -266,6 +271,9 @@
|
|||
<if test="proName != null">
|
||||
AND locate(#{proName},bwem.pro_name)
|
||||
</if>
|
||||
<if test="idNumber != null">
|
||||
AND pw.id_number = #{idNumber}
|
||||
</if>
|
||||
<if test="subComId != null">
|
||||
AND psc.id = #{subComId}
|
||||
</if>
|
||||
|
|
@ -339,13 +347,18 @@
|
|||
bwc.contract_start_date,
|
||||
bwc.contract_stop_date,
|
||||
bwc.wage_approved_way,
|
||||
bwc.wage_criterion
|
||||
bwc.wage_criterion,
|
||||
bwwc.id as wage_card_id,
|
||||
bwwc.bank_name,
|
||||
bwwc.bank_branch_name,
|
||||
bwwc.bank_card_code
|
||||
FROM
|
||||
pm_worker pw
|
||||
INNER JOIN bm_worker_ein_msg bwem ON pw.id = bwem.worker_id
|
||||
LEFT JOIN (select * from bm_att_person where worker_id = #{id} order by att_day desc limit 1) bap on pw.id=bap.worker_id
|
||||
LEFT JOIN bm_worker_contract bwc ON pw.id = bwc.worker_id
|
||||
AND bwc.id = bwem.contract_id
|
||||
AND bwc.id = bwem.contract_id and bwc.is_active = 1
|
||||
LEFT JOIN (select * from bm_worker_wage_card where worker_id = #{id} and is_active = 1 limit 1) bwwc ON pw.id = bwwc.worker_id
|
||||
WHERE
|
||||
pw.id = #{id}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
<result column="name" property="name" />
|
||||
<result column="id_number" property="idNumber" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="age" property="age" />
|
||||
<result column="sex" property="sex" />
|
||||
<result column="ein_status" property="einStatus" />
|
||||
<result column="pro_name" property="proName" />
|
||||
<result column="sub_name" property="subName" />
|
||||
|
|
@ -28,6 +30,8 @@
|
|||
pw.`name`,
|
||||
pw.id_number,
|
||||
pw.phone,
|
||||
pw.age,
|
||||
pw.sex,
|
||||
bwepr.id,
|
||||
bwepr.pro_id,
|
||||
bwepr.pro_name,
|
||||
|
|
@ -63,6 +67,12 @@
|
|||
<if test="subId != null and subId != ''">
|
||||
AND bwepr.sub_id = #{subId}
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
AND bwepr.pro_name LIKE CONCAT('%', #{proName}, '%')
|
||||
</if>
|
||||
<if test="subName != null and subName != ''">
|
||||
AND bwepr.sub_name LIKE CONCAT('%', #{subName}, '%')
|
||||
</if>
|
||||
<if test="teamId != null and teamId != ''">
|
||||
AND bwepr.team_id = #{teamId}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue