Commit 03542cf5 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents bc195002 88d8657e
...@@ -125,4 +125,15 @@ public class ArchivesConstants { ...@@ -125,4 +125,15 @@ public class ArchivesConstants {
* 项目 获取区域数据失败: * 项目 获取区域数据失败:
*/ */
public static final String SETTLE_DOMAIN_CHECK_AREA_NOT_EXISTS = "获取区域数据失败:"; public static final String SETTLE_DOMAIN_CHECK_AREA_NOT_EXISTS = "获取区域数据失败:";
/**
* 合同审核意见不可为空
*/
public static final String CONTRACT_AUDIT_STATUS_NOT_EMPTY = "审核意见必填!";
/**
* 审核说明不可超过200字
*/
public static final String CONTRACT_AUDIT_REMARK_TOO_LONG = "审核说明不可超过200字!";
} }
...@@ -384,6 +384,12 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -384,6 +384,12 @@ public class TEmployeeContractInfo extends BaseEntity {
@Schema(description = "审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)") @Schema(description = "审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)")
private Integer auditStatus; private Integer auditStatus;
/**
* 审核人
*/
@Schema(description = "审核人")
private String auditUserName;
/** /**
* 最新审核通过时间 * 最新审核通过时间
*/ */
......
...@@ -366,6 +366,9 @@ public class TEmployeeProject extends BaseEntity { ...@@ -366,6 +366,9 @@ public class TEmployeeProject extends BaseEntity {
/** /**
* 员工合同状态(字典) * 员工合同状态(字典)
* 0 无合同
* 2 不在用
* 1 在用
*/ */
@Schema(description = "员工合同状态(字典)0初始状态") @Schema(description = "员工合同状态(字典)0初始状态")
@ExcelAttribute(name = "合同状态", isDataId = true,dataType = ExcelAttributeConstants.PERSONNEL_STATE) @ExcelAttribute(name = "合同状态", isDataId = true,dataType = ExcelAttributeConstants.PERSONNEL_STATE)
......
...@@ -213,9 +213,9 @@ public class TSettleDomain extends BaseEntity { ...@@ -213,9 +213,9 @@ public class TSettleDomain extends BaseEntity {
private Integer town; private Integer town;
/** /**
* 服务状态:0正常 1停止服务 * 服务状态:0正常 1停止服务 2冻结
*/ */
@Schema(description = "服务状态:0正常 1停止服务") @Schema(description = "服务状态:0正常 1停止服务 2冻结")
private String stopFlag; private String stopFlag;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author fxj
* @Date 2022/12/12
* @Description
* @Version 1.0
*/
@Data
public class EmpContractAuditVo implements Serializable {
/**
* 审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)
*/
@Schema(description = "审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)")
private Integer auditStatus;
/**
* 审核原因
*/
@Schema(description = "审核说明,前端传参用,字段不存数据库,数据库存审核记录")
@TableField(exist = false)
private String auditRemark;
/**
* 待审核IDS
*/
private List<String> ids;
}
...@@ -450,6 +450,14 @@ public class EmployeeProjectExportParamVO extends BaseEntity { ...@@ -450,6 +450,14 @@ public class EmployeeProjectExportParamVO extends BaseEntity {
@ExcelProperty(value ="项目档案状态") @ExcelProperty(value ="项目档案状态")
private String status; private String status;
/**
* 项目档案状态
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目档案状态")
@ExcelAttribute(name = "项目档案状态")
private String projectStatusReplace;
/** /**
* 社保-省 * 社保-省
*/ */
......
...@@ -442,12 +442,12 @@ public class EmployeeProjectExportVO { ...@@ -442,12 +442,12 @@ public class EmployeeProjectExportVO {
private String projectSource; private String projectSource;
/** /**
* 项目档案状态(0草稿、1已审核 * 项目档案状态(0=正常,1=已减项
*/ */
@ExcelAttribute(name ="项目档案状态", readConverterExp = "0=草稿,1=已审核")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目档案状态") @ExcelProperty(value ="项目档案状态")
private String status; @ExcelAttribute(name = "项目档案状态")
private String projectStatus;
/** /**
* 项目档案创建人 * 项目档案创建人
......
...@@ -85,9 +85,9 @@ public class ProjectSetInfoVo implements Serializable { ...@@ -85,9 +85,9 @@ public class ProjectSetInfoVo implements Serializable {
private String businessThirdType; private String businessThirdType;
/** /**
* 服务状态:0正常 1停止服务 * 服务状态:0正常 1停止服务 2冻结
*/ */
@Schema(description = "服务状态:0正常 1停止服务") @Schema(description = "服务状态:0正常 1停止服务 2冻结")
private String stopFlag; private String stopFlag;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/11/23
* @Description
* @Version 1.0
*/
@Data
public class TSettleDomainDataVo implements Serializable {
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String departNo;
/**
* 项目档案在档人数
*/
@Schema(description = "项目档案在档人数")
private long projectNum;
/**
* 合同在用数
*/
@Schema(description = "合同在用数")
private long contractNum;
/**
* 社保在保人数
*/
@Schema(description = "社保在保人数")
private long socialNum;
/**
* 公积金在保人数
*/
@Schema(description = "公积金在保人数")
private long fundNum;
}
...@@ -192,9 +192,9 @@ public class TSettleDomainEkpVo implements Serializable { ...@@ -192,9 +192,9 @@ public class TSettleDomainEkpVo implements Serializable {
private Integer town; private Integer town;
/** /**
* 服务状态:0正常 1停止服务 * 服务状态:0正常 1停止服务 2冻结
*/ */
@Schema(description = "服务状态:0正常 1停止服务") @Schema(description = "服务状态:0正常 1停止服务 2冻结")
private String stopFlag; private String stopFlag;
/** /**
......
...@@ -14,7 +14,7 @@ public class TSettleDomainListVo { ...@@ -14,7 +14,7 @@ public class TSettleDomainListVo {
*/ */
private List<TSettleDomainSelectVo> listSelectVO; private List<TSettleDomainSelectVo> listSelectVO;
private Map<String,TSettleDomainSelectVo> mapSlectVo; private Map<String,TSettleDomainSelectVo> mapSelectVo;
private Map<String,TSettleDomain> mapVO; private Map<String,TSettleDomain> mapVO;
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/11/23
* @Description
* @Version 1.0
*/
@Data
public class TSettleDomainUpdVo implements Serializable {
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String departNo;
/**
* 服务状态:0正常 1停止服务 2冻结
*/
@Schema(description = "服务状态:0正常 1停止服务 2冻结")
private String stopFlag;
}
package com.yifu.cloud.plus.v1.yifu.archives.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Description: 允许跨域以
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
//是否发送Cookie
.allowCredentials(true)
//放行哪些原始域
.allowedOriginPatterns("*")
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"})
.allowedHeaders("*")
.exposedHeaders("*");
}
}
...@@ -30,9 +30,15 @@ public class EmployeeConstants { ...@@ -30,9 +30,15 @@ public class EmployeeConstants {
public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填"; public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填";
public static final String FILE_CITY_MUST = "更新档案县,档案市必填"; public static final String FILE_CITY_MUST = "更新档案县,档案市必填";
public static final String DEPT_NO_ERROR = "项目编码错误"; public static final String DEPT_NO_ERROR = "项目编码错误";
public static final String DEPT_NO_EXIST = "根据项目编码未找到项目"; public static final String DEPT_NO_EXIST = "未找到对应的项目,请核实";
public static final String CHECK_ERROR = "校验服务错误,请联系管理员!"; public static final String CHECK_ERROR = "校验服务错误,请联系管理员!";
public static final String CHECK_NO_RESPONSE = "校验服务器未返回,请联系管理员!"; public static final String CHECK_NO_RESPONSE = "校验服务器未返回,请联系管理员!";
// 拦截合同使用
public static final String SITUATION_ONE = "正常签订";
public static final String SITUATION_TWO = "正常续签";
public static final String SITUATION_THREE = "离职再入职";
public static final String SITUATION_SIX = "作废"; public static final String SITUATION_SIX = "作废";
public static final String SITUATION_SEVEN = "终止"; public static final String SITUATION_SEVEN = "终止";
public static final String EMPID_NOT_EMPTY = "员工ID、项目ID不可为空;"; public static final String EMPID_NOT_EMPTY = "员工ID、项目ID不可为空;";
...@@ -53,7 +59,10 @@ public class EmployeeConstants { ...@@ -53,7 +59,10 @@ public class EmployeeConstants {
public static final String CONTRACT_REDUCE_INFO_NOT_EMPTY = "签订类型为终止时,离职日期和终止原因必填"; public static final String CONTRACT_REDUCE_INFO_NOT_EMPTY = "签订类型为终止时,离职日期和终止原因必填";
public static final String CONTRACT_REDUCE_REASON_NOT_EMPTY = "终止原因为其他时,原因说明必填"; public static final String CONTRACT_REDUCE_REASON_NOT_EMPTY = "终止原因为其他时,原因说明必填";
/**
* 对应项目编码已停止合作
*/
public static final String EMP_DISPATCH_SETTLEDOMAIN_STOP = "对应项目编码不存在或者已停止合作";
/** /**
* 无数据可更新 * 无数据可更新
**/ **/
......
...@@ -126,8 +126,8 @@ public class TEmpChangeInfoController { ...@@ -126,8 +126,8 @@ public class TEmpChangeInfoController {
@Operation(description = "分页查询") @Operation(description = "分页查询")
@GetMapping("/getAllDeptPage" ) @GetMapping("/getAllDeptPage" )
public R<IPage<TSettleDomain>> getItemNamePage(Page page,@RequestParam(required = false) String departName public R<IPage<TSettleDomain>> getItemNamePage(Page page,@RequestParam(required = false) String departName
, @RequestParam(required = false) String customerId) { , @RequestParam(required = false) String customerId, @RequestParam(required = false) String flag) {
return new R<>(tEmpChangeInfoService.getAllDeptPage(page, departName, customerId)); return new R<>(tEmpChangeInfoService.getAllDeptPage(page, departName, customerId,flag));
} }
/** /**
......
...@@ -19,8 +19,10 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller; ...@@ -19,8 +19,10 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAuditVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -28,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -28,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
...@@ -218,15 +221,43 @@ public class TEmployeeContractInfoController { ...@@ -218,15 +221,43 @@ public class TEmployeeContractInfoController {
@PostMapping("/auditContract") @PostMapping("/auditContract")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_audit')") @PreAuthorize("@pms.hasPermission('temployeecontractinfo_audit')")
public R<String> auditContract(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) { public R<String> auditContract(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
if (Common.isEmpty(tEmployeeContractInfo.getAuditStatus())) { if (Common.isEmpty(tEmployeeContractInfo.getAuditStatus())) {
return R.failed("审核意见必填!"); return R.failed(ArchivesConstants.CONTRACT_AUDIT_STATUS_NOT_EMPTY);
} }
if (Common.isNotNull(tEmployeeContractInfo.getAuditRemark()) && tEmployeeContractInfo.getAuditRemark().length() > 200) { if (Common.isNotNull(tEmployeeContractInfo.getAuditRemark()) && tEmployeeContractInfo.getAuditRemark().length() > 200) {
return R.failed("审核说明不可超过200字!"); return R.failed(ArchivesConstants.CONTRACT_AUDIT_REMARK_TOO_LONG);
} }
return tEmployeeContractInfoService.auditContract(tEmployeeContractInfo); return tEmployeeContractInfoService.auditContract(tEmployeeContractInfo,user);
}
/**
* @Author fxj
* @Description 批量审核员工合同
* @Date 16:21 2022/12/12
**/
@Operation(summary = "审核-员工合同(主键:ID;审核意见auditStatus(2审核通过;3审核不通过);审核说明auditRemark;)权限temployeecontractinfo_audit", description = "审核-员工合同")
@SysLog("批量审核员工合同")
@PostMapping("/auditContractBatch")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_audit')")
public R<List<ErrorMessage>> auditContractBatch(@RequestBody EmpContractAuditVo contractAuditVo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
if (Common.isEmpty(contractAuditVo.getIds())) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
if (Common.isEmpty(contractAuditVo.getAuditStatus())) {
return R.failed(ArchivesConstants.CONTRACT_AUDIT_STATUS_NOT_EMPTY);
}
if (Common.isNotNull(contractAuditVo.getAuditRemark()) && contractAuditVo.getAuditRemark().length() > 200) {
return R.failed(ArchivesConstants.CONTRACT_AUDIT_REMARK_TOO_LONG);
}
return tEmployeeContractInfoService.auditContractBatch(contractAuditVo,user);
} }
/** /**
* 审核员工合同 * 审核员工合同
* 审核通过后,变为在用,项目内其他的合同不再用 * 审核通过后,变为在用,项目内其他的合同不再用
...@@ -342,10 +373,13 @@ public class TEmployeeContractInfoController { ...@@ -342,10 +373,13 @@ public class TEmployeeContractInfoController {
@SysLog("批量导出合同审核") @SysLog("批量导出合同审核")
@PostMapping("/exportAuditContractInfo") @PostMapping("/exportAuditContractInfo")
@PreAuthorize("@pms.hasPermission('employee_export_contract_audit')") @PreAuthorize("@pms.hasPermission('employee_export_contract_audit')")
public void exportAuditContractInfo(@RequestBody(required = false) TEmployeeContractSearchVo contractInfo, HttpServletResponse response) { public void exportAuditContractInfo(@RequestBody(required = false) TEmployeeContractSearchVo contractInfo,
@RequestParam(required = false,name = "mId") String mId,
HttpServletResponse response) {
if (Common.isEmpty(contractInfo)){ if (Common.isEmpty(contractInfo)){
contractInfo = new TEmployeeContractSearchVo(); contractInfo = new TEmployeeContractSearchVo();
} }
contractInfo.setMId(mId);
contractInfo.setAuditStatus(CommonConstants.ONE_INT); contractInfo.setAuditStatus(CommonConstants.ONE_INT);
this.setAuth(contractInfo); this.setAuth(contractInfo);
tEmployeeContractInfoService.exportAuditContractInfo(contractInfo, response); tEmployeeContractInfoService.exportAuditContractInfo(contractInfo, response);
......
...@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; ...@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportParamVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportParamVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainDataVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; 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.Common;
...@@ -339,4 +340,17 @@ public class TEmployeeProjectController { ...@@ -339,4 +340,17 @@ public class TEmployeeProjectController {
public Boolean updateEmployeeSalaryStatus(@RequestBody EmpStatusVo vo) { public Boolean updateEmployeeSalaryStatus(@RequestBody EmpStatusVo vo) {
return tEmployeeProjectService.updateEmployeeSalaryStatus(vo); return tEmployeeProjectService.updateEmployeeSalaryStatus(vo);
} }
/**
* 查询项目对应的数据
* @author hyc
* @param deptNoList
* @date 2022-12-12 17:45
* @return R
*/
@Operation(summary = "查询项目对应的数据", description = "查询项目对应的数据")
@PostMapping("/selectSettleMentData")
public R<List<TSettleDomainDataVo>> selectSettleMentData(@RequestBody List<String> deptNoList) {
return tEmployeeProjectService.selectSettleMentData(deptNoList);
}
} }
...@@ -185,7 +185,7 @@ public class TSettleDomainController { ...@@ -185,7 +185,7 @@ public class TSettleDomainController {
TSettleDomainListVo listVo = new TSettleDomainListVo(); TSettleDomainListVo listVo = new TSettleDomainListVo();
listVo.setListSelectVO(list); listVo.setListSelectVO(list);
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
listVo.setMapSlectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k))); listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k)));
} }
return listVo; return listVo;
} }
...@@ -324,4 +324,23 @@ public class TSettleDomainController { ...@@ -324,4 +324,23 @@ public class TSettleDomainController {
public R<IPage<IdNameNoVo>> getUnitPage(Page<IdNameNoVo> page, IdNameNoVo idNameNo) { public R<IPage<IdNameNoVo>> getUnitPage(Page<IdNameNoVo> page, IdNameNoVo idNameNo) {
return R.ok(tSettleDomainService.getUnitPage(page, idNameNo)); return R.ok(tSettleDomainService.getUnitPage(page, idNameNo));
} }
/**
* 修改项目表--EKP调用接口
* @author hyc
* @param jsonStr
* @return R
*/
@Operation(summary = "更新项目服务状态--EKP调用接口", description = "更新项目服务状态--EKP调用接口")
@SysLog("更新项目服务状态--EKP调用接口")
@PostMapping("/updateProjectStopStatus")
public R updateProjectStopStatus(@RequestBody String jsonStr) {
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
List<TSettleDomainUpdVo> list= JSONObject.parseArray(jsonStr, TSettleDomainUpdVo.class);
return tSettleDomainService.updateProjectStopStatus(list);
}
} }
...@@ -70,5 +70,5 @@ public interface TEmpChangeInfoService extends IService<TEmpChangeInfo> { ...@@ -70,5 +70,5 @@ public interface TEmpChangeInfoService extends IService<TEmpChangeInfo> {
*/ */
R<List<TCustomerInfo>> getAllUint(String customerName); R<List<TCustomerInfo>> getAllUint(String customerName);
IPage<TSettleDomain> getAllDeptPage(Page page, String deptName, String customerId); IPage<TSettleDomain> getAllDeptPage(Page page, String deptName, String customerId,String flag);
} }
...@@ -21,11 +21,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -21,11 +21,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAuditVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.core.vo.YifuUser;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
...@@ -98,12 +100,13 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract ...@@ -98,12 +100,13 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
/** /**
* @param tEmployeeContractInfo * @param tEmployeeContractInfo
* @param user
* @Description: 审核 * @Description: 审核
* @Author: hgw * @Author: hgw
* @Date: 2022/7/1 10:23 * @Date: 2022/7/1 10:23
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo); R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo, YifuUser user);
/** /**
* @param id * @param id
...@@ -175,4 +178,6 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract ...@@ -175,4 +178,6 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
* @return * @return
**/ **/
void exportAuditContractInfo(TEmployeeContractSearchVo contractInfo, HttpServletResponse response); void exportAuditContractInfo(TEmployeeContractSearchVo contractInfo, HttpServletResponse response);
R<List<ErrorMessage>> auditContractBatch(EmpContractAuditVo contractAuditVo, YifuUser user);
} }
...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; ...@@ -25,6 +25,7 @@ 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.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportParamVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportParamVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainDataVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -224,4 +225,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> { ...@@ -224,4 +225,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
* @return: void * @return: void
**/ **/
void everyDayUpdateEmployeContractStatus(); void everyDayUpdateEmployeContractStatus();
R<List<TSettleDomainDataVo>> selectSettleMentData(List<String> deptNoList);
} }
...@@ -108,4 +108,6 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -108,4 +108,6 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
R updateProjectInfo(List<TSettleDomainEkpVo> list); R updateProjectInfo(List<TSettleDomainEkpVo> list);
R updateProjectStopStatus(List<TSettleDomainUpdVo> list);
} }
...@@ -272,6 +272,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -272,6 +272,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
if (null == employeeContractInfo) { if (null == employeeContractInfo) {
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo = new TEmployeeContractInfo();
newEmployeeContractInfo.setAuditUserName(user.getNickname());
saveTEmployeeContractInfo(newEmployeeContractInfo, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, tEmployeeProject); saveTEmployeeContractInfo(newEmployeeContractInfo, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, tEmployeeProject);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo);
...@@ -281,6 +282,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -281,6 +282,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
employeeContractInfoMapper.updateById(employeeContractInfo); employeeContractInfoMapper.updateById(employeeContractInfo);
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo2 = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo2 = new TEmployeeContractInfo();
newEmployeeContractInfo2.setAuditUserName(user.getNickname());
saveTEmployeeContractInfo(newEmployeeContractInfo2, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, tEmployeeProject); saveTEmployeeContractInfo(newEmployeeContractInfo2, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, tEmployeeProject);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo2); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo2);
...@@ -308,6 +310,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -308,6 +310,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo();
newEmployeeContractInfo1.setAuditUserName(user.getNickname());
saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, project); saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, project);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1);
...@@ -345,6 +348,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -345,6 +348,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo();
newEmployeeContractInfo1.setAuditUserName(user.getNickname());
saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, newEmployeeInfo, tCustomerInfo, newTEmpProject); saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, newEmployeeInfo, tCustomerInfo, newTEmpProject);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1);
......
...@@ -104,6 +104,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -104,6 +104,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda() TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle()) .eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("对应项目编码的项目已停止合作");
}
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeeProject.getId()); TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeeProject.getId());
updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo()); updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo());
updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId()); updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId());
...@@ -154,7 +157,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -154,7 +157,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget(); List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
Map<Long,ErrorMessage> errorMsgMap = new HashMap<>(); Map<Long,ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)){ if (Common.isNotNull(errorMessageList)){
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage)); errorMessageList.forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
} }
List<TEmployeeProject> updateList = new ArrayList<>(); List<TEmployeeProject> updateList = new ArrayList<>();
...@@ -162,7 +165,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -162,7 +165,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
// 执行数据插入操作 组装 // 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个 // 已有验证报错直接下一个
if (Common.isNotNull(errorMsgMap.get(i+2))){ if (Common.isNotNull(errorMsgMap.get((long)i+2))){
continue; continue;
} }
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
...@@ -177,12 +180,11 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -177,12 +180,11 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) { if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) {
if (Common.isEmpty(excel.getChangeStartMonth())) { if (Common.isEmpty(excel.getChangeStartMonth())) {
errorMsg.add("划转起始月不能为空"); errorMsg.add("划转起始月不能为空");
} else if (PATTERN.matcher(excel.getChangeStartMonth()).matches()) { } else if (PATTERN.matcher(excel.getChangeStartMonth()).matches() &&
if (Integer.parseInt(excel.getChangeStartMonth()) > Integer.parseInt(DateUtil.getThisMonth())) { Integer.parseInt(excel.getChangeStartMonth()) > Integer.parseInt(DateUtil.getThisMonth())) {
errorMsg.add("划转起始月要小于等于当前月"); errorMsg.add("划转起始月要小于等于当前月");
} }
} }
}
//项目编码校验 //项目编码校验
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda() TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
...@@ -199,7 +201,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -199,7 +201,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL) .eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT)); .eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT));
if (Common.isNotNull(tEmployeeProject)) { if (Common.isNotNull(tEmployeeProject)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHECKS_CHANGE_EMP_PROJECT, excel.getNewSettleCode())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_NEW_SEARCH_NOT_EXIST, excel.getNewSettleCode()));
} }
// 数据合法情况 // 数据合法情况
if (CollUtil.isEmpty(errorMsg)) { if (CollUtil.isEmpty(errorMsg)) {
...@@ -313,12 +315,12 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -313,12 +315,12 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
* @Date 2022-07-26 * @Date 2022-07-26
*/ */
@Override @Override
public IPage<TSettleDomain> getAllDeptPage(Page page, String deptName, String customerId) { public IPage<TSettleDomain> getAllDeptPage(Page page, String deptName, String customerId,String flag) {
LambdaQueryWrapper<TSettleDomain> wrapper = buildQueryWrapper(deptName, customerId); LambdaQueryWrapper<TSettleDomain> wrapper = buildQueryWrapper(deptName, customerId,flag);
return tSettleDomainMapper.selectPage(page,wrapper); return tSettleDomainMapper.selectPage(page,wrapper);
} }
private LambdaQueryWrapper buildQueryWrapper(String deptName, String customerId) { private LambdaQueryWrapper buildQueryWrapper(String deptName, String customerId,String flag) {
LambdaQueryWrapper<TSettleDomain> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TSettleDomain> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(deptName)) { if (Common.isNotNull(deptName)) {
wrapper.like(TSettleDomain::getDepartName, deptName); wrapper.like(TSettleDomain::getDepartName, deptName);
...@@ -327,7 +329,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -327,7 +329,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
wrapper.eq(TSettleDomain::getCustomerId, customerId); wrapper.eq(TSettleDomain::getCustomerId, customerId);
} }
wrapper.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING); wrapper.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING);
if (Common.isEmpty(flag)) {
wrapper.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING); wrapper.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING);
}
return wrapper; return wrapper;
} }
} }
...@@ -670,6 +670,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -670,6 +670,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isEmpty(fileSource)) { if (Common.isEmpty(fileSource)) {
return R.failed("人员档案来源必填!(4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)"); return R.failed("人员档案来源必填!(4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)");
} }
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, employeeInfo.getDeptNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("对应项目编码的项目已停止合作");
}
TEmployeeInfo check = new TEmployeeInfo(); TEmployeeInfo check = new TEmployeeInfo();
check.setEmpName(employeeInfo.getEmpName()); check.setEmpName(employeeInfo.getEmpName());
check.setEmpIdcard(employeeInfo.getEmpIdcard()); check.setEmpIdcard(employeeInfo.getEmpIdcard());
...@@ -950,6 +957,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -950,6 +957,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
String idCard; String idCard;
// 个性化校验逻辑 // 个性化校验逻辑
List<String> deptNoList = new ArrayList<>(); List<String> deptNoList = new ArrayList<>();
TSettleDomain settleDomain;
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
// 判空 // 判空
...@@ -985,7 +993,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -985,7 +993,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (!deptNoList.isEmpty()) { if (!deptNoList.isEmpty()) {
List<TSettleDomain> deptList = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda() List<TSettleDomain> deptList = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL) .eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag, CommonConstants.STATUS_NORMAL)
.in(TSettleDomain::getDepartNo, deptNoList) .in(TSettleDomain::getDepartNo, deptNoList)
); );
if (deptList == null || deptList.isEmpty()) { if (deptList == null || deptList.isEmpty()) {
...@@ -1105,6 +1112,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1105,6 +1112,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveList.add(saveEmp); saveList.add(saveEmp);
} }
} else { } else {
settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getDeptNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(settleDomain)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST, excel.getEmpIdcard()));
}
// 档案不存在 // 档案不存在
// 校验身份证实名 // 校验身份证实名
TCheckIdCard checkIdCard = new TCheckIdCard(); TCheckIdCard checkIdCard = new TCheckIdCard();
...@@ -2219,7 +2234,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2219,7 +2234,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT) .eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getId,vo.getContractId()) .eq(TEmployeeContractInfo::getId,vo.getContractId())
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT) .eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.eq(TEmployeeContractInfo::getDispatchFlag,CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(c)){ if (Common.isNotNull(c)){
TEmployeeContractAudit contractAudit = new TEmployeeContractAudit(); TEmployeeContractAudit contractAudit = new TEmployeeContractAudit();
...@@ -2229,6 +2243,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2229,6 +2243,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contractAudit.setCreateName(c.getCreateName()); contractAudit.setCreateName(c.getCreateName());
contractAudit.setCreateTime(LocalDateTime.now()); contractAudit.setCreateTime(LocalDateTime.now());
//审核通过 //审核通过
c.setAuditUserName(c.getCreateBy());
if (CommonConstants.ZERO_STRING.equals(vo.getType())){ if (CommonConstants.ZERO_STRING.equals(vo.getType())){
c.setAuditStatus(CommonConstants.TWO_INT); c.setAuditStatus(CommonConstants.TWO_INT);
c.setInUse(CommonConstants.ZERO_STRING); c.setInUse(CommonConstants.ZERO_STRING);
......
...@@ -220,6 +220,39 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -220,6 +220,39 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
} }
} }
@Override
public R updateProjectStopStatus(List<TSettleDomainUpdVo> list) {
if (Common.isNotNull(list)) {
TSettleDomain settleDomain;
for (TSettleDomainUpdVo settleDomainUpdVo : list) {
if (Common.isEmpty(settleDomainUpdVo.getDepartNo()) ||
Common.isEmpty(settleDomainUpdVo.getStopFlag())) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
if (!CommonConstants.ONE_STRING.equals(settleDomainUpdVo.getStopFlag()) &&
!CommonConstants.TWO_STRING.equals(settleDomainUpdVo.getStopFlag()) &&
!CommonConstants.ZERO_STRING.equals(settleDomainUpdVo.getStopFlag())) {
return R.failed("服务状态传参错误");
}
settleDomain = baseMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, settleDomainUpdVo.getDepartNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(settleDomain)) {
return R.failed("不存在该项目");
}
if (settleDomain.getStopFlag().equals(settleDomainUpdVo.getStopFlag())) {
return R.failed("不可重复变更项目服务状态");
}
settleDomain.setStopFlag(settleDomainUpdVo.getStopFlag());
baseMapper.updateById(settleDomain);
}
return R.ok();
}else {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
}
private String checkInfo(TSettleDomain domain) { private String checkInfo(TSettleDomain domain) {
if (Common.isEmpty(domain.getId())){ if (Common.isEmpty(domain.getId())){
return ArchivesConstants.SETTLE_DOMAIN_ID_NOT_EMPTY; return ArchivesConstants.SETTLE_DOMAIN_ID_NOT_EMPTY;
......
...@@ -238,6 +238,9 @@ ...@@ -238,6 +238,9 @@
#{idStr} #{idStr}
</foreach> </foreach>
</if> </if>
<if test="tEmployeeContractInfo.auditUserName != null and tEmployeeContractInfo.auditUserName.trim() != ''">
AND a.AUDIT_USER_NAME like concat('%',#{tEmployeeContractInfo.auditUserName},'%')
</if>
<if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''"> <if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''">
AND a.ID = #{tEmployeeContractInfo.id} AND a.ID = #{tEmployeeContractInfo.id}
</if> </if>
...@@ -374,10 +377,7 @@ ...@@ -374,10 +377,7 @@
AND a.CREATE_BY = #{tEmployeeContractInfo.createBy} AND a.CREATE_BY = #{tEmployeeContractInfo.createBy}
</if> </if>
<if test="tEmployeeContractInfo.createName != null and tEmployeeContractInfo.createName.trim() != ''"> <if test="tEmployeeContractInfo.createName != null and tEmployeeContractInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tEmployeeContractInfo.createName} AND a.CREATE_NAME like concat('%',#{tEmployeeContractInfo.createName},'%')
</if>
<if test="tEmployeeContractInfo.createTime != null">
AND a.CREATE_TIME = #{tEmployeeContractInfo.createTime}
</if> </if>
<if test="tEmployeeContractInfo.updateBy != null and tEmployeeContractInfo.updateBy.trim() != ''"> <if test="tEmployeeContractInfo.updateBy != null and tEmployeeContractInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tEmployeeContractInfo.updateBy} AND a.UPDATE_BY = #{tEmployeeContractInfo.updateBy}
...@@ -386,7 +386,6 @@ ...@@ -386,7 +386,6 @@
AND a.UPDATE_TIME = #{tEmployeeContractInfo.updateTime} AND a.UPDATE_TIME = #{tEmployeeContractInfo.updateTime}
</if> </if>
<if test="tEmployeeContractInfo.unitNo != null and tEmployeeContractInfo.unitNo.trim() != ''"> <if test="tEmployeeContractInfo.unitNo != null and tEmployeeContractInfo.unitNo.trim() != ''">
AND a.UNIT_NO = #{tEmployeeContractInfo.unitNo} AND a.UNIT_NO = #{tEmployeeContractInfo.unitNo}
</if> </if>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<resultMap id="tEmployeeProjectExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO"> <resultMap id="tEmployeeProjectExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO">
<result property="empCode" column="EMP_CODE"/> <result property="empCode" column="EMP_CODE"/>
<result property="projectStatus" column="PROJECT_STATUS"/>
<result property="proEmpNatrue" column="PROEMP_NATRUE"/> <result property="proEmpNatrue" column="PROEMP_NATRUE"/>
<result property="empNatrue" column="EMP_NATRUE"/> <result property="empNatrue" column="EMP_NATRUE"/>
<result property="empName" column="EMP_NAME"/> <result property="empName" column="EMP_NAME"/>
...@@ -103,7 +104,6 @@ ...@@ -103,7 +104,6 @@
<result property="empNatrue" column="EMP_NATRUE"/> <result property="empNatrue" column="EMP_NATRUE"/>
<result property="proCreateName" column="PROCREATE_NAME"/> <result property="proCreateName" column="PROCREATE_NAME"/>
<result property="proCreateTime" column="PROCREATE_TIME"/> <result property="proCreateTime" column="PROCREATE_TIME"/>
<result property="status" column="STATUS"/>
<result property="fileProvince" column="FILE_PROVINCE"/> <result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/> <result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/> <result property="fileTown" column="FILE_TOWN"/>
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
b.ADMISSION_DATE, b.ADMISSION_DATE,
b.GRADUTION_DATE, b.GRADUTION_DATE,
b.REMARK, b.REMARK,
if(a.STATUS=0,'草稿','已审核') STATUS, if(a.STATUS='0','草稿',IF(a.PROJECT_STATUS=1,'已减项','已审核')) PROJECT_STATUS,
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME, a.CREATE_TIME,
b.EMP_EMAIL, b.EMP_EMAIL,
...@@ -377,10 +377,10 @@ ...@@ -377,10 +377,10 @@
<if test="tEmployeeProject.socialProvince != null"> <if test="tEmployeeProject.socialProvince != null">
AND a.SOCIAL_PROVINCE = #{tEmployeeProject.socialProvince} AND a.SOCIAL_PROVINCE = #{tEmployeeProject.socialProvince}
</if> </if>
<if test="tEmployeeProject.fileCity != null"> <if test="tEmployeeProject.socialCity != null">
AND a.SOCIAL_CITY = #{tEmployeeProject.socialCity} AND a.SOCIAL_CITY = #{tEmployeeProject.socialCity}
</if> </if>
<if test="tEmployeeProject.fileTown != null"> <if test="tEmployeeProject.socialTown != null">
AND a.SOCIAL_TOWN = #{tEmployeeProject.socialTown} AND a.SOCIAL_TOWN = #{tEmployeeProject.socialTown}
</if> </if>
<if test="tEmployeeProject.empNatureArray != null and tEmployeeProject.empNatureArray.length > 0"> <if test="tEmployeeProject.empNatureArray != null and tEmployeeProject.empNatureArray.length > 0">
...@@ -435,6 +435,9 @@ ...@@ -435,6 +435,9 @@
<if test="tEmployeeProject.empIdcard != null and tEmployeeProject.empIdcard.trim() != ''"> <if test="tEmployeeProject.empIdcard != null and tEmployeeProject.empIdcard.trim() != ''">
AND a.EMP_IDCARD like concat('%',#{tEmployeeProject.empIdcard},'%') AND a.EMP_IDCARD like concat('%',#{tEmployeeProject.empIdcard},'%')
</if> </if>
<if test="tEmployeeProject.projectStatusReplace != null and tEmployeeProject.projectStatusReplace.trim() != ''">
AND a.PROJECT_STATUS = #{tEmployeeProject.projectStatusReplace}
</if>
<if test="tEmployeeProject.bankName != null and tEmployeeProject.bankName.trim() != ''"> <if test="tEmployeeProject.bankName != null and tEmployeeProject.bankName.trim() != ''">
AND a.BANK_NAME = #{tEmployeeProject.bankName} AND a.BANK_NAME = #{tEmployeeProject.bankName}
</if> </if>
...@@ -528,10 +531,10 @@ ...@@ -528,10 +531,10 @@
<if test="tEmployeeProject.socialProvince != null"> <if test="tEmployeeProject.socialProvince != null">
AND a.SOCIAL_PROVINCE = #{tEmployeeProject.socialProvince} AND a.SOCIAL_PROVINCE = #{tEmployeeProject.socialProvince}
</if> </if>
<if test="tEmployeeProject.fileCity != null"> <if test="tEmployeeProject.socialCity != null">
AND a.SOCIAL_CITY = #{tEmployeeProject.socialCity} AND a.SOCIAL_CITY = #{tEmployeeProject.socialCity}
</if> </if>
<if test="tEmployeeProject.fileTown != null"> <if test="tEmployeeProject.socialTown != null">
AND a.SOCIAL_TOWN = #{tEmployeeProject.socialTown} AND a.SOCIAL_TOWN = #{tEmployeeProject.socialTown}
</if> </if>
<if test="tEmployeeProject.idList != null"> <if test="tEmployeeProject.idList != null">
......
...@@ -211,8 +211,11 @@ ...@@ -211,8 +211,11 @@
<if test="tSettleDomain.deleteFlag != null and tSettleDomain.deleteFlag.trim() != ''"> <if test="tSettleDomain.deleteFlag != null and tSettleDomain.deleteFlag.trim() != ''">
and a.DELETE_FLAG = #{tSettleDomain.deleteFlag} and a.DELETE_FLAG = #{tSettleDomain.deleteFlag}
</if> </if>
<if test="tSettleDomain.stopFlag != null and tSettleDomain.stopFlag.trim() != ''"> <if test="tSettleDomain.stopFlag != null and tSettleDomain.stopFlag.trim() != '' and tSettleDomain.stopFlag == 0">
and a.STOP_FLAG = #{tSettleDomain.stopFlag} and a.STOP_FLAG = '0'
</if>
<if test="tSettleDomain.stopFlag != null and tSettleDomain.stopFlag.trim() != '' and tSettleDomain.stopFlag == 1">
and (a.STOP_FLAG = '1' or a.STOP_FLAG = '2')
</if> </if>
</if> </if>
order by CREATE_TIME desc order by CREATE_TIME desc
......
package com.yifu.cloud.plus.v1.yifu.auth.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Description: 允许跨域以
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
//是否发送Cookie
.allowCredentials(true)
//放行哪些原始域
.allowedOriginPatterns("*")
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"})
.allowedHeaders("*")
.exposedHeaders("*");
}
}
...@@ -80,7 +80,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { ...@@ -80,7 +80,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
.failureHandler(authenticationFailureHandler()).and().logout() .failureHandler(authenticationFailureHandler()).and().logout()
.logoutSuccessHandler(logoutSuccessHandler()).deleteCookies("JSESSIONID").invalidateHttpSession(true) .logoutSuccessHandler(logoutSuccessHandler()).deleteCookies("JSESSIONID").invalidateHttpSession(true)
.and() .and()
.authorizeRequests().antMatchers("/**/login","/token/**", "/actuator/**", "/mobile/**", "/oauth/token").permitAll() .authorizeRequests().antMatchers("/**/login","/token/**", "/actuator/**", "/mobile/**", "/oauth/token","/weixin/callback").permitAll()
.anyRequest().authenticated().and().csrf().disable(); .anyRequest().authenticated().and().csrf().disable();
} }
......
...@@ -18,34 +18,54 @@ package com.yifu.cloud.plus.v1.yifu.auth.endpoint; ...@@ -18,34 +18,54 @@ package com.yifu.cloud.plus.v1.yifu.auth.endpoint;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginTool;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.callback.WeixinLoginCallback;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinError;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinUserInfo;
import com.yifu.cloud.plus.v1.yifu.auth.vo.WxUserVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; 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.CommonConstants;
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.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder; import com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.AuthUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.event.LogoutSuccessEvent; import org.springframework.security.authentication.event.LogoutSuccessEvent;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2RefreshToken; import org.springframework.security.oauth2.common.OAuth2RefreshToken;
import org.springframework.security.oauth2.provider.AuthorizationRequest; import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
import org.springframework.security.oauth2.provider.ClientDetails; import org.springframework.security.oauth2.provider.*;
import org.springframework.security.oauth2.provider.ClientDetailsService; import org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestValidator;
import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -56,8 +76,12 @@ import java.util.stream.Collectors; ...@@ -56,8 +76,12 @@ import java.util.stream.Collectors;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/token") @RequestMapping("/token")
@EnableConfigurationProperties(DaprUpmsProperties.class)
@Tag(name = "获取Token")
public class YifuTokenEndpoint { public class YifuTokenEndpoint {
private final DaprUpmsProperties daprUpmsProperties;
private final ClientDetailsService clientDetailsService; private final ClientDetailsService clientDetailsService;
private final TokenStore tokenStore; private final TokenStore tokenStore;
...@@ -66,6 +90,36 @@ public class YifuTokenEndpoint { ...@@ -66,6 +90,36 @@ public class YifuTokenEndpoint {
private final CacheManager cacheManager; private final CacheManager cacheManager;
private final PasswordEncoder passwordEncoder;
private final AuthorizationServerTokenServices defaultAuthorizationServerTokenServices;
/**
* 构建userdetails
*
* @param result 用户信息
* @return
*/
private UserDetails getUserDetails(R<UserInfo> result) {
if (result == null || result.getData() == null) {
throw new UsernameNotFoundException("用户不存在");
}
UserInfo info = result.getData();
// 获取资源
Set<String> dbAuthsSet = new HashSet<>(Arrays.asList(info.getPermissions()));
Collection<? extends GrantedAuthority> authorities
= AuthorityUtils.createAuthorityList(dbAuthsSet.toArray(new String[0]));
SysUser user = info.getSysUser();
// 构造security用户
YifuUser thisUser = new YifuUser(user.getUserId(), user.getDeptId(),user.getDeptName(), user.getUsername(),
user.getNickname(),user.getSystemFlag(), SecurityConstants.BCRYPT + user.getPassword(),
user.getPhone(), true, true, true,
CommonConstants.STATUS_NORMAL.equals(user.getLockFlag()),
user.getUserGroup(),authorities, user.getLdapDn());
thisUser.setClientRoleMap(info.getClientRoleMap());
return thisUser;
}
/** /**
* 认证页面 * 认证页面
* @param modelAndView * @param modelAndView
...@@ -165,4 +219,90 @@ public class YifuTokenEndpoint { ...@@ -165,4 +219,90 @@ public class YifuTokenEndpoint {
return R.ok(result); return R.ok(result);
} }
/**
* 微信扫码回调登录业务处理
* @param code
* @param state 客户端加密串
* @param type 0 或空 取值配置 1 取值传参
* @return
*/
@GetMapping(value = "/weixin/callback")
@ResponseBody
public String wxCallback(HttpServletRequest request,@RequestParam String code, String state, String type, String appid , String secret) {
return LoginTool.loginTwo(code, appid, secret, getCallback(request, state));
}
private WeixinLoginCallback getCallback(HttpServletRequest request, String state) {
return new WeixinLoginCallback() {
@Override
public String handle(WeixinUserInfo userInfo) {
if (null != userInfo && null != userInfo.getOpenid()) {
SysUser user = new SysUser();
user.setWxOpenid(userInfo.getOpenid());
R<UserInfo> result = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/user/inner/getSysUserByWxOpenId", user, UserInfo.class, SecurityConstants.FROM_IN);
OAuth2AccessToken oAuth2AccessToken = null;
if (null != result && null != result.getData() && result.getData().getSysUser() != null) {
SysUser sysUser = result.getData().getSysUser();
if (!CommonConstants.ZERO_STRING.equals(sysUser.getLockFlag())) {
return JSON.toJSONString(R.failed("用户".concat(sysUser.getNickname()).concat("账号:").concat(sysUser.getUsername()).concat("已被锁定,请联系管理员。")));
}
UserDetails userDetails = getUserDetails(result);
try {
String header = request.getHeader(com.yifu.cloud.plus.v1.yifu.auth.constants.SecurityConstants.CLIENT_HEADER_KEY_NEW);
if(Common.isEmpty(header)){
header = request.getHeader(com.yifu.cloud.plus.v1.yifu.auth.constants.SecurityConstants.CLIENT_HEADER_KEY);
//兼容老逻辑
if(Common.isEmpty(header)){
header = request.getHeader(HttpHeaders.AUTHORIZATION);
}
}
if (Common.isEmpty(header)) {
throw new InvalidClientException("请求头中client信息为空");
}
String[] tokens = AuthUtils.extractAndDecodeHeader(header);
assert tokens.length == 2;
String clientId = tokens[0];
ClientDetails clientDetails = clientDetailsService.loadClientByClientId(clientId);
//校验secret
if (!passwordEncoder.matches(tokens[1], clientDetails.getClientSecret())) {
throw new InvalidClientException("Given client ID does not match authenticated client");
}
TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), clientId, clientDetails.getScope(), "mobile");
//校验scope
new DefaultOAuth2RequestValidator().validateScope(tokenRequest, clientDetails);
OAuth2Request oAuth2Request = tokenRequest.createOAuth2Request(clientDetails);
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken
(userDetails, userDetails.getPassword());
OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(oAuth2Request, authentication);
oAuth2AccessToken = defaultAuthorizationServerTokenServices.createAccessToken(oAuth2Authentication);
} catch (Exception e) {
log.info("客户端解析出错。");
return JSON.toJSONString(R.failed("无此客户端"));
}
WxUserVo wxUserVo = new WxUserVo();
wxUserVo.setOauth2AccessToken(oAuth2AccessToken);
wxUserVo.setWeixinUserInfo(userInfo);
wxUserVo.setUser(sysUser);
return JSON.toJSONString(R.ok(wxUserVo));
} else {
return JSON.toJSONString(R.other(userInfo, "该用户未注册", CommonConstants.REGISTERED));
}
}
//查询用户
log.info("登录成功业务处理");
return JSON.toJSONString(R.failed("openid为空"));
}
@Override
public String errer(WeixinError error) {
log.info("登录失败业务处理");
log.error(error.getErrmsg());
return JSON.toJSONString(R.failed(error.getErrmsg()));
}
};
}
} }
package com.yifu.cloud.plus.v1.yifu.auth;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AuthBeanAutoConfiguration {
}
package com.yifu.cloud.plus.v1.yifu.auth.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestTemplate;
/**
* 三方登录服务接入
* @author daijie_jay
* @since 2017年11月29日
*/
public abstract class AbstractLoginService<T extends LoginProperties> implements LoginService {
protected static final String REDIRECT = "redirect:";
@Autowired
protected RestTemplate restTemplate;
@Autowired
protected T properties;
public String getRedirectUrl() {
return REDIRECT + properties.getRedirectUri();
}
public String getErrorUrl() {
return REDIRECT + properties.getErrorUri();
}
@SuppressWarnings("unchecked")
@Override
public T getProperties(){
return properties;
}
@Override
public String loadAuthPage() {
return this.loadAuthPage(null);
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util;
public interface LoginCallback<T, E> {
/**
* 登录成功后逻辑处理,处理结束如果有则返回错误信息
* @param userInfo 第三方用户实体
*/
public String handle(T userInfo);
/**
* 登录失败后逻辑处理 ,处理结束如果有则返回错误信息
* @param error 第三方错误实体
*/
public String errer(E error);
}
package com.yifu.cloud.plus.v1.yifu.auth.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* 登录属性配置初始化
*/
// @Component
public class LoginProperties {
/*public String appid = "wxcb81e4a2ad8d9012";
public String appsecret = "546f366801ad42fec8e67393ed484879";*/
public String appid = "wxfb3a14ee64c87046";
public String appsecret = "e2143c5a1f635e039122de27f29354fe";
public String redirectUri = "https://www.ngrok.xiaomiqiu.cn/admin/hi";
public String errorUri = "/error";
public String callbackUri = "https://www.ngrok.xiaomiqiu.cn/oauth/weixin/callback";
/*@Value("${weixin.login.appid}")
protected String appid;
@Value("${weixin.login.appsecret}")
protected String appsecret;
@Value("${weixin.login.redirectUri}")
protected String redirectUri;
@Value("${weixin.login.errorUri}")
protected String errorUri;
@Value("${weixin.login.callbackUri}")
protected String callbackUri;*/
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getAppsecret() {
return appsecret;
}
public void setAppsecret(String appsecret) {
this.appsecret = appsecret;
}
public String getRedirectUri() {
return redirectUri;
}
public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}
public String getErrorUri() {
return errorUri;
}
public void setErrorUri(String errorUri) {
this.errorUri = errorUri;
}
public String getCallbackUri() {
return callbackUri;
}
public void setCallbackUri(String callbackUri) {
this.callbackUri = callbackUri;
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util;
/**
* 返回结果
*/
public interface LoginResult {
/**
* 是否正常返回
* @return Boolean
*/
Boolean getResult();
}
package com.yifu.cloud.plus.v1.yifu.auth.util;
/**
* 三方登录服务接入
*/
public interface LoginService {
public <T extends LoginProperties> T getProperties();
/**
* 加载第三方授权页
* @return String
*/
String loadAuthPage();
/**
* 加载第三方授权页
* @param state 数据声明
* @return String
*/
String loadAuthPage(String state);
}
package com.yifu.cloud.plus.v1.yifu.auth.util;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.WeixinLoginTool;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.callback.WeixinLoginCallback;
@SuppressWarnings("unchecked")
public class LoginTool {
/**
* 支持前端传惨 appid secret 兼容 多个公众号的情况
* @param appAuthCode
* @param appid
* @param secret
* @param callback
* @return
*/
public static String loginTwo(String appAuthCode, String appid ,String secret, LoginCallback callback){
return WeixinLoginTool.login(appAuthCode,appid,secret, (WeixinLoginCallback) callback);
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.annotation;
import com.yifu.cloud.plus.v1.yifu.auth.AuthBeanAutoConfiguration;
import com.yifu.cloud.plus.v1.yifu.auth.util.config.WeixinLoginBeanAutoConfiguration;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.WeixinLoginTool;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({AuthBeanAutoConfiguration.class, WeixinLoginBeanAutoConfiguration.class, WeixinLoginTool.class})
public @interface EnableWeixinLogin {
}
package com.yifu.cloud.plus.v1.yifu.auth.util.config;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.WeixinLoignProperties;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.callback.WeixinLoginCallbackController;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.service.WeixinLoginService;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 微信登录自动装置
*/
//@Configuration
// @EnableConfigurationProperties({WeixinLoignProperties.class})
public class WeixinLoginBeanAutoConfiguration {
@Bean("weixinLoginService")
public WeixinLoginService loginService() {
return new WeixinLoginService();
}
@Bean
public WeixinLoginCallbackController loginCallbackController() {
return new WeixinLoginCallbackController();
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin;
/**
* 微信登录常量配置
*/
public class WeixinLoginConstants {
public static final String HOST_API = "https://api.weixin.qq.com";
/**
* 临时code获取accessToken
*/
public static final String ACCESS_TOKEN = "/sns/oauth2/access_token";
/**
* 获取用户信息
*/
public static final String USER_INFO = "/sns/userinfo";
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginResult;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.callback.WeixinLoginCallback;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinAccessToken;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinError;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinUserInfo;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.service.WeixinLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 微信登录工具
*/
@Component
public class WeixinLoginTool {
private static WeixinLoginService wxLoginService;
@Autowired
public void setWeixinLoginService(WeixinLoginService wxLoginService) {
WeixinLoginTool.wxLoginService = wxLoginService;
}
/**
* 微信登录
* 实用于已得到微信临时code
* @param appAuthCode 临时code
* @param callback 回调函数
* @return String
*/
public static String login(String appAuthCode, WeixinLoginCallback callback){
LoginResult result = wxLoginService.getAccessToken(appAuthCode);
if(result.getResult()){
WeixinAccessToken accessToken = (WeixinAccessToken) result;
result = wxLoginService.getWxUserInfo(accessToken);
if(result.getResult()){
WeixinUserInfo userInfo = (WeixinUserInfo) result;
return callback.handle(userInfo);
}
}
return callback.errer((WeixinError) result);
}
/**
* 微信登录
* 实用于已得到微信临时code
* @param appAuthCode 临时code
* @param callback 回调函数
* @return String
*/
public static String login(String appAuthCode, String appid ,String secret, WeixinLoginCallback callback){
LoginResult result = wxLoginService.getAccessToken(appAuthCode,appid,secret);
if(result.getResult()){
WeixinAccessToken accessToken = (WeixinAccessToken) result;
result = wxLoginService.getWxUserInfo(accessToken);
if(result.getResult()){
WeixinUserInfo userInfo = (WeixinUserInfo) result;
return callback.handle(userInfo);
}
}
return callback.errer((WeixinError) result);
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginProperties;
import org.springframework.stereotype.Component;
/**
* 微信登录属性配置初始化
*/
@Component
public class WeixinLoignProperties extends LoginProperties {
private String token;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin.callback;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginCallback;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinError;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinUserInfo;
/**
* 微信登录回调
*/
public interface WeixinLoginCallback extends LoginCallback<WeixinUserInfo, WeixinError> {
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin.callback;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.WeixinLoginTool;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 微信登录扫描回调
*/
/*@Controller*/
public class WeixinLoginCallbackController {
/**
* 处理回调业务
* @param code 临时code
* @param state 数据声明
* @param callback 回调函数
* @return String
*/
/*@GetMapping(value = WeixinLoginConstants.LOGIN_CALLBACK)*/
public String callback(@RequestParam String code, String state, WeixinLoginCallback callback){
return WeixinLoginTool.login(code, callback);
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginResult;
/**
* 微信认证权限的实体
*/
public class WeixinAccessToken implements LoginResult {
//接口调用凭证
private String access_token;
//access_token接口调用凭证超时时间,单位(秒)
private Long expires_in;
//用户刷新access_token
private String refresh_token;
//授权用户唯一标识
private String openid;
//用户授权的作用域,使用逗号(,)分隔
private String scope;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public Long getExpires_in() {
return expires_in;
}
public void setExpires_in(Long expires_in) {
this.expires_in = expires_in;
}
public String getRefresh_token() {
return refresh_token;
}
public void setRefresh_token(String refresh_token) {
this.refresh_token = refresh_token;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getScope() {
return scope;
}
public void setScope(String scope) {
this.scope = scope;
}
@Override
public Boolean getResult() {
return true;
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginResult;
/**
* 错误信息
*/
public class WeixinError implements LoginResult {
private String errcode;
private String errmsg;
public String getErrcode() {
return errcode;
}
public void setErrcode(String errcode) {
this.errcode = errcode;
}
public String getErrmsg() {
return errmsg;
}
public void setErrmsg(String errmsg) {
this.errmsg = errmsg;
}
@Override
public Boolean getResult() {
return false;
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginResult;
import java.util.List;
/**
* 用户信息
*/
public class WeixinUserInfo implements LoginResult {
//普通用户的标识,对当前开发者帐号唯一
private String openid;
//普通用户昵称
private String nickname;
//普通用户性别,1为男性,2为女性
private Integer sex;
//普通用户个人资料填写的省份
private String province;
//普通用户个人资料填写的城市
private String city;
//国家,如中国为CN
private String country;
//用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空
private String headimgurl;
//用户特权信息,json数组,如微信沃卡用户为(chinaunicom)
private List<String> privilege;
//用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。
private String unionid;
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getHeadimgurl() {
return headimgurl;
}
public void setHeadimgurl(String headimgurl) {
this.headimgurl = headimgurl;
}
public List<String> getPrivilege() {
return privilege;
}
public void setPrivilege(List<String> privilege) {
this.privilege = privilege;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
@Override
public Boolean getResult() {
return true;
}
}
package com.yifu.cloud.plus.v1.yifu.auth.util.weixin.service;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.yifu.cloud.plus.v1.yifu.auth.util.AbstractLoginService;
import com.yifu.cloud.plus.v1.yifu.auth.util.LoginResult;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.WeixinLoginConstants;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.WeixinLoignProperties;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinAccessToken;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinError;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinUserInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
/**
* 微信登录服务
*/
@Service
public class WeixinLoginService extends AbstractLoginService<WeixinLoignProperties> {
private static final Logger logger = LoggerFactory.getLogger(WeixinLoginService.class);
public LoginResult getAccessToken(String code) {
StringBuilder uri = new StringBuilder();
uri.append(WeixinLoginConstants.HOST_API + WeixinLoginConstants.ACCESS_TOKEN + "?appid=");
uri.append(properties.getAppid());
uri.append("&secret=").append(properties.getAppsecret());
uri.append("&code=" + code).append("&grant_type=authorization_code");
try {
String url = uri.toString();
String result = restTemplate.getForObject(url, String.class);
JSONObject json = JSONUtil.parseObj(result);
if(json.getStr("access_token") != null){
WeixinAccessToken accessToken = new WeixinAccessToken();
accessToken.setAccess_token(json.getStr("access_token"));
accessToken.setOpenid(json.getStr("open_id"));
accessToken.setExpires_in(json.getLong("expires_in"));
accessToken.setRefresh_token(json.getStr("refresh_token"));
accessToken.setScope(json.getStr("scope"));
return accessToken;
}else{
WeixinError error = new WeixinError();
error.setErrcode(json.getStr("errcode"));
error.setErrmsg(json.getStr("errmsg"));
return error;
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return null;
}
public LoginResult getAccessToken(String code,String appid ,String secret) {
StringBuilder uri = new StringBuilder();
uri.append(WeixinLoginConstants.HOST_API + WeixinLoginConstants.ACCESS_TOKEN + "?appid=");
if (Common.isNotNull(appid) && Common.isNotNull(secret)){
uri.append(appid);
uri.append("&secret=").append(secret);
}else {
uri.append(properties.getAppid());
uri.append("&secret=").append(properties.getAppsecret());
}
uri.append("&code=" + code).append("&grant_type=authorization_code");
try {
String url = uri.toString();
String result = restTemplate.getForObject(url, String.class);
JSONObject json = JSONUtil.parseObj(result);
if(json.getStr("access_token") != null){
WeixinAccessToken accessToken = new WeixinAccessToken();
accessToken.setAccess_token(json.getStr("access_token"));
accessToken.setOpenid(json.getStr("open_id"));
accessToken.setExpires_in(json.getLong("expires_in"));
accessToken.setRefresh_token(json.getStr("refresh_token"));
accessToken.setScope(json.getStr("scope"));
return accessToken;
}else{
WeixinError error = new WeixinError();
error.setErrcode(json.getStr("errcode"));
error.setErrmsg(json.getStr("errmsg"));
return error;
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return null;
}
public LoginResult getWxUserInfo(WeixinAccessToken accessToken) {
StringBuilder uri = new StringBuilder();
uri.append(WeixinLoginConstants.HOST_API + WeixinLoginConstants.USER_INFO + "?access_token=");
uri.append(accessToken.getAccess_token());
uri.append("&openid=" + accessToken.getOpenid());
uri.append("&lang=zh_CN");
try {
String result = restTemplate.getForObject(uri.toString(), String.class);
WeixinUserInfo userInfo = JSONUtil.toBean(result, WeixinUserInfo.class);
if(userInfo != null && null != userInfo.getOpenid()){
return userInfo;
}else{
WeixinError error = JSONUtil.toBean(result, WeixinError.class);
return error;
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return null;
}
@Override
public String loadAuthPage(String state) {
return null;
}
}
package com.yifu.cloud.plus.v1.yifu.auth.vo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.auth.util.weixin.model.WeixinUserInfo;
import lombok.Data;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
/**
* @program: master
* @description: 微信返回包装类
* @author: pwang
* @create: 2020-08-10 21:11
**/
@Data
public class WxUserVo {
private OAuth2AccessToken oauth2AccessToken;
private WeixinUserInfo weixinUserInfo;
private SysUser user;
}
...@@ -36,3 +36,10 @@ spring: ...@@ -36,3 +36,10 @@ spring:
prefer-file-system-access: true prefer-file-system-access: true
suffix: .ftl suffix: .ftl
template-loader-path: classpath:/templates/ template-loader-path: classpath:/templates/
weixin:
login:
appid: wxfb3a14ee64c87046
appsecret: e2143c5a1f635e039122de27f29354fe
redirectUri: https://www.ngrok.xiaomiqiu.cn/admin/hi
errorUri: /error
callbackUri: https://www.ngrok.xiaomiqiu.cn/oauth/weixin/callback
...@@ -8,7 +8,9 @@ package com.yifu.cloud.plus.v1.check.constant; ...@@ -8,7 +8,9 @@ package com.yifu.cloud.plus.v1.check.constant;
*/ */
public interface ChecksConstants { public interface ChecksConstants {
String NACOS_CHECK_CONFIG_ERROR="nacos中checks.yaml的配置canCheck未开启!"; String NACOS_CHECK_CONFIG_ERROR="校验服务验证开关关闭!";
String CHECK_CONFIG_ACCESS="校验服务验证关闭,自动放行!";
String CODE="code"; String CODE="code";
......
...@@ -13,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -13,6 +13,7 @@ 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 java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -39,8 +40,10 @@ public class ChecksUtil { ...@@ -39,8 +40,10 @@ public class ChecksUtil {
// 1.调用身份信息校验api // 1.调用身份信息校验api
checkIdCardMethod(checkIdCard); checkIdCardMethod(checkIdCard);
} else { } else {
checkIdCard.setIsTrue(CommonConstants.ZERO_INT); //checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
checkIdCard.setReason(ChecksConstants.NACOS_CHECK_CONFIG_ERROR); //checkIdCard.setReason(ChecksConstants.NACOS_CHECK_CONFIG_ERROR);
checkIdCard.setIsTrue(CommonConstants.ONE_INT);
checkIdCard.setReason(ChecksConstants.CHECK_CONFIG_ACCESS);
} }
} }
/** /**
...@@ -52,10 +55,23 @@ public class ChecksUtil { ...@@ -52,10 +55,23 @@ public class ChecksUtil {
public static R<Map<String,TCheckMobile>> checkMobile(String mobiles, boolean canCheck) { public static R<Map<String,TCheckMobile>> checkMobile(String mobiles, boolean canCheck) {
Map<String,TCheckMobile> checkMobiles = new HashMap<>(); Map<String,TCheckMobile> checkMobiles = new HashMap<>();
if (canCheck) { if (canCheck) {
// 1.调用身份信息校验api // 1.调用手机信息校验api
return checkMobileMethod(mobiles,checkMobiles); return checkMobileMethod(mobiles,checkMobiles);
} else { } else {
return R.failed(ChecksConstants.NACOS_CHECK_CONFIG_ERROR); TCheckMobile checkMobile;
List<String> mobileList = Common.initStrToList(mobiles,CommonConstants.COMMA_STRING);
Map<String,TCheckMobile> resMap = new HashMap<>();
if (Common.isNotNull(mobileList)){
for (String m:mobileList){
checkMobile = new TCheckMobile();
checkMobile.setMobile(m);
checkMobile.setStatus(CommonConstants.ONE_STRING);
checkMobile.setType(CommonConstants.ONE_STRING);
checkMobile.setMessage(ChecksConstants.CHECK_CONFIG_ACCESS);
resMap.put(m,checkMobile);
}
}
return R.ok(resMap);
} }
} }
/** /**
...@@ -67,10 +83,17 @@ public class ChecksUtil { ...@@ -67,10 +83,17 @@ public class ChecksUtil {
**/ **/
public static R<TCheckBankNo> checkBankNoTwo(String name, String cardNo, boolean canCheck) { public static R<TCheckBankNo> checkBankNoTwo(String name, String cardNo, boolean canCheck) {
if (canCheck) { if (canCheck) {
// 1.调用身份信息校验api // 1.调用银行卡信息校验api
return checkBankNoTwoMethod(name,cardNo); return checkBankNoTwoMethod(name,cardNo);
} else { } else {
return R.failed(ChecksConstants.NACOS_CHECK_CONFIG_ERROR); TCheckBankNo checkBankNo = new TCheckBankNo();
checkBankNo.setBankNo(cardNo);
checkBankNo.setName(name);
checkBankNo.setMessage(ChecksConstants.CHECK_CONFIG_ACCESS);
checkBankNo.setResult("01");
checkBankNo.setType(CommonConstants.ONE_STRING);
checkBankNo.setRemark(ChecksConstants.CHECK_CONFIG_ACCESS);
return R.ok(checkBankNo);
} }
} }
......
...@@ -104,5 +104,11 @@ ...@@ -104,5 +104,11 @@
<version>3.1.1</version> <version>3.1.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.5.30</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -133,6 +133,7 @@ public interface CommonConstants { ...@@ -133,6 +133,7 @@ public interface CommonConstants {
String FIVE_STRING = "5"; String FIVE_STRING = "5";
String TWELVE_STRING = "12"; String TWELVE_STRING = "12";
int TWELVE_INT = 12;
String THIRTEEN_STRING = "13"; String THIRTEEN_STRING = "13";
...@@ -507,4 +508,33 @@ public interface CommonConstants { ...@@ -507,4 +508,33 @@ public interface CommonConstants {
public static final String A_CREATE_BY = "a.CREATE_BY"; public static final String A_CREATE_BY = "a.CREATE_BY";
String SETTLE_DOMAIN_GET_ERROR = "获取结算主体信息失败!"; String SETTLE_DOMAIN_GET_ERROR = "获取结算主体信息失败!";
/**
* c端机构节点 code
* @Author hgw
* @Date 2022-12-13 11:05:24
**/
public static final String WX_C_ORG_CODE = "00294";
/**
* c端机构节点 id
* @Author hgw
* @Date 2022-12-13 11:05:33
**/
public static final long WX_C_ORG_ID = 294;
/**
* c端机构节点 name
* @Author hgw
* @Date 2022-12-13 11:05:33
**/
public static final String WX_C_ORG_NAME = "C端用户";
// C端前缀
public static final String C_PREFIX = CacheConstants.DEFAULT_CODE_KEY.concat("_C_");
/**
* 用户未注册
*/
public static final Integer REGISTERED = 3;
} }
...@@ -299,12 +299,20 @@ public interface ErrorCodes { ...@@ -299,12 +299,20 @@ public interface ErrorCodes {
* 人员在该项目下存在进行中/未完结的服务 * 人员在该项目下存在进行中/未完结的服务
*/ */
String ARCHIVES_PROJECT_CHANGE_NOT_EXIST = "archives.project.change.not.exist"; String ARCHIVES_PROJECT_CHANGE_NOT_EXIST = "archives.project.change.not.exist";
/**
* 人员在该项目下存在存在在用或待审核、待提交的合同,不允许减项
*/
String ARCHIVES_PROJECT_CHANGE_CONTRACT_EXIST = "archives.project.change.contract.exist";
/** /**
* 人员在原项目中存在在途的服务,请先终止后,再进行划转 * 人员在原项目中存在在途的服务,请先终止后,再进行划转
*/ */
String QT_PROJECT_CHANGE_NOT_EXIST = "qt.project.change.not.exist"; String QT_PROJECT_CHANGE_NOT_EXIST = "qt.project.change.not.exist";
/** /**
* 未找到对应的项目,请核实 * 未找到对应的新项目或者新项目已停止合作,请核实
*/
String PROJECT_NEW_SEARCH_NOT_EXIST = "project.new.search.not.exist";
/**
* 未找到对应的项目或者项目已停止合作,请核实
*/ */
String PROJECT_SEARCH_NOT_EXIST = "project.search.not.exist"; String PROJECT_SEARCH_NOT_EXIST = "project.search.not.exist";
/** /**
...@@ -478,7 +486,7 @@ public interface ErrorCodes { ...@@ -478,7 +486,7 @@ public interface ErrorCodes {
*/ */
String EMP_DISPATCH_EMP_NOT_EMPTY = "emp.dispatch.emp.not.empty"; String EMP_DISPATCH_EMP_NOT_EMPTY = "emp.dispatch.emp.not.empty";
/** /**
* 派增异常: 对应项目编码已停止合作 * 派增异常:对应项目编码的项目已冻结/已停止合作
*/ */
String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop"; String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop";
/** /**
......
...@@ -62,6 +62,10 @@ public class Common { ...@@ -62,6 +62,10 @@ public class Common {
return null == obj || "".equals(obj) || "null".equals(obj); return null == obj || "".equals(obj) || "null".equals(obj);
} }
public static boolean isEmpty(Map obj) {
return (null == obj || obj.size() == 0);
}
public static boolean isEmpty(List obj) { public static boolean isEmpty(List obj) {
return (null == obj || obj.size() == 0); return (null == obj || obj.size() == 0);
} }
......
...@@ -88,6 +88,13 @@ public class R<T> implements Serializable { ...@@ -88,6 +88,13 @@ public class R<T> implements Serializable {
return restResult(data, CommonConstants.FAIL, msg); return restResult(data, CommonConstants.FAIL, msg);
} }
public static <T> R<T> other(int code, String msg) {
return restResult(null, code, msg);
}
public static <T> R<T> other(T data, String msg, int code) {
return restResult(data, code, msg);
}
private static <T> R<T> restResult(T data, int code, String msg) { private static <T> R<T> restResult(T data, int code, String msg) {
R<T> apiResult = new R<>(); R<T> apiResult = new R<>();
apiResult.setCode(code); apiResult.setCode(code);
......
package com.yifu.cloud.plus.v1.yifu.common.core.util;
import lombok.extern.slf4j.Slf4j;
import java.security.SecureRandom;
import java.util.Random;
/**
* @description: 随机数工具
* @author: hgw
* @create: 2022-12-12 17:51:35
**/
@Slf4j
public class RandomUtil {
private RandomUtil() {
throw new IllegalStateException("Utility class");
}
/**
* 获取六位随机数
*
* @return
* @Author pwang
* @Date 2020-08-24 17:26
**/
public static String getSix() {
log.info("获取随机数开始>>>>>>>>>");
Random rad = new SecureRandom();
log.info("获取随机数结束<<<<<<<<<");
String result = rad.nextInt(1000000) + "";
if (result.length() != 6) {
return getSix();
}
return result;
}
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import lombok.Data;
/**
* @program: master
* @description: 阿里短信服务返回结果
* @author: fxj
* @create: 2022-12-12
**/
@Data
public class AliSmsResult {
/**
* 成功的code
* @Author fxj
* @Date 2022-12-12
**/
public static final String SUCCESS_CODE = "OK";
//发送回执ID,可根据该ID在接口QuerySendDetails中查询具体的发送状态。
private String bizId;
/**
* 请求状态码。
* 返回OK代表请求成功。
* 其他错误码详见错误码列表。
**/
private String code;
//状态码的描述。
private String message;
//请求ID。
private String requestId;
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import lombok.Data;
/**
* 节日祝福 参数封装对象
* @Author fxj
* @Date 2021-05-07
* @return
**/
@Data
public class ParamVo {
private String name;
private String zhengjian;
private String time;
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import lombok.Data;
import java.io.Serializable;
@Data
public class QuerySendResult implements Serializable {
private int totalCount;
private String message;
private String requestId;
private String code;
private SmsSendDetailDTOs smsSendDetailDTOs;
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import lombok.Data;
import java.io.Serializable;
/**
* 短信发送回执结果
* @Author fxj
* @Date 2021-05-08
* @return
**/
@Data
public class SmsSendDetailDTO implements Serializable {
private String sendDate;
private String outId;
/**
* 短信发送状态,包括:
* 1:等待回执。
* 2:发送失败。
* 3:发送成功。
**/
private Integer sendStatus;
private String receiveDate;
private String errCode;
private String templateCode;
private String content;
private String phoneNum;
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class SmsSendDetailDTOs implements Serializable {
private List<SmsSendDetailDTO> smsSendDetailDTO;
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import lombok.extern.slf4j.Slf4j;
/**
* @program: master
* @description: 阿里云短信工具
* @author: pwang
* @create: 2020-08-24 11:44
**/
@Slf4j
public class SmsUtil {
private static final String ACCESS_KEY_ID = "LTAI4G1h6voBYGPCV4RNmqMo";
private static final String ACCESS_KEY_SECRET = "1e4TWryIdScpsIqPxXZynGNMASdCkl";
private static final String ERROR_INFO = "调取阿里云服务异常";
private SmsUtil() { throw new IllegalStateException("Utility class");}
/**
* 短信发送方法
* @Author fxj
* @Date 2022-12-12
* @param phone
* @param code
* @param signName
* @return 正确结果{"Message":"OK","RequestId":"38FA1BE1-52C1-4833-9211-AD55CF264988","BizId":"342207398251524244^0","Code":"OK"}
**/
public static AliSmsResult sendSms(String phone,String code,String signName) {
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", ACCESS_KEY_ID, ACCESS_KEY_SECRET);
IAcsClient client = new DefaultAcsClient(profile);
JSONObject exceptionResult = new JSONObject();
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain("dysmsapi.aliyuncs.com");
request.setSysVersion("2017-05-25");
request.setSysAction("SendSms");
request.putQueryParameter("RegionId", "cn-hangzhou");
request.putQueryParameter("PhoneNumbers", phone);
request.putQueryParameter("SignName", signName);
request.putQueryParameter("TemplateCode", "SMS_200465275");
request.putQueryParameter("TemplateParam", "{\"code\":\""+code+"\"}");
try {
CommonResponse response = client.getCommonResponse(request);
return JSON.parseObject(response.getData(),AliSmsResult.class);
} catch (Exception e) {
log.error(ERROR_INFO,e);
exceptionResult.put("Message", ERROR_INFO);
exceptionResult.put("Code", "ERROR");
return exceptionResult.toJavaObject(AliSmsResult.class);
}
}
/**
* 发送皖信人力云的短信方法
* @Author fxj
* @Date 2022-12-12
* @param phone
* @param code
* @return 错误示例 {"Message":"模板不合法(不存在或被拉黑)","RequestId":"D7923A5B-AE30-481C-84D4-56BB0F230848","Code":"isv.SMS_TEMPLATE_ILLEGAL"}
**/
public static AliSmsResult sendSms(String phone,String code) {
return sendSms(phone,code,"皖信人力云");
}
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import java.util.ArrayList;
import java.util.List;
public class YiFuSmsTookit {
private YiFuSmsTookit() { throw new IllegalStateException("Utility class");}
/**
* 批量发送提前校验或封装签名
* @Author fxj
* @Date 2021-05-07
* @param phones
* @param templateParams
* @param signName
* @param templateCode
* @return
**/
public static AliSmsResult sendBatchSms(List<String> phones,
List<String> templateParams,
String signName,
String templateCode){
if (null == phones || null == templateParams){
return getSmsResult(CommonConstants.FAIL.toString(),"电话和变量参数不可为空!");
}
if (phones.size() != templateParams.size()){
return getSmsResult(CommonConstants.FAIL.toString(),"电话号码与变量参数数据不一致!");
}
List<String> signNames= new ArrayList<>();
List<ParamVo> templateParamList = new ArrayList<>();
for (int i=0;i<phones.size();i++){
signNames.add(signName);
}
ParamVo paramVo = null;
for (String param:templateParams){
paramVo = new ParamVo();
paramVo.setName(param);
templateParamList.add(paramVo);
}
return YiFuSmsUtil.sendBatchSms(phones,templateParamList, signNames,templateCode);
}
/**
* 批量发送提前校验或封装签名
* @Author fxj
* @Date 2021-05-07
* @param phones
* @param templateParamList
* @param signName
* @param templateCode
* @return
**/
public static AliSmsResult sendBusBatchSms(List<String> phones,
List<ParamVo> templateParamList,
String signName,
String templateCode){
if (null == phones || null == templateParamList){
return getSmsResult(CommonConstants.FAIL.toString(),"电话和变量参数不可为空!");
}
List<String> signNames= new ArrayList<>();
if (phones.size() != templateParamList.size()){
return getSmsResult(CommonConstants.FAIL.toString(),"电话号码与变量参数数据不一致!");
}
for (int i=0;i<phones.size();i++){
signNames.add(signName);
}
return YiFuSmsUtil.sendBatchSms(phones,templateParamList, signNames,templateCode);
}
private static AliSmsResult getSmsResult(String code,String msg){
AliSmsResult aliSmsResult = new AliSmsResult();
aliSmsResult.setCode(code);
aliSmsResult.setMessage(msg);
return aliSmsResult;
}
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("18909690612");
list.add("18909690533");
YiFuSmsUtil.querySendDetails(list,"","20210509",null,null);
}
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.alisms;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @program: master
* @description: 阿里云短信工具 - 安徽易服 的阿里云短信
* @author: fang
* @create: 2021-05-07
**/
@Slf4j
public class YiFuSmsUtil {
private static final String ACCESS_KEY_ID = "LTAIDh9goA3jgpun";
private static final String ACCESS_KEY_SECRET = "eN8EHPAZxglNfcUCMhAT02cy93omLa";
private static final String ERROR_INFO = "调取阿里云服务异常";
private static final String REGIONID = "cn-hangzhou";
private static final String SYS_DOMAIN = "dysmsapi.aliyuncs.com";
private static final String SYS_VERSION = "2017-05-25";
private static final String MESSAGE = "Message";
private static final String CODE = "Code";
private YiFuSmsUtil() { throw new IllegalStateException("Utility class");}
/**
* 防寒、防暑、节假日短信 单条发送
* @Author fxj
* @Date 2021-05-07
* @param phone
* @param templateParam
* @param signName
* @param templateCode
* @return
* 错误示例 {"Message":"模板不合法(不存在或被拉黑)","RequestId":"D7923A5B-AE30-481C-84D4-56BB0F230848","Code":"isv.SMS_TEMPLATE_ILLEGAL"}
* 正确结果{"Message":"OK","RequestId":"38FA1BE1-52C1-4833-9211-AD55CF264988","BizId":"342207398251524244^0","Code":"OK"}
**/
public static AliSmsResult sendSms(String phone,String templateParam,String signName,String templateCode){
DefaultProfile profile = DefaultProfile.getProfile(REGIONID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
IAcsClient client = new DefaultAcsClient(profile);
JSONObject exceptionResult = new JSONObject();
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain(SYS_DOMAIN);
request.setSysVersion(SYS_VERSION);
request.setSysAction("SendSms");
request.putQueryParameter("RegionId", REGIONID);
request.putQueryParameter("PhoneNumbers", phone);
request.putQueryParameter("SignName", signName);
request.putQueryParameter("TemplateCode", templateCode);
request.putQueryParameter("TemplateParam", "{\"name\":\""+templateParam+"\"}");
try {
CommonResponse response = client.getCommonResponse(request);
return JSON.parseObject(response.getData(),AliSmsResult.class);
} catch (Exception e) {
log.error(ERROR_INFO,e);
exceptionResult.put(MESSAGE, ERROR_INFO);
exceptionResult.put(CODE, e.getMessage());
return exceptionResult.toJavaObject(AliSmsResult.class);
}
}
/**
* 防寒、防暑、节假日短信 批量发送
* @Author fxj
* @Date 2021-05-07
* @param phones
* @param templateParams
* @param signNames
* @param templateCode
* @return
* 错误示例 {"Message":"模板不合法(不存在或被拉黑)","RequestId":"D7923A5B-AE30-481C-84D4-56BB0F230848","Code":"isv.SMS_TEMPLATE_ILLEGAL"}
* 正确结果{"Message":"OK","RequestId":"38FA1BE1-52C1-4833-9211-AD55CF264988","BizId":"342207398251524244^0","Code":"OK"}
**/
public static AliSmsResult sendBatchSms(List<String> phones,
List<ParamVo> templateParams,
List<String> signNames,
String templateCode){
DefaultProfile profile = DefaultProfile.getProfile(REGIONID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
IAcsClient client = new DefaultAcsClient(profile);
JSONObject exceptionResult = new JSONObject();
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain(SYS_DOMAIN);
request.setSysVersion(SYS_VERSION);
request.setSysAction("SendBatchSms");
request.putQueryParameter("PhoneNumberJson", JSONObject.toJSONString(phones));
request.putQueryParameter("SignNameJson", JSONObject.toJSONString(signNames));
request.putQueryParameter("TemplateCode", templateCode);
request.putQueryParameter("TemplateParamJson", JSONObject.toJSONString(templateParams));
try {
CommonResponse response = client.getCommonResponse(request);
return JSON.parseObject(response.getData(),AliSmsResult.class);
} catch (Exception e) {
log.error(ERROR_INFO,e);
exceptionResult.put(MESSAGE, ERROR_INFO);
exceptionResult.put(CODE, e.getMessage());
return exceptionResult.toJavaObject(AliSmsResult.class);
}
}
public static QuerySendResult querySendDetail(String phone, String bizId, String sendDate, String pageSize, String curPage){
DefaultProfile profile = DefaultProfile.getProfile(REGIONID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
IAcsClient client = new DefaultAcsClient(profile);
JSONObject exceptionResult = new JSONObject();
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain(SYS_DOMAIN);
request.setSysVersion(SYS_VERSION);
request.setSysAction("QuerySendDetails");
request.putQueryParameter("PhoneNumber", phone);
request.putQueryParameter("BizId", bizId);
request.putQueryParameter("SendDate", sendDate);
request.putQueryParameter("PageSize", null==pageSize?"10":pageSize);
request.putQueryParameter("CurrentPage", null ==curPage?"1":curPage);
try {
CommonResponse response = client.getCommonResponse(request);
return JSON.parseObject(response.getData(),QuerySendResult.class);
} catch (Exception e) {
log.error(ERROR_INFO,e);
exceptionResult.put(MESSAGE, ERROR_INFO);
exceptionResult.put(CODE, e.getMessage());
return exceptionResult.toJavaObject(QuerySendResult.class);
}
}
public static Map<String,SmsSendDetailDTO> querySendDetails(List<String> phones, String bizId, String sendDate, String pageSize, String curPage){
DefaultProfile profile = DefaultProfile.getProfile(REGIONID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
IAcsClient client = new DefaultAcsClient(profile);
JSONObject exceptionResult = new JSONObject();
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain(SYS_DOMAIN);
request.setSysVersion(SYS_VERSION);
request.setSysAction("QuerySendDetails");
request.putQueryParameter("BizId", bizId);
request.putQueryParameter("SendDate", sendDate);
request.putQueryParameter("PageSize", null==pageSize?"10":pageSize);
request.putQueryParameter("CurrentPage", null ==curPage?"1":curPage);
Map<String,SmsSendDetailDTO> smsSendDetailMap = new HashMap<>();
try {
if (Common.isNotEmpty(phones)){
CommonResponse response;
QuerySendResult sendResult;
for (String phone:phones){
request.putQueryParameter("PhoneNumber", phone);
response = client.getCommonResponse(request);
sendResult =JSON.parseObject(response.getData(),QuerySendResult.class);
if (null != sendResult &&
null != sendResult.getSmsSendDetailDTOs() &&
Common.isNotNull(sendResult.getSmsSendDetailDTOs().getSmsSendDetailDTO())){
smsSendDetailMap.put(phone,sendResult.getSmsSendDetailDTOs().getSmsSendDetailDTO().get(0));
}
}
}
} catch (Exception e) {
log.error(ERROR_INFO,e);
exceptionResult.put(MESSAGE, ERROR_INFO);
exceptionResult.put(CODE, e.getMessage());
}
return smsSendDetailMap;
}
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.http;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
/**
* 获取http会话数据的工具类
*
* @author daijie
* @since 2017年6月5日
*/
public class HttpConversationUtil {
private static Logger logger = LoggerFactory.getLogger(HttpConversationUtil.class);
/**
* 获取当前请求会话
* @return HttpServletRequest
*/
public static HttpServletRequest getRequest(){
return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
}
/**
* 获取当前响应会话
* @return HttpServletResponse
*/
public static HttpServletResponse getResponse(){
return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse();
}
/**
* 获取当前请求会话IP
* @return String
*/
public static String getIP(){
String ip = getRequest().getHeader("x-forwarded-for");
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)){
ip = getRequest().getHeader("Proxy-Client-IP");
}
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)){
ip = getRequest().getHeader("WL-Proxy-Client-IP");
}
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)){
ip = getRequest().getRemoteAddr();
}
return ip.equals("0:0:0:0:0:0:0:1")?"127.0.0.1":ip;
}
/**
* 获取请求Body转换为json字符串
*
* @return String
*/
public static String getBodyString() {
StringBuilder sb = new StringBuilder();
InputStream inputStream = null;
BufferedReader reader = null;
try {
inputStream = getRequest().getInputStream();
reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
String line = "";
while ((line = reader.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
logger.info("未读取到请求body中数据");
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
logger.info("未读取到请求body中数据");
}
}
}
return sb.toString();
}
/**
* 得到所有的参数的值
* @return Map
*/
public static Map<String,Object> handelRequest(){
Map<String,Object> obj = new HashMap<String,Object>();
Enumeration<String> coll = getRequest().getParameterNames();
while(coll.hasMoreElements()){
String key = coll.nextElement();
obj.put(key, getRequest().getParameter(key)==null?"":getRequest().getParameter(key) );
}
if(obj.get("pageSize")!=null || obj.get("pageNumber")!=null){
int pageSize = Integer.valueOf(obj.get("pageSize").toString());
int pageNumber = Integer.valueOf(obj.get("pageNumber").toString());
int startIndex = (pageNumber - 1) * pageSize;
obj.put("startIndex", startIndex);
obj.put("pageSize", pageSize);
obj.put("pageNumber", pageNumber);
}
return obj;
}
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.http.htapi;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* 仿JS 编码 解码
* @Author fxj
* @Date 2020-11-13
* @return
**/
public class EncodingUtil {
public static String decodeURIComponent(String s) {
if (s == null) {
return null;
}
String result = null;
try {
result = URLDecoder.decode(s, CommonConstants.UTF8);
}
// This exception should never occur.
catch (UnsupportedEncodingException e) {
result = s;
}
return result;
}
public static String encodeURIComponent(String s) {
String result = null;
try {
result = URLEncoder.encode(s, CommonConstants.UTF8)
.replaceAll("\\+", "%20")
.replaceAll("\\%21", "!")
.replaceAll("\\%27", "'")
.replaceAll("\\%28", "(")
.replaceAll("\\%29", ")")
.replaceAll("\\%7E", "~");
}
// This exception should never occur.
catch (UnsupportedEncodingException e) {
result = s;
}
return result;
}
private EncodingUtil() {
super();
}
}
package com.yifu.cloud.plus.v1.yifu.common.core.util.http.htapi;
import lombok.Data;
import java.io.Serializable;
/**
* API 返回结果
* @Author fxj
* @Date 2020-11-13
* @return
**/
@Data
public class ResultBean implements Serializable {
/**
* API返回结果
**/
private String ENCMSG;
}
...@@ -17,10 +17,13 @@ ...@@ -17,10 +17,13 @@
package com.yifu.cloud.plus.v1.yifu.common.core.vo; package com.yifu.cloud.plus.v1.yifu.common.core.vo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.User;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map;
/** /**
* @author lengleng * @author lengleng
...@@ -91,4 +94,11 @@ public class YifuUser extends User { ...@@ -91,4 +94,11 @@ public class YifuUser extends User {
this.ldapDn = ldapDn; this.ldapDn = ldapDn;
} }
/**
* key是客户端id,val是角色id数组
*/
@Getter
@Setter
private Map<String, List<Integer>> clientRoleMap;
} }
...@@ -97,10 +97,13 @@ archives.project.emp.not.exist=\u8BE5\u4EBA\u5458\u65E0\u5BF9\u5E94\u7684\u9879\ ...@@ -97,10 +97,13 @@ archives.project.emp.not.exist=\u8BE5\u4EBA\u5458\u65E0\u5BF9\u5E94\u7684\u9879\
archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B58\u5728\u8FDB\u884C\u4E2D/\u672A\u5B8C\u7ED3\u7684\u670D\u52A1 archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B58\u5728\u8FDB\u884C\u4E2D/\u672A\u5B8C\u7ED3\u7684\u670D\u52A1
archives.project.change.contract.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B58\u5728\u5728\u7528\u6216\u5F85\u5BA1\u6838\u3001\u5F85\u63D0\u4EA4\u7684\u5408\u540C\uFF0C\u4E0D\u5141\u8BB8\u51CF\u9879
archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u635F\u5931\u548C\u5176\u4ED6\u635F\u5931\u4E0D\u53EF\u540C\u65F6\u4E3A\u7A7A archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u635F\u5931\u548C\u5176\u4ED6\u635F\u5931\u4E0D\u53EF\u540C\u65F6\u4E3A\u7A7A
qt.project.change.not.exist=\u4EBA\u5458\u5728\u539F\u9879\u76EE\u4E2D\u5B58\u5728\u5728\u9014\u7684\u670D\u52A1\uFF0C\u8BF7\u5148\u7EC8\u6B62\u540E\uFF0C\u518D\u8FDB\u884C\u5212\u8F6C qt.project.change.not.exist=\u4EBA\u5458\u5728\u539F\u9879\u76EE\u4E2D\u5B58\u5728\u5728\u9014\u7684\u670D\u52A1\uFF0C\u8BF7\u5148\u7EC8\u6B62\u540E\uFF0C\u518D\u8FDB\u884C\u5212\u8F6C
project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u9879\u76EE\uFF0C\u8BF7\u6838\u5B9E project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u9879\u76EE\u6216\u8005\u9879\u76EE\u5DF2\u505C\u6B62\u5408\u4F5C\uFF0C\u8BF7\u6838\u5B9E
project.new.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u65B0\u9879\u76EE\u6216\u8005\u65B0\u9879\u76EE\u5DF2\u505C\u6B62\u5408\u4F5C\uFF0C\u8BF7\u6838\u5B9E
change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A
change.less.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u8981\u5C0F\u4E8E\u7B49\u4E8E\u5F53\u524D\u6708 change.less.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u8981\u5C0F\u4E8E\u7B49\u4E8E\u5F53\u524D\u6708
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
<artifactId>yifu-social-api</artifactId> <artifactId>yifu-social-api</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-insurances-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yifu.cloud.plus.v1</groupId> <groupId>com.yifu.cloud.plus.v1</groupId>
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util; package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import java.util.List;
/** /**
* @Author fxj * @Author fxj
* @Date 2022/8/17 * @Date 2022/8/17
...@@ -17,5 +22,14 @@ public class SalaryDaprUtil { ...@@ -17,5 +22,14 @@ public class SalaryDaprUtil {
@Autowired @Autowired
private DaprSalaryProperties daprProperties; private DaprSalaryProperties daprProperties;
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public void updateSalarySettleStatus(List<EkpSocialViewVo> infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateSalarySettleStatus", JSON.toJSONString(infoVo), EkpSocialViewVo.class, SecurityConstants.FROM_IN);
}
} }
...@@ -5,6 +5,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; ...@@ -5,6 +5,8 @@ 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.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.dapr.config.DaprSocialProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
...@@ -133,4 +135,26 @@ public class SocialDaprUtils { ...@@ -133,4 +135,26 @@ public class SocialDaprUtils {
public void deleteById(TIncomeDetail infoVo) { public void deleteById(TIncomeDetail infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/deleteById", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN); HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/deleteById", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
} }
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public void updateSocialSettleStatus(List<EkpSocialViewVo> infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/updateSocialSettleStatus", JSON.toJSONString(infoVo), EkpSocialViewVo.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public void updateIncomeSettleStatus(List<EkpInsuranceViewVo> infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateIncomeSettleStatus", JSON.toJSONString(infoVo), EkpInsuranceViewVo.class, SecurityConstants.FROM_IN);
}
} }
...@@ -65,7 +65,7 @@ public class YifuResourceServerConfigurerAdapter extends ResourceServerConfigure ...@@ -65,7 +65,7 @@ public class YifuResourceServerConfigurerAdapter extends ResourceServerConfigure
permitAllUrl.getUrls().forEach(url -> registry.antMatchers(url).permitAll()); permitAllUrl.getUrls().forEach(url -> registry.antMatchers(url).permitAll());
// “/user/getInfoByUsername" URL 访问放行 // “/user/getInfoByUsername" URL 访问放行
registry.and() registry.and()
.authorizeRequests().antMatchers("/user/getInfoByUsername","/api/**","/api-docs/**").permitAll() .authorizeRequests().antMatchers("/api/**","/api-docs/**","/**/getInfoByEmpPhone","/**/sendCCode","/**/employee/registration").permitAll()
.anyRequest().authenticated().and().csrf().disable(); .anyRequest().authenticated().and().csrf().disable();
} }
......
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.common.security.service; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.common.security.service;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo; import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
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.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
...@@ -59,7 +60,7 @@ public class YifuUserDetailsServiceImpl implements YifuUserDetailsService { ...@@ -59,7 +60,7 @@ public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
return (YifuUser) cache.get(username).get(); return (YifuUser) cache.get(username).get();
} }
R<UserInfo> result = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(), "/user/getInfoByUsername", "?username="+username, UserInfo.class); R<UserInfo> result = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(), "/user/getInfoByUsername", "?username="+username, UserInfo.class, SecurityConstants.FROM_IN);
UserDetails userDetails = getUserDetails(result); UserDetails userDetails = getUserDetails(result);
if (cache != null) { if (cache != null) {
cache.put(username, userDetails); cache.put(username, userDetails);
......
...@@ -140,7 +140,14 @@ public class InsurancesConstants { ...@@ -140,7 +140,14 @@ public class InsurancesConstants {
* 项目编码不存在 * 项目编码不存在
*/ */
public static final String DEPT_NO_IS_NOT_EXIST = "项目编码不存在"; public static final String DEPT_NO_IS_NOT_EXIST = "项目编码不存在";
/**
* 对应项目编码已停止合作
*/
public static final String EMP_DISPATCH_SETTLEDOMAIN_STOP = "对应项目编码已停止合作";
/**
* 对应替换员工项目编码已停止合作
*/
public static final String EMP_DISPATCH_REPALCE_SETTLEDOMAIN_STOP = "对应替换员工项目编码已停止合作";
/** /**
* 替换员工项目不存在 * 替换员工项目不存在
*/ */
......
...@@ -297,6 +297,30 @@ public class TInsuranceDetail extends BaseEntity { ...@@ -297,6 +297,30 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "订单编号") @Schema(description = "订单编号")
private String orderNo; private String orderNo;
/**
* 收入信息结算状态 0 已结算 1 结算中 2 未结算 3 无需结算
*/
@Schema(description = "收入信息结算状态")
private String incomeSettleFlag;
/**
* 收入信息结算状态 0 已收 1 未收 2 垫付
*/
@Schema(description = "收入信息收款状态")
private String incomeCollectFlag;
/**
* 支出信息结算状态 0 已结算 1 结算中 2 未结算 3 无需结算
*/
@Schema(description = "支出信息结算状态")
private String paySettleFlag;
/**
* 收入信息结算状态 0 已付 1 未付
*/
@Schema(description = "支出信息付款状态")
private String payCollectFlag;
/** /**
* 创建人所在部门 * 创建人所在部门
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/8/22
* @Description 薪资明细对应参数
* @Version 1.0
*/
@Data
public class EkpInsuranceViewVo implements Serializable {
/**
* 明细id
**/
private String id;
/**
* 收入信息结算状态 0 已结算 1 结算中 2 未结算 3 已冻结
*/
private String incomeSettleFlag;
/**
* 收入信息结算状态 0 已收 1 未收 2 垫付
*/
private String incomeCollectFlag;
/**
* 支出信息结算状态 0 已结算 1 结算中 2 未结算
*/
private String paySettleFlag;
/**
* 支出信息付款状态 0 已付 1 未付
*/
private String payCollectFlag;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/8/22
* @Description 薪资明细对应参数
* @Version 1.0
*/
@Data
public class EkpSocialViewVo implements Serializable {
/**
* 明细id
**/
private String id;
/**
* 收入信息结算状态 0 已结算 1 结算中 2 未结算 3 已冻结
*/
private String incomeSettleFlag;
/**
* 收入信息结算状态 0 已收 1 未收 2 垫付
*/
private String incomeCollectFlag;
/**
* 支出信息结算状态 0 已结算 1 结算中 2 未结算
*/
private String paySettleFlag;
/**
* 支出信息付款状态 0 已付 1 未付
*/
private String payCollectFlag;
/**
* 结算单标识 预估 实缴
*/
private String settleFlag;
/**
* 0 收入结算单号 1 支出结算单号
*/
private String payFlag;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author huyc
* @Date 2022/12/27
* @Description 结算单号对应参数
* @Version 1.0
*/
@Data
public class EkpStatusParamVo implements Serializable {
/**
* 结算单号
**/
private String settleNo;
/**
* 0 收入结算单号 1 支出结算单号
*/
private String payFlag;
/**
* 结算单类型 0 社保/管理费 1公积金/风险金
*/
private String typeFlag;
}
...@@ -682,4 +682,56 @@ public class TInsuranceDetailController { ...@@ -682,4 +682,56 @@ public class TInsuranceDetailController {
tInsuranceDetailService.ekpUpdateInsuranceDept(changeDeptVo); tInsuranceDetailService.ekpUpdateInsuranceDept(changeDeptVo);
} }
/**
* 更新收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新商险收款状态--EKP调用接口", description = "更新商险收款状态--EKP调用接口")
@SysLog("更新商险收款状态--EKP调用接口")
@PostMapping("/updateInsuranceSettleStatus")
public R updateInsuranceSettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateInsuranceSettleStatus(vo);
}
/**
* 更新社保收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新社保收款状态--EKP调用接口", description = "更新社保收款状态--EKP调用接口")
@SysLog("更新社保收款状态--EKP调用接口")
@PostMapping("/updateSocialSettleStatus")
public R updateSocialSettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateSocialSettleStatus(vo);
}
/**
* 更新收入收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新收入收款状态--EKP调用接口", description = "更新收入收款状态--EKP调用接口")
@SysLog("更新收入收款状态--EKP调用接口")
@PostMapping("/updateIncomeSettleStatus")
public R updateIncomeSettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateIncomeSettleStatus(vo);
}
/**
* 更新薪资收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新薪资收款状态--EKP调用接口", description = "更新薪资收款状态--EKP调用接口")
@SysLog("更新薪资收款状态--EKP调用接口")
@PostMapping("/updateSalarySettleStatus")
public R updateSalarySettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateSalarySettleStatus(vo);
}
} }
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp; package com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author zhaji * @author zhaji
...@@ -18,4 +23,18 @@ public interface EkpSettleMapper { ...@@ -18,4 +23,18 @@ public interface EkpSettleMapper {
* @return {@link SettleVo} * @return {@link SettleVo}
*/ */
SettleVo getSettle(String id); SettleVo getSettle(String id);
List<EkpInsuranceViewVo> selectSettleStatusBySettleNo(@Param("settleNo") String settleNo, @Param("payFlag") String payFlag);
List<EkpSocialViewVo> selectSocialViewStatusBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
List<EkpSocialViewVo> selectFundViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
List<EkpInsuranceViewVo> selectFIncomelViewBySettleNo(@Param("settleNo") String settleNo);
List<EkpInsuranceViewVo> selectIncomeViewBySettleNo(@Param("settleNo") String settleNo);
List<EkpSocialViewVo> selectSalarylViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
} }
...@@ -3,8 +3,12 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp; ...@@ -3,8 +3,12 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp;
import com.baomidou.mybatisplus.extension.service.IService; 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.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import java.util.List;
/** /**
* @author zhaji * @author zhaji
* @description TODO * @description TODO
...@@ -20,4 +24,37 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> { ...@@ -20,4 +24,37 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> {
* @return {@link R} * @return {@link R}
*/ */
SettleVo getSettle(String id); SettleVo getSettle(String id);
/**
* 根据结算单编号查询商险视图信息
*
*/
List<EkpInsuranceViewVo> selectViewBySettleNo(String settleNo, String payFlag);
/**
* 根据结算单编号查询社保视图信息
*
*/
List<EkpSocialViewVo> selectSocialViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询公积金视图信息
*
*/
List<EkpSocialViewVo> selectFundViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询管理费视图信息
*
*/
List<EkpInsuranceViewVo> selectIncomelViewBySettleNo(String settleNo);
/**
* 根据结算单编号查询风险金视图信息
*
*/
List<EkpInsuranceViewVo> selectFIncomelViewBySettleNo(String settleNo);
/**
* 根据结算单编号查询薪资视图信息
*
*/
List<EkpSocialViewVo> selectSalarylViewBySettleNo(String settleNo,String payFlag);
} }
...@@ -5,11 +5,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,11 +5,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpSettleMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpSettleMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService; import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
...@@ -28,6 +31,36 @@ public class EkpSettleServiceImpl implements EkpSettleService { ...@@ -28,6 +31,36 @@ public class EkpSettleServiceImpl implements EkpSettleService {
return ekpSettleMapper.getSettle(id); return ekpSettleMapper.getSettle(id);
} }
@Override
public List<EkpInsuranceViewVo> selectViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSettleStatusBySettleNo(settleNo,payFlag);
}
@Override
public List<EkpSocialViewVo> selectSocialViewBySettleNo(String settleNo, String payFlag) {
return ekpSettleMapper.selectSocialViewStatusBySettleNo(settleNo,payFlag);
}
@Override
public List<EkpSocialViewVo> selectFundViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectFundViewBySettleNo(settleNo,payFlag);
}
@Override
public List<EkpInsuranceViewVo> selectFIncomelViewBySettleNo(String settleNo) {
return ekpSettleMapper.selectFIncomelViewBySettleNo(settleNo);
}
@Override
public List<EkpInsuranceViewVo> selectIncomelViewBySettleNo(String settleNo) {
return ekpSettleMapper.selectIncomeViewBySettleNo(settleNo);
}
@Override
public List<EkpSocialViewVo> selectSalarylViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSalarylViewBySettleNo(settleNo,payFlag);
}
@Override @Override
public boolean saveBatch(Collection<TInsuranceTypeRate> entityList, int batchSize) { public boolean saveBatch(Collection<TInsuranceTypeRate> entityList, int batchSize) {
return false; return false;
......
...@@ -465,4 +465,40 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -465,4 +465,40 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return: void * @return: void
**/ **/
void ekpUpdateInsuranceDept(ChangeDeptVo changeDeptVo); void ekpUpdateInsuranceDept(ChangeDeptVo changeDeptVo);
/**
* @param vo
* @Description: 更新商险结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateInsuranceSettleStatus(EkpStatusParamVo vo);
/**
* @param vo
* @Description: 更新社保结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateSocialSettleStatus(EkpStatusParamVo vo);
/**
* @param vo
* @Description: 更新收入结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateIncomeSettleStatus(EkpStatusParamVo vo);
/**
* @param vo
* @Description: 更新薪资结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateSalarySettleStatus(EkpStatusParamVo vo);
} }
...@@ -11,10 +11,31 @@ ...@@ -11,10 +11,31 @@
<result property="actualStatus" column="fd_3b05bd5ed0b976" jdbcType="VARCHAR"/> <result property="actualStatus" column="fd_3b05bd5ed0b976" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<resultMap id="BaseResultStatusMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo">
<id property="id" column="detailsId" jdbcType="VARCHAR"/>
<result property="incomeSettleFlag" column="earningStatus" jdbcType="VARCHAR"/>
<result property="incomeCollectFlag" column="receiptStatus" jdbcType="VARCHAR"/>
<result property="paySettleFlag" column="zhichuEarningStatus" jdbcType="VARCHAR"/>
<result property="payCollectFlag" column="payStatus" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="BaseResultSocialStatusMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo">
<id property="id" column="detailsId" jdbcType="VARCHAR"/>
<result property="incomeSettleFlag" column="earningStatus" jdbcType="VARCHAR"/>
<result property="incomeCollectFlag" column="receiptStatus" jdbcType="VARCHAR"/>
<result property="paySettleFlag" column="zhichuEarningStatus" jdbcType="VARCHAR"/>
<result property="payCollectFlag" column="payStatus" jdbcType="VARCHAR"/>
<result property="settleFlag" column="orderType" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
fd_id,fd_3b05ba46bb042e,fd_3b05ba4808a3ca,fd_3b05bd5ed0b976 fd_id,fd_3b05ba46bb042e,fd_3b05ba4808a3ca,fd_3b05bd5ed0b976
</sql> </sql>
<sql id="Base_Column_List_Status">
detailsId,earningStatus,receiptStatus,zhichuEarningStatus,payStatus
</sql>
<select id="getSettle" resultMap="BaseResultMap"> <select id="getSettle" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
...@@ -23,6 +44,106 @@ ...@@ -23,6 +44,106 @@
where where
fd_3b05ba46bb042e = #{id} fd_3b05ba46bb042e = #{id}
</select> </select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectSettleStatusBySettleNo" resultMap="BaseResultStatusMap">
select
<include refid="Base_Column_List_Status"></include>
from
ekp.view_insurance_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
<!-- 根据结算单编码获取社保视图信息 -->
<select id="selectSocialViewStatusBySettleNo" resultMap="BaseResultSocialStatusMap">
select
detailsId,
earningStatus,
receiptStatus,
zhichuEarningStatus,
payStatus,
orderType
from
ekp.view_social_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
<!-- 根据结算单编码获取公积金视图信息 -->
<select id="selectFundViewBySettleNo" resultMap="BaseResultSocialStatusMap">
select
detailsId,
earningStatus,
receiptStatus,
zhichuEarningStatus,
payStatus
from
ekp.view_funds_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectFIncomelViewBySettleNo" resultMap="BaseResultStatusMap">
select
detailsId,
earningStatus,
receiptStatus
from
ekp.view_riskfund_info
where
earningNo = #{settleNo}
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectIncomeViewBySettleNo" resultMap="BaseResultStatusMap">
select
detailsId,
earningStatus,
receiptStatus
from
ekp.view_management_info
where
earningNo = #{settleNo}
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectSalarylViewBySettleNo" resultMap="BaseResultSocialStatusMap">
select
detailsId,
earningStatus,
receiptStatus,
zhichuEarningStatus,
payStatus
from
ekp.view_salary_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
</mapper> </mapper>
......
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
<result property="unitId" column="UNIT_ID" jdbcType="VARCHAR"/> <result property="unitId" column="UNIT_ID" jdbcType="VARCHAR"/>
<result property="unitName" column="UNIT_NAME" jdbcType="VARCHAR"/> <result property="unitName" column="UNIT_NAME" jdbcType="VARCHAR"/>
<result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/> <result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/>
<result property="incomeSettleFlag" column="INCOME_SETTLE_FLAG"/>
<result property="incomeCollectFlag" column="INCOME_COLLECT_FLAG"/>
<result property="paySettleFlag" column="PAY_COLLECT_FLAG"/>
<result property="payCollectFlag" column="PAY_SETTLE_FLAG"/>
</resultMap> </resultMap>
<resultMap id="UpdateMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceUpdateVO"> <resultMap id="UpdateMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceUpdateVO">
<id property="id" column="ID" jdbcType="VARCHAR"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
......
...@@ -505,11 +505,40 @@ public class TSalaryAccount extends BaseEntity { ...@@ -505,11 +505,40 @@ public class TSalaryAccount extends BaseEntity {
@ExcelProperty(value = "累计3岁以下婴幼儿照护") @ExcelProperty(value = "累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney; private BigDecimal sumBabyMoney;
@ExcelAttribute(name = "累计个人养老金", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
@ExcelAttribute(name = "年终奖单独扣税税费", isFloat = true,max = "999999999.99") @ExcelAttribute(name = "年终奖单独扣税税费", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "年终奖单独扣税税费") @ExcelProperty(value = "年终奖单独扣税税费")
private BigDecimal annualBonusTax; private BigDecimal annualBonusTax;
/**
* 收入信息结算状态 0 已结算 1 结算中 2 未结算 3 已冻结
*/
@Schema(description = "收入信息结算状态")
private String incomeSettleFlag;
/**
* 收入信息结算状态 0 已收 1 未收 2 垫付
*/
@Schema(description = "收入信息收款状态")
private String incomeCollectFlag;
/**
* 支出信息结算状态 0 已结算 1 结算中 2 未结算
*/
@Schema(description = "支出信息结算状态")
private String paySettleFlag;
/**
* 收入信息结算状态 0 已付 1 未付
*/
@Schema(description = "支出信息付款状态")
private String payCollectFlag;
/** /**
* 工资月份-起 * 工资月份-起
*/ */
...@@ -520,4 +549,7 @@ public class TSalaryAccount extends BaseEntity { ...@@ -520,4 +549,7 @@ public class TSalaryAccount extends BaseEntity {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String salaryMonthEnd; private String salaryMonthEnd;
@ExcelProperty(value = "导入行号")
private Integer rowIndex;
} }
...@@ -270,11 +270,11 @@ public class TSalaryAccount2022 { ...@@ -270,11 +270,11 @@ public class TSalaryAccount2022 {
@ExcelProperty("单位name") @ExcelProperty("单位name")
private String unitName; private String unitName;
/** /**
* 累计婴幼儿照护费用 * 累计3岁以下婴幼儿照护
*/ */
@ExcelAttribute(name = "累计婴幼儿照护费用") @ExcelAttribute(name = "累计3岁以下婴幼儿照护")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("累计婴幼儿照护费用") @ExcelProperty("累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney; private BigDecimal sumBabyMoney;
/** /**
* 是否当月新增人员 * 是否当月新增人员
...@@ -297,4 +297,10 @@ public class TSalaryAccount2022 { ...@@ -297,4 +297,10 @@ public class TSalaryAccount2022 {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码") @ExcelProperty("手机号码")
private String empPhone; private String empPhone;
@ExcelAttribute(name = "累计个人养老金", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
} }
...@@ -441,4 +441,12 @@ public class TSalaryStandard extends BaseEntity { ...@@ -441,4 +441,12 @@ public class TSalaryStandard extends BaseEntity {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String salaryMonthEnd; private String salaryMonthEnd;
@TableField(exist = false)
@Schema(description = "创建时间起")
private String createTimeStart;
@TableField(exist = false)
@Schema(description = "创建时间止")
private String createTimeEnd;
} }
...@@ -180,14 +180,23 @@ public class TSpecialDeducationSum extends BaseEntity { ...@@ -180,14 +180,23 @@ public class TSpecialDeducationSum extends BaseEntity {
private BigDecimal sumContinuingEducationMoney; private BigDecimal sumContinuingEducationMoney;
/** /**
* 累计婴幼儿照护费用 (累计3岁以下婴幼儿照护) * 累计3岁以下婴幼儿照护 (累计3岁以下婴幼儿照护)
* hgw 2022-4-2 11:05:44 樊青青提的需求 * hgw 2022-4-2 11:05:44 樊青青提的需求
*/ */
@ExcelAttribute(name = "累计婴幼儿照护费用", isFloat = true,max = "999999999.99") @ExcelAttribute(name = "累计3岁以下婴幼儿照护", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "累计婴幼儿照护费用") @ExcelProperty(value = "累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney; private BigDecimal sumBabyMoney;
/**
* 累计个人养老金
* hgw 2022-12-13 17:15:48 樊青青提的需求
*/
@ExcelAttribute(name = "累计个人养老金", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
/** /**
* 企业(职业)年金 * 企业(职业)年金
*/ */
......
...@@ -186,6 +186,11 @@ public class TStatisticsCurrentReport { ...@@ -186,6 +186,11 @@ public class TStatisticsCurrentReport {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("累计3岁以下婴幼儿照护") @ExcelProperty("累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney; private BigDecimal sumBabyMoney;
@ExcelAttribute(name = "累计个人养老金", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
/** /**
* 是否当月新增人员 * 是否当月新增人员
*/ */
...@@ -299,5 +304,4 @@ public class TStatisticsCurrentReport { ...@@ -299,5 +304,4 @@ public class TStatisticsCurrentReport {
@ExcelProperty("专项汇总") @ExcelProperty("专项汇总")
private BigDecimal specialDeduMoney; private BigDecimal specialDeduMoney;
} }
...@@ -380,11 +380,16 @@ public class TStatisticsCurrentReportMarket { ...@@ -380,11 +380,16 @@ public class TStatisticsCurrentReportMarket {
@ExcelProperty("单位name") @ExcelProperty("单位name")
private String unitName; private String unitName;
/** /**
* 累计婴幼儿照护费用 * 累计3岁以下婴幼儿照护
*/ */
@ExcelAttribute(name = "累计婴幼儿照护费用") @ExcelAttribute(name = "累计3岁以下婴幼儿照护")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("累计婴幼儿照护费用") @ExcelProperty("累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney; private BigDecimal sumBabyMoney;
@ExcelAttribute(name = "累计个人养老金", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
} }
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