Commit 3ac0f515 authored by fangxinjiang's avatar fangxinjiang

附属信息附件上传接口调整

parent e6354539
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -119,4 +116,12 @@ public class TEmpDisabilityInfo extends BaseEntity { ...@@ -119,4 +116,12 @@ public class TEmpDisabilityInfo extends BaseEntity {
@Schema(description ="备注") @Schema(description ="备注")
private String remark; private String remark;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField(exist = false)
private String attaIds;
} }
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -143,4 +140,19 @@ public class TEmpEducation extends BaseEntity { ...@@ -143,4 +140,19 @@ public class TEmpEducation extends BaseEntity {
@Schema(description ="备注") @Schema(description ="备注")
private String remark; private String remark;
/**
* 专业
*/
@Schema(description ="专业")
private String major;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField(exist = false)
private String attaIds;
} }
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -121,4 +118,12 @@ public class TEmpProfessionalQualification extends BaseEntity { ...@@ -121,4 +118,12 @@ public class TEmpProfessionalQualification extends BaseEntity {
*/ */
@Schema(description ="备注") @Schema(description ="备注")
private String remark; private String remark;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField(exist = false)
private String attaIds;
} }
...@@ -25,6 +25,8 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage; ...@@ -25,6 +25,8 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
...@@ -99,7 +101,8 @@ public class TEmpDisabilityInfoController { ...@@ -99,7 +101,8 @@ public class TEmpDisabilityInfoController {
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('archives_tempdisabilityinfo_add')" ) @PreAuthorize("@pms.hasPermission('archives_tempdisabilityinfo_add')" )
public R<Boolean> save(@RequestBody TEmpDisabilityInfo tEmpDisabilityInfo) { public R<Boolean> save(@RequestBody TEmpDisabilityInfo tEmpDisabilityInfo) {
return R.ok(tEmpDisabilityInfoService.save(tEmpDisabilityInfo));
return tEmpDisabilityInfoService.saveDiy(tEmpDisabilityInfo);
} }
/** /**
......
...@@ -90,8 +90,8 @@ public class TEmpProfessionalQualificationController { ...@@ -90,8 +90,8 @@ public class TEmpProfessionalQualificationController {
@SysLog("新增员工职业资格信息表" ) @SysLog("新增员工职业资格信息表" )
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('archives_tempprofessionalqualification_add')" ) @PreAuthorize("@pms.hasPermission('archives_tempprofessionalqualification_add')" )
public R save(@RequestBody TEmpProfessionalQualification tEmpProfessionalQualification) { public R<Boolean> save(@RequestBody TEmpProfessionalQualification tEmpProfessionalQualification) {
return R.ok(tEmpProfessionalQualificationService.save(tEmpProfessionalQualification)); return tEmpProfessionalQualificationService.saveDiy(tEmpProfessionalQualification);
} }
/** /**
......
...@@ -37,4 +37,6 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> { ...@@ -37,4 +37,6 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
List<TAttaInfo> getTAttaInfoList(@Param("tAttaInfo") TAttaInfo tAttaInfo); List<TAttaInfo> getTAttaInfoList(@Param("tAttaInfo") TAttaInfo tAttaInfo);
List<TAttaInfo> getKeenAtta(@Param("dayStart")LocalDateTime dayStart, @Param("values")Collection<String> values); List<TAttaInfo> getKeenAtta(@Param("dayStart")LocalDateTime dayStart, @Param("values")Collection<String> values);
int updateDomainId(@Param("domainId")String domainId, @Param("ids")List<String> ids);
} }
...@@ -49,4 +49,6 @@ public interface TAttaInfoService extends IService<TAttaInfo> { ...@@ -49,4 +49,6 @@ public interface TAttaInfoService extends IService<TAttaInfo> {
Boolean batchOssFileDelete(List<TAttaInfo> delAttaList); Boolean batchOssFileDelete(List<TAttaInfo> delAttaList);
List<TAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values); List<TAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values);
Boolean updateDomainId(String domainId, List<String> ids);
} }
...@@ -35,4 +35,6 @@ import java.util.List; ...@@ -35,4 +35,6 @@ import java.util.List;
public interface TEmpDisabilityInfoService extends IService<TEmpDisabilityInfo> { public interface TEmpDisabilityInfoService extends IService<TEmpDisabilityInfo> {
R<List<ErrorMessage>> importTmpDisability(List<EmpDisabilityExcelVO> excelVOList, BindingResult bindingResult); R<List<ErrorMessage>> importTmpDisability(List<EmpDisabilityExcelVO> excelVOList, BindingResult bindingResult);
R<Boolean> saveDiy(TEmpDisabilityInfo tEmpDisabilityInfo);
} }
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/** /**
* 员工职业资格信息表 * 员工职业资格信息表
...@@ -28,4 +29,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification ...@@ -28,4 +29,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification
*/ */
public interface TEmpProfessionalQualificationService extends IService<TEmpProfessionalQualification> { public interface TEmpProfessionalQualificationService extends IService<TEmpProfessionalQualification> {
R<Boolean> saveDiy(TEmpProfessionalQualification tEmpProfessionalQualification);
} }
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -99,4 +100,11 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo ...@@ -99,4 +100,11 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo
public List<TAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values) { public List<TAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values) {
return baseMapper.getKeenAtta(dayStart,values); return baseMapper.getKeenAtta(dayStart,values);
} }
@Override
public Boolean updateDomainId(String domainId, List<String> ids){
if (Common.isEmpty(domainId) || !Common.isNotEmpty(ids)){
return false;
}
return baseMapper.updateDomainId(domainId,ids) > 0;
}
} }
...@@ -21,12 +21,16 @@ import cn.hutool.core.collection.CollUtil; ...@@ -21,12 +21,16 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpDisabilityInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpDisabilityInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; 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.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -40,8 +44,11 @@ import java.util.Set; ...@@ -40,8 +44,11 @@ import java.util.Set;
* @author fxj * @author fxj
* @date 2022-06-18 09:39:46 * @date 2022-06-18 09:39:46
*/ */
@RequiredArgsConstructor
@Service @Service
public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInfoMapper, TEmpDisabilityInfo> implements TEmpDisabilityInfoService { public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInfoMapper, TEmpDisabilityInfo> implements TEmpDisabilityInfoService {
private final TAttaInfoMapper attaInfoMapper;
/** /**
* @Author fxj * @Author fxj
* @Description 员工伤残信息导入 * @Description 员工伤残信息导入
...@@ -82,6 +89,23 @@ public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInf ...@@ -82,6 +89,23 @@ public class TEmpDisabilityInfoServiceImpl extends ServiceImpl<TEmpDisabilityInf
} }
return R.ok(); return R.ok();
} }
@Override
public R<Boolean> saveDiy(TEmpDisabilityInfo tEmpDisabilityInfo) {
int res = baseMapper.insert(tEmpDisabilityInfo);
if (res > CommonConstants.ZERO_INT){
//更新附件信息
List<String> ids;
if (Common.isNotNull(tEmpDisabilityInfo.getAttaIds())){
ids = Common.initStrToList(tEmpDisabilityInfo.getAttaIds(), CommonConstants.COMMA_STRING);
attaInfoMapper.updateDomainId(tEmpDisabilityInfo.getId(),ids);
}
return R.ok();
}else {
return R.failed();
}
}
/** /**
* 插入excel Post * 插入excel Post
*/ */
......
...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService;
...@@ -53,6 +54,8 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T ...@@ -53,6 +54,8 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
private final TEmployeeInfoMapper employeeInfoMapper; private final TEmployeeInfoMapper employeeInfoMapper;
private final TAttaInfoMapper attaInfoMapper;
/** /**
* @Author fxj * @Author fxj
* @Description 批量导入学历信息 * @Description 批量导入学历信息
...@@ -143,8 +146,15 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T ...@@ -143,8 +146,15 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
if (Common.isNotNull(education)){ if (Common.isNotNull(education)){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING, tEmpEducation.getEducationName())); return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING, tEmpEducation.getEducationName()));
} }
//更新档案信息
updateEducationOfEmp(education); updateEducationOfEmp(education);
baseMapper.insert(tEmpEducation); baseMapper.insert(tEmpEducation);
//更新附件信息
List<String> ids;
if (Common.isNotNull(tEmpEducation.getAttaIds())){
ids = Common.initStrToList(tEmpEducation.getAttaIds(),CommonConstants.COMMA_STRING);
attaInfoMapper.updateDomainId(tEmpEducation.getId(),ids);
}
return R.ok(); return R.ok();
} }
......
...@@ -18,17 +18,41 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -18,17 +18,41 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpProfessionalQualificationMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpProfessionalQualificationMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpProfessionalQualificationService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpProfessionalQualificationService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 员工职业资格信息表 * 员工职业资格信息表
* *
* @author fxj * @author fxj
* @date 2022-06-18 09:39:46 * @date 2022-06-18 09:39:46
*/ */
@RequiredArgsConstructor
@Service @Service
public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpProfessionalQualificationMapper, TEmpProfessionalQualification> implements TEmpProfessionalQualificationService { public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpProfessionalQualificationMapper, TEmpProfessionalQualification> implements TEmpProfessionalQualificationService {
private final TAttaInfoMapper attaInfoMapper;
@Override
public R<Boolean> saveDiy(TEmpProfessionalQualification qualification) {
int res = baseMapper.insert(qualification);
if (res <= CommonConstants.ZERO_INT){
return R.failed();
}
//更新附件信息
List<String> ids;
if (Common.isNotNull(qualification.getAttaIds())){
ids = Common.initStrToList(qualification.getAttaIds(), CommonConstants.COMMA_STRING);
attaInfoMapper.updateDomainId(qualification.getId(),ids);
}
return R.ok();
}
} }
...@@ -27,6 +27,7 @@ import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ; ...@@ -27,6 +27,7 @@ import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpWorkRecordingMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpWorkRecordingMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpWorkRecordingService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpWorkRecordingService;
...@@ -54,6 +55,8 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM ...@@ -54,6 +55,8 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
private final TEmployeeInfoMapper employeeInfoMapper; private final TEmployeeInfoMapper employeeInfoMapper;
private final TAttaInfoMapper attaInfoMapper;
@Override @Override
public R<List<ErrorMessage>> importEmpWorkRecord(List<EmpWorkRecordExcelVO> excelVOList, BindingResult bindingResult) { public R<List<ErrorMessage>> importEmpWorkRecord(List<EmpWorkRecordExcelVO> excelVOList, BindingResult bindingResult) {
// 通用校验获取失败的数据 // 通用校验获取失败的数据
......
...@@ -92,4 +92,18 @@ ...@@ -92,4 +92,18 @@
and a.relation_type in ("3","4") and a.relation_type in ("3","4")
</where> </where>
</select> </select>
<update id="updateDomainId">
update t_atta_info
<trim prefix="set" suffixOverrides=",">
domain_id=#{domainId}
</trim>
WHERE
<if test="ids != null and ids.size() > 0">
id in
<foreach collection="ids" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
</update>
</mapper> </mapper>
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
<result property="createName" column="CREATE_NAME"/> <result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<result property="major" column="MAJOR"/>
<result property="remark" column="REMARK"/> <result property="remark" column="REMARK"/>
<result property="certificationName" column="CERTIFICATION_NAME"/> <result property="certificationName" column="CERTIFICATION_NAME"/>
......
...@@ -11,4 +11,38 @@ public interface ChecksConstants { ...@@ -11,4 +11,38 @@ public interface ChecksConstants {
String NACOS_CHECK_CONFIG_ERROR="nacos中checks.yaml的配置canCheck未开启!"; String NACOS_CHECK_CONFIG_ERROR="nacos中checks.yaml的配置canCheck未开启!";
String CODE="code"; String CODE="code";
String DATA="data";
String CODE_200000="200000";
String NO_DATA_RESULT="接口无返回数据";
String MESSAGE="message";
String MOBILE="mobile";
String AREA="area";
String NUMBER_TYPE ="numberType";
String CHARGES_STATUS = "chargesStatus";
String STATUS="status";
String RESULT="result";
String REMARK="remark";
String APP_ID ="appId";
String APP_KEY="appKey";
String MOBILES="mobiles";
String NAME="name";
String ID_NUM="idNum";
String CARD_NO="cardNo";
} }
...@@ -25,11 +25,11 @@ public class ChecksUtil { ...@@ -25,11 +25,11 @@ public class ChecksUtil {
@Value("${canCheck:false}") @Value("${canCheck:false}")
private static boolean canCheck; private static boolean canCheck;
private static final String APP_ID_ID_CARD = "oi0mucL4"; private static final String APP_ID = "oi0mucL4";
private static final String APP_KEY_ID_CARD = "s4lW5JRA"; private static final String APP_KEY = "s4lW5JRA";
private static final String API_URL_ID_CARD = "https://api.253.com/open/idcard/id-card-auth"; private static final String API_URL = "https://api.253.com/open/idcard/id-card-auth";
private static JsonParser jsonParser = new JsonParser(); private static JsonParser jsonParser = new JsonParser();
...@@ -87,29 +87,29 @@ public class ChecksUtil { ...@@ -87,29 +87,29 @@ public class ChecksUtil {
if (jsonObject != null) { if (jsonObject != null) {
//响应code码。200000:成功,其他失败 //响应code码。200000:成功,其他失败
String code = jsonObject.get(ChecksConstants.CODE).getAsString(); String code = jsonObject.get(ChecksConstants.CODE).getAsString();
if ("200000".equals(code) && jsonObject.get("data") != null) { if (ChecksConstants.CODE_200000.equals(code) && jsonObject.get(ChecksConstants.DATA) != null) {
// 调用身份信息校验成功 // 调用身份信息校验成功
// 解析结果数据,进行业务处理 // 解析结果数据,进行业务处理
// 校验状态码 200000:成功,其他失败 // 校验状态码 200000:成功,其他失败
JsonObject resJson = jsonObject.get("data").getAsJsonObject(); JsonObject resJson = jsonObject.get(ChecksConstants.DATA).getAsJsonObject();
String message = jsonObject.get("message").getAsString(); String message = jsonObject.get(ChecksConstants.MESSAGE).getAsString();
if (Common.isNotNull(resJson)){ if (Common.isNotNull(resJson)){
TCheckBankNo bankNo = new TCheckBankNo(); TCheckBankNo bankNo = new TCheckBankNo();
bankNo.setBankNo(resJson.getAsJsonObject().get("bankNo").getAsString()); bankNo.setBankNo(resJson.getAsJsonObject().get("bankNo").getAsString());
bankNo.setBankName(resJson.getAsJsonObject().get("bankName").getAsString()); bankNo.setBankName(resJson.getAsJsonObject().get("bankName").getAsString());
bankNo.setCardCategory(resJson.getAsJsonObject().get("cardCategory").getAsString()); bankNo.setCardCategory(resJson.getAsJsonObject().get("cardCategory").getAsString());
bankNo.setCardType(resJson.getAsJsonObject().get("cardType").getAsString()); bankNo.setCardType(resJson.getAsJsonObject().get("cardType").getAsString());
bankNo.setResult(resJson.getAsJsonObject().get("result").getAsString()); bankNo.setResult(resJson.getAsJsonObject().get(ChecksConstants.RESULT).getAsString());
bankNo.setMessage(message); bankNo.setMessage(message);
bankNo.setRemark(resJson.getAsJsonObject().get("remark").getAsString()); bankNo.setRemark(resJson.getAsJsonObject().get(ChecksConstants.REMARK).getAsString());
bankNo.setType(CommonConstants.ONE_STRING); bankNo.setType(CommonConstants.ONE_STRING);
} }
} else { } else {
// 记录错误日志,正式项目中请换成log打印 // 记录错误日志,正式项目中请换成log打印
return R.failed("银行卡号校验失败,code:" + code + ",msg:" + jsonObject.get("message").getAsString()); return R.failed("银行卡号校验失败,code:" + code + ",msg:" + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
} }
} else { } else {
return R.failed("接口无返回数据"); return R.failed(ChecksConstants.NO_DATA_RESULT);
} }
return R.ok(checkBankNo); return R.ok(checkBankNo);
} }
...@@ -128,22 +128,22 @@ public class ChecksUtil { ...@@ -128,22 +128,22 @@ public class ChecksUtil {
if (jsonObject != null) { if (jsonObject != null) {
//响应code码。200000:成功,其他失败 //响应code码。200000:成功,其他失败
String code = jsonObject.get(ChecksConstants.CODE).getAsString(); String code = jsonObject.get(ChecksConstants.CODE).getAsString();
if ("200000".equals(code) && jsonObject.get("data") != null) { if (ChecksConstants.CODE_200000.equals(code) && jsonObject.get(ChecksConstants.DATA) != null) {
// 调用身份信息校验成功 // 调用身份信息校验成功
// 解析结果数据,进行业务处理 // 解析结果数据,进行业务处理
// 校验状态码 200000:成功,其他失败 // 校验状态码 200000:成功,其他失败
JsonObject resJson = jsonObject.get("data").getAsJsonObject(); JsonObject resJson = jsonObject.get(ChecksConstants.DATA).getAsJsonObject();
String message = jsonObject.get("message").getAsString(); String message = jsonObject.get(ChecksConstants.MESSAGE).getAsString();
JsonArray mobileArray = resJson.getAsJsonArray(); JsonArray mobileArray = resJson.getAsJsonArray();
if (Common.isNotNull(mobileArray) && mobileArray.size() > CommonConstants.ZERO_INT){ if (Common.isNotNull(mobileArray) && mobileArray.size() > CommonConstants.ZERO_INT){
TCheckMobile mobile = null; TCheckMobile mobile = null;
for (int i = 0;i < mobileArray.size(); i++){ for (int i = 0;i < mobileArray.size(); i++){
mobile = new TCheckMobile(); mobile = new TCheckMobile();
mobile.setMobile(mobileArray.get(i).getAsJsonObject().get("mobile").getAsString()); mobile.setMobile(mobileArray.get(i).getAsJsonObject().get(ChecksConstants.MOBILE).getAsString());
mobile.setArea(mobileArray.get(i).getAsJsonObject().get("area").getAsString()); mobile.setArea(mobileArray.get(i).getAsJsonObject().get(ChecksConstants.AREA).getAsString());
mobile.setNumbertype(mobileArray.get(i).getAsJsonObject().get("numberType").getAsString()); mobile.setNumbertype(mobileArray.get(i).getAsJsonObject().get(ChecksConstants.NUMBER_TYPE).getAsString());
mobile.setChargesstatus(mobileArray.get(i).getAsJsonObject().get("chargesStatus").getAsString()); mobile.setChargesstatus(mobileArray.get(i).getAsJsonObject().get(ChecksConstants.CHARGES_STATUS).getAsString());
mobile.setStatus(mobileArray.get(i).getAsJsonObject().get("status").getAsString()); mobile.setStatus(mobileArray.get(i).getAsJsonObject().get(ChecksConstants.STATUS).getAsString());
mobile.setMessage(message); mobile.setMessage(message);
mobile.setType(CommonConstants.ONE_STRING); mobile.setType(CommonConstants.ONE_STRING);
checkMobileMap.put(mobile.getMobile(),mobile); checkMobileMap.put(mobile.getMobile(),mobile);
...@@ -151,10 +151,10 @@ public class ChecksUtil { ...@@ -151,10 +151,10 @@ public class ChecksUtil {
} }
} else { } else {
// 记录错误日志,正式项目中请换成log打印 // 记录错误日志,正式项目中请换成log打印
return R.failed("手机号校验失败,code:" + code + ",msg:" + jsonObject.get("message").getAsString()); return R.failed("手机号校验失败,code:" + code + ",msg:" + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
} }
} else { } else {
return R.failed("接口无返回数据"); return R.failed(ChecksConstants.NO_DATA_RESULT);
} }
return R.ok(checkMobileMap); return R.ok(checkMobileMap);
} }
...@@ -166,37 +166,37 @@ public class ChecksUtil { ...@@ -166,37 +166,37 @@ public class ChecksUtil {
if (jsonObject != null) { if (jsonObject != null) {
//响应code码。200000:成功,其他失败 //响应code码。200000:成功,其他失败
String code = jsonObject.get(ChecksConstants.CODE).getAsString(); String code = jsonObject.get(ChecksConstants.CODE).getAsString();
if ("200000".equals(code) && jsonObject.get("data") != null) { if (ChecksConstants.CODE_200000.equals(code) && jsonObject.get(ChecksConstants.DATA) != null) {
// 调用身份信息校验成功 // 调用身份信息校验成功
// 解析结果数据,进行业务处理 // 解析结果数据,进行业务处理
// 校验状态码 200000:成功,其他失败 // 校验状态码 200000:成功,其他失败
String resultStr = jsonObject.get("data").getAsJsonObject().get("result").getAsString(); String resultStr = jsonObject.get(ChecksConstants.DATA).getAsJsonObject().get(ChecksConstants.RESULT).getAsString();
if ("01".equals(resultStr)) { if ("01".equals(resultStr)) {
checkIdCard.setIsTrue(1); checkIdCard.setIsTrue(1);
checkIdCard.setReason("正确"); checkIdCard.setReason("正确");
} else { } else {
checkIdCard.setIsTrue(0); checkIdCard.setIsTrue(0);
String remark = jsonObject.get("data").getAsJsonObject().get("remark").getAsString(); String remark = jsonObject.get(ChecksConstants.DATA).getAsJsonObject().get(ChecksConstants.REMARK).getAsString();
checkIdCard.setReason("调用身份信息校验失败,resultStr:" + resultStr + ",msg:" + remark); checkIdCard.setReason("调用身份信息校验失败,resultStr:" + resultStr + ",msg:" + remark);
} }
} else { } else {
// 记录错误日志,正式项目中请换成log打印 // 记录错误日志,正式项目中请换成log打印
checkIdCard.setIsTrue(0); checkIdCard.setIsTrue(0);
checkIdCard.setReason("调用身份信息校验失败,code:" + code + ",msg:" + jsonObject.get("message").getAsString()); checkIdCard.setReason("调用身份信息校验失败,code:" + code + ",msg:" + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
} }
} else { } else {
checkIdCard.setIsTrue(0); checkIdCard.setIsTrue(0);
checkIdCard.setReason("接口无返回数据"); checkIdCard.setReason(ChecksConstants.NO_DATA_RESULT);
} }
} }
private static JsonObject invokeIdCard(String name, String idNum) { private static JsonObject invokeIdCard(String name, String idNum) {
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("appId", APP_ID_ID_CARD); params.put(ChecksConstants.APP_ID, APP_ID);
params.put("appKey", APP_KEY_ID_CARD); params.put(ChecksConstants.APP_KEY, APP_KEY);
params.put("name", name); params.put(ChecksConstants.NAME, name);
params.put("idNum", idNum); params.put(ChecksConstants.ID_NUM, idNum);
String result = HttpUtils.post(API_URL_ID_CARD, params); String result = HttpUtils.post(API_URL, params);
// 解析json,并返回结果 // 解析json,并返回结果
return jsonParser.parse(result).getAsJsonObject(); return jsonParser.parse(result).getAsJsonObject();
} }
...@@ -209,23 +209,23 @@ public class ChecksUtil { ...@@ -209,23 +209,23 @@ public class ChecksUtil {
**/ **/
private static JsonObject invokeMobile(String mobiles) { private static JsonObject invokeMobile(String mobiles) {
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("appId", APP_ID_ID_CARD); params.put(ChecksConstants.APP_ID, APP_ID);
params.put("appKey", APP_KEY_ID_CARD); params.put(ChecksConstants.APP_KEY, APP_KEY);
params.put("mobiles", mobiles); params.put(ChecksConstants.MOBILES, mobiles);
String result = HttpUtils.post(API_URL_ID_CARD, params); String result = HttpUtils.post(API_URL, params);
// 解析json,并返回结果 // 解析json,并返回结果
return jsonParser.parse(result).getAsJsonObject(); return jsonParser.parse(result).getAsJsonObject();
} }
private static JsonObject invokeBankNo(String name, String idNum, String cardNo, String mobile) { private static JsonObject invokeBankNo(String name, String idNum, String cardNo, String mobile) {
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("appId", APP_ID_ID_CARD); params.put(ChecksConstants.APP_ID, APP_ID);
params.put("appKey", APP_KEY_ID_CARD); params.put(ChecksConstants.APP_KEY, APP_KEY);
params.put("name", name); params.put(ChecksConstants.NAME, name);
params.put("idNum", idNum); params.put(ChecksConstants.ID_NUM, idNum);
params.put("cardNo", cardNo); params.put(ChecksConstants.CARD_NO, cardNo);
params.put("mobile", mobile); params.put(ChecksConstants.MOBILE, mobile);
String result = HttpUtils.post(API_URL_ID_CARD, params); String result = HttpUtils.post(API_URL, params);
// 解析json,并返回结果 // 解析json,并返回结果
return jsonParser.parse(result).getAsJsonObject(); return jsonParser.parse(result).getAsJsonObject();
} }
......
...@@ -43,7 +43,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -43,7 +43,6 @@ import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/tcheckbankno" ) @RequestMapping("/tcheckbankno" )
@Tag(name = "银行卡卡号 校验管理") @Tag(name = "银行卡卡号 校验管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TCheckBankNoController { public class TCheckBankNoController {
private final TCheckBankNoService tCheckBankNoService; private final TCheckBankNoService tCheckBankNoService;
...@@ -56,7 +55,6 @@ public class TCheckBankNoController { ...@@ -56,7 +55,6 @@ public class TCheckBankNoController {
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('demo_tcheckbankno_get')" )
public R getTCheckBankNoPage(Page page, TCheckBankNo tCheckBankNo) { public R getTCheckBankNoPage(Page page, TCheckBankNo tCheckBankNo) {
return R.ok(tCheckBankNoService.page(page, Wrappers.query(tCheckBankNo))); return R.ok(tCheckBankNoService.page(page, Wrappers.query(tCheckBankNo)));
} }
...@@ -122,9 +120,12 @@ public class TCheckBankNoController { ...@@ -122,9 +120,12 @@ public class TCheckBankNoController {
*/ */
@Operation(description = "银行卡号校验") @Operation(description = "银行卡号校验")
@SysLog("银行卡号校验" ) @SysLog("银行卡号校验" )
@Inner //@Inner
@GetMapping("/checkBankNo" ) @GetMapping("/checkBankNo" )
public R<TCheckBankNo> checkBankNo(String name, String idNum, String cardNo, String mobile) { public R<TCheckBankNo> checkBankNo(@RequestParam(value = "name",required = true)String name,
@RequestParam(value = "idNum",required = true)String idNum,
@RequestParam(value = "cardNo",required = true)String cardNo,
@RequestParam(value = "mobile",required = false) String mobile) {
return tCheckBankNoService.checkBankNo(name,idNum,cardNo,mobile); return tCheckBankNoService.checkBankNo(name,idNum,cardNo,mobile);
} }
} }
...@@ -22,7 +22,7 @@ import java.util.Map; ...@@ -22,7 +22,7 @@ import java.util.Map;
/** /**
* 身份证实名校验自留库 * 身份证实名校验自留库
* *
* @author hgw * @author fxj
* @date 2022-05-11 16:12:18 * @date 2022-05-11 16:12:18
*/ */
@RestController @RestController
...@@ -122,7 +122,7 @@ public class TCheckIdCardController { ...@@ -122,7 +122,7 @@ public class TCheckIdCardController {
/** /**
* @param checkList * @param checkList
* @Description: 校验姓名身份证 * @Description: 校验姓名身份证
* @Author: hgw * @Author: fxj
* @Date: 2022-5-12 15:18:53 * @Date: 2022-5-12 15:18:53
* @return: com.yifu.cloud.v1.common.core.util.R * @return: com.yifu.cloud.v1.common.core.util.R
**/ **/
......
...@@ -43,7 +43,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -43,7 +43,6 @@ import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/tcheckmobile" ) @RequestMapping("/tcheckmobile" )
@Tag(name = "手机号码校验管理") @Tag(name = "手机号码校验管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TCheckMobileController { public class TCheckMobileController {
private final TCheckMobileService tCheckMobileService; private final TCheckMobileService tCheckMobileService;
...@@ -56,7 +55,6 @@ public class TCheckMobileController { ...@@ -56,7 +55,6 @@ public class TCheckMobileController {
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('demo_tcheckmobile_get')" )
public R getTCheckMobilePage(Page page, TCheckMobile tCheckMobile) { public R getTCheckMobilePage(Page page, TCheckMobile tCheckMobile) {
return R.ok(tCheckMobileService.page(page, Wrappers.query(tCheckMobile))); return R.ok(tCheckMobileService.page(page, Wrappers.query(tCheckMobile)));
} }
......
...@@ -13,3 +13,15 @@ spring: ...@@ -13,3 +13,15 @@ spring:
config: config:
activate: activate:
on-profile: dev on-profile: dev
## spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://127.0.0.1:3000/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
\ No newline at end of file
...@@ -11,4 +11,16 @@ spring: ...@@ -11,4 +11,16 @@ spring:
url: jdbc:mysql://192.168.1.65:22306/yifu_checks?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true url: jdbc:mysql://192.168.1.65:22306/yifu_checks?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
config: config:
activate: activate:
on-profile: test on-profile: test
\ No newline at end of file ## spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://127.0.0.1:3000/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
\ No newline at end of file
...@@ -13,22 +13,6 @@ management: ...@@ -13,22 +13,6 @@ management:
endpoint: endpoint:
health: health:
show-details: ALWAYS show-details: ALWAYS
## spring security 配置
security:
oauth2:
client:
client-id: ENC(27v1agvAug87ANOVnbKdsw==)
client-secret: ENC(VbnkopxrwgbFVKp+UxJ2pg==)
scope: server
resource:
loadBalanced: true
token-info-uri: http://yifu-auth/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
# mybaits-plus配置 # mybaits-plus配置
mybatis-plus: mybatis-plus:
...@@ -45,4 +29,37 @@ mybatis-plus: ...@@ -45,4 +29,37 @@ mybatis-plus:
spring: spring:
application: application:
name: @artifactId@ name: @artifactId@
\ No newline at end of file #swagger 文档 https://springdoc.org/
### OpenAPI3 注解
# OpenAPI 3 注解位置
# @Tag(name = “接口类描述”) Controller 类上
# @Operation(summary =“接口方法描述”) Controller 方法上
# @Parameters Controller 方法上
# @Parameter(description=“参数描述”) Controller 方法上 @Parameters 里
# @Parameter(description=“参数描述”) Controller 方法的参数上
# @Parameter(hidden = true) 或 @Hidden --
# @Schema DTO类上
# @Schema DTO属性上
springdoc:
api-docs:
#是否开启文档功能
enabled: true
#swagger后端请求地址
path: /api-docs
swagger-ui:
#自定义swagger前端请求路径,输入http:127.0.0.1:8080/test会自动重定向到swagger页面
path: /api
#包扫描路径
packages-to-scan: com.yifu.cloud.plus.v1.check.controller
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
#分组名
#- group: admin
#按路径匹配
# pathsToMatch: /admin/**
#分组名
- group: checks
#按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.check.controller
\ No newline at end of file
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