Commit 92e8b945 authored by fangxinjiang's avatar fangxinjiang

批量审核

parent 4b48583b
......@@ -40,6 +40,12 @@ public class YifuUser extends User {
@Getter
private final Long deptId;
/**
* 部门名称
*/
@Getter
private final String deptName;
/**
* 用户名称
*/
......@@ -64,12 +70,13 @@ public class YifuUser extends User {
@Getter
private final String userGroup;
public YifuUser(String id, Long deptId, String username, String nickname,String systemFlag, String password, String phone, boolean enabled,
public YifuUser(String id, Long deptId,String deptName, String username, String nickname,String systemFlag, String password, String phone, boolean enabled,
boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked,String userGroup,
Collection<? extends GrantedAuthority> authorities) {
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
this.id = id;
this.deptId = deptId;
this.deptName = deptName;
this.phone = phone;
this.nickname = nickname;
this.systemFlag = systemFlag;
......
......@@ -23,6 +23,12 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-check-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author fxj
* @Date 2022/7/11
* @Description
* @Version 1.0
*/
@Log4j2
@EnableConfigurationProperties(DaprCheckProperties.class)
public class CheckDaprUtil {
@Autowired
private DaprCheckProperties daprCheckProperties;
/**
* @Author fxj
* @Description 身份证&姓名一致性校验
* @Date 21:15 2022/7/18
* @Param
* @return
**/
public R<TCheckIdCard> checkIdCardSingle(TCheckIdCard tCheckIdCard){
R<TCheckIdCard> res = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),daprCheckProperties.getAppId(),"/tcheckidcard/inner/checkIdCardSingle",JSON.toJSONString(tCheckIdCard), TCheckIdCard.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("校验身份证信息失败!");
}
return res;
}
}
......@@ -69,7 +69,7 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered {
SysUser user = info.getSysUser();
// 构造security用户
return new YifuUser(user.getUserId(), user.getDeptId(), user.getUsername(),user.getNickname(),user.getSystemFlag(),
return new YifuUser(user.getUserId(), user.getDeptId(),user.getDeptName(), user.getUsername(),user.getNickname(),user.getSystemFlag(),
SecurityConstants.BCRYPT + user.getPassword(), user.getPhone(), true, true,
true, StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL), user.getUserGroup(),authorities);
}
......
package com.yifu.cloud.plus.v1.yifu.social.constants;
public class DispatchConstants {
public static final String UPDATE_SOCIAL_AND_FUND_FAIL = "更新社保或公积金办理状态失败!";
public static final String NO_CONTRACT_INFO = "无合同数据,请补充合同信息后导入(合同名称、合同类型等信息)!";
public static final String ADD_EMP_CONTRACTOR_FAIL = "新增员工合同失败:";
public static final String ADD_EMP_FAIL = "新增员工失败:";
public static final String PARAM_ERROR = "传参有误!";
public static final String DISPATCH_AUDIT_ERROR = "派单审核异常:";
public static final String NO_OPERATOR_DATA = "无数据可操作";
public static final String EMP_CONTRACTOR_SERVER_ERROR = "员工合同新增服务异常!";
public static final String FUND_REDUCE_FAIL= "公积金派减失败:";
public static final String EMP_PHONE_INVALID = "档案手机号无效,请更新档案或模板的手机号码!";
public static final String DISPATCH_PHONE_NOT_EMPTY = "派单手机号不可为空,请更新档案或模板的手机号码!";
/**
* 社保派单
* '缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳) PAYMENT_TYPE
*/
enum PaymentType {
LATEST("0", "最低"),
SHORT("1", "自定义"),
BATCHADD("2", "最高");
private String code;
private String desc;
PaymentType(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
}
/**
* 社保
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String SOCIAL_INFO= "tSocialInfo";
/**
* 公积金
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String PROVIDENT_INFO= "tProvidentFund";
/**
* 员工ID传参有误
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String PARAM_EMPLOYEE_ID_EMPTY = "传参有误:员工ID不可为空";
/**
* 无对应员工ID的员工数据
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String NO_EMPLOYEE_OF_ID = "无对应员工ID的员工信息";
/**
* 员工、社保、公积金信息
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String EMPLOYEE_SOCIAL_FUND_INFO ="员工、社保、公积金信息";
/**
* 派单ID不可为空,多个ID请用逗号分割
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String DISPATCH_ID_NOT_EMPTY ="派单ID不可为空,多个ID请用逗号分割!";
/**
* offical
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String OFFICE = "offical";
/**
* add
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String ADD = "add";
/**
* minus
* @Author fxj
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String MINUS = "minus";
/**
* 更新缴费库薪资结算状态失败
* @Author fxj
* @Date 2022-01-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String UPDATE_RELATION_FROM_SALARY_FAILED = "更新缴费库薪资结算状态失败,请重新尝试或联系管理人员!";
public static final String UNIT_PENSION_CARDINAL_NOT_NULL= "单位养老基数不能为空!";
public static final String UNIT_MEDICAL_CARDINAL_NOT_NULL= "单位医疗基数不能为空!";
public static final String UNIT_UNEMPLOYMENT_CARDINAL_NOT_NULL= "单位失业基数不能为空!";
public static final String UNIT_INJURY_CARDINAL_NOT_NULL= "单位工伤基数不能为空!";
public static final String UNIT_BIRTH_CARDINAL_NOT_NULL= "单位生育基数不能为空!";
public static final String PERSONAL_PENSION_CARDINAL_NOT_NULL= "个人养老基数不能为空!";
public static final String PERSONAL_MEDICAL_CARDINAL_NOT_NULL= "个人医疗基数不能为空!";
public static final String PERSONAL_UNEMPLOYMENT_CARDINAL_NOT_NULL= "个人失业基数不能为空!";
public static final String UNIT_PENSION_CARDINAL_LIMIT_ERROR= "单位养老基数不可大于上限或小于下限!";
public static final String UNIT_MEDICAL_CARDINAL_LIMIT_ERROR= "单位医疗基数不可大于上限或小于下限!";
public static final String UNIT_UNEMPLOYMENT_CARDINAL_LIMIT_ERROR= "单位失业基数不可大于上限或小于下限!";
public static final String UNIT_INJURY_CARDINAL_LIMIT_ERROR= "单位工伤基数不可大于上限或小于下限!";
public static final String UNIT_BIRTH_CARDINAL_LIMIT_ERROR= "单位生育基数不可大于上限或小于下限!";
public static final String PERSONAL_PENSION_CARDINAL_LIMIT_ERROR= "个人养老基数不可大于上限或小于下限!";
public static final String PERSONAL_MEDICAL_CARDINAL_LIMIT_ERROR= "个人医疗基数不可大于上限或小于下限!";
public static final String PERSONAL_UNEMPLOYMENT_CARDINAL_LIMIT_ERROR= "个人失业基数不可大于上限或小于下限!";
public static final String UNIT_FUND_CARDINAL_LIMIT_ERROR= "公积金基数不可大于上限或小于下限!";
public static final String EMPLOYEE= "员工:";
}
......@@ -388,6 +388,7 @@ public class TDispatchInfo extends BaseEntity {
@Schema(description = "审核意见" )
@ExcelProperty("审核意见" )
private String auditRemark;
/**
* 公积金办理备注
*/
......
......@@ -26,16 +26,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.http.HttpHeaders;
import lombok.extern.log4j.Log4j2;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -43,13 +43,13 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 派单信息记录表
*
* @author fxj
* @date 2022-07-15 11:38:05
*/
@Log4j2
@RestController
@RequiredArgsConstructor
@RequestMapping("/tdispatchinfo" )
......@@ -230,4 +230,43 @@ public class TDispatchInfoController {
public R<List<ErrorMessage>> importListReduce(@RequestBody MultipartFile file){
return tDispatchInfoService.importReduceDiy(file.getInputStream());
}
/**
* @Author fxj
* @Description 派单申请批量审核
* @Date 16:54 2022/7/25
* @Param
* @return
**/
@Operation(description = "派单申请批量审核,传参派单ID hasPermission('wxhr:tdispatchinfo_addApplyAudit')")
@PostMapping("/addApplyAudit")
@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_addApplyAudit')")
public R<List<ErrorMessage>> addApplyAudit(@RequestParam(name = "ids", required = true) String ids,
@RequestParam(name = "auditStatus", required = true) String auditStatus,
@RequestParam(name = "auditRemark", required = false) String auditRemark) {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed(CommonConstants.USER_FAIL);
}
try {
if (!Common.isNotNull(ids)) {
return R.failed(DispatchConstants.DISPATCH_ID_NOT_EMPTY);
}
Integer flag = 1;
if (CommonConstants.ONE_STRING.equals(auditStatus)) {
//审核通过
flag = CommonConstants.ZERO_INT;
} else if (CommonConstants.TWO_STRING.equals(auditStatus)) {
//审核不通过
flag = CommonConstants.ONE_INT;
} else {
return R.failed("派单审核状态参数异常:0待审核 1审核通过 2审核不通过");
}
List<ErrorMessage> errorInfo = tDispatchInfoService.addBatchApplyAudit(Common.initStrToList(ids, CommonConstants.COMMA_STRING), user, flag, auditStatus, null==auditRemark?"":auditRemark);
return R.ok(errorInfo,"派单审核结果:");
} catch (Exception e) {
log.error("派单审核异常:" + e.getMessage());
return R.failed("数据异常,派单审核失败!");
}
}
}
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
......@@ -53,4 +54,6 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<Boolean> removeByIdDiy(String id);
DispatchDetailVo getSocialAndFundInfoById(String id);
List<ErrorMessage> addBatchApplyAudit(List<String> initStrToList, YifuUser user, Integer flag, String auditStatus, String auditRemark);
}
......@@ -20,9 +20,7 @@ public class ServiceUtil {
/**
* @Description: 返回字符串对应的int值
* @Author: hgw
* @Date: 2022/7/18 17:29
* @return: int
**/
public static int convertStringToInt(String num1) {
if (Common.isEmpty(num1) || !Common.isNumber(num1)) {
......
......@@ -97,6 +97,12 @@ public class SysUser extends BaseEntity {
@Schema(description = "用户所属部门id")
private Long deptId;
/**
* 部门名称
*/
@Schema(description = "部门名称")
private String deptName;
/**
* 用户分组
*/
......
......@@ -40,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.enums.MenuTypeEnum;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo;
......@@ -96,6 +97,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
BeanUtils.copyProperties(userDto, sysUser);
sysUser.setDelFlag(CommonConstants.STATUS_NORMAL);
sysUser.setPassword(ENCODER.encode(userDto.getPassword()));
initDeptName(sysUser);
baseMapper.insert(sysUser);
userDto.getRole().stream().map(roleId -> {
SysUserRole userRole = new SysUserRole();
......@@ -106,6 +108,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return Boolean.TRUE;
}
private void initDeptName(SysUser sysUser) {
if (Common.isNotNull(sysUser.getDeptId())){
SysDept sysDept = sysDeptMapper.selectById(sysUser.getDeptId());
if (Common.isNotNull(sysDept)) {
sysUser.setDeptName(sysDept.getName());
}
}
}
/**
* 通过查用户的全部信息
* @param sysUser 用户
......@@ -198,6 +209,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
sysUser.setPhone(userDto.getPhone());
sysUser.setUserId(userVO.getUserId());
sysUser.setAvatar(userDto.getAvatar());
sysUser.setDeptId(userDto.getDeptId());
initDeptName(sysUser);
return this.updateById(sysUser);
}
......@@ -214,7 +227,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
SysUser sysUser = new SysUser();
BeanUtils.copyProperties(userDto, sysUser);
sysUser.setUpdateTime(LocalDateTime.now());
initDeptName(sysUser);
/*if (StrUtil.isNotBlank(userDto.getPassword())) {
sysUser.setPassword(ENCODER.encode(userDto.getPassword()));
}*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment