|
@@ -38,7 +38,7 @@ public class CheckInsPlyComeUtils {
|
|
|
*/
|
|
*/
|
|
|
public static String checkSignDate(String data,String msg){
|
|
public static String checkSignDate(String data,String msg){
|
|
|
String errorMsg =null;
|
|
String errorMsg =null;
|
|
|
- if(StringUtils.isBlank(data) || isValidDate("yyyy-MM-dd HH:mm:ss", data) ){
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(data) || !isValidDate(data,"yyyy-MM-dd HH:mm:ss") ){
|
|
|
errorMsg = msg+"不能为空或格式错误,格式为yyyy-MM-dd HH:mm:ss";
|
|
errorMsg = msg+"不能为空或格式错误,格式为yyyy-MM-dd HH:mm:ss";
|
|
|
}
|
|
}
|
|
|
return errorMsg;
|
|
return errorMsg;
|
|
@@ -95,7 +95,7 @@ public class CheckInsPlyComeUtils {
|
|
|
public static Map<String,String> checkCompanyName(String data,String msg) {
|
|
public static Map<String,String> checkCompanyName(String data,String msg) {
|
|
|
ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
|
|
ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
|
|
|
EsmInsCompanyService esmInsCompanyService = applicationContext.getBean(EsmInsCompanyService.class);
|
|
EsmInsCompanyService esmInsCompanyService = applicationContext.getBean(EsmInsCompanyService.class);
|
|
|
- EsmInsCompany insCompany = esmInsCompanyService.findInsCompanyByName(data);
|
|
|
|
|
|
|
+ EsmInsCompany insCompany = esmInsCompanyService.findInsCompanyByNameOrNamesimple(data);
|
|
|
String errorMsg =null;
|
|
String errorMsg =null;
|
|
|
String id ="";
|
|
String id ="";
|
|
|
if(StringUtils.isBlank(data) || insCompany==null ){
|
|
if(StringUtils.isBlank(data) || insCompany==null ){
|
|
@@ -117,10 +117,12 @@ public class CheckInsPlyComeUtils {
|
|
|
public static Map<String,Object> checkAgreeName(String data, String msg,String type) {
|
|
public static Map<String,Object> checkAgreeName(String data, String msg,String type) {
|
|
|
ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
|
|
ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
|
|
|
PtlAgreementService ptlAgreementService = applicationContext.getBean(PtlAgreementService.class);
|
|
PtlAgreementService ptlAgreementService = applicationContext.getBean(PtlAgreementService.class);
|
|
|
- PtlAgreement ptlAgreement = ptlAgreementService.getByAgreementTitle(data);
|
|
|
|
|
|
|
+ //由于协议名称确定不了唯一,通过协议编号确认唯一 add by hxl 2024-10-12 14:36
|
|
|
|
|
+ PtlAgreement ptlAgreement = ptlAgreementService.getById(data);
|
|
|
|
|
+ //PtlAgreement ptlAgreement = ptlAgreementService.getByAgreementTitle(data);
|
|
|
String errorMsg =null;
|
|
String errorMsg =null;
|
|
|
if(StringUtils.isBlank(data) || ptlAgreement==null ){
|
|
if(StringUtils.isBlank(data) || ptlAgreement==null ){
|
|
|
- errorMsg=msg+"不能为空或者格式错误,未查询到"+msg+"名称,请填写协议名称";
|
|
|
|
|
|
|
+ errorMsg=msg+"不能为空或者格式错误,未查询到"+msg+"名称,请填写协议编号";
|
|
|
}else {
|
|
}else {
|
|
|
// 2 私有 1 平台
|
|
// 2 私有 1 平台
|
|
|
if(!type.equals(ptlAgreement.getAgreementType())){
|
|
if(!type.equals(ptlAgreement.getAgreementType())){
|
|
@@ -189,7 +191,7 @@ public class CheckInsPlyComeUtils {
|
|
|
companyId = companyMap.get("id").toString();
|
|
companyId = companyMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
String partnerCompaniesId =null;
|
|
String partnerCompaniesId =null;
|
|
|
- Map<String, String> companySubMap = checkCompanyName(dto.getCompanyName(), "保司机构");
|
|
|
|
|
|
|
+ Map<String, String> companySubMap = checkCompanyName(dto.getPartnerCompaniesName(), "保司机构");
|
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
|
errorMsg+=companySubMap+"; ";
|
|
errorMsg+=companySubMap+"; ";
|
|
|
}else if( companySubMap.get("msg")==null){
|
|
}else if( companySubMap.get("msg")==null){
|
|
@@ -200,10 +202,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}
|
|
}
|
|
|
String agreeId=null;
|
|
String agreeId=null;
|
|
|
String agreeDeptId =null;
|
|
String agreeDeptId =null;
|
|
|
|
|
+ PtlAgreement ptl= null;
|
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
|
}else if(agreeMap.get("msg")==null){
|
|
}else if(agreeMap.get("msg")==null){
|
|
|
|
|
+ ptl =((PtlAgreement)agreeMap.get("id"));
|
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
|
}
|
|
}
|
|
@@ -241,6 +245,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}else if(addTypeMap.get("msg")==null){
|
|
}else if(addTypeMap.get("msg")==null){
|
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
|
|
+ //添加验证协议id 和保险公司id和保司机构id匹配 add by hxl 2024-10-12
|
|
|
|
|
+ if(companyId!=null && partnerCompaniesId !=null && ptl!=null ){
|
|
|
|
|
+ if(!ptl.getInsuranceCompanyId().equals(companyId) || !ptl.getPartnerCompaniesId().equals(partnerCompaniesId)){
|
|
|
|
|
+ errorMsg+="协议选择和保险公司和保司机构名称不一致,请确认;";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
map.put("msg",errorMsg);
|
|
map.put("msg",errorMsg);
|
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
@@ -275,7 +285,7 @@ public class CheckInsPlyComeUtils {
|
|
|
companyId = companyMap.get("id").toString();
|
|
companyId = companyMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
String partnerCompaniesId =null;
|
|
String partnerCompaniesId =null;
|
|
|
- Map<String, String> companySubMap = checkCompanyName(dto.getCompanyName(), "保司机构");
|
|
|
|
|
|
|
+ Map<String, String> companySubMap = checkCompanyName(dto.getPartnerCompaniesName(), "保司机构");
|
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
|
errorMsg+=companySubMap+"; ";
|
|
errorMsg+=companySubMap+"; ";
|
|
|
}else if( companySubMap.get("msg")==null){
|
|
}else if( companySubMap.get("msg")==null){
|
|
@@ -286,10 +296,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}
|
|
}
|
|
|
String agreeId=null;
|
|
String agreeId=null;
|
|
|
String agreeDeptId =null;
|
|
String agreeDeptId =null;
|
|
|
|
|
+ PtlAgreement ptl= null;
|
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
|
}else if(agreeMap.get("msg")==null){
|
|
}else if(agreeMap.get("msg")==null){
|
|
|
|
|
+ ptl =((PtlAgreement)agreeMap.get("id"));
|
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
|
}
|
|
}
|
|
@@ -327,6 +339,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}else if(addTypeMap.get("msg")==null){
|
|
}else if(addTypeMap.get("msg")==null){
|
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
|
|
+ //添加验证协议id 和保险公司id和保司机构id匹配 add by hxl 2024-10-12
|
|
|
|
|
+ if(companyId!=null && partnerCompaniesId !=null && ptl!=null ){
|
|
|
|
|
+ if(!ptl.getInsuranceCompanyId().equals(companyId) || !ptl.getPartnerCompaniesId().equals(partnerCompaniesId)){
|
|
|
|
|
+ errorMsg+="协议选择和保险公司和保司机构名称不一致,请确认;";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
map.put("msg",errorMsg);
|
|
map.put("msg",errorMsg);
|
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
@@ -360,7 +378,7 @@ public class CheckInsPlyComeUtils {
|
|
|
companyId = companyMap.get("id").toString();
|
|
companyId = companyMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
String partnerCompaniesId =null;
|
|
String partnerCompaniesId =null;
|
|
|
- Map<String, String> companySubMap = checkCompanyName(dto.getCompanyName(), "保司机构");
|
|
|
|
|
|
|
+ Map<String, String> companySubMap = checkCompanyName(dto.getPartnerCompaniesName(), "保司机构");
|
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
|
errorMsg+=companySubMap+"; ";
|
|
errorMsg+=companySubMap+"; ";
|
|
|
}else if( companySubMap.get("msg")==null){
|
|
}else if( companySubMap.get("msg")==null){
|
|
@@ -371,10 +389,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}
|
|
}
|
|
|
String agreeId=null;
|
|
String agreeId=null;
|
|
|
String agreeDeptId =null;
|
|
String agreeDeptId =null;
|
|
|
|
|
+ PtlAgreement ptl= null;
|
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
|
}else if(agreeMap.get("msg")==null){
|
|
}else if(agreeMap.get("msg")==null){
|
|
|
|
|
+ ptl =((PtlAgreement)agreeMap.get("id"));
|
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
|
}
|
|
}
|
|
@@ -400,6 +420,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}else if(addTypeMap.get("msg")==null){
|
|
}else if(addTypeMap.get("msg")==null){
|
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
|
|
+ //添加验证协议id 和保险公司id和保司机构id匹配 add by hxl 2024-10-12
|
|
|
|
|
+ if(companyId!=null && partnerCompaniesId !=null && ptl!=null ){
|
|
|
|
|
+ if(!ptl.getInsuranceCompanyId().equals(companyId) || !ptl.getPartnerCompaniesId().equals(partnerCompaniesId)){
|
|
|
|
|
+ errorMsg+="协议选择和保险公司和保司机构名称不一致,请确认;";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
map.put("msg",errorMsg);
|
|
map.put("msg",errorMsg);
|
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
@@ -432,7 +458,7 @@ public class CheckInsPlyComeUtils {
|
|
|
companyId = companyMap.get("id").toString();
|
|
companyId = companyMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
String partnerCompaniesId =null;
|
|
String partnerCompaniesId =null;
|
|
|
- Map<String, String> companySubMap = checkCompanyName(dto.getCompanyName(), "保司机构");
|
|
|
|
|
|
|
+ Map<String, String> companySubMap = checkCompanyName(dto.getPartnerCompaniesName(), "保司机构");
|
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
|
errorMsg+=companySubMap+"; ";
|
|
errorMsg+=companySubMap+"; ";
|
|
|
}else if( companySubMap.get("msg")==null){
|
|
}else if( companySubMap.get("msg")==null){
|
|
@@ -443,10 +469,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}
|
|
}
|
|
|
String agreeId=null;
|
|
String agreeId=null;
|
|
|
String agreeDeptId =null;
|
|
String agreeDeptId =null;
|
|
|
|
|
+ PtlAgreement ptl= null;
|
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "2");
|
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
|
}else if(agreeMap.get("msg")==null){
|
|
}else if(agreeMap.get("msg")==null){
|
|
|
|
|
+ ptl =((PtlAgreement)agreeMap.get("id"));
|
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
|
}
|
|
}
|
|
@@ -472,6 +500,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}else if(addTypeMap.get("msg")==null){
|
|
}else if(addTypeMap.get("msg")==null){
|
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
|
|
+ //添加验证协议id 和保险公司id和保司机构id匹配 add by hxl 2024-10-12
|
|
|
|
|
+ if(companyId!=null && partnerCompaniesId !=null && ptl!=null ){
|
|
|
|
|
+ if(!ptl.getInsuranceCompanyId().equals(companyId) || !ptl.getPartnerCompaniesId().equals(partnerCompaniesId)){
|
|
|
|
|
+ errorMsg+="协议选择和保险公司和保司机构名称不一致,请确认;";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
map.put("msg",errorMsg);
|
|
map.put("msg",errorMsg);
|
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
@@ -504,7 +538,7 @@ public class CheckInsPlyComeUtils {
|
|
|
companyId = companyMap.get("id").toString();
|
|
companyId = companyMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
String partnerCompaniesId =null;
|
|
String partnerCompaniesId =null;
|
|
|
- Map<String, String> companySubMap = checkCompanyName(dto.getCompanyName(), "保司机构");
|
|
|
|
|
|
|
+ Map<String, String> companySubMap = checkCompanyName(dto.getPartnerCompaniesName(), "保司机构");
|
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
if(companySubMap!=null && companySubMap.get("msg")!=null){
|
|
|
errorMsg+=companySubMap+"; ";
|
|
errorMsg+=companySubMap+"; ";
|
|
|
}else if( companySubMap.get("msg")==null){
|
|
}else if( companySubMap.get("msg")==null){
|
|
@@ -515,10 +549,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}
|
|
}
|
|
|
String agreeId=null;
|
|
String agreeId=null;
|
|
|
String agreeDeptId =null;
|
|
String agreeDeptId =null;
|
|
|
|
|
+ PtlAgreement ptl= null;
|
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "1");
|
|
Map<String, Object> agreeMap = checkAgreeName(dto.getAgreementName(), "协议选择", "1");
|
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
if(agreeMap!=null && agreeMap.get("msg")!=null){
|
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
errorMsg+=agreeMap.get("msg").toString()+"; ";
|
|
|
}else if(agreeMap.get("msg")==null){
|
|
}else if(agreeMap.get("msg")==null){
|
|
|
|
|
+ ptl =((PtlAgreement)agreeMap.get("id"));
|
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
agreeId = ((PtlAgreement)agreeMap.get("id")).getId().toString();
|
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
agreeDeptId = ((PtlAgreement)agreeMap.get("id")).getDeptId().toString();
|
|
|
}
|
|
}
|
|
@@ -567,6 +603,12 @@ public class CheckInsPlyComeUtils {
|
|
|
}else if(addTypeMap.get("msg")==null){
|
|
}else if(addTypeMap.get("msg")==null){
|
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
addTypeId = addTypeMap.get("id").toString();
|
|
|
}
|
|
}
|
|
|
|
|
+ //添加验证协议id 和保险公司id和保司机构id匹配 add by hxl 2024-10-12
|
|
|
|
|
+ if(companyId!=null && partnerCompaniesId !=null && ptl!=null ){
|
|
|
|
|
+ if(!ptl.getInsuranceCompanyId().equals(companyId) || !ptl.getPartnerCompaniesId().equals(partnerCompaniesId)){
|
|
|
|
|
+ errorMsg+="协议选择和保险公司和保司机构名称不一致,请确认;";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
map.put("msg",errorMsg);
|
|
map.put("msg",errorMsg);
|
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
if(StringUtils.isBlank(errorMsg)){
|
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|
|
InsPlyIncome insPlyIncome =new InsPlyIncome(dto.getSignDate(),dto.getLicenseno(),companyId,dto.getCompanyName(),partnerCompaniesId,dto.getPartnerCompaniesName(),
|