|
|
@ -1,67 +1,43 @@
|
|
|
|
package com.glxp.api.service.sync;
|
|
|
|
package com.glxp.api.service.sync;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.glxp.api.dao.basic.*;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.inout.*;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.purchase.*;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.BasicProductsEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.ProductInfoEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.UdiCompanyEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.purchase.SupManufacturerEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.res.sync.*;
|
|
|
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.TransactionIsolationLevel;
|
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.constant.BasicProcessStatus;
|
|
|
|
import com.glxp.api.constant.BasicProcessStatus;
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.basic.*;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.purchase.*;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.ProductInfoEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.UdiCompanyEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
|
|
|
|
import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
|
|
|
|
import com.glxp.api.entity.sync.BasicExportStatusEntity;
|
|
|
|
import com.glxp.api.entity.sync.BasicExportStatusEntity;
|
|
|
|
import com.glxp.api.entity.sync.BasicExportStatusTimeEntity;
|
|
|
|
import com.glxp.api.entity.sync.BasicExportStatusTimeEntity;
|
|
|
|
import com.glxp.api.http.sync.SpGetHttpClient;
|
|
|
|
import com.glxp.api.http.sync.SpGetHttpClient;
|
|
|
|
import com.glxp.api.req.sync.SpsSyncDataRequest;
|
|
|
|
import com.glxp.api.req.sync.SpsSyncDataRequest;
|
|
|
|
import com.glxp.api.res.sync.*;
|
|
|
|
import com.glxp.api.res.sync.*;
|
|
|
|
import com.glxp.api.service.basic.BasicHospTypeService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.TransactionIsolationLevel;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
@ -770,6 +746,30 @@ public class HeartService {
|
|
|
|
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_SYS_SETTING);
|
|
|
|
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_SYS_SETTING);
|
|
|
|
spsSyncSysSettingResponse.setTaskId(basicExportStatusEntity1.getId());
|
|
|
|
spsSyncSysSettingResponse.setTaskId(basicExportStatusEntity1.getId());
|
|
|
|
BaseResponse<String> baseResponse = spGetHttp.postSysSetting(spsSyncSysSettingResponse);
|
|
|
|
BaseResponse<String> baseResponse = spGetHttp.postSysSetting(spsSyncSysSettingResponse);
|
|
|
|
|
|
|
|
//若模板记录不为空,则将模板文件同步过去
|
|
|
|
|
|
|
|
String uploadFileLog = "";
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getSystemPDFTemplateEntities())) {
|
|
|
|
|
|
|
|
List<Map<String, String>> list = new ArrayList<>(spsSyncSysSettingResponse.getSystemPDFTemplateEntities().size() * 2);
|
|
|
|
|
|
|
|
spsSyncSysSettingResponse.getSystemPDFTemplateEntities().forEach(systemPDFTemplateEntity -> {
|
|
|
|
|
|
|
|
//分切文件并封装参数
|
|
|
|
|
|
|
|
Map<String, String> pathFileMap = new HashMap<>(1);
|
|
|
|
|
|
|
|
pathFileMap.put("fileName", StrUtil.split(systemPDFTemplateEntity.getPath(), "template/").get(1));
|
|
|
|
|
|
|
|
list.add(pathFileMap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> jrxmlPathFileMap = new HashMap<>(1);
|
|
|
|
|
|
|
|
jrxmlPathFileMap.put("fileName", StrUtil.split(systemPDFTemplateEntity.getJrxmlPath(), "template/").get(1));
|
|
|
|
|
|
|
|
list.add(jrxmlPathFileMap);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseResponse<String> response = spGetHttp.postTemplateFile(list);
|
|
|
|
|
|
|
|
if (response.getCode() == 20000) {
|
|
|
|
|
|
|
|
log.info("模板文件列表上传成功");
|
|
|
|
|
|
|
|
uploadFileLog = "\n模板文件列表上传成功";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
log.info("模板文件上传失败,响应信息:{}", response.getMessage());
|
|
|
|
|
|
|
|
uploadFileLog = "\n模板文件列表上传失败,错误信息:" + response.getMessage();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
basicExportStatusEntity1.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
|
|
|
|
basicExportStatusEntity1.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -778,7 +778,7 @@ public class HeartService {
|
|
|
|
basicExportStatusEntity1.setEndTime(new Date());
|
|
|
|
basicExportStatusEntity1.setEndTime(new Date());
|
|
|
|
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
|
|
|
|
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
|
|
|
|
|
|
|
|
|
|
|
|
basicExportStatusEntity1.setRemark(spsSyncSysSettingResponse.logs());
|
|
|
|
basicExportStatusEntity1.setRemark(spsSyncSysSettingResponse.logs() + uploadFileLog);
|
|
|
|
basicExportStatusEntity1.setUpdateTime(new Date());
|
|
|
|
basicExportStatusEntity1.setUpdateTime(new Date());
|
|
|
|
basicExportService.updateExportStatus(basicExportStatusEntity1);
|
|
|
|
basicExportService.updateExportStatus(basicExportStatusEntity1);
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|