新疆部署初始版本
This commit is contained in:
parent
a848710e08
commit
f46d421a1c
|
|
@ -2,6 +2,7 @@ package com.syjiaer.clinic.server.common.util;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -10,7 +11,8 @@ import java.util.stream.Stream;
|
|||
public class DateUtil {
|
||||
public static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static final DateTimeFormatter INPUT_FORMATTER = DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
|
||||
private static final DateTimeFormatter OUTPUT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
public LocalDateTime now() {
|
||||
return LocalDateTime.now();
|
||||
}
|
||||
|
|
@ -76,4 +78,14 @@ public class DateUtil {
|
|||
return Stream.iterate(startDate, date -> date.plusDays(1))
|
||||
.limit(java.time.temporal.ChronoUnit.DAYS.between(startDate, endDate) + 1).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化 EEE MMM dd HH:mm:ss z yyyy 到 yyyy-MM-dd HH:mm:ss
|
||||
* @param dateStr
|
||||
* @return
|
||||
*/
|
||||
public static String parseAndFormatDate(String dateStr) {
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateStr, INPUT_FORMATTER);
|
||||
return zonedDateTime.format(OUTPUT_FORMATTER);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.syjiaer.clinic.server.common.exception.MessageException;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
|
@ -16,8 +17,10 @@ import java.util.zip.ZipOutputStream;
|
|||
@Component
|
||||
public class FileUtil {
|
||||
public List<String> unzip(String path, String filename) {
|
||||
List<String> file_list = new ArrayList<String>();
|
||||
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(path + "/" + filename))) {
|
||||
List<String> file_list = new ArrayList<>();
|
||||
try (InputStream is = new FileInputStream(path + "/" + filename);
|
||||
ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(is), Charset.forName("UTF-8"))) { // 强制指定编码为 UTF-8
|
||||
|
||||
byte[] buffer = new byte[4096];
|
||||
ZipEntry zipEntry;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class HttpUtil {
|
|||
BufferedReader reader = null;
|
||||
String tempLine = null;
|
||||
|
||||
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "GBK"));
|
||||
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
while ((tempLine = reader.readLine()) != null) {
|
||||
resultBuffer.append(tempLine);
|
||||
}
|
||||
|
|
@ -79,9 +79,7 @@ public class HttpUtil {
|
|||
}
|
||||
logger.info("调用医保请求出参==》" + result);
|
||||
JSONObject result_json = JSON.parseObject(result);
|
||||
if(result_json==null||result_json.isEmpty()){
|
||||
throw new MessageException("医保接口返回数据异常");
|
||||
}
|
||||
|
||||
if (!result_json.getString("err_msg").equals("成功") &&!result_json.getString("err_msg").equals("success") && !result_json.getString("err_msg").isEmpty()) {
|
||||
throw new MessageException(result_json.getString("err_msg"));
|
||||
}
|
||||
|
|
@ -275,8 +273,8 @@ public class HttpUtil {
|
|||
map.put("msgid", config.get("social", "msgid") + now_str.format(now) + String.valueOf(randomNumber));
|
||||
map.put("infver", "V1.0");
|
||||
map.put("inf_time", now.format(now_str2));
|
||||
map.put("opter", config.get("social", "opter"));
|
||||
map.put("opter_name", config.get("social", "opterName"));
|
||||
map.put("opter",managerUser.getId().toString());
|
||||
map.put("opter_name", managerUser.getName());
|
||||
map.put("opter_type", "1");
|
||||
map.put("fixmedins_code", config.get("social", "fixmedinsCode"));
|
||||
map.put("fixmedins_name", config.get("social", "fixmedinsName"));
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
|
@ -33,6 +34,7 @@ public abstract class BaseService {
|
|||
@Value("${jwt.secret}")
|
||||
protected String jwtSecret;
|
||||
|
||||
protected static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
protected ManagerUser getManagerUser() {
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ public class ChargeService extends BaseService {
|
|||
ChargeOrder order = chargeOrderMapper.selectByCode(changeOrderCode);
|
||||
Diagnosis diagnosis = diagnosisMapper.selectByCode(order.getDiagnosisCode());
|
||||
//预支付只需要卡号
|
||||
String cardNumber = mdtrtCertNo.substring(0, mdtrtCertNo.indexOf("|"));
|
||||
String cardNumber = mdtrtCertNo;
|
||||
PatientRegistration registration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
||||
|
||||
IM2206A im2206A = new IM2206A();
|
||||
|
|
@ -598,15 +598,15 @@ public class ChargeService extends BaseService {
|
|||
data.setPsn_no(registration.getPsnNo());
|
||||
data.setMdtrt_cert_type(mdtrtCertType);
|
||||
data.setMdtrt_cert_no(cardNumber);
|
||||
data.setMed_type("12");
|
||||
data.setMed_type(config.get("social", "medType"));
|
||||
data.setMedfee_sumamt(order.getTotalPrice());
|
||||
data.setPsn_setlway("01");
|
||||
data.setMdtrt_id(registration.getMdtrtId());
|
||||
data.setChrg_bchno(order.getCode());
|
||||
data.setAcct_used_flag("1");
|
||||
data.setInsutype(insutype);
|
||||
IM2206A.ExpContent expContent = new IM2206A.ExpContent();
|
||||
data.setExp_content(expContent);
|
||||
// IM2206A.ExpContent expContent = new IM2206A.ExpContent();
|
||||
// data.setExp_content(expContent);
|
||||
im2206A.setData(data);
|
||||
return socialRequest.call2206A(im2206A);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ import com.syjiaer.clinic.server.common.api.request.SocialRequest;
|
|||
import com.syjiaer.clinic.server.common.util.HttpUtil;
|
||||
import com.syjiaer.clinic.server.entity.social.SocialDirectoryLimit;
|
||||
import com.syjiaer.clinic.server.mapper.social.SocialDirectoryLimitMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -19,6 +22,7 @@ import java.util.logging.Logger;
|
|||
* 目录有效期
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SocialDirectoryLimitService {
|
||||
@Autowired
|
||||
|
|
@ -83,8 +87,15 @@ public class SocialDirectoryLimitService {
|
|||
}
|
||||
|
||||
private JSONObject call(String updt_time, int page_num) {
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(updt_time);
|
||||
|
||||
// 定义目标格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// 格式化输出
|
||||
String formattedDate = zonedDateTime.format(formatter);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("updt_time", updt_time);
|
||||
map.put("updt_time", formattedDate);
|
||||
map.put("page_num", page_num);
|
||||
map.put("page_size", 1000);
|
||||
map.put("vali_flag", "1");
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import com.syjiaer.clinic.server.mapper.social.SocialDirectorySelfMapper;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -83,8 +85,15 @@ public class SocialDirectorySelfService {
|
|||
}
|
||||
|
||||
private JSONObject call(String updt_time, int page_num) {
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(updt_time);
|
||||
|
||||
// 定义目标格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// 格式化输出
|
||||
String formattedDate = zonedDateTime.format(formatter);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("updt_time", updt_time);
|
||||
map.put("updt_time", formattedDate);
|
||||
map.put("page_num", page_num);
|
||||
map.put("page_size", 1000);
|
||||
map.put("vali_flag", "1");
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ public class SocialDirectoryService extends BaseService {
|
|||
if (type == 1302) {
|
||||
flag = line_array[13];
|
||||
socialDirectory.setKeyword(line_array[19]+","+socialDirectory.getProducer()+","+socialDirectory.getName()+","+socialDirectory.getCode());
|
||||
socialDirectory.setCreateDatetime(LocalDateTime.parse(line_array[15], dateTimeFormatter));
|
||||
socialDirectory.setUpdateDatetime(LocalDateTime.parse(line_array[16], dateTimeFormatter));
|
||||
socialDirectory.setCreateDatetime(LocalDateTime.parse(DateUtil.parseAndFormatDate(line_array[15]), dateTimeFormatter));
|
||||
socialDirectory.setUpdateDatetime(LocalDateTime.parse(DateUtil.parseAndFormatDate(line_array[16]), dateTimeFormatter));
|
||||
}
|
||||
if (type == 1306) {
|
||||
flag = line_array[67];
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import com.syjiaer.clinic.server.mapper.social.SocialDirectoryUpinfoMapper;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -83,8 +85,15 @@ public class SocialDirectoryUpinfoService {
|
|||
}
|
||||
|
||||
private JSONObject call(String updt_time, int page_num) {
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(updt_time);
|
||||
|
||||
// 定义目标格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// 格式化输出
|
||||
String formattedDate = zonedDateTime.format(formatter);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("updt_time", updt_time);
|
||||
map.put("updt_time", formattedDate);
|
||||
map.put("page_num", page_num);
|
||||
map.put("page_size", 1000);
|
||||
map.put("vali_flag", "1");
|
||||
|
|
|
|||
Loading…
Reference in New Issue