|
@@ -259,15 +259,33 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
}
|
|
|
String dataInfo = this.taskClient.queryTaskContractId(task.getParallelProcessInstanceId());
|
|
|
String contractId = Func.toStrArray(dataInfo)[0];
|
|
|
+ String projectId = Func.toStrArray(dataInfo)[1];
|
|
|
|
|
|
String ids = String.join(",", eVisaConfigList);
|
|
|
- String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
|
|
|
- List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
|
|
|
+ String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
|
|
|
+ List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
|
System.out.println("合同-" + contractId + "--" + sqlinfo);
|
|
|
- if (maps == null || maps.isEmpty()) {
|
|
|
+ if (maps2 == null || maps2.isEmpty()) {
|
|
|
return finalPdfUrl;
|
|
|
}
|
|
|
//
|
|
|
+ List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
+ Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
|
|
|
+ .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("id")))));
|
|
|
+
|
|
|
+ for(String keyId :peopleByAge.keySet()){
|
|
|
+ List<Map<String, Object>> keyList = peopleByAge.get(keyId);
|
|
|
+ if(keyList!=null && keyList.size()==1){
|
|
|
+ maps.addAll(keyList);
|
|
|
+ }else if(keyList!=null && keyList.size()>=2){
|
|
|
+ for(Map<String, Object> datax : keyList){
|
|
|
+ if((datax.get("project_id")+"").equals(projectId)){
|
|
|
+ maps.add(datax);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(reType.equals("2")){ //中方中讯
|
|
|
if (maps != null && !maps.isEmpty()) {
|
|
|
String fileUrl = finalPdfUrl;
|
|
@@ -336,6 +354,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
vo.setSealType("3");
|
|
|
vo.setCompanySeal(true);
|
|
|
vo.setKeyword(eVisaConfig.get("id") + "");
|
|
|
+
|
|
|
vo.setOffSetX(eVisaConfig.get("pyzbx") + "");
|
|
|
vo.setOffSetY(eVisaConfig.get("pyzby") + "");
|
|
|
sealStrategyVOS.add(vo);
|
|
@@ -417,7 +436,6 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
//获取需要签章的数据
|
|
|
List<TaskApprovalVO.ApprovalFile> files = taskFile.getApprovalFileList();
|
|
|
|
|
|
-
|
|
|
//这里的文件只会是一张拼接好的PDF
|
|
|
for (TaskApprovalVO.ApprovalFile file : files) {
|
|
|
|
|
@@ -441,19 +459,19 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
String projectId = Func.toStrArray(dataInfo)[1];
|
|
|
|
|
|
if (taskFile.getRemarkType().equals("2")) {//东方 中讯 daMap.put("keyWord","1673632651551965184");
|
|
|
- String sqlinfo = " SELECT a.id as keyWord,a.project_id,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0 ) as sealId from m_textdict_info a where a.type =2 and a.id in (" + ids + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
|
|
|
+ String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0 ) as sealId from m_textdict_info a where a.type =2 and a.id in (" + ids + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
|
|
|
System.out.println("东方中讯-个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
|
|
|
List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
|
if (maps2 != null && !maps2.isEmpty()) {
|
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
|
|
|
- .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("id")))));
|
|
|
+ .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("keyWord")))));
|
|
|
|
|
|
for(String keyId :peopleByAge.keySet()){
|
|
|
List<Map<String, Object>> keyList = peopleByAge.get(keyId);
|
|
|
if(keyList!=null && keyList.size()==1){
|
|
|
maps.addAll(keyList);
|
|
|
- }else if(keyList!=null && keyList.size()>=1){
|
|
|
+ }else if(keyList!=null && keyList.size()>=2){
|
|
|
for(Map<String, Object> datax : keyList){
|
|
|
if((datax.get("project_id")+"").equals(projectId)){
|
|
|
maps.add(datax);
|
|
@@ -471,12 +489,16 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
daMa.put("showHeight",30);
|
|
|
daMa.put("showWidth",60);
|
|
|
//设置显示签字体的位置
|
|
|
- daMa.put("sealOffsetY",-15);
|
|
|
- daMa.put("sealOffsetX",-30);
|
|
|
-
|
|
|
+ String yzx = dataMap.get("pyzby")+"";
|
|
|
+ String xzx = dataMap.get("pyzbx")+"";
|
|
|
+ Double sealOffsetY =Func.toDouble(yzx) -15;
|
|
|
+ Double sealOffsetX =Func.toDouble(xzx) -30;
|
|
|
+ daMa.put("sealOffsetX",sealOffsetX);
|
|
|
+ daMa.put("sealOffsetY",sealOffsetY);
|
|
|
+ // daMa.put("sealOffsetY",-15);
|
|
|
+ // daMa.put("sealOffsetX",-30);
|
|
|
byte[] fileByte;
|
|
|
if (fileUrl.indexOf("aliyuncs.com") >= 0) {
|
|
|
-
|
|
|
URL url =new URL(pdfUrl);
|
|
|
fileByte = IOUtils.toByteArray(url);
|
|
|
} else {
|
|
@@ -511,7 +533,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
return SUCCESS + "@@@@" + taskFile.getApprovalFileList().get(0).getFileUrl();
|
|
|
}
|
|
|
} else { //安心签证
|
|
|
- String sqlinfo = " SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + task.getUserId() + "' and is_deleted=0 ) as signature_file_url from m_textdict_info a where a.type =2 and a.id in (" + ids + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
|
|
|
+ String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + task.getUserId() + "' and is_deleted=0 ) as signature_file_url from m_textdict_info a where a.type =2 and a.id in (" + ids + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
|
|
|
List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
|
|
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
@@ -522,7 +544,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
List<Map<String, Object>> keyList = peopleByAge.get(keyId);
|
|
|
if(keyList!=null && keyList.size()==1){
|
|
|
maps.addAll(keyList);
|
|
|
- }else if(keyList!=null && keyList.size()>=1){
|
|
|
+ }else if(keyList!=null && keyList.size()>=2){
|
|
|
for(Map<String, Object> datax : keyList){
|
|
|
if((datax.get("project_id")+"").equals(projectId)){
|
|
|
maps.add(datax);
|