Commit 85c92013 authored by fangxinjiang's avatar fangxinjiang

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

parents d271e4d0 3aaf5093
package com.yifu.cloud.plus.v1.yifu.common.ldap.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
@Data
@Component
@PropertySource("classpath:ldapConfig.properties")
@ConfigurationProperties(value = "ldap", ignoreInvalidFields = false)
public class LdapProperties {
String url;
String dn;
String password;
Integer port;
String userName;
String baseDn;
}
...@@ -56,13 +56,13 @@ public class PersonVo { ...@@ -56,13 +56,13 @@ public class PersonVo {
private String homeDirectory; private String homeDirectory;
/** /**
* 主键 * 部门名称
*/ */
@Attribute(name = "ou") @Attribute(name = "ou")
private String deptName; private String deptName;
/** /**
* 主键 * 用户密码
*/ */
@Attribute(name = "userPassword") @Attribute(name = "userPassword")
private String password; private String password;
......
package com.yifu.cloud.plus.v1.yifu.common.ldap.util;
import javax.naming.AuthenticationException;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.Control;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
import java.util.Hashtable;
/**
* 用户登陆认证,LDAP跨域认证,通过LDAP对用户进行更新
*
*/
public class LdapCheck {
private static LdapContext ctx = null;
private static Control[] connCtls = null;
/**** 定义LDAP的基本连接信息 ******/
// LDAP的连接地址(ldap://ip:port/)port默认为389
private static String URL = "192.168.1.65";
//port
private static String port = "389";
// LDAP的根DN
private static String BASEDN = "dc=worfu,dc=com";
// LDAP的连接账号(身份认证管理平台添加的应用账号,应用账号格式:uid=?,ou=?,dc=????)
private static String PRINCIPAL = "cn=admin,dc=worfu,dc=com";
// LDAP的连接账号的密码(身份认证管理平台添加的应用账号的密码)
private static String PASSWORD = "yifu123456!";
// 校验用户名密码的方法
public static boolean authenticate(String usr, String pwd) {
boolean valide = false;
if (pwd == null || pwd == "")
return false;
if (ctx == null) {
getCtx();
}
String userDN = getUserDN(usr);
if ("".equals(userDN) || userDN == null) {
return false;
}
try {
ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, userDN);
ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, pwd);
ctx.reconnect(connCtls);
valide = true;
closeCtx();
} catch (AuthenticationException e) {
System.out.println(userDN + " is not authenticated");
System.out.println(e.toString());
valide = false;
} catch (NamingException e) {
System.out.println(userDN + " is not authenticated");
valide = false;
}
return valide;
}
public static void getCtx() {
if (ctx != null) {
return;
}
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, URL + ":" + port + BASEDN);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL);
env.put(Context.SECURITY_CREDENTIALS, PASSWORD);
try {
// 链接ldap
ctx = new InitialLdapContext(env, connCtls);
} catch (AuthenticationException e) {
System.out.println("Authentication faild: " + e.toString());
} catch (Exception e) {
System.out.println("Something wrong while authenticating: " + e.toString());
}
}
public static void closeCtx() {
try {
if (ctx != null)
ctx.close();
} catch (NamingException ex) {
}
}
public static String getUserDN(String uid) {
String userDN = "";
try {
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
NamingEnumeration<?> en = ctx.search("", "uid=" + uid, constraints);
if (en == null) {
System.out.println("Have no NamingEnumeration.");
}
if (!en.hasMoreElements()) {
System.out.println("Have no element.");
}
while (en != null && en.hasMoreElements()) {
Object obj = en.nextElement();
if (obj instanceof SearchResult) {
SearchResult si = (SearchResult) obj;
userDN += si.getName();
userDN += "," + BASEDN;
} else {
System.out.println(obj);
}
System.out.println();
}
} catch (Exception e) {
System.out.println("Exception in search():" + e);
}
return userDN;
}
}
\ No newline at end of file
...@@ -2,10 +2,12 @@ package com.yifu.cloud.plus.v1.yifu.common.ldap.util; ...@@ -2,10 +2,12 @@ package com.yifu.cloud.plus.v1.yifu.common.ldap.util;
import com.unboundid.ldap.sdk.*; import com.unboundid.ldap.sdk.*;
import com.unboundid.ldap.sdk.controls.SubentriesRequestControl; import com.unboundid.ldap.sdk.controls.SubentriesRequestControl;
import com.yifu.cloud.plus.v1.yifu.common.ldap.config.LdapProperties;
import com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo; import com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo;
import com.yifu.cloud.plus.v1.yifu.common.ldap.mapper.PersonAttributesMapper; import com.yifu.cloud.plus.v1.yifu.common.ldap.mapper.PersonAttributesMapper;
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.ldap.core.LdapTemplate; import org.springframework.ldap.core.LdapTemplate;
import javax.naming.AuthenticationException; import javax.naming.AuthenticationException;
...@@ -23,26 +25,19 @@ import java.util.List; ...@@ -23,26 +25,19 @@ import java.util.List;
import static org.springframework.ldap.query.LdapQueryBuilder.query; import static org.springframework.ldap.query.LdapQueryBuilder.query;
@Log4j2 @Log4j2
@EnableConfigurationProperties(LdapProperties.class)
public class LdapUtil { public class LdapUtil {
@Autowired @Autowired
private LdapTemplate ldapTemplate; private LdapTemplate ldapTemplate;
@Autowired
private LdapProperties ldapProperties;
private static LdapContext ctx = null; private static LdapContext ctx = null;
private static Control[] connCtls = null; private static Control[] connCtls = null;
/**** 定义LDAP的基本连接信息 ******/
// LDAP的连接地址(ldap://ip:port/)port默认为389
private static String URL = "ldap://192.168.1.65:389/";
// LDAP的根DN
private static String BASEDN = "dc=worfu,dc=com";
// LDAP的连接账号(身份认证管理平台添加的应用账号,应用账号格式:uid=?,ou=?,dc=????)
private static String PRINCIPAL = "cn=admin,dc=worfu,dc=com";
// LDAP的连接账号的密码(身份认证管理平台添加的应用账号的密码)
private static String PASSWORD = "yifu123456!";
/** /**
* @return List<SearchResultEntry> * @return List<SearchResultEntry>
* @author huyc * @author huyc
...@@ -52,8 +47,9 @@ public class LdapUtil { ...@@ -52,8 +47,9 @@ public class LdapUtil {
public List<SearchResultEntry> getAllPersonNamesWithTraditionalWay() { public List<SearchResultEntry> getAllPersonNamesWithTraditionalWay() {
List<SearchResultEntry> result = new ArrayList<SearchResultEntry>(); List<SearchResultEntry> result = new ArrayList<SearchResultEntry>();
try { try {
LDAPConnection connection = new LDAPConnection("192.168.1.65", 389, "cn=admin,dc=worfu,dc=com", "yifu123456!"); LDAPConnection connection = new LDAPConnection(ldapProperties.getUrl(), ldapProperties.getPort(),
SearchRequest searchRequest = new SearchRequest("ou=安徽皖信人力资源管理有限公司,ou=wanxin,dc=worfu,dc=com", SearchScope.SUB, "(objectclass=*)"); ldapProperties.getUserName(), ldapProperties.getPassword());
SearchRequest searchRequest = new SearchRequest(ldapProperties.getBaseDn(), SearchScope.SUB, "(objectclass=*)");
searchRequest.addControl(new SubentriesRequestControl()); searchRequest.addControl(new SubentriesRequestControl());
SearchResult searchResult = connection.search(searchRequest); SearchResult searchResult = connection.search(searchRequest);
for (SearchResultEntry entry : searchResult.getSearchEntries()) { for (SearchResultEntry entry : searchResult.getSearchEntries()) {
...@@ -99,16 +95,17 @@ public class LdapUtil { ...@@ -99,16 +95,17 @@ public class LdapUtil {
return valide; return valide;
} }
public static void getCtx() { public void getCtx() {
if (ctx != null) { if (ctx != null) {
return; return;
} }
Hashtable<String, String> env = new Hashtable<String, String>(); Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, URL + BASEDN); env.put(Context.PROVIDER_URL, "ldap://" + ldapProperties.getUrl() + ":" + ldapProperties.getPort() +
"/" + ldapProperties.getDn());
env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL); env.put(Context.SECURITY_PRINCIPAL, ldapProperties.getUserName());
env.put(Context.SECURITY_CREDENTIALS, PASSWORD); env.put(Context.SECURITY_CREDENTIALS, ldapProperties.getPassword());
try { try {
// 链接ldap // 链接ldap
ctx = new InitialLdapContext(env, connCtls); ctx = new InitialLdapContext(env, connCtls);
...@@ -117,12 +114,12 @@ public class LdapUtil { ...@@ -117,12 +114,12 @@ public class LdapUtil {
} }
} }
public static void closeCtx() throws NamingException { public void closeCtx() throws NamingException {
if (ctx != null) if (ctx != null)
ctx.close(); ctx.close();
} }
public static String getUserDN(String uid) { public String getUserDN(String uid) {
String userDN = ""; String userDN = "";
try { try {
SearchControls constraints = new SearchControls(); SearchControls constraints = new SearchControls();
...@@ -133,7 +130,7 @@ public class LdapUtil { ...@@ -133,7 +130,7 @@ public class LdapUtil {
if (obj instanceof javax.naming.directory.SearchResult) { if (obj instanceof javax.naming.directory.SearchResult) {
javax.naming.directory.SearchResult si = (javax.naming.directory.SearchResult) obj; javax.naming.directory.SearchResult si = (javax.naming.directory.SearchResult) obj;
userDN += si.getName(); userDN += si.getName();
userDN += "," + BASEDN; userDN += "," + ldapProperties.getDn();
} }
} }
} catch (Exception e) { } catch (Exception e) {
......
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.ldap.config.LdapAutoConfigue\ com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil\
ldap.url=192.168.1.65
ldap.port=389
ldap.userName=cn=admin,dc=worfu,dc=com
ldap.password=yifu123456!
ldap.dn=dc=worfu,dc=com
ldap.baseDn=ou=\u5B89\u5FBD\u7696\u4FE1\u4EBA\u529B\u8D44\u6E90\u7BA1\u7406\u6709\u9650\u516C\u53F8,ou=wanxin,dc=worfu,dc=com
\ No newline at end of file
...@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; ...@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
/** /**
...@@ -37,21 +38,15 @@ public class TInsuranceSettleCancel implements Serializable { ...@@ -37,21 +38,15 @@ public class TInsuranceSettleCancel implements Serializable {
* 项目名称 * 项目名称
*/ */
private String deptName; private String deptName;
/**
* 订单编号
*/
private String orderNo;
/** /**
* 推送标识 1成功 0失败 * 推送标识 未推送,1成功 0失败
*/ */
private Integer isCancelPush; private Integer isCancelPush;
/** /**
* 创建时间 * 创建时间
*/ */
private Date createTime; private LocalDateTime createTime;
/** /**
* 操作人 * 操作人
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -86,4 +87,11 @@ public class InsuranceReplaceParam implements Serializable { ...@@ -86,4 +87,11 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "错误信息") @Schema(description = "错误信息")
private String errorMessage; private String errorMessage;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
*/
@JsonIgnore
private Integer settleType;
} }
...@@ -327,8 +327,8 @@ public class TInsuranceDetailController { ...@@ -327,8 +327,8 @@ public class TInsuranceDetailController {
* @return {@link R<IPage< RefundExportListVo >>} * @return {@link R<IPage< RefundExportListVo >>}
*/ */
@Operation(summary = "减员办理列表分页查询", description = "减员办理列表分页查询") @Operation(summary = "减员办理列表分页查询", description = "减员办理列表分页查询")
@PostMapping("/getInsuranceRefundHandlingPageList") @GetMapping("/getInsuranceRefundHandlingPageList")
public R<IPage<RefundExportListVo>> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @RequestBody InsuranceRefundHandlingParam param) { public R<IPage<RefundExportListVo>> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page,InsuranceRefundHandlingParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingPageList(page,param)); return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingPageList(page,param));
} }
......
...@@ -152,7 +152,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -152,7 +152,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
TInsuranceRefundDetail selectRefundDetail(@Param("param") TInsuranceRefundDetail refundDetail); TInsuranceRefundDetail selectRefundDetail(@Param("param") TInsuranceRefundDetail refundDetail);
/** /**
* TODO * 根据ID导出减员办理列表
* *
* @author zhaji * @author zhaji
* @param idList * @param idList
...@@ -161,7 +161,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -161,7 +161,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
List<RefundExportListVo> getRefundExportListBySelect(@Param("idList")List<String> idList); List<RefundExportListVo> getRefundExportListBySelect(@Param("idList")List<String> idList);
/** /**
* TODO * 导出减员办理列表
* *
* @author zhaji * @author zhaji
* @param param * @param param
......
...@@ -312,14 +312,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -312,14 +312,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setEmpName(success.getReplaceEmpName()); newDetail.setEmpName(success.getReplaceEmpName());
newDetail.setEmpIdcardNo(success.getReplaceEmpIdcardNo()); newDetail.setEmpIdcardNo(success.getReplaceEmpIdcardNo());
newDetail.setDeptNo(success.getReplaceDeptNo()); newDetail.setDeptNo(success.getReplaceDeptNo());
//替换项目的结算方式
newDetail.setSettleType(success.getSettleType());
newDetail.setPost(success.getPost()); newDetail.setPost(success.getPost());
//其他状态置为空 //其他状态置为空
newDetail.setIsOverdue(null); newDetail.setIsOverdue(null);
newDetail.setIsUse(null); newDetail.setIsUse(null);
newDetail.setIsEffect(null); newDetail.setIsEffect(null);
newDetail.setReduceHandleStatus(null); newDetail.setReduceHandleStatus(null);
//创建时间是新数据插入时间
newDetail.setCreateTime(LocalDateTime.now());
newDetail.setCreateBy(user.getId());
newDetail.setCreateName(user.getNickname());
//替换不参与结算 //替换不参与结算
newDetail.setDefaultSettleId(null); newDetail.setDefaultSettleId(null);
newDetail.setActualPremium(null);
newDetail.setEstimatePremium(null);
Boolean insert = this.save(newDetail); Boolean insert = this.save(newDetail);
//替换记录 //替换记录
if (insert){ if (insert){
...@@ -1813,6 +1821,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1813,6 +1821,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else {
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
}
} }
} }
} }
...@@ -2616,12 +2634,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2616,12 +2634,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail :: getSettleType,success.getNewSettleType()) .set(TInsuranceDetail :: getSettleType,success.getNewSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId()) .set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
//如果旧项目为合并结算,且新项目也是合并结算,则计算新的预估保费,作废旧的预估保费 //如果旧项目为合并结算,且新项目也是合并结算,则计算新的预估保费,作废旧的预估保费
if(CommonConstants.ZERO_INT == oldSettleType && CommonConstants.ZERO_INT == newSettleType){ if(CommonConstants.ZERO_INT == oldSettleType && CommonConstants.ZERO_INT == newSettleType){
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
//如果存在则更新,不存在则新建 //如果存在则更新,不存在则新建
if (StringUtils.isNotBlank(success.getDefaultSettleId())){ if (StringUtils.isNotBlank(success.getDefaultSettleId())){
TInsuranceSettle tInsuranceSettle = tInsuranceSettleService.getById(success.getDefaultSettleId());
tInsuranceSettle.setId(success.getDefaultSettleId()); tInsuranceSettle.setId(success.getDefaultSettleId());
tInsuranceSettle.setSettleType(success.getNewSettleType()); tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setInsDetailId(success.getId()); tInsuranceSettle.setInsDetailId(success.getId());
...@@ -2629,6 +2649,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2629,6 +2649,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle.setUpdateTime(LocalDateTime.now()); tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle); tInsuranceSettleService.updateById(tInsuranceSettle);
}else{ }else{
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
tInsuranceSettle.setInsDetailId(success.getId()); tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType()); tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
...@@ -2645,6 +2666,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2645,6 +2666,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(CommonConstants.ZERO_INT == oldSettleType && CommonConstants.ONE_INT == newSettleType){ if(CommonConstants.ZERO_INT == oldSettleType && CommonConstants.ONE_INT == newSettleType){
//更新旧的结算信息 //更新旧的结算信息
if (StringUtils.isNotBlank(success.getDefaultSettleId())){ if (StringUtils.isNotBlank(success.getDefaultSettleId())){
TInsuranceSettle tInsuranceSettle = tInsuranceSettleService.getById(success.getDefaultSettleId());
tInsuranceSettle.setId(success.getDefaultSettleId()); tInsuranceSettle.setId(success.getDefaultSettleId());
tInsuranceSettle.setSettleType(success.getNewSettleType()); tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setInsDetailId(success.getId()); tInsuranceSettle.setInsDetailId(success.getId());
...@@ -2655,7 +2677,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2655,7 +2677,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceSettleCancel tInsuranceSettleCancel = new TInsuranceSettleCancel(); TInsuranceSettleCancel tInsuranceSettleCancel = new TInsuranceSettleCancel();
tInsuranceSettleCancel.setInsDetailId(success.getId()); tInsuranceSettleCancel.setInsDetailId(success.getId());
tInsuranceSettleCancel.setSettleId(success.getDefaultSettleId()); tInsuranceSettleCancel.setSettleId(success.getDefaultSettleId());
tInsuranceSettleCancel.setDeptNo(success.getOldDeptNo());
tInsuranceSettleCancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancel.setCreateUesr(user.getId());
tInsuranceSettleCancel.setCreateTime(LocalDateTime.now());
}else{ }else{
//更新预估保费 //更新预估保费
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0")); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0"));
...@@ -2666,6 +2691,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2666,6 +2691,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
//更新旧的结算信息 //更新旧的结算信息
if (StringUtils.isNotBlank(success.getDefaultSettleId())){ if (StringUtils.isNotBlank(success.getDefaultSettleId())){
TInsuranceSettle tInsuranceSettle = tInsuranceSettleService.getById(success.getDefaultSettleId());
tInsuranceSettle.setId(success.getDefaultSettleId()); tInsuranceSettle.setId(success.getDefaultSettleId());
tInsuranceSettle.setSettleType(success.getNewSettleType()); tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setInsDetailId(success.getId()); tInsuranceSettle.setInsDetailId(success.getId());
...@@ -2674,6 +2700,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2674,6 +2700,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.updateById(tInsuranceSettle); tInsuranceSettleService.updateById(tInsuranceSettle);
//推送EKP //推送EKP
}else{ }else{
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
tInsuranceSettle.setInsDetailId(success.getId()); tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType()); tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
...@@ -2686,9 +2713,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2686,9 +2713,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail::getDefaultSettleId,tInsuranceSettle.getId()); updateWrapper.set(TInsuranceDetail::getDefaultSettleId,tInsuranceSettle.getId());
} }
} }
//如果旧项目为单独结算,且新项目也是单独结算,则更新单独结算信息 //如果旧项目为单独结算,且新项目也是单独结算,则更新项目编码,并发送至ekp
if(CommonConstants.ONE_INT == oldSettleType && CommonConstants.ONE_INT == newSettleType){ if(CommonConstants.ONE_INT == oldSettleType && CommonConstants.ONE_INT == newSettleType){
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); //updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
} }
update(updateWrapper); update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate(); TInsuranceOperate insuranceOperate = new TInsuranceOperate();
...@@ -2704,8 +2731,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2704,8 +2731,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList"); List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
return R.ok(errorList,"导入成功"); return R.ok(errorList,"导入成功");
} }
/**
* 发送变更结算月至EKP
*
* @author zhaji
* @param successList
* @return void
*/
private void updateMonth2EKP(List<DeptChangeCheckParam> successList) {
for (DeptChangeCheckParam param : successList) {
String newDeptNo = param.getNewDeptNo();
String oldDeptNo = param.getOldDeptNo();
Integer newSettleType = param.getNewSettleType();
Integer oldSettleType = param.getOldSettleType();
String defaultSettleId = param.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId) && CommonConstants.ZERO_INT == newSettleType){
}
}
}
/** /**
* 发送变更通知至EKP * 发送变更项目至EKP
* *
* @author zhaji * @author zhaji
* @param successList * @param successList
...@@ -2724,6 +2772,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2724,6 +2772,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
/**
* 发送作废信息至EKP
*
* @author zhaji
* @param cancelList 作废信息列表
* @return void
*/
private void pushSettleCancel2EKP(List<TInsuranceSettleCancel> cancelList) {
for (TInsuranceSettleCancel param : cancelList) {
}
}
/** /**
* 根据保险公司名称查询保单明细 * 根据保险公司名称查询保单明细
* *
...@@ -3469,7 +3530,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3469,7 +3530,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setEstimatePremium(estimatePremium); param.setEstimatePremium(estimatePremium);
} }
} }
//如果 //去重
for (int j =0 ;j< deptChangeCheckList.size();j++) { for (int j =0 ;j< deptChangeCheckList.size();j++) {
DeptChangeCheckParam CheckParam = deptChangeCheckList.get(j); DeptChangeCheckParam CheckParam = deptChangeCheckList.get(j);
if(CheckParam.getEmpName().equals(param.getEmpName()) if(CheckParam.getEmpName().equals(param.getEmpName())
......
...@@ -564,16 +564,16 @@ ...@@ -564,16 +564,16 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%') and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%') and detail.DEPT_NO = #{param.deptNo}
</if> </if>
<if test="param.reduceHandleStatus != null"> <if test="param.reduceHandleStatus != null">
and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus} and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if> </if>
<if test="param.isOverdue != null"> <if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%') and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.isUse != null"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.IS_USE like concat('%',replace(replace(#{param.isUse},'_','\_'),'%','\%'),'%') and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if> </if>
ORDER BY refund.CREATE_TIME DESC ORDER BY refund.CREATE_TIME DESC
</select> </select>
...@@ -672,7 +672,7 @@ ...@@ -672,7 +672,7 @@
and detail.POLICY_NO = #{param.policyNo} and detail.POLICY_NO = #{param.policyNo}
</if> </if>
</select> </select>
<!-- 已投保列表分页查询--> <!-- 根据ID导出减员办理列表-->
<select id="getRefundExportListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo"> <select id="getRefundExportListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
select select
detail.id as id, detail.id as id,
...@@ -705,7 +705,7 @@ ...@@ -705,7 +705,7 @@
</foreach> </foreach>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!-- 已投保列表分页查询--> <!-- 根据查询参数导出减员办理列表-->
<select id="getRefundExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo"> <select id="getRefundExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
select select
detail.id as id, detail.id as id,
...@@ -740,14 +740,17 @@ ...@@ -740,14 +740,17 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%') and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%') and detail.DEPT_NO = #{param.deptNo}
</if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if> </if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!-- 已投保列表分页查询--> <!-- 减员办理-->
<update id="updateInsuranceRefund"> <update id="updateInsuranceRefund">
update update
t_insurance_detail detail t_insurance_detail detail
...@@ -762,7 +765,7 @@ ...@@ -762,7 +765,7 @@
</foreach> </foreach>
</update> </update>
<!--getInsuranceListByIdCard--> <!--根据身份证查询商险信息-->
<select id="getInsuranceListByIdCard" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListByIdCardVo"> <select id="getInsuranceListByIdCard" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListByIdCardVo">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<result property="settleId" column="SETTLE_ID" jdbcType="VARCHAR"/> <result property="settleId" column="SETTLE_ID" jdbcType="VARCHAR"/>
<result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/> <result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/> <result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="isCancelPush" column="IS_CANCEL_PUSH" jdbcType="TINYINT"/> <result property="isCancelPush" column="IS_CANCEL_PUSH" jdbcType="TINYINT"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/> <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="createUesr" column="CREATE_UESR" jdbcType="VARCHAR"/> <result property="createUesr" column="CREATE_UESR" jdbcType="VARCHAR"/>
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
ID,INS_DETAIL_ID,SETTLE_ID, ID,INS_DETAIL_ID,SETTLE_ID,
DEPT_NO,DEPT_NAME,ORDER_NO, DEPT_NO,DEPT_NAME,
IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR
</sql> </sql>
</mapper> </mapper>
...@@ -26,13 +26,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -26,13 +26,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.unboundid.ldap.sdk.SearchResultEntry; import com.unboundid.ldap.sdk.SearchResultEntry;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDeptRelation; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDeptRelation;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper; import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper; import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptRelationService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptRelationService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.ldap.util.LdapUtil; import com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...@@ -44,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -44,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* <p> * <p>
...@@ -214,6 +211,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -214,6 +211,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
SysDept insertSysDept = new SysDept(); SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName); insertSysDept.setName(deptName);
insertSysDept.setParentId(0L); insertSysDept.setParentId(0L);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
insertSysDept.setDeptDn(dn); insertSysDept.setDeptDn(dn);
this.save(insertSysDept); this.save(insertSysDept);
} else { } else {
...@@ -231,6 +231,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -231,6 +231,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
insertSysDept.setName(deptName); insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId()); insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn); insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
this.save(insertSysDept); this.save(insertSysDept);
} }
} else { } else {
......
...@@ -424,7 +424,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -424,7 +424,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
if (null != list) { if (null != list) {
List<SysUser> listUser = this.list(Wrappers.<SysUser>query().lambda().eq(SysUser::getDelFlag, CommonConstants.STATUS_NORMAL)); List<SysUser> listUser = this.list(Wrappers.<SysUser>query().lambda().eq(SysUser::getDelFlag, CommonConstants.STATUS_NORMAL));
List<String> list1 = listUser.stream().map(SysUser::getUsername).collect(Collectors.toList()); List<String> list1 = listUser.stream().map(SysUser::getUsername).collect(Collectors.toList());
Map<String, String> map = listUser.stream().collect(HashMap::new, (m, v) -> m.put(v.getUsername(), v.getUserId()), HashMap::putAll);
List<PersonVo> updateList = new ArrayList<>(); List<PersonVo> updateList = new ArrayList<>();
List<PersonVo> insertList = new ArrayList<>(); List<PersonVo> insertList = new ArrayList<>();
for (PersonVo personVo : list) { for (PersonVo personVo : list) {
...@@ -469,6 +468,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -469,6 +468,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
insertSysDept.setName(deptName); insertSysDept.setName(deptName);
insertSysDept.setParentId(0L); insertSysDept.setParentId(0L);
insertSysDept.setDeptDn(dn); insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
sysDeptMapper.insert(insertSysDept); sysDeptMapper.insert(insertSysDept);
} else { } else {
sysDept.setName(deptName); sysDept.setName(deptName);
...@@ -484,6 +486,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -484,6 +486,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
insertSysDept.setName(deptName); insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId()); insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn); insertSysDept.setDeptDn(dn);
if (Common.isNotNull(entry.getAttributeValue("x-ouid"))) {
insertSysDept.setDeptId(Long.valueOf(entry.getAttributeValue("x-ouid")));
}
sysDeptMapper.insert(insertSysDept); sysDeptMapper.insert(insertSysDept);
} }
} else { } else {
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
<insert id="batchInsertUser" parameterType="java.util.List"> <insert id="batchInsertUser" parameterType="java.util.List">
insert into sys_user insert into sys_user
(user_id,username,phone,email,password,nickname,create_time) (user_id,username,phone,email,password,nickname,deptId,create_time)
VALUES VALUES
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
( (
...@@ -220,6 +220,7 @@ ...@@ -220,6 +220,7 @@
#{item.email,jdbcType=VARCHAR}, #{item.email,jdbcType=VARCHAR},
#{item.password,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR},
#{item.personName,jdbcType=VARCHAR}, #{item.personName,jdbcType=VARCHAR},
#{item.deptId,jdbcType=VARCHAR},
now() now()
) )
</foreach> </foreach>
...@@ -256,6 +257,13 @@ ...@@ -256,6 +257,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="deptId =case" suffix="end," >
<foreach collection="list" item="i" index="index">
<if test="i.deptId!=null">
when username=#{i.uid} then #{i.deptId}
</if>
</foreach>
</trim>
<trim prefix="update_time =case" suffix="end,"> <trim prefix="update_time =case" suffix="end,">
<foreach collection="list" item="i" index="index"> <foreach collection="list" item="i" index="index">
when username=#{i.uid} then now() when username=#{i.uid} then now()
......
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