Commit 89af8b27 authored by hongguangwu's avatar hongguangwu

Merge branch 'MVP1.7.15' into MVP1.7.15-fdd

parents 548b2271 3dbeb7e7
...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurRuleInfoSearchVo; ...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurRuleInfoSearchVo;
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.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 io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -35,6 +36,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -35,6 +36,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -152,4 +154,6 @@ public class TAutoInsurRuleInfoController { ...@@ -152,4 +154,6 @@ public class TAutoInsurRuleInfoController {
public void export(HttpServletResponse response, @RequestBody TAutoInsurRuleInfoSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TAutoInsurRuleInfoSearchVo searchVo) {
tAutoInsurRuleInfoService.listExport(response,searchVo); tAutoInsurRuleInfoService.listExport(response,searchVo);
} }
} }
...@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -31,6 +31,7 @@ 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.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.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -42,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -42,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -183,4 +185,15 @@ public class TAutoMainRelController { ...@@ -183,4 +185,15 @@ public class TAutoMainRelController {
menuUtil.setAuthSql(user, tAutoMainRel); menuUtil.setAuthSql(user, tAutoMainRel);
tAutoMainRelService.listExport(response,tAutoMainRel); tAutoMainRelService.listExport(response,tAutoMainRel);
} }
/**
* @Author fxj
* @Description 远程接口获取项目对应商险的自动化配置信息,有商险自动化且配置为启用的
* @Date 11:20 2025/9/17
**/
@Inner
@PostMapping("/inner/getProjectAutoSetMap")
public Map<String,String> getProjectAutoSetMap(@RequestBody List<String> departNos) {
return tAutoMainRelService.getProjectAutoSetMap(departNos);
}
} }
...@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 商险购买规则配置表 * 商险购买规则配置表
...@@ -48,4 +49,5 @@ public interface TAutoInsurRuleInfoService extends IService<TAutoInsurRuleInfo> ...@@ -48,4 +49,5 @@ public interface TAutoInsurRuleInfoService extends IService<TAutoInsurRuleInfo>
void listExport(HttpServletResponse response, TAutoInsurRuleInfoSearchVo searchVo); void listExport(HttpServletResponse response, TAutoInsurRuleInfoSearchVo searchVo);
List<TAutoInsurRuleInfo> noPageDiy(TAutoInsurRuleInfoSearchVo searchVo); List<TAutoInsurRuleInfo> noPageDiy(TAutoInsurRuleInfoSearchVo searchVo);
} }
...@@ -32,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -32,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 项目配置表主表 * 项目配置表主表
...@@ -62,4 +63,6 @@ public interface TAutoMainRelService extends IService<TAutoMainRel> { ...@@ -62,4 +63,6 @@ public interface TAutoMainRelService extends IService<TAutoMainRel> {
R<TAutoMainRelDetailVo> getProjectRule(String deptId, String deptNo); R<TAutoMainRelDetailVo> getProjectRule(String deptId, String deptNo);
IPage<TAutoContractScheme> getContractSchemePage(Page<TAutoContractScheme> page, TAutoContractScheme search); IPage<TAutoContractScheme> getContractSchemePage(Page<TAutoContractScheme> page, TAutoContractScheme search);
Map<String, String> getProjectAutoSetMap(List<String> departNos);
} }
...@@ -33,6 +33,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -33,6 +33,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoInsurRuleInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoInsurRuleInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoInsurRuleInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAutoInsurRuleInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAutoInsurRuleInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TAutoInsurRuleInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.MSetttleCustomerUserVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurRuleInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurRuleInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurRuleInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TAutoInsurRuleInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -47,7 +48,10 @@ import java.io.IOException; ...@@ -47,7 +48,10 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 商险购买规则配置表 * 商险购买规则配置表
* *
...@@ -146,7 +150,7 @@ public class TAutoInsurRuleInfoServiceImpl extends ServiceImpl<TAutoInsurRuleInf ...@@ -146,7 +150,7 @@ public class TAutoInsurRuleInfoServiceImpl extends ServiceImpl<TAutoInsurRuleInf
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
private Long noPageCountDiy(TAutoInsurRuleInfoSearchVo searchVo) { private Long noPageCountDiy(TAutoInsurRuleInfoSearchVo searchVo) {
LambdaQueryWrapper<TAutoInsurRuleInfo> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TAutoInsurRuleInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){ if (Common.isNotNull(idList)){
...@@ -244,4 +248,6 @@ public class TAutoInsurRuleInfoServiceImpl extends ServiceImpl<TAutoInsurRuleInf ...@@ -244,4 +248,6 @@ public class TAutoInsurRuleInfoServiceImpl extends ServiceImpl<TAutoInsurRuleInf
BeanUtil.copyProperties(excel, insert); BeanUtil.copyProperties(excel, insert);
this.save(insert); this.save(insert);
} }
} }
...@@ -1112,4 +1112,21 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri ...@@ -1112,4 +1112,21 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
} }
return wrapper; return wrapper;
} }
/**
* @Author fxj
* @Description 远程接口获取项目对应商险的自动化配置信息,有商险自动化且配置为启用的
* @Date 11:26 2025/9/17
**/
@Override
public Map<String, String> getProjectAutoSetMap(List<String> departNos) {
Map<String,String> map = new HashMap<>();
//和产品确认了只要有配置的,则限制商险派单,不看配置是否可用,不看是否配置了商险自动化
List<TAutoMainRel> list = baseMapper.selectList(Wrappers.<TAutoMainRel>query().lambda());
if(Common.isNotNull(list)){
for(TAutoMainRel vo :list){
map.put(vo.getDeptNo(),vo.getDeptNo());
}
}
return map;
}
} }
...@@ -36,6 +36,20 @@ public class ArchivesDaprUtil { ...@@ -36,6 +36,20 @@ public class ArchivesDaprUtil {
@Autowired @Autowired
private DaprArchivesProperties daprArchivesProperties; private DaprArchivesProperties daprArchivesProperties;
/**
* @Author fxj
* @Description 获取项目自动化设置信息,只返回配置了自动化且商险自动化为是的信息
* @Date 11:16 2025/9/17
**/
public R<Map<String,String>> getProjectAutoSetMap(List<String> departNos){
R<Map> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tautomainrel/inner/getProjectAutoSetMap" , JSON.toJSONString(departNos), Map.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取项目商险自动化信息失败!");
}
Map<String,String> map = JSON.parseObject(JSON.toJSONString(res.getData()),new TypeReference<HashMap<String,String>>(){});
return R.ok(map);
}
public R<Map<String,String>> getCustomerUserMap(List<String> userList){ public R<Map<String,String>> getCustomerUserMap(List<String> userList){
R<Map> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/msetttlecustomeruser/inner/getCustomerUserMap" , JSON.toJSONString(userList), Map.class, SecurityConstants.FROM_IN); R<Map> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/msetttlecustomeruser/inner/getCustomerUserMap" , JSON.toJSONString(userList), Map.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
......
...@@ -104,7 +104,11 @@ ...@@ -104,7 +104,11 @@
<artifactId>yifu-common-ekp</artifactId> <artifactId>yifu-common-ekp</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-cp</artifactId>
<version>4.7.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -70,4 +70,10 @@ public class EkpAlertTableController { ...@@ -70,4 +70,10 @@ public class EkpAlertTableController {
ekpAlertTableService.pushBudgetAlertInfoTomanager(0); ekpAlertTableService.pushBudgetAlertInfoTomanager(0);
} }
@PostMapping("/tesxWxExcelApi")
public void tesxWxExcelApi() {
ekpAlertTableService.tesxWxExcelApi();
}
} }
...@@ -30,4 +30,6 @@ public interface EkpAlertTableService extends IService<EkpAlertTable> { ...@@ -30,4 +30,6 @@ public interface EkpAlertTableService extends IService<EkpAlertTable> {
void pushBudgetAlertInfoTomanager(int type); void pushBudgetAlertInfoTomanager(int type);
void tesxWxExcelApi();
} }
...@@ -23,6 +23,8 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpBudgetWarningInfo; ...@@ -23,6 +23,8 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpBudgetWarningInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpAlertTableMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpAlertTableMapper;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpBudgetWarningInfoMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpBudgetWarningInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpAlertTableService; import com.yifu.cloud.plus.v1.ekp.service.EkpAlertTableService;
import com.yifu.cloud.plus.v1.ekp.util.SmartSheetDebugService;
import com.yifu.cloud.plus.v1.ekp.util.WeComSmartSheetManager;
import com.yifu.cloud.plus.v1.ekp.vo.BudgetWarningVo; import com.yifu.cloud.plus.v1.ekp.vo.BudgetWarningVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
...@@ -57,6 +59,15 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E ...@@ -57,6 +59,15 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E
@Autowired @Autowired
private EkpBudgetWarningInfoMapper warningInfoMapper; private EkpBudgetWarningInfoMapper warningInfoMapper;
@Autowired
private WeComSmartSheetManager smartSheetManager;
@Autowired
private SmartSheetDebugService debugService;
/** /**
...@@ -243,6 +254,7 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E ...@@ -243,6 +254,7 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E
log.error("执行预算预警任务时发生异常:", e); log.error("执行预算预警任务时发生异常:", e);
} }
} }
/** /**
* @param config 预警配置 * @param config 预警配置
* @return 是否超额 * @return 是否超额
...@@ -296,4 +308,27 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E ...@@ -296,4 +308,27 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E
} }
return false; return false;
} }
@Override
public void tesxWxExcelApi() {
/*RestTemplate restTemplate = new RestTemplate();
String accessToken = wxConfig.getAccessToken(restTemplate);
Map<String, Object> requestBody = new HashMap<>();
//requestBody.put("spaceid", ""); // 非必填,空间spaceid。若指定spaceid,则fatherid也要同时指定
//requestBody.put("fatherid", "Sheet1"); // 非必填,父目录fileid, 在根目录时为空间spaceid
requestBody.put("doc_type", 10); // 文档类型, 3:文档 4:表格 10:智能表格
requestBody.put("doc_name", "发票基础信息"); // 文档名字(注意:文件名最多填255个字符, 超过255个字符会被截断)
requestBody.put("admin_users", new String[]{"FeiTaiLang_Fang"}); // 非必填,文档管理员userid
// 发送POST请求(示例使用Spring的RestTemplate)
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers);
restTemplate = new RestTemplate();
String createDocUrl = "https://qyapi.weixin.qq.com/cgi-bin/wedoc/create_doc?access_token="+accessToken;
ResponseEntity<String> response = restTemplate.postForEntity(createDocUrl,requestEntity, String.class);*/
//smartSheetManager.test(wxConfig);
debugService.debugInsertIssue(wxConfig);
}
} }
package com.yifu.cloud.plus.v1.ekp.util;
import lombok.Data;
/**
* @Author fxj
* @Date 2025/9/18
* @Description
* @Version 1.0
*/
@Data
public class FieldInfo {
private String fieldId;
private String title;
private String type;
@Override
public String toString() {
return "FieldInfo{" +
"fieldId='" + fieldId + '\'' +
", title='" + title + '\'' +
", type='" + type + '\'' +
'}';
}
}
package com.yifu.cloud.plus.v1.ekp.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.ekp.config.WxConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author fxj
* @Date 2025/9/18
* @Description
* @Version 1.0
*/
@Service
public class SmartSheetDebugService {
@Autowired
private WeComSmartSheetDebugger debugger;
/**
* 调试企业微信智能表格记录添加问题
*
*/
public void debugInsertIssue(WxConfig wxConfig) {
String corpId = "wwbcb090af0dfe50e5";
String corpSecret = "16kqEL_eU-ARwYyqLgEBWHgxm8gXVnkzv_eJMLy9Np";
String docId = "dcTSMCj4lWV9MEP7lquZacOY8WS4g-iHxP_jVYA02tdYwb2YYc3BpDR8NrFWkEngHUg8abET4eTIpo9Zv-571NEA";
String sheetId = "q979lj";
System.out.println("=== 开始调试企业微信智能表格记录添加问题 ===");
// 1. 获取并打印表格字段信息
System.out.println("=== 表格字段信息 ===");
List<WeComSmartSheetDebugger.FieldInfo> fields = debugger.getSheetFields(wxConfig,corpId, corpSecret, docId, sheetId);
if (fields.isEmpty()) {
System.out.println("未能获取到表格字段信息,请检查参数是否正确");
return;
}
for (WeComSmartSheetDebugger.FieldInfo field : fields) {
System.out.println("字段ID: " + field.getFieldId() +
", 字段标题: '" + field.getTitle() + "'" +
", 字段类型: " + field.getType());
}
// 创建数据
List<Map<String, Object>> records = new ArrayList<>();
// 第一条记录
Map<String, Object> record1 = new HashMap<>();
record1.put("姓名", "文本内容1");
record1.put("部门", "文本内容2");
record1.put("年龄", "文本内容3");
records.add(record1);
// 第二条记录
Map<String, Object> record2 = new HashMap<>();
record2.put("姓名", "文本内容1");
record2.put("部门", "文本内容2");
record2.put("年龄", "文本内容3");
records.add(record2);
/* // 2. 准备要插入的数据(示例数据,请根据实际情况修改)
List<Map<String, String>> records = new ArrayList<>();
Map<String, Object> record = new HashMap<>();
Map<String, Object> values = new HashMap<>();
List<Map<String, String>> fieldContent = new ArrayList<>();
Map<String, String> textContent = new HashMap<>();
textContent.put("type", "text");
textContent.put("text", "张三");
fieldContent.add(textContent);
textContent = new HashMap<>();
textContent.put("type", "text");
textContent.put("text", "李四");
fieldContent.add(textContent);
// 注意:这里的字段名称必须与表格中的完全一致(包括大小写和空格)
values.put("姓名", fieldContent);
fieldContent = new ArrayList<>();
record = new HashMap<>();
values = new HashMap<>();
textContent = new HashMap<>();
textContent.put("type", "text");
textContent.put("text", "技术部");
fieldContent.add(textContent);
textContent = new HashMap<>();
textContent.put("type", "text");
textContent.put("text", "产品部");
fieldContent.add(textContent);
values.put("部门", fieldContent);
record.put("values", values);
records.add(record);*/
/*fieldContent = new ArrayList<>();
record = new HashMap<>();
values = new HashMap<>();
textContent = new HashMap<>();
textContent.put("type", "text");
textContent.put("text", "技术部");
fieldContent.add(textContent);
textContent = new HashMap<>();
textContent.put("type", "text");
textContent.put("text", "产品部");
fieldContent.add(textContent);
values.put("部门", fieldContent);
record.put("values", values);
records.add(record);*/
// 3. 验证字段匹配性
System.out.println("\n=== 字段匹配性验证 ===");
List<String> mismatches = debugger.validateFields(wxConfig,corpId, corpSecret, docId, sheetId, records);
if (mismatches.isEmpty()) {
System.out.println("所有字段都匹配");
} else {
System.out.println("以下字段不匹配:");
for (String mismatch : mismatches) {
System.out.println("- " + mismatch);
}
System.out.println("请根据以上信息修正数据后重试");
return;
}
// 4. 测试插入数据并查看详细响应
System.out.println("\n=== 测试数据插入 ===");
String response = debugger.testInsertData(wxConfig,corpId, corpSecret, docId, sheetId, records);
System.out.println("API响应: " + response);
System.out.println("\n=== 调试完成 ===");
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.ekp.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
/**
* 企业微信智能表格字段信息获取工具类
* 用于获取智能表格的字段信息,帮助诊断"字段不存在"错误
*/
@Component
public class WeComSheetFieldFetcher {
/**
* 企业微信API基础URL
*/
private static final String WE_COM_API_BASE_URL = "https://qyapi.weixin.qq.com/cgi-bin";
/**
* 获取access_token的接口路径
*/
private static final String GET_TOKEN_PATH = "/gettoken";
/**
* 获取智能表格字段信息的接口路径
*/
private static final String GET_FIELDS_PATH = "/wedoc/smartsheet/get_fields";
/**
* 获取智能表格字段信息
*
* @param corpId 企业ID
* @param corpSecret 应用的密钥
* @param docId 文档ID
* @param sheetId 工作表ID
* @return 字段信息列表
*/
public List<FieldInfo> getSheetFields(String corpId, String corpSecret, String docId, String sheetId) {
List<FieldInfo> fieldInfos = new ArrayList<>();
try {
// 1. 获取access_token
String accessToken = getAccessToken(corpId, corpSecret);
if (accessToken == null || accessToken.isEmpty()) {
System.err.println("获取access_token失败");
return fieldInfos;
}
// 2. 获取字段信息
fieldInfos = fetchFields(accessToken, docId, sheetId);
} catch (Exception e) {
System.err.println("获取表格字段信息时发生异常: " + e.getMessage());
e.printStackTrace();
}
return fieldInfos;
}
/**
* 获取企业微信access_token
*
* @param corpId 企业ID
* @param corpSecret 应用密钥
* @return access_token
*/
private String getAccessToken(String corpId, String corpSecret) {
try {
String url = WE_COM_API_BASE_URL + GET_TOKEN_PATH + "?corpid=" + corpId + "&corpsecret=" + corpSecret;
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
JSONObject jsonObject = JSON.parseObject(response.getBody());
if (jsonObject.getInteger("errcode") == 0) {
return jsonObject.getString("access_token");
} else {
System.err.println("获取access_token失败,错误代码:" + jsonObject.getInteger("errcode")
+ ",错误信息:" + jsonObject.getString("errmsg"));
return null;
}
}
} catch (Exception e) {
System.err.println("获取access_token时发生异常: " + e.getMessage());
e.printStackTrace();
}
return null;
}
/**
* 获取字段信息
*
* @param accessToken 访问令牌
* @param docId 文档ID
* @param sheetId 工作表ID
* @return 字段信息列表
*/
private List<FieldInfo> fetchFields(String accessToken, String docId, String sheetId) {
List<FieldInfo> fieldInfos = new ArrayList<>();
try {
String url = WE_COM_API_BASE_URL + GET_FIELDS_PATH + "?access_token=" + accessToken;
RestTemplate restTemplate = new RestTemplate();
// 构造请求体
JSONObject requestBody = new JSONObject();
requestBody.put("docid", docId);
requestBody.put("sheet_id", sheetId);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers);
ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
JSONObject jsonObject = JSON.parseObject(response.getBody());
if (jsonObject.getInteger("errcode") == 0) {
JSONArray fields = jsonObject.getJSONArray("fields");
if (fields != null && !fields.isEmpty()) {
for (int i = 0; i < fields.size(); i++) {
JSONObject field = fields.getJSONObject(i);
FieldInfo fieldInfo = new FieldInfo();
fieldInfo.setFieldId(field.getString("field_id"));
fieldInfo.setTitle(field.getString("title"));
fieldInfo.setType(field.getString("type"));
fieldInfos.add(fieldInfo);
}
}
} else {
System.err.println("获取字段信息失败,错误代码:" + jsonObject.getInteger("errcode")
+ ",错误信息:" + jsonObject.getString("errmsg"));
}
}
} catch (Exception e) {
System.err.println("获取字段信息时发生异常: " + e.getMessage());
e.printStackTrace();
}
return fieldInfos;
}
/**
* 使用示例
*
* @param args 命令行参数
*/
public static void main(String[] args) {
WeComSheetFieldFetcher fetcher = new WeComSheetFieldFetcher();
// 示例数据
String corpId = "your_corp_id";
String corpSecret = "your_corp_secret";
String docId = "your_doc_id";
String sheetId = "your_sheet_id";
// 获取字段信息列表
List<FieldInfo> fields = fetcher.getSheetFields(corpId, corpSecret, docId, sheetId);
System.out.println("获取到的字段信息列表: " + fields);
// 打印每个字段的详细信息
for (FieldInfo field : fields) {
System.out.println("字段ID: " + field.getFieldId() +
", 字段标题: " + field.getTitle() +
", 字段类型: " + field.getType());
}
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.ekp.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.ekp.config.WxConfig;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
/**
* 企业微信智能表格SheetId获取工具类
* 用于通过文档ID获取表格ID
*/
@Data
@Component
public class WeComSheetIdFetcher {
/**
* 企业微信API基础URL
*/
private static final String WE_COM_API_BASE_URL = "https://qyapi.weixin.qq.com/cgi-bin";
/**
* 获取access_token的接口路径
*/
private static final String GET_TOKEN_PATH = "/gettoken";
/**
* 查询子表的接口路径
*/
private static final String GET_SHEET_PATH = "/wedoc/smartsheet/get_sheet";
/**
* 通过文档ID获取表格ID列表
*
* @param docId 文档ID
* @return 表格ID列表
*/
public List<String> getSheetIds(WxConfig wxConfig,String docId) {
List<String> sheetIds = new ArrayList<>();
try {
RestTemplate restTemplate = new RestTemplate();
// 1. 获取access_token
String accessToken = wxConfig.getAccessToken(restTemplate);
//getAccessToken(corpId, corpSecret);
if (accessToken == null || accessToken.isEmpty()) {
System.err.println("获取access_token失败");
return sheetIds;
}
// 2. 查询子表信息
List<SheetInfo> sheetInfos = getSheetInfo(accessToken, docId);
for (SheetInfo sheetInfo : sheetInfos) {
// 只返回智能表类型的sheet_id
if ("smartsheet".equals(sheetInfo.getType())) {
sheetIds.add(sheetInfo.getSheetId());
}
}
} catch (Exception e) {
System.err.println("获取表格ID时发生异常: " + e.getMessage());
e.printStackTrace();
}
return sheetIds;
}
/**
* 获取企业微信access_token
*
* @param corpId 企业ID
* @param corpSecret 应用密钥
* @return access_token
*/
private String getAccessToken(String corpId, String corpSecret) {
try {
String url = WE_COM_API_BASE_URL + GET_TOKEN_PATH + "?corpid=" + corpId + "&corpsecret=" + corpSecret;
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
JSONObject jsonObject = JSON.parseObject(response.getBody());
if (jsonObject.getInteger("errcode") == 0) {
return jsonObject.getString("access_token");
} else {
System.err.println("获取access_token失败,错误代码:" + jsonObject.getInteger("errcode")
+ ",错误信息:" + jsonObject.getString("errmsg"));
return null;
}
}
} catch (Exception e) {
System.err.println("获取access_token时发生异常: " + e.getMessage());
e.printStackTrace();
}
return null;
}
/**
* 查询子表信息
*
* @param accessToken 访问令牌
* @param docId 文档ID
* @return 子表信息列表
*/
private List<SheetInfo> getSheetInfo(String accessToken, String docId) {
List<SheetInfo> sheetInfos = new ArrayList<>();
try {
String url = WE_COM_API_BASE_URL + GET_SHEET_PATH + "?access_token=" + accessToken;
RestTemplate restTemplate = new RestTemplate();
// 构造请求体
JSONObject requestBody = new JSONObject();
requestBody.put("docid", docId);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers);
ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
JSONObject jsonObject = JSON.parseObject(response.getBody());
if (jsonObject.getInteger("errcode") == 0) {
JSONArray sheets = jsonObject.getJSONArray("sheet_list");
if (sheets != null && !sheets.isEmpty()) {
for (int i = 0; i < sheets.size(); i++) {
JSONObject sheet = sheets.getJSONObject(i);
SheetInfo sheetInfo = new SheetInfo();
sheetInfo.setSheetId(sheet.getString("sheet_id"));
sheetInfo.setTitle(sheet.getString("title"));
sheetInfo.setType(sheet.getString("type"));
sheetInfos.add(sheetInfo);
}
}
} else {
System.err.println("查询子表信息失败,错误代码:" + jsonObject.getInteger("errcode")
+ ",错误信息:" + jsonObject.getString("errmsg"));
}
}
} catch (Exception e) {
System.err.println("查询子表信息时发生异常: " + e.getMessage());
e.printStackTrace();
}
return sheetInfos;
}
/**
* 子表信息内部类
*/
public static class SheetInfo {
private String sheetId;
private String title;
private String type; // smartsheet: 智能表, dashboard: 仪表盘, external: 说明页
public String getSheetId() {
return sheetId;
}
public void setSheetId(String sheetId) {
this.sheetId = sheetId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String toString() {
return "SheetInfo{" +
"sheetId='" + sheetId + '\'' +
", title='" + title + '\'' +
", type='" + type + '\'' +
'}';
}
}
/**
* 使用示例
*
* @param args 命令行参数
*/
public static void main(String[] args) {
WeComSheetIdFetcher fetcher = new WeComSheetIdFetcher();
// 示例数据
String corpId = "your_corp_id";
String corpSecret = "your_corp_secret";
String docId = "your_doc_id";
// 获取表格ID列表
/* List<String> sheetIds = fetcher.getSheetIds(docId);
System.out.println("获取到的表格ID列表: " + sheetIds);*/
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.ekp.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.ekp.config.WxConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.List;
import java.util.Map;
/**
* 企业微信智能表格数据插入工具类
* 用于向已有的企业微信智能表格中插入数据
*/
@Component
public class WeComSmartSheetDataInserter {
@Autowired
private WxConfig wxConfig;
/**
* 企业微信API基础URL
*/
private static final String WE_COM_API_BASE_URL = "https://qyapi.weixin.qq.com/cgi-bin";
/**
* 获取access_token的接口路径
*/
private static final String GET_TOKEN_PATH = "/gettoken";
/**
* 智能表格添加记录的接口路径
*/
private static final String ADD_RECORDS_PATH = "/wedoc/smartsheet/add_records";
/**
* 向企业微信智能表格中插入数据
*
* @param docId 文档ID
* @param sheetId 表格ID
* @param records 要插入的记录列表
* @return 插入结果
*/
public boolean insertData(String docId, String sheetId, List<Map<String, Object>> records) {
try {
RestTemplate restTemplate = new RestTemplate();
// 1. 获取access_token
String accessToken = wxConfig.getAccessToken(restTemplate);
//getAccessToken(corpId, corpSecret);
if (accessToken == null || accessToken.isEmpty()) {
System.err.println("获取access_token失败");
return false;
}
// 2. 构造请求体
JSONObject requestBody = new JSONObject();
requestBody.put("docid", docId);
requestBody.put("sheet_id", sheetId);
requestBody.put("key_type", "CELL_VALUE_KEY_TYPE_FIELD_TITLE");
// 构造records数组
new com.alibaba.fastjson.JSONArray();
requestBody.put("records", records);
// 3. 发送请求插入数据
boolean result = addRecords(accessToken, requestBody);
if (result) {
System.out.println("数据插入成功");
} else {
System.err.println("数据插入失败");
}
return result;
} catch (Exception e) {
System.err.println("插入数据时发生异常: " + e.getMessage());
e.printStackTrace();
return false;
}
}
/**
* 获取企业微信access_token
*
* @param corpId 企业ID
* @param corpSecret 应用密钥
* @return access_token
*/
private String getAccessToken(String corpId, String corpSecret) {
try {
String url = WE_COM_API_BASE_URL + GET_TOKEN_PATH + "?corpid=" + corpId + "&corpsecret=" + corpSecret;
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
JSONObject jsonObject = JSON.parseObject(response.getBody());
if (jsonObject.getInteger("errcode") == 0) {
return jsonObject.getString("access_token");
} else {
System.err.println("获取access_token失败,错误代码:" + jsonObject.getInteger("errcode")
+ ",错误信息:" + jsonObject.getString("errmsg"));
return null;
}
}
} catch (Exception e) {
System.err.println("获取access_token时发生异常: " + e.getMessage());
e.printStackTrace();
}
return null;
}
/**
* 向智能表格添加记录
*
* @param accessToken 访问令牌
* @param requestBody 请求体
* @return 是否成功
*/
private boolean addRecords(String accessToken, JSONObject requestBody) {
try {
String url = WE_COM_API_BASE_URL + ADD_RECORDS_PATH + "?access_token=" + accessToken;
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers);
ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
JSONObject jsonObject = JSON.parseObject(response.getBody());
if (jsonObject.getInteger("errcode") == 0) {
return true;
} else {
System.err.println("添加记录失败,错误代码:" + jsonObject.getInteger("errcode")
+ ",错误信息:" + jsonObject.getString("errmsg"));
return false;
}
}
} catch (Exception e) {
System.err.println("添加记录时发生异常: " + e.getMessage());
e.printStackTrace();
}
return false;
}
/**
* 使用示例
*
* @param args 命令行参数
*/
public static void main(String[] args) {
WeComSmartSheetDataInserter inserter = new WeComSmartSheetDataInserter();
// 示例数据
String corpId = "your_corp_id";
String corpSecret = "your_corp_secret";
String docId = "your_doc_id";
String sheetId = "your_sheet_id";
// 构造要插入的数据
new java.util.ArrayList<Map<String, Object>>();
/*
// 示例记录
Map<String, Object> record1 = new HashMap<>();
Map<String, Object> values1 = new HashMap<>();
values1.put("姓名", "张三");
values1.put("年龄", 25);
values1.put("部门", "技术部");
record1.put("values", values1);
Map<String, Object> record2 = new HashMap<>();
Map<String, Object> values2 = new HashMap<>();
values2.put("姓名", "李四");
values2.put("年龄", 30);
values2.put("部门", "市场部");
record2.put("values", values2);
records.add(record1);
records.add(record2);
// 执行插入
boolean success = inserter.insertData(corpId, corpSecret, docId, sheetId, records);
if (success) {
System.out.println("数据插入成功");
} else {
System.out.println("数据插入失败");
}
*/
}
}
\ No newline at end of file
...@@ -1341,4 +1341,6 @@ public class InsurancesConstants { ...@@ -1341,4 +1341,6 @@ public class InsurancesConstants {
* *
*/ */
public static final String IMPORT_POLICY_REMARK = "保单号维护模版导入"; public static final String IMPORT_POLICY_REMARK = "保单号维护模版导入";
public static final String INSURANCE_AUTO_FLAG_IS_ENABLE = "该项目已纳入自动化,请至作业自动化模块入职登记-接收确认后自动派单";
} }
...@@ -132,7 +132,7 @@ public class TInsuranceDetailController { ...@@ -132,7 +132,7 @@ public class TInsuranceDetailController {
@PostMapping("/addInsurance") @PostMapping("/addInsurance")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insure_add')") @PreAuthorize("@pms.hasPermission('insurance_custserve_insure_add')")
public R<List<InsuranceAddParam>> addInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceAddParam> paramList){ public R<List<InsuranceAddParam>> addInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceAddParam> paramList){
return tInsuranceDetailService.addInsurance(paramList,null); return tInsuranceDetailService.addInsurance(paramList,null,false);
} }
/** /**
...@@ -146,7 +146,7 @@ public class TInsuranceDetailController { ...@@ -146,7 +146,7 @@ public class TInsuranceDetailController {
@PostMapping("/batchInsurance") @PostMapping("/batchInsurance")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insure_batch_add')") @PreAuthorize("@pms.hasPermission('insurance_custserve_insure_batch_add')")
public R<List<InsuranceBatchParam>> batchInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceBatchParam> paramList){ public R<List<InsuranceBatchParam>> batchInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceBatchParam> paramList){
return tInsuranceDetailService.batchInsurance(paramList,null); return tInsuranceDetailService.batchInsurance(paramList,null,false);
} }
/** /**
...@@ -160,7 +160,7 @@ public class TInsuranceDetailController { ...@@ -160,7 +160,7 @@ public class TInsuranceDetailController {
@PostMapping("/replaceInsurance") @PostMapping("/replaceInsurance")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insure_update')") @PreAuthorize("@pms.hasPermission('insurance_custserve_insure_update')")
public R<List<InsuranceReplaceParam>> replaceInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceReplaceParam> paramList){ public R<List<InsuranceReplaceParam>> replaceInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceReplaceParam> paramList){
return tInsuranceDetailService.replaceInsurance(paramList,null); return tInsuranceDetailService.replaceInsurance(paramList,null,false);
} }
/** /**
......
...@@ -82,7 +82,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -82,7 +82,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList * @param paramList
* @return {@link R<List<InsuranceAddParam>>} * @return {@link R<List<InsuranceAddParam>>}
*/ */
R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo); R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo,boolean autoFlag);
/** /**
* 商险批增 * 商险批增
...@@ -91,7 +91,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -91,7 +91,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList * @param paramList
* @return {@link R<List<InsuranceBatchParam>>} * @return {@link R<List<InsuranceBatchParam>>}
*/ */
R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo); R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo,boolean autoFlag);
/** /**
* 商险替换 * 商险替换
* *
...@@ -99,7 +99,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -99,7 +99,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList * @param paramList
* @return {@link R<List<InsuranceReplaceParam>>} * @return {@link R<List<InsuranceReplaceParam>>}
*/ */
R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo); R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo,boolean autoFlag);
/** /**
* 通过id删除 * 通过id删除
......
...@@ -269,19 +269,19 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -269,19 +269,19 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
List<InsuranceBatchParam> batchParamList = new ArrayList<>(); List<InsuranceBatchParam> batchParamList = new ArrayList<>();
List<InsuranceReplaceParam> replaceParamList = new ArrayList<>(); List<InsuranceReplaceParam> replaceParamList = new ArrayList<>();
if (!addParamList.isEmpty()) { if (!addParamList.isEmpty()) {
R<List<InsuranceAddParam>> listR = detailService.addInsurance(addParamList,null); R<List<InsuranceAddParam>> listR = detailService.addInsurance(addParamList,null,true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
paramList = listR.getData(); paramList = listR.getData();
} }
} }
if (!batchAddParamList.isEmpty()) { if (!batchAddParamList.isEmpty()) {
R<List<InsuranceBatchParam>> listR = detailService.batchInsurance(batchAddParamList,null); R<List<InsuranceBatchParam>> listR = detailService.batchInsurance(batchAddParamList,null,true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
batchParamList = listR.getData(); batchParamList = listR.getData();
} }
} }
if (!replaceAddParamList.isEmpty()) { if (!replaceAddParamList.isEmpty()) {
R<List<InsuranceReplaceParam>> listR = detailService.replaceInsurance(replaceAddParamList,null); R<List<InsuranceReplaceParam>> listR = detailService.replaceInsurance(replaceAddParamList,null,true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
replaceParamList = listR.getData(); replaceParamList = listR.getData();
} }
......
...@@ -291,6 +291,7 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap ...@@ -291,6 +291,7 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
TInsuranceType type = null; TInsuranceType type = null;
TBusinessOperate operate = null; TBusinessOperate operate = null;
TInsurancePolicy policy = null; TInsurancePolicy policy = null;
List<TInsurancePolicy> saveList = new ArrayList<>();
// 执行数据插入操作 组装 // 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
...@@ -337,17 +338,31 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap ...@@ -337,17 +338,31 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
policy.setEnableFlag(CommonConstants.ZERO_INT); policy.setEnableFlag(CommonConstants.ZERO_INT);
policy.setDeleteFlag(CommonConstants.ZERO_INT); policy.setDeleteFlag(CommonConstants.ZERO_INT);
//插入保单维护信息 //插入保单维护信息
baseMapper.insert(policy); saveList.add(policy);
//baseMapper.insert(policy);
//插入保单维护操作日志 //插入保单维护操作日志
//第一次新增插入变更记录表为insert,前端会将insert渲染为批量导入 //第一次新增插入变更记录表为insert,前端会将insert渲染为批量导入
operate = new TBusinessOperate();
operate.setBusinessId(policy.getId());
operate.setDifferenceInfo("insert");
tBusinessOperateService.save(operate);
policyNoMap.put(excel.getPolicyNo(), excel.getRowIndex().toString()); policyNoMap.put(excel.getPolicyNo(), excel.getRowIndex().toString());
} }
List<TBusinessOperate> operateList = new ArrayList<>();
if (Common.isNotNull(saveList)) {
this.saveBatch(saveList);
for (TInsurancePolicy py : saveList){
operate = new TBusinessOperate();
operate.setBusinessId(policy.getId());
operate.setDifferenceInfo("insert");
operateList.add( operate);
//tBusinessOperateService.save(operate);
}
if (Common.isNotNull(operateList)){
tBusinessOperateService.saveBatch(operateList);
}
}
// 清理map list 等数据 // 清理map list 等数据
Common.clear(saveList);
Common.clear(operateList);
Common.clear(excelVOList); Common.clear(excelVOList);
} }
......
...@@ -181,7 +181,7 @@ public class SysHouseHoldInfo extends BaseEntity { ...@@ -181,7 +181,7 @@ public class SysHouseHoldInfo extends BaseEntity {
/** /**
* 单位编号 * 单位编号
*/ */
@ExcelAttribute(name = "单位编号" ) @ExcelAttribute(name = "单位编号" , maxLength = 50)
@Schema(description ="单位编号") @Schema(description ="单位编号")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位编号") @ExcelProperty("单位编号")
...@@ -217,7 +217,7 @@ public class SysHouseHoldInfo extends BaseEntity { ...@@ -217,7 +217,7 @@ public class SysHouseHoldInfo extends BaseEntity {
/** /**
* 社保-登录账户 * 社保-登录账户
*/ */
@ExcelAttribute(name = "社保-登录账户" ) @ExcelAttribute(name = "社保-登录账户" , maxLength = 50)
@Schema(description ="社保-登录账户") @Schema(description ="社保-登录账户")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保-登录账户") @ExcelProperty("社保-登录账户")
...@@ -235,7 +235,7 @@ public class SysHouseHoldInfo extends BaseEntity { ...@@ -235,7 +235,7 @@ public class SysHouseHoldInfo extends BaseEntity {
/** /**
* 医保-登录账户 * 医保-登录账户
*/ */
@ExcelAttribute(name = "医保-登录账户" ) @ExcelAttribute(name = "医保-登录账户" , maxLength = 50)
@Schema(description ="医保-登录账户") @Schema(description ="医保-登录账户")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保-登录账户") @ExcelProperty("医保-登录账户")
...@@ -280,7 +280,7 @@ public class SysHouseHoldInfo extends BaseEntity { ...@@ -280,7 +280,7 @@ public class SysHouseHoldInfo extends BaseEntity {
/** /**
* 医保单位编号 * 医保单位编号
*/ */
@ExcelAttribute(name = "医保-单位编号" ) @ExcelAttribute(name = "医保-单位编号" , maxLength = 50)
@Schema(description ="医保-单位编号") @Schema(description ="医保-单位编号")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保-单位编号") @ExcelProperty("医保-单位编号")
......
...@@ -66,7 +66,7 @@ public class TSocialFriendBackLog { ...@@ -66,7 +66,7 @@ public class TSocialFriendBackLog {
/** /**
* @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径 * @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径
* 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片 18 反馈附件下载 * 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片 18 反馈附件下载
* 19:花名册附件src * 19:花名册附件src 20:税友异常情况记录
* @Author: hgw * @Author: hgw
* @Date: 2025/5/27 10:15 * @Date: 2025/5/27 10:15
**/ **/
......
...@@ -91,11 +91,18 @@ public class TDispatchInfoExportVo { ...@@ -91,11 +91,18 @@ public class TDispatchInfoExportVo {
/** /**
* 社保自动化标识 0 是 1 否 2 无 * 社保自动化标识 0 是 1 否 2 无
*/ */
@ExcelAttribute(name = "是否自动化审核",isNotEmpty = false,readConverterExp = "0=是,1=否,2=无") @ExcelAttribute(name = "是否自动化社保",isNotEmpty = false,readConverterExp = "0=是,1=否,2=无")
@Schema(description = "是否自动化审核:0 是 1 否2 无" ) @Schema(description = "是否自动化社保:0 是 1 否2 无" )
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="是否自动化审核") @ExcelProperty(value ="是否自动化社保")
private String autoFlag; private String autoFlag;/**
* 是否自动化医保 0 是 1 否 2 无
*/
@ExcelAttribute(name = "是否自动化医保",isNotEmpty = false,readConverterExp = "0=是,1=否,2=无")
@Schema(description = "是否自动化医保:0 是 1 否2 无" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="是否自动化医保")
private String autoFlagYsd;
/** /**
* 合同类型(字典值) * 合同类型(字典值)
......
...@@ -219,7 +219,7 @@ public class TSocialHouseholdInsertVo extends RowIndex implements Serializable { ...@@ -219,7 +219,7 @@ public class TSocialHouseholdInsertVo extends RowIndex implements Serializable {
/** /**
* 社保推送类型(是否单个接口) 0否1是(税友接口走单个还是批量,审核是否立即推送税友) MVP1.7.15 调整为社保推送类型 0批量 1单个 * 社保推送类型(是否单个接口) 0否1是(税友接口走单个还是批量,审核是否立即推送税友) MVP1.7.15 调整为社保推送类型 0批量 1单个
*/ */
@ExcelAttribute(name = "社保推送类型" ,readConverterExp = "0=批量,1=单个",errorInfo = "社保推送类型不能为空") @ExcelAttribute(name = "社保推送类型" ,errorInfo = "社保推送类型不能为空")
@Schema(description ="社保推送类型") @Schema(description ="社保推送类型")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保推送类型") @ExcelProperty("社保推送类型")
...@@ -228,7 +228,7 @@ public class TSocialHouseholdInsertVo extends RowIndex implements Serializable { ...@@ -228,7 +228,7 @@ public class TSocialHouseholdInsertVo extends RowIndex implements Serializable {
/** /**
* 医保推送类型 0否1是 MVP1.7.15 新增医保推送类型 0批量 1单个 * 医保推送类型 0否1是 MVP1.7.15 新增医保推送类型 0批量 1单个
*/ */
@ExcelAttribute(name = "医保推送类型",readConverterExp = "0=批量,1=单个",errorInfo = "医保推送类型不能为空") @ExcelAttribute(name = "医保推送类型",errorInfo = "医保推送类型不能为空")
@Schema(description ="医保推送类型") @Schema(description ="医保推送类型")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保推送类型") @ExcelProperty("医保推送类型")
......
...@@ -219,7 +219,7 @@ public class TSocialHouseholdUpdateVo extends RowIndex implements Serializable { ...@@ -219,7 +219,7 @@ public class TSocialHouseholdUpdateVo extends RowIndex implements Serializable {
/** /**
* 社保推送类型(是否单个接口) 0否1是(税友接口走单个还是批量,审核是否立即推送税友) MVP1.7.15 调整为社保推送类型 0批量 1单个 * 社保推送类型(是否单个接口) 0否1是(税友接口走单个还是批量,审核是否立即推送税友) MVP1.7.15 调整为社保推送类型 0批量 1单个
*/ */
@ExcelAttribute(name = "社保推送类型" ,readConverterExp = "0=批量,1=单个",errorInfo = "社保推送类型不能为空") @ExcelAttribute(name = "社保推送类型" ,errorInfo = "社保推送类型不能为空")
@Schema(description ="社保推送类型") @Schema(description ="社保推送类型")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保推送类型") @ExcelProperty("社保推送类型")
...@@ -228,7 +228,7 @@ public class TSocialHouseholdUpdateVo extends RowIndex implements Serializable { ...@@ -228,7 +228,7 @@ public class TSocialHouseholdUpdateVo extends RowIndex implements Serializable {
/** /**
* 医保推送类型 0否1是 MVP1.7.15 新增医保推送类型 0批量 1单个 * 医保推送类型 0否1是 MVP1.7.15 新增医保推送类型 0批量 1单个
*/ */
@ExcelAttribute(name = "医保推送类型" ,readConverterExp = "0=批量,1=单个",errorInfo = "医保推送类型不能为空") @ExcelAttribute(name = "医保推送类型" ,errorInfo = "医保推送类型不能为空")
@Schema(description ="医保推送类型") @Schema(description ="医保推送类型")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保推送类型") @ExcelProperty("医保推送类型")
......
...@@ -11,6 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; ...@@ -11,6 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
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.social.entity.SysHouseHoldInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendBackLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.*; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -90,8 +91,8 @@ public class SocialFriendConfig { ...@@ -90,8 +91,8 @@ public class SocialFriendConfig {
* @Date: 2024-12-9 16:54:31 * @Date: 2024-12-9 16:54:31
* @return: java.lang.String * @return: java.lang.String
**/ **/
public String pushFriendByInfo(RestTemplate restTemplate, SociaFriendYgsAddVo vo, List<SociaFriendYgsAddVo> listVo, int type, String thisTime public String pushFriendByInfo(RestTemplate restTemplate, SociaFriendYgsAddVo vo, List<SociaFriendYgsAddVo> listVo
, List<TSocialFriendBackLog> backLogList) { , int type, String bizNo, List<TSocialFriendBackLog> backLogList, TSocialFriendBackLogService tSocialFriendBackLogService) {
String addId = ""; String addId = "";
String appAddUrl = urlPre; String appAddUrl = urlPre;
if (type == 1 || type == 3) { if (type == 1 || type == 3) {
...@@ -121,7 +122,7 @@ public class SocialFriendConfig { ...@@ -121,7 +122,7 @@ public class SocialFriendConfig {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
// 外部业务订单号 // 外部业务订单号
json.put("bizNo", vo.getSocialId() + type + thisTime); json.put("bizNo", bizNo);
// 企业名称——户名 // 企业名称——户名
json.put("qymc", vo.getSocialHouseholdName()); json.put("qymc", vo.getSocialHouseholdName());
// 税号——户配置的“单位统一信用代码” // 税号——户配置的“单位统一信用代码”
...@@ -160,26 +161,18 @@ public class SocialFriendConfig { ...@@ -160,26 +161,18 @@ public class SocialFriendConfig {
if (type == 2 || type == 4) { if (type == 2 || type == 4) {
// 职工社会保险减少花名册 // 职工社会保险减少花名册
fileName = "zgshbxjshmc"; fileName = "zgshbxjshmc";
} if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs());
}
if (type > 2 && vo.getImgListYsd() != null && !vo.getImgListYsd().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd());
}
if (type == 2 || type == 4) {
json.put(fileName, vo.getQyzgshbxzyhmc()); json.put(fileName, vo.getQyzgshbxzyhmc());
} else { } else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
json.put(fileName, qyzgshbxzyhmclbArr); json.put(fileName, vo.getQyzgjbylbxcbdjb());
} }
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) { } else {
JSONArray qyzgshbxzyhmclbArr = new JSONArray(); JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb()); if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb());
}
if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) { if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松 // 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs()); qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs());
...@@ -188,9 +181,7 @@ public class SocialFriendConfig { ...@@ -188,9 +181,7 @@ public class SocialFriendConfig {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松 // 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd()); qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd());
} }
if (type == 2 || type == 4) { if (!qyzgshbxzyhmclbArr.isEmpty()) {
json.put(fileName, vo.getQyzgjbylbxcbdjb());
} else {
json.put(fileName, qyzgshbxzyhmclbArr); json.put(fileName, qyzgshbxzyhmclbArr);
} }
} }
...@@ -203,10 +194,19 @@ public class SocialFriendConfig { ...@@ -203,10 +194,19 @@ public class SocialFriendConfig {
backLogPush.setLogInfo(JSON.toJSONString(json, features)); backLogPush.setLogInfo(JSON.toJSONString(json, features));
backLogPush.setCreateTime(LocalDateTime.now()); backLogPush.setCreateTime(LocalDateTime.now());
backLogList.add(backLogPush); backLogList.add(backLogPush);
TSocialFriendBackLog errorSave = new TSocialFriendBackLog();
errorSave.setSocialId(bizNo);
errorSave.setType(20);
errorSave.setLogInfo(JSON.toJSONString(json, features));
errorSave.setCreateTime(LocalDateTime.now());
tSocialFriendBackLogService.save(errorSave);
String dataResultList = restTemplate.postForObject(appAddUrl, formEntity, String.class); String dataResultList = restTemplate.postForObject(appAddUrl, formEntity, String.class);
// {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y" // {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y"
// ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172" // ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172"
if (Common.isNotNull(dataResultList)) { if (Common.isNotNull(dataResultList)) {
errorSave.setType(21);
tSocialFriendBackLogService.updateById(errorSave);
// 拉取的数据日志 // 拉取的数据日志
TSocialFriendBackLog backLog = new TSocialFriendBackLog(); TSocialFriendBackLog backLog = new TSocialFriendBackLog();
StringBuilder ids = new StringBuilder(); StringBuilder ids = new StringBuilder();
......
...@@ -70,5 +70,8 @@ public class HouseConfigConstants { ...@@ -70,5 +70,8 @@ public class HouseConfigConstants {
public static final String ERROR_TEMPLATE_TWENTY_ONE = "医保自动化不可为空"; public static final String ERROR_TEMPLATE_TWENTY_ONE = "医保自动化不可为空";
public static final String IS_SINGLE_YES = "单个";
public static final String IS_SINGLE_NO = "批量";
} }
...@@ -807,7 +807,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -807,7 +807,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
continue; continue;
} }
//判断推送类型是否准确 //判断推送类型是否准确
if (!CommonConstants.ZERO_STRING.equals(excel.getIsSingle()) && !CommonConstants.ONE_STRING.equals(excel.getIsSingle())) { if (!HouseConfigConstants.IS_SINGLE_NO.equals(excel.getIsSingle()) && !HouseConfigConstants.IS_SINGLE_YES.equals(excel.getIsSingle())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE,excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE,excel));
continue; continue;
} }
...@@ -845,7 +845,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -845,7 +845,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
continue; continue;
} }
//判断推送类型是否准确 //判断推送类型是否准确
if (!CommonConstants.ZERO_STRING.equals(excel.getIsSingleYsd()) && !CommonConstants.ONE_STRING.equals(excel.getIsSingleYsd())) { if (!HouseConfigConstants.IS_SINGLE_NO.equals(excel.getIsSingleYsd()) && !HouseConfigConstants.IS_SINGLE_YES.equals(excel.getIsSingleYsd())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE_TWO,excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE_TWO,excel));
continue; continue;
} }
...@@ -871,12 +871,15 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -871,12 +871,15 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
//是否自动办理,选择是时,社保和医保信息必须填写其中一个,否则导入不成功--》MVP1.7.15 选择是 社保信息必填 //是否自动办理,选择是时,社保和医保信息必须填写其中一个,否则导入不成功--》MVP1.7.15 选择是 社保信息必填
//选择否时,不做限制要求,可填可不填,导入时正常导入填写的字段 //选择否时,不做限制要求,可填可不填,导入时正常导入填写的字段
if (CommonConstants.IS_TRUE.equals(excel.getAutoStatus()) && Common.isEmpty(excel.getSocialAccount())){ if (CommonConstants.IS_TRUE.equals(excel.getAutoStatus())
&&(Common.isEmpty(excel.getSocialAccount())
|| Common.isEmpty(excel.getSocialPassword())) ){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_TWO,excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_TWO,excel));
continue; continue;
} }
//MVP1.7.15 医保是否自动办理,选择是时,医保信息必须填写,否则导入不成功 //MVP1.7.15 医保是否自动办理,选择是时,医保信息必须填写,否则导入不成功
if (CommonConstants.IS_TRUE.equals(excel.getAutoStatusYsd()) && Common.isEmpty(excel.getMediclAccount())){ if (CommonConstants.IS_TRUE.equals(excel.getAutoStatusYsd())
&& (Common.isEmpty(excel.getMediclAccount()) || Common.isEmpty(excel.getMediclPassword())) ){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_TWO_TWO,excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_TWO_TWO,excel));
continue; continue;
} }
...@@ -940,7 +943,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -940,7 +943,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
household.setDataFlagYgs(excel.getDataFlagYgs().equals(CommonConstants.IS_TRUE) ? "1" : "0"); household.setDataFlagYgs(excel.getDataFlagYgs().equals(CommonConstants.IS_TRUE) ? "1" : "0");
} }
if (Common.isNotNull(excel.getIsSingle())){ if (Common.isNotNull(excel.getIsSingle())){
household.setIsSingle(excel.getIsSingle()); household.setIsSingle(excel.getIsSingle().equals(HouseConfigConstants.IS_SINGLE_NO) ? "0" : "1");
} }
if (Common.isNotNull(excel.getRosterAutoFlagYsd())){ if (Common.isNotNull(excel.getRosterAutoFlagYsd())){
household.setRosterAutoFlagYsd(excel.getRosterAutoFlagYsd().equals(CommonConstants.IS_TRUE) ? "1" : "0"); household.setRosterAutoFlagYsd(excel.getRosterAutoFlagYsd().equals(CommonConstants.IS_TRUE) ? "1" : "0");
...@@ -949,7 +952,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -949,7 +952,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
household.setDataFlagYsd(excel.getDataFlagYsd().equals(CommonConstants.IS_TRUE) ? "1" : "0"); household.setDataFlagYsd(excel.getDataFlagYsd().equals(CommonConstants.IS_TRUE) ? "1" : "0");
} }
if (Common.isNotNull(excel.getIsSingleYsd())){ if (Common.isNotNull(excel.getIsSingleYsd())){
household.setIsSingleYsd(excel.getIsSingleYsd()); household.setIsSingleYsd(excel.getIsSingleYsd().equals(HouseConfigConstants.IS_SINGLE_NO) ? "0" : "1");
} }
household.setOrganId(dicMap.get(household.getOrganName())); household.setOrganId(dicMap.get(household.getOrganName()));
...@@ -1014,6 +1017,10 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -1014,6 +1017,10 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
.eq(SysHouseHoldInfo::getType,CommonConstants.ZERO_STRING) .eq(SysHouseHoldInfo::getType,CommonConstants.ZERO_STRING)
.eq(SysHouseHoldInfo::getName,excel.getName()) .eq(SysHouseHoldInfo::getName,excel.getName())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(info)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_NOT_EXIT,excel));
continue;
}
if (Common.isNotNull(excel.getProvince()) && Common.isNotNull(excel.getCity())) { if (Common.isNotNull(excel.getProvince()) && Common.isNotNull(excel.getCity())) {
info.setProvince(excel.getProvince()); info.setProvince(excel.getProvince());
info.setCity(excel.getCity()); info.setCity(excel.getCity());
...@@ -1033,10 +1040,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -1033,10 +1040,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if (Common.isNotNull(excel.getTown())) { if (Common.isNotNull(excel.getTown())) {
excel.setTown(areaMap.get(excel.getTown()).getAreaName()); excel.setTown(areaMap.get(excel.getTown()).getAreaName());
} }
if (Common.isEmpty(info)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_NOT_EXIT,excel));
continue;
}
if (Common.isNotNull(excel.getOrganName())) { if (Common.isNotNull(excel.getOrganName())) {
excel.setOrganName(excel.getOrganName().replace(" ","")); excel.setOrganName(excel.getOrganName().replace(" ",""));
if (Common.isNotNull(dicMap) && Common.isEmpty(dicMap.get(excel.getOrganName()))) { if (Common.isNotNull(dicMap) && Common.isEmpty(dicMap.get(excel.getOrganName()))) {
...@@ -1086,14 +1090,14 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -1086,14 +1090,14 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
//判断推送类型是否准确 //判断推送类型是否准确
if (Common.isNotNull(excel.getIsSingle()) if (Common.isNotNull(excel.getIsSingle())
&& !CommonConstants.ZERO_STRING.equals(excel.getIsSingle()) && !HouseConfigConstants.IS_SINGLE_NO.equals(excel.getIsSingle())
&& !CommonConstants.ONE_STRING.equals(excel.getIsSingle())) { && !HouseConfigConstants.IS_SINGLE_YES.equals(excel.getIsSingle())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE,excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE,excel));
continue; continue;
} }
if (Common.isNotNull(excel.getIsSingleYsd()) if (Common.isNotNull(excel.getIsSingleYsd())
&& !CommonConstants.ZERO_STRING.equals(excel.getIsSingleYsd()) && !HouseConfigConstants.IS_SINGLE_NO.equals(excel.getIsSingleYsd())
&& !CommonConstants.ONE_STRING.equals(excel.getIsSingleYsd())) { && !HouseConfigConstants.IS_SINGLE_YES.equals(excel.getIsSingleYsd())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE_TWO,excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), HouseConfigConstants.ERROR_TEMPLATE_NINE_TWO,excel));
continue; continue;
} }
...@@ -1269,10 +1273,10 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -1269,10 +1273,10 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
info.setAutoStatusYsd(excel.getAutoStatusYsd().equals(CommonConstants.IS_TRUE) ? "0" : "1"); info.setAutoStatusYsd(excel.getAutoStatusYsd().equals(CommonConstants.IS_TRUE) ? "0" : "1");
} }
if (Common.isNotNull(excel.getIsSingle())) { if (Common.isNotNull(excel.getIsSingle())) {
info.setIsSingle(excel.getIsSingle()); info.setIsSingle(excel.getIsSingle().equals(HouseConfigConstants.IS_SINGLE_NO) ? "0" : "1");
} }
if (Common.isNotNull(excel.getIsSingleYsd())) { if (Common.isNotNull(excel.getIsSingleYsd())) {
info.setIsSingleYsd(excel.getIsSingleYsd()); info.setIsSingleYsd(excel.getIsSingleYsd().equals(HouseConfigConstants.IS_SINGLE_NO) ? "0" : "1");
} }
if (Common.isNotNull(excel.getRosterAutoFlagYgs())) { if (Common.isNotNull(excel.getRosterAutoFlagYgs())) {
info.setRosterAutoFlagYgs(excel.getRosterAutoFlagYgs().equals(CommonConstants.IS_TRUE) ? "1" : "0"); info.setRosterAutoFlagYgs(excel.getRosterAutoFlagYgs().equals(CommonConstants.IS_TRUE) ? "1" : "0");
......
...@@ -3972,16 +3972,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3972,16 +3972,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(dis.getSocialProvince()) && provinceId.equals(dis.getSocialProvince()) if (Common.isNotNull(dis.getSocialProvince()) && provinceId.equals(dis.getSocialProvince())
&& set != null && Common.isNotNull(set.getType()) && set.getType() == 1) { && set != null && Common.isNotNull(set.getType()) && set.getType() == 1) {
isFriend = true; isFriend = true;
} // 单个与批量审核,都推送,但是会过滤户里配置单个的
if (!isFriend || CommonConstants.ONE_STRING.equals(isSingleAudit)) { friendIdList.add(dis.getId());
// 当前默认 安徽省 ,且开关是税友的,才可以税友推送办理 } else {
if (isFriend) { soldierIdList.add(dis.getId());
// 断开派单单条推送税友
// 单个审核接口并且户类型为单个,即时推送税友
friendIdList.add(dis.getId());
} else {
soldierIdList.add(dis.getId());
}
} }
} }
......
...@@ -218,6 +218,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -218,6 +218,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 同一个户才一批次推送,因为账号密码不一样 ,不同户,则先推送一批 // 同一个户才一批次推送,因为账号密码不一样 ,不同户,则先推送一批
boolean nextFlag = false; boolean nextFlag = false;
SociaFriendYgsAddVo vo; SociaFriendYgsAddVo vo;
String bizNo;
int i=1; int i=1;
TSocialFriendReduceSet reduceSet; TSocialFriendReduceSet reduceSet;
// 是否为单个推送(派单审核时定性的) // 是否为单个推送(派单审核时定性的)
...@@ -315,13 +316,16 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -315,13 +316,16 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
i=0; i=0;
nextFlag = false; nextFlag = false;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList); // 针对部分传参bizNo却无requestId返回的情况,需要改进代码:
bizNo = vo.getSocialId() + type + thisTime;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, bizNo, backLogList, tSocialFriendBackLogService);
ygsHandleStatus = CommonConstants.TWO_STRING; ygsHandleStatus = CommonConstants.TWO_STRING;
remark = "已推送提交任务!"; remark = "已推送提交任务!";
if (Common.isEmpty(requestId)) { if (Common.isEmpty(requestId)) {
requestId = "推送税友失败"; requestId = "推送税友未返回,请联系管理员bizNo="+bizNo;
ygsHandleStatus = CommonConstants.FIVE_STRING; ygsHandleStatus = CommonConstants.FIVE_STRING;
remark = "推送税友失败,转人工处理!"; remark = "推送税友未返回,转人工处理!请联系管理员bizNo="+bizNo;
} }
for (TSocialInfo s : socialInfoTemp) { for (TSocialInfo s : socialInfoTemp) {
s.setYgsRequestId(requestId); s.setYgsRequestId(requestId);
...@@ -506,6 +510,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -506,6 +510,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 同一个户才一批次推送,因为账号密码不一样 ,不同户,则先推送一批 // 同一个户才一批次推送,因为账号密码不一样 ,不同户,则先推送一批
boolean nextFlag = false; boolean nextFlag = false;
SociaFriendYgsAddVo vo; SociaFriendYgsAddVo vo;
String bizNo;
int i=1; int i=1;
TSocialFriendReduceSet reduceSet; TSocialFriendReduceSet reduceSet;
// 是否为生成解除劳动合同书 且是 派减 // 是否为生成解除劳动合同书 且是 派减
...@@ -614,13 +619,15 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -614,13 +619,15 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
} }
i=0; i=0;
nextFlag = false; nextFlag = false;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList); // 针对部分无requestId返回的情况,优化代码
bizNo = vo.getSocialId() + type + thisTime;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, bizNo, backLogList, tSocialFriendBackLogService);
ysdHandleStatus = CommonConstants.TWO_STRING; ysdHandleStatus = CommonConstants.TWO_STRING;
remark = "已推送提交任务!"; remark = "已推送提交任务!";
if (Common.isEmpty(requestId)) { if (Common.isEmpty(requestId)) {
requestId = "推送税友失败"; requestId = "推送税友未返回,请联系管理员bizNo="+bizNo;
ysdHandleStatus = CommonConstants.FIVE_STRING; ysdHandleStatus = CommonConstants.FIVE_STRING;
remark = "推送税友失败,转人工处理!"; remark = "推送税友未返回,转人工处理!请联系管理员bizNo="+bizNo;
} }
for (TSocialInfo s : socialInfoTemp) { for (TSocialInfo s : socialInfoTemp) {
s.setYsdRequestId(requestId); s.setYsdRequestId(requestId);
...@@ -1042,7 +1049,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -1042,7 +1049,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
TSocialFriendBackLog backLog = new TSocialFriendBackLog(); TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setType(CommonConstants.SEVEN_INT); backLog.setType(CommonConstants.SEVEN_INT);
backLog.setSocialId(searchVo.getSocialId()); backLog.setSocialId(searchVo.getSocialId());
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog); R<String> ulrR = excelToImage.excelToImg(searchVo.getSocialId(), ossUtil, tSocialFriendBackLogService
, inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog); tSocialFriendBackLogService.save(backLog);
return ulrR; return ulrR;
} catch (Exception e) { } catch (Exception e) {
...@@ -1313,9 +1321,9 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -1313,9 +1321,9 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog.setSocialId(vo.getSocialId()); backLog.setSocialId(vo.getSocialId());
backLog.setType(CommonConstants.SIX_INT); backLog.setType(CommonConstants.SIX_INT);
backLog.setCreateTime(LocalDateTime.now()); backLog.setCreateTime(LocalDateTime.now());
// 上传花名册到阿里云
this.uploadHuaMingCeToOss(vo, fileName, inputStreamOut); R<String> ulrR = excelToImage.excelToImg(vo.getSocialId(), ossUtil, tSocialFriendBackLogService
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog); , inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog); tSocialFriendBackLogService.save(backLog);
return ulrR; return ulrR;
} catch (Exception e) { } catch (Exception e) {
...@@ -1335,35 +1343,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -1335,35 +1343,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
} }
} }
/**
* @param vo
* @param fileName
* @param inputStreamOut
* @Description: 上传花名册到阿里云
* @Author: hgw
* @Date: 2025/9/12 14:18
* @return: void
**/
private void uploadHuaMingCeToOss(SociaFriendYgsAddVo vo, String fileName, FileInputStream inputStreamOut) {
try {
String key = "socialFriend/" + vo.getSocialId() + "/" + System.currentTimeMillis() + fileName;
ossUtil.uploadFileByStream(inputStreamOut, key, null);
TSocialFriendBackLog backLogFile = new TSocialFriendBackLog();
backLogFile.setSocialId(vo.getSocialId());
backLogFile.setType(19);
backLogFile.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(key)) {
URL fileUrl = ossUtil.getObjectUrl(null, key);
if (Common.isNotNull(fileUrl)) {
key += fileUrl.toString();
}
}
backLogFile.setLogInfo(key);
tSocialFriendBackLogService.save(backLogFile);
} catch (Exception e) {
log.info("花名册上传到阿里云失败,查看文件使用,没有找税友要也行");
}
}
/** /**
* 填充主表数据 * 填充主表数据
...@@ -1777,7 +1757,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -1777,7 +1757,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog.setSocialId(searchVo.getSocialId()); backLog.setSocialId(searchVo.getSocialId());
backLog.setType(CommonConstants.SIX_INT); backLog.setType(CommonConstants.SIX_INT);
backLog.setCreateTime(LocalDateTime.now()); backLog.setCreateTime(LocalDateTime.now());
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog); R<String> ulrR = excelToImage.excelToImg(searchVo.getSocialId(), ossUtil, tSocialFriendBackLogService
, inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog); tSocialFriendBackLogService.save(backLog);
return ulrR; return ulrR;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -455,7 +455,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -455,7 +455,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
for (Map.Entry<String, FailReasonConfig> config : errorMap.entrySet()) { for (Map.Entry<String, FailReasonConfig> config : errorMap.entrySet()) {
if (config.getKey().contains(CommonConstants.HU_CORE) if (config.getKey().contains(CommonConstants.HU_CORE)
&& huId.equals(config.getKey().split(CommonConstants.HU_CORE)[0]) && huId.equals(config.getKey().split(CommonConstants.HU_CORE)[0])
&& msg.contains(config.getKey())) { && msg.contains(config.getKey().split(CommonConstants.HU_CORE)[1])) {
configTemp = config.getValue(); configTemp = config.getValue();
break; break;
} }
......
...@@ -9,16 +9,20 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil; ...@@ -9,16 +9,20 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
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.social.config.SocialFriendConfig; import com.yifu.cloud.plus.v1.yifu.social.config.SocialFriendConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendBackLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
import java.nio.file.Files; import java.nio.file.Files;
import java.time.LocalDateTime;
import java.util.Base64; import java.util.Base64;
/** /**
...@@ -40,7 +44,8 @@ public class ExcelToImage { ...@@ -40,7 +44,8 @@ public class ExcelToImage {
private final static String toImagOSSError = ":ExcelToImage上传OSS异常"; private final static String toImagOSSError = ":ExcelToImage上传OSS异常";
public R<String> excelToImg(InputStream inputStream , SocialFriendConfig socialFriendConfig public R<String> excelToImg(String socialId, OSSUtil ossUtil, TSocialFriendBackLogService tSocialFriendBackLogService
,InputStream inputStream , SocialFriendConfig socialFriendConfig
, RestTemplate restTemplate, TSocialFriendBackLog backLog){ , RestTemplate restTemplate, TSocialFriendBackLog backLog){
backLog.setLogInfo("开始转换excel为图片"); backLog.setLogInfo("开始转换excel为图片");
if (null == inputStream || null == socialFriendConfig){ if (null == inputStream || null == socialFriendConfig){
...@@ -72,6 +77,8 @@ public class ExcelToImage { ...@@ -72,6 +77,8 @@ public class ExcelToImage {
if (Common.isEmpty(url)){ if (Common.isEmpty(url)){
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagOSSError); return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagOSSError);
} }
// 上传花名册到阿里云
this.uploadHuaMingCeToOss(ossUtil, tSocialFriendBackLogService, socialId, file.getName(), file);
return R.ok(url); return R.ok(url);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -91,6 +98,38 @@ public class ExcelToImage { ...@@ -91,6 +98,38 @@ public class ExcelToImage {
} }
return R.failed(CommonConstants.RESULT_DATA_FAIL); return R.failed(CommonConstants.RESULT_DATA_FAIL);
} }
/**
* @param socialId
* @param fileName
* @param file
* @Description: 上传花名册到阿里云
* @Author: hgw
* @Date: 2025/9/12 14:18
* @return: void
**/
private void uploadHuaMingCeToOss(OSSUtil ossUtil, TSocialFriendBackLogService tSocialFriendBackLogService
, String socialId, String fileName, File file) {
try {
String key = "socialFriend/" + socialId + "/" + System.currentTimeMillis() + fileName;
ossUtil.uploadFileByFile(file, key, null);
TSocialFriendBackLog backLogFile = new TSocialFriendBackLog();
backLogFile.setSocialId(socialId);
backLogFile.setType(19);
backLogFile.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(key)) {
URL fileUrl = ossUtil.getObjectUrl(null, key);
if (Common.isNotNull(fileUrl)) {
key += fileUrl.toString();
}
}
backLogFile.setLogInfo(key);
tSocialFriendBackLogService.save(backLogFile);
} catch (Exception e) {
// log.info("花名册上传到阿里云失败,查看文件使用,没有找税友要也行")
}
}
//压缩文件到指定大小 //压缩文件到指定大小
private File compressImage(File originalFile, String projectRoot) throws IOException { private File compressImage(File originalFile, String projectRoot) throws IOException {
BufferedImage image = ImageIO.read(originalFile); BufferedImage image = ImageIO.read(originalFile);
......
...@@ -175,6 +175,9 @@ ...@@ -175,6 +175,9 @@
<if test="sysHouseHoldInfo.autoStatus != null and sysHouseHoldInfo.autoStatus.trim() != ''"> <if test="sysHouseHoldInfo.autoStatus != null and sysHouseHoldInfo.autoStatus.trim() != ''">
AND a.AUTO_STATUS = #{sysHouseHoldInfo.autoStatus} AND a.AUTO_STATUS = #{sysHouseHoldInfo.autoStatus}
</if> </if>
<if test="sysHouseHoldInfo.autoStatusYsd != null and sysHouseHoldInfo.autoStatusYsd.trim() != ''">
AND a.AUTO_STATUS_YSD = #{sysHouseHoldInfo.autoStatusYsd}
</if>
<if test="sysHouseHoldInfo.updateTime != null"> <if test="sysHouseHoldInfo.updateTime != null">
AND a.UPDATE_TIME = #{sysHouseHoldInfo.updateTime} AND a.UPDATE_TIME = #{sysHouseHoldInfo.updateTime}
</if> </if>
...@@ -270,7 +273,7 @@ ...@@ -270,7 +273,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
,AREA_CODE ,AREA_CODE
FROM sys_house_hold_info a FROM sys_house_hold_info a
where a.AUTO_STATUS = '0' where a.AUTO_STATUS = '0' or a.AUTO_STATUS_YSD = '0'
</select> </select>
</mapper> </mapper>
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
<result property="graduationTime" column="GRADUATION_TIME"/> <result property="graduationTime" column="GRADUATION_TIME"/>
<result property="autoFlag" column="AUTO_FLAG"/> <result property="autoFlag" column="AUTO_FLAG"/>
<result property="autoFlagYsd" column="AUTO_FLAG_YSD"/>
<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/> <result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
<result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/> <result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/>
...@@ -482,6 +483,9 @@ ...@@ -482,6 +483,9 @@
<if test="tDispatchInfo.autoFlag != null and tDispatchInfo.autoFlag.trim() != ''"> <if test="tDispatchInfo.autoFlag != null and tDispatchInfo.autoFlag.trim() != ''">
AND a.AUTO_FLAG = #{tDispatchInfo.autoFlag} AND a.AUTO_FLAG = #{tDispatchInfo.autoFlag}
</if> </if>
<if test="tDispatchInfo.autoFlagYsd != null and tDispatchInfo.autoFlagYsd.trim() != ''">
AND a.AUTO_FLAG_YSD = #{tDispatchInfo.autoFlagYsd}
</if>
<if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''"> <if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''">
AND a.ID = #{tDispatchInfo.id} AND a.ID = #{tDispatchInfo.id}
</if> </if>
...@@ -1000,7 +1004,10 @@ ...@@ -1000,7 +1004,10 @@
a.GRADUATION_TIME, a.GRADUATION_TIME,
case when a.AUTO_FLAG = 0 then "是" case when a.AUTO_FLAG = 0 then "是"
when a.AUTO_FLAG = 1 then "否" when a.AUTO_FLAG = 1 then "否"
else "无" end as "AUTO_FLAG" else "无" end as "AUTO_FLAG",
case when a.AUTO_FLAG_YSD = 0 then "是"
when a.AUTO_FLAG_YSD = 1 then "否"
else "无" end as "AUTO_FLAG_YSD"
from t_dispatch_info a from t_dispatch_info a
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
...@@ -1618,15 +1625,22 @@ ...@@ -1618,15 +1625,22 @@
a.SCHOOL_NAME, a.SCHOOL_NAME,
a.MAJOR, a.MAJOR,
a.FIRST_PAY_TIME, a.FIRST_PAY_TIME,
a.GRADUATION_TIME,a.AUTO_FLAG a.GRADUATION_TIME
,a.SOCIAL_HOUSEHOLD_NAME,s.YGS_HANDLE_STATUS,s.YSD_HANDLE_STATUS ,a.SOCIAL_HOUSEHOLD_NAME,s.YGS_HANDLE_STATUS,s.YSD_HANDLE_STATUS
,s.YGS_REMARK,s.YSD_REMARK,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD ,s.YGS_REMARK,s.YSD_REMARK,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD
,s.YGS_REQUEST_ID,s.YSD_REQUEST_ID ,s.YGS_REQUEST_ID,s.YSD_REQUEST_ID
,if(a.type ='0',YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT ,if(a.type ='0',YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT ,if(a.type ='0',YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT
,a.BACK_FILE_FLAG ,a.BACK_FILE_FLAG
,a.IS_SINGLE
,a.IS_AUTO_LEAVE_DOC ,SUBSTRING_INDEX(GROUP_CONCAT(a.AUTO_FLAG ORDER BY a.CREATE_TIME desc),',',1) AUTO_FLAG
,SUBSTRING_INDEX(GROUP_CONCAT(a.AUTO_FLAG_YSD ORDER BY a.CREATE_TIME desc),',',1) AUTO_FLAG_YSD
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_SINGLE ORDER BY a.CREATE_TIME desc),',',1) IS_SINGLE
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_SINGLE_YSD ORDER BY a.CREATE_TIME desc),',',1) IS_SINGLE_YSD
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_AUTO_LEAVE_DOC ORDER BY a.CREATE_TIME desc),',',1) IS_AUTO_LEAVE_DOC
,SUBSTRING_INDEX(GROUP_CONCAT(a.ROSTER_AUTO_FLAG_YGS ORDER BY a.CREATE_TIME desc),',',1) ROSTER_AUTO_FLAG_YGS
,SUBSTRING_INDEX(GROUP_CONCAT(a.ROSTER_AUTO_FLAG_YSD ORDER BY a.CREATE_TIME desc),',',1) ROSTER_AUTO_FLAG_YSD
FROM t_dispatch_info a FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
...@@ -1715,7 +1729,7 @@ ...@@ -1715,7 +1729,7 @@
a.SCHOOL_NAME, a.SCHOOL_NAME,
a.MAJOR, a.MAJOR,
a.FIRST_PAY_TIME, a.FIRST_PAY_TIME,
a.GRADUATION_TIME,a.AUTO_FLAG a.GRADUATION_TIME,a.AUTO_FLAG,a.AUTO_FLAG_YSD
,a.SOCIAL_HOUSEHOLD_NAME ,a.SOCIAL_HOUSEHOLD_NAME
,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD ,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD
,if(a.type ='0' and s.add_ygs_Handle_Status != '0', s.add_ygs_Handle_Status, s.ygs_Handle_Status) ygs_Handle_Status ,if(a.type ='0' and s.add_ygs_Handle_Status != '0', s.add_ygs_Handle_Status, s.ygs_Handle_Status) ygs_Handle_Status
...@@ -2127,7 +2141,7 @@ ...@@ -2127,7 +2141,7 @@
AND a.STATUS = "2" AND a.STATUS = "2"
and (( a.type = '0' AND (s.HANDLE_STATUS = "0" or s.HANDLE_STATUS = "4") ) or ( a.type ='1' AND (if(ifnull(h.id,0) != '0',h.HANDLE_STATUS,s.HANDLE_STATUS) in ('1','5','6','3','7') or (s.HANDLE_STATUS in ('1','5','6','3','7') and s.REDUCE_CAN = '1')) )) and (( a.type = '0' AND (s.HANDLE_STATUS = "0" or s.HANDLE_STATUS = "4") ) or ( a.type ='1' AND (if(ifnull(h.id,0) != '0',h.HANDLE_STATUS,s.HANDLE_STATUS) in ('1','5','6','3','7') or (s.HANDLE_STATUS in ('1','5','6','3','7') and s.REDUCE_CAN = '1')) ))
and a.SOCIAL_HANDLE_STATUS in ('0','4') and a.SOCIAL_HANDLE_STATUS in ('0','4')
and (a.auto_flag='1' or s.YGS_HANDLE_STATUS ='5' or s.YSD_HANDLE_STATUS = '5' ) and (a.auto_flag='1' or a.auto_flag_ysd='1' or s.YGS_HANDLE_STATUS ='5' or s.YSD_HANDLE_STATUS = '5' )
<!--<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''"> <!--<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
/*待办理组合判断*/ /*待办理组合判断*/
...@@ -2158,7 +2172,7 @@ ...@@ -2158,7 +2172,7 @@
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
AND a.social_id is not null AND a.social_id is not null
and a.AUTO_FLAG = '0' and (a.AUTO_FLAG = '0' or a.AUTO_FLAG_YSD = '0')
<include refid="where_getSocialRecordRoster_base"/> <include refid="where_getSocialRecordRoster_base"/>
<if test="tDispatchInfo != null"> <if test="tDispatchInfo != null">
...@@ -2821,7 +2835,7 @@ ...@@ -2821,7 +2835,7 @@
</select> </select>
<select id="getAutoFlag" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.AutoFlagVo"> <select id="getAutoFlag" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.AutoFlagVo">
select a.id as 'dispatchId', select a.id as 'dispatchId',
b.AUTO_STATUS as 'autoFlag', b.AUTO_STATUS as 'autoFlagYgs',
b.AUTO_STATUS_YSD as 'autoFlagYsd', b.AUTO_STATUS_YSD as 'autoFlagYsd',
b.IS_SINGLE as 'isSingleYgs', b.IS_SINGLE as 'isSingleYgs',
b.IS_SINGLE_YSD as 'isSingleYsd', b.IS_SINGLE_YSD as 'isSingleYsd',
...@@ -2865,7 +2879,7 @@ ...@@ -2865,7 +2879,7 @@
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
AND a.social_id is not null AND a.social_id is not null
and a.AUTO_FLAG = '0' and (a.AUTO_FLAG = '0' or a.AUTO_FLAG_YSD = '0')
and a.type = '0' and a.type = '0'
<!-- 税友反馈接口目前只支持社保附件下载,必须是办理成功的 --> <!-- 税友反馈接口目前只支持社保附件下载,必须是办理成功的 -->
and s.ygs_Handle_Status = '6' and s.ygs_Handle_Status = '6'
......
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
LEFT JOIN sys_house_hold_info h on h.id=s.SOCIAL_HOUSEHOLD LEFT JOIN sys_house_hold_info h on h.id=s.SOCIAL_HOUSEHOLD
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m') where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m') and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and h.DEL_FLAG='0' and h.TYPE = '0' and h.AUTO_STATUS = '0' and h.DEL_FLAG='0' and h.TYPE = '0' and (h.AUTO_STATUS = '0' or h.AUTO_STATUS_YSD = '0')
GROUP BY s.EMP_IDCARD GROUP BY s.EMP_IDCARD
</select> </select>
<!-- 工资调整 --> <!-- 工资调整 -->
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m') where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0'
and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y12') and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y12')
and h.DEL_FLAG='0' and h.TYPE = '0' and h.AUTO_STATUS = '0' and h.DEL_FLAG='0' and h.TYPE = '0' and (h.AUTO_STATUS = '0' or h.AUTO_STATUS_YSD = '0')
GROUP BY s.EMP_IDCARD GROUP BY s.EMP_IDCARD
</select> </select>
...@@ -320,14 +320,14 @@ ...@@ -320,14 +320,14 @@
'' companyNo ,s.NAME companyName,'' isPrint,'' createMonth,'是' isDownLoad,'否' danDuoSheet '' companyNo ,s.NAME companyName,'' isPrint,'' createMonth,'是' isDownLoad,'否' danDuoSheet
,'否' danDanSheet,'是' duoDanSheet,'' startDate,'' endDate,'' isSalary,'' returnInfo ,'否' danDanSheet,'是' duoDanSheet,'' startDate,'' endDate,'' isSalary,'' returnInfo
from sys_house_hold_info s from sys_house_hold_info s
where s.DEL_FLAG='0' and s.TYPE = '0' and s.AUTO_STATUS = '0' where s.DEL_FLAG='0' and s.TYPE = '0' and (s.AUTO_STATUS = '0' or s.AUTO_STATUS_YSD = '0')
</select> </select>
<!-- 社保士兵实缴3张表查询2_合肥-社保-人员缴费明细打印 --> <!-- 社保士兵实缴3张表查询2_合肥-社保-人员缴费明细打印 -->
<select id="getSoldierPaymentSelectTwoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectTwoVo"> <select id="getSoldierPaymentSelectTwoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectTwoVo">
select select
s.NAME companyName,'' paymentType,'' payMonth,'' returnInfo ,'' returnInfoOne ,'' returnInfoTwo s.NAME companyName,'' paymentType,'' payMonth,'' returnInfo ,'' returnInfoOne ,'' returnInfoTwo
from sys_house_hold_info s from sys_house_hold_info s
where s.DEL_FLAG='0' and s.TYPE = '0' and s.AUTO_STATUS = '0' where s.DEL_FLAG='0' and s.TYPE = '0' and (s.AUTO_STATUS = '0' or s.AUTO_STATUS_YSD = '0')
</select> </select>
<!-- 社保士兵实缴3张表查询3_合肥-医保-单位缴费明细查询 --> <!-- 社保士兵实缴3张表查询3_合肥-医保-单位缴费明细查询 -->
<select id="getSoldierPaymentSelectThreeList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectThreeVo"> <select id="getSoldierPaymentSelectThreeList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectThreeVo">
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
,'' returnInfoOne ,'' returnInfoOne
,'' returnInfoTwo ,'' returnInfoTwo
from sys_house_hold_info s from sys_house_hold_info s
where s.DEL_FLAG='0' and s.TYPE = '0' and s.AUTO_STATUS = '0' where s.DEL_FLAG='0' and s.TYPE = '0' and (s.AUTO_STATUS = '0' or s.AUTO_STATUS_YSD = '0')
</select> </select>
......
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