|
@@ -67,6 +67,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -92,7 +94,7 @@ public class Task {
|
|
|
private IFsFollowService fsFollowService;
|
|
|
@Autowired
|
|
|
private IFsStoreAfterSalesService fsStoreAfterSalesService;
|
|
|
-// @Autowired
|
|
|
+ // @Autowired
|
|
|
// IErpOrderService erpOrderService;
|
|
|
@Autowired
|
|
|
FsIntegralOrderMapper integralOrderMapper;
|
|
@@ -133,7 +135,7 @@ public class Task {
|
|
|
FsPackageOrderServiceImpl packageOrderService;
|
|
|
@Autowired
|
|
|
private IFsStoreOrderLogsService fsStoreOrderLogsService;
|
|
|
- org.slf4j.Logger logger= LoggerFactory.getLogger(getClass());
|
|
|
+ org.slf4j.Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
@Autowired
|
|
|
IFsDoctorService doctorService;
|
|
|
@Autowired
|
|
@@ -185,15 +187,15 @@ public class Task {
|
|
|
public void ConsumerSopTempVoice() {
|
|
|
try {
|
|
|
Long newCompanyUserId = redisCache.popVoiceKey(SOP_TEMP_VOICE_KEY);
|
|
|
- if(newCompanyUserId != null){
|
|
|
- List<QwSopTempVoice> sopTempVoices = redisCache.getVoiceAllList(SOP_TEMP_VOICE_KEY + ":" +newCompanyUserId);
|
|
|
- if(sopTempVoices != null && !sopTempVoices.isEmpty()) {
|
|
|
+ if (newCompanyUserId != null) {
|
|
|
+ List<QwSopTempVoice> sopTempVoices = redisCache.getVoiceAllList(SOP_TEMP_VOICE_KEY + ":" + newCompanyUserId);
|
|
|
+ if (sopTempVoices != null && !sopTempVoices.isEmpty()) {
|
|
|
try {
|
|
|
for (QwSopTempVoice qwSopTempVoice : sopTempVoices) {
|
|
|
try {
|
|
|
AudioVO audioVO = new AudioVO();
|
|
|
List<FastgptChatVoiceHomo> homos = fastgptChatVoiceHomoMapper.selectFastgptChatVoiceHomoList(new FastgptChatVoiceHomo());
|
|
|
- audioVO = AudioUtils.createUserUrlAndUrl(homos,qwSopTempVoice.getCompanyUserId(), qwSopTempVoice.getVoiceTxt());
|
|
|
+ audioVO = AudioUtils.createUserUrlAndUrl(homos, qwSopTempVoice.getCompanyUserId(), qwSopTempVoice.getVoiceTxt());
|
|
|
if (audioVO != null && audioVO.getWavUrl() != null && audioVO.getUrl() != null) {
|
|
|
qwSopTempVoice.setVoiceUrl(audioVO.getUrl());
|
|
|
qwSopTempVoice.setUserVoiceUrl(audioVO.getWavUrl());
|
|
@@ -209,7 +211,7 @@ public class Task {
|
|
|
redisCache.deleteObject(SOP_TEMP_VOICE_KEY + ":" + newCompanyUserId);
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
log.info("没有需要生成的语音");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -281,7 +283,7 @@ public class Task {
|
|
|
FastgptEventLogTotal eventLogTotal = new FastgptEventLogTotal();
|
|
|
eventLogTotal.setId(info.getId());
|
|
|
eventLogTotal.setCount(newCount);
|
|
|
- if(!processedKeys.contains(uniqueKey)) {
|
|
|
+ if (!processedKeys.contains(uniqueKey)) {
|
|
|
toUpdateList.add(eventLogTotal);
|
|
|
// 标记为已处理
|
|
|
processedKeys.add(uniqueKey);
|
|
@@ -289,7 +291,7 @@ public class Task {
|
|
|
}
|
|
|
} else {
|
|
|
total.setStatTime(dateTime);
|
|
|
- if(!processedKeys.contains(uniqueKey)) {
|
|
|
+ if (!processedKeys.contains(uniqueKey)) {
|
|
|
toInsertList.add(total);
|
|
|
// 标记为已处理
|
|
|
processedKeys.add(uniqueKey);
|
|
@@ -392,7 +394,7 @@ public class Task {
|
|
|
FastgptEventLogTotal eventLogTotalNew = new FastgptEventLogTotal();
|
|
|
eventLogTotalNew.setId(info.getId());
|
|
|
eventLogTotalNew.setCount(totalCount);
|
|
|
- if(!processedKeys.contains(uniqueKey)){
|
|
|
+ if (!processedKeys.contains(uniqueKey)) {
|
|
|
toUpdateList.add(eventLogTotalNew);
|
|
|
// 标记为已处理
|
|
|
processedKeys.add(uniqueKey);
|
|
@@ -409,7 +411,7 @@ public class Task {
|
|
|
eventLogTotal.setQwUserId(tokenLog.getQwUserId());
|
|
|
eventLogTotal.setStatTime(dateTime);
|
|
|
|
|
|
- if(!processedKeys.contains(uniqueKey)) {
|
|
|
+ if (!processedKeys.contains(uniqueKey)) {
|
|
|
toInsertList.add(eventLogTotal);
|
|
|
// 标记为已处理
|
|
|
processedKeys.add(uniqueKey);
|
|
@@ -435,23 +437,23 @@ public class Task {
|
|
|
|
|
|
|
|
|
//定时查询ipad主机使用情况,建议每天凌晨1点执行一次
|
|
|
- public void totalIpadTask(){
|
|
|
+ public void totalIpadTask() {
|
|
|
String dateTime = DateUtils.addDateDays(-1); // 昨天
|
|
|
List<QwIpadTotalVo> qwIpadTotalVos = userService.selectCompanyByIpadStatusCount();
|
|
|
- if(qwIpadTotalVos != null && !qwIpadTotalVos.isEmpty()){
|
|
|
+ if (qwIpadTotalVos != null && !qwIpadTotalVos.isEmpty()) {
|
|
|
qwIpadTotalVos.forEach(qwIpadTotalVo ->
|
|
|
qwIpadTotalVo.setStatTime(dateTime)
|
|
|
);
|
|
|
int a = userService.insertQwIpadTotal(qwIpadTotalVos);
|
|
|
- if(a == 0){
|
|
|
+ if (a == 0) {
|
|
|
log.error("插入ipad主机失败");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
log.error("查询没有数据");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void addQwUserName(){
|
|
|
+ public void addQwUserName() {
|
|
|
QwCompany qwCompany = new QwCompany();
|
|
|
List<QwCompany> companyList = qwCompanyService.selectQwCompanyList(qwCompany);
|
|
|
for (QwCompany company : companyList) {
|
|
@@ -459,50 +461,55 @@ public class Task {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void videoTranscode() throws Exception
|
|
|
- {
|
|
|
+ public void videoTranscode() throws Exception {
|
|
|
|
|
|
tencentCloudCosService.videoTranscode();
|
|
|
}
|
|
|
|
|
|
- public void updateUrl() throws Exception
|
|
|
- {
|
|
|
+ public void updateUrl() throws Exception {
|
|
|
|
|
|
tencentCloudCosService.updateUrl();
|
|
|
}
|
|
|
- public void addPrescribeImg() throws Exception
|
|
|
- {
|
|
|
- List<Long> ids= fsPrescribeService.selectFsPrescribeByPrescribeIdByOrderType();
|
|
|
+
|
|
|
+ public void addPrescribeImg() throws Exception {
|
|
|
+ List<Long> ids = fsPrescribeService.selectFsPrescribeByPrescribeIdByOrderType();
|
|
|
for (Long id : ids) {
|
|
|
System.out.println(id);
|
|
|
fsPrescribeService.PrescribeStoreImg(id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void addQwWatchLog() throws Exception
|
|
|
- {
|
|
|
+ public void addQwWatchLog() throws Exception {
|
|
|
+ LocalDateTime now = LocalDateTime.now().withSecond(0);
|
|
|
fsCourseWatchLogService.addCourseWatchLogDay();
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void transferLog() throws Exception
|
|
|
- {
|
|
|
+ public void addQwWatchLogMinute(Long minute) {
|
|
|
+ if(minute == null) minute = 30L;
|
|
|
+ LocalDateTime now = LocalDateTime.now().withSecond(0);
|
|
|
+ LocalDateTime start = now.minusMinutes(minute);
|
|
|
+ LocalDateTime end = now.minusSeconds(1);
|
|
|
+ fsCourseWatchLogService.addCourseWatchLogDayMinute(start, end);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void transferLog() throws Exception {
|
|
|
qwExternalContactTransferLogService.updateQwExternalContactTransferLogByStatus();
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void isArtificial() throws Exception
|
|
|
- {
|
|
|
+ public void isArtificial() throws Exception {
|
|
|
fastGptChatSessionMapper.updateFastGptChatSessionByIsReply();
|
|
|
|
|
|
}
|
|
|
- public void expirationQwAppCountWay(){
|
|
|
+
|
|
|
+ public void expirationQwAppCountWay() {
|
|
|
qwAppContactWayService.expirationQwAppCountWay();
|
|
|
|
|
|
}
|
|
|
- public void sendOrderMsg() throws Exception
|
|
|
- {
|
|
|
+
|
|
|
+ public void sendOrderMsg() throws Exception {
|
|
|
List<FsStoreOrder> fsStoreOrders = fsStoreOrderMapper.selectStoreOrderIdByFollow();
|
|
|
for (FsStoreOrder fsStoreOrder : fsStoreOrders) {
|
|
|
|
|
@@ -510,81 +517,77 @@ public class Task {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- public void redPacketSubMoney() throws Exception
|
|
|
- {
|
|
|
+
|
|
|
+ public void redPacketSubMoney() throws Exception {
|
|
|
List<RedPacketMoneyVO> redPacketMoneyVOS = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByCompany();
|
|
|
for (RedPacketMoneyVO redPacketMoneyVO : redPacketMoneyVOS) {
|
|
|
- companyService.subtractCompanyMoney(redPacketMoneyVO.getMoney(),redPacketMoneyVO.getCompanyId());
|
|
|
+ companyService.subtractCompanyMoney(redPacketMoneyVO.getMoney(), redPacketMoneyVO.getCompanyId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void redPacketAddMoney() throws Exception
|
|
|
- {
|
|
|
+ public void redPacketAddMoney() throws Exception {
|
|
|
List<RedPacketMoneyVO> redPacketMoneyVOS = fsCourseRedPacketLogMapper.selectFsCourseAddRedPacketLogByCompany();
|
|
|
for (RedPacketMoneyVO redPacketMoneyVO : redPacketMoneyVOS) {
|
|
|
- companyService.addRedPacketCompanyMoney(redPacketMoneyVO.getMoney(),redPacketMoneyVO.getCompanyId());
|
|
|
+ companyService.addRedPacketCompanyMoney(redPacketMoneyVO.getMoney(), redPacketMoneyVO.getCompanyId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void updateCompanyUserStatus()
|
|
|
- {
|
|
|
+ public void updateCompanyUserStatus() {
|
|
|
CompanyUser user = new CompanyUser();
|
|
|
user.setStatus("0");
|
|
|
user.setDelFlag("0");
|
|
|
List<CompanyUser> companyUsers = companyUserMapper.selectCompanyUserList(user);
|
|
|
for (CompanyUser companyUser : companyUsers) {
|
|
|
- if(SecurityUtils.matchesPassword("123456", companyUser.getPassword())){
|
|
|
+ if (SecurityUtils.matchesPassword("123456", companyUser.getPassword())) {
|
|
|
companyUser.setStatus("1");
|
|
|
companyUserMapper.updateCompanyUser(companyUser);
|
|
|
- logger.info("密码为123456 停用账号:"+companyUser.getUserId()+":"+companyUser.getNickName());
|
|
|
+ logger.info("密码为123456 停用账号:" + companyUser.getUserId() + ":" + companyUser.getNickName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- public void couponStatus()
|
|
|
- {
|
|
|
+
|
|
|
+ public void couponStatus() {
|
|
|
fsUserCouponMapper.updateFsUserCouponStatusByLimtTime();
|
|
|
}
|
|
|
|
|
|
//每10秒执行一次
|
|
|
- public void auditPrescribe()
|
|
|
- {
|
|
|
+ public void auditPrescribe() {
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.inquiryConfig");
|
|
|
String configValue = sysConfig.getConfigValue();
|
|
|
Map<String, Object> config = (Map<String, Object>) JSON.parse(configValue);
|
|
|
- boolean isAudit = (boolean)config.get("isAutoPrescribeAudit");
|
|
|
- if (isAudit){
|
|
|
+ boolean isAudit = (boolean) config.get("isAutoPrescribeAudit");
|
|
|
+ if (isAudit) {
|
|
|
fsPrescribeService.auditPrescribe();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void deliveryOp()
|
|
|
- {
|
|
|
+ public void deliveryOp() {
|
|
|
IErpOrderService erpOrderService = getErpService();
|
|
|
List<FsStoreOrder> orders = null;
|
|
|
- if (erpOrderService == gyOrderService){
|
|
|
+ if (erpOrderService == gyOrderService) {
|
|
|
orders = fsStoreOrderMapper.selectOmsOrderdeliveryOp();
|
|
|
- } else if (erpOrderService == wdtOrderService || erpOrderService == dfOrderService || erpOrderService == jSTOrderService){
|
|
|
+ } else if (erpOrderService == wdtOrderService || erpOrderService == dfOrderService || erpOrderService == jSTOrderService) {
|
|
|
orders = fsStoreOrderMapper.selectWdtOmsOrderdeliveryOp();
|
|
|
}
|
|
|
|
|
|
|
|
|
- for(FsStoreOrder order:orders){
|
|
|
+ for (FsStoreOrder order : orders) {
|
|
|
|
|
|
- ErpOrderQueryRequert request=new ErpOrderQueryRequert();
|
|
|
+ ErpOrderQueryRequert request = new ErpOrderQueryRequert();
|
|
|
|
|
|
request.setCode(order.getExtendOrderId());
|
|
|
- if (erpOrderService != null){
|
|
|
- ErpOrderQueryResponse response=erpOrderService.getOrder(request);
|
|
|
- if (erpOrderService != dfOrderService){
|
|
|
- if(response.getOrders()!=null&&response.getOrders().size()>0){
|
|
|
- for(ErpOrderQuery orderQuery : response.getOrders()){
|
|
|
- if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
|
|
|
- for(ErpDeliverys delivery:orderQuery.getDeliverys()){
|
|
|
- if(delivery.getDelivery()&& StringUtils.isNotEmpty(delivery.getMail_no())){
|
|
|
+ if (erpOrderService != null) {
|
|
|
+ ErpOrderQueryResponse response = erpOrderService.getOrder(request);
|
|
|
+ if (erpOrderService != dfOrderService) {
|
|
|
+ if (response.getOrders() != null && response.getOrders().size() > 0) {
|
|
|
+ for (ErpOrderQuery orderQuery : response.getOrders()) {
|
|
|
+ if (orderQuery.getDeliverys() != null && orderQuery.getDeliverys().size() > 0) {
|
|
|
+ for (ErpDeliverys delivery : orderQuery.getDeliverys()) {
|
|
|
+ if (delivery.getDelivery() && StringUtils.isNotEmpty(delivery.getMail_no())) {
|
|
|
//更新商订单状态 删除REDIS
|
|
|
- fsStoreOrderService.deliveryOrder(order.getOrderCode(),delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
|
|
|
- redisCache.deleteObject("delivery"+":"+order.getExtendOrderId());
|
|
|
+ fsStoreOrderService.deliveryOrder(order.getOrderCode(), delivery.getMail_no(), delivery.getExpress_code(), delivery.getExpress_name());
|
|
|
+ redisCache.deleteObject("delivery" + ":" + order.getExtendOrderId());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -597,19 +600,17 @@ public class Task {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void getOrderDeliveryStatus()
|
|
|
- {
|
|
|
+ public void getOrderDeliveryStatus() {
|
|
|
IErpOrderService erpOrderService = getErpService();
|
|
|
List<FsStoreOrder> orders = null;
|
|
|
- if (erpOrderService !=null && erpOrderService == dfOrderService){
|
|
|
+ if (erpOrderService != null && erpOrderService == dfOrderService) {
|
|
|
orders = fsStoreOrderMapper.selectShippedOrder();
|
|
|
- if(orders!=null&& !orders.isEmpty()){
|
|
|
+ if (orders != null && !orders.isEmpty()) {
|
|
|
List<CompletableFuture<Void>> futures = new ArrayList<>();
|
|
|
- for(FsStoreOrder order:orders){
|
|
|
+ for (FsStoreOrder order : orders) {
|
|
|
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
|
|
erpOrderService.getOrderDeliveryStatus(order);
|
|
|
});
|
|
@@ -620,15 +621,14 @@ public class Task {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void CreateOmsAndHis()
|
|
|
- {
|
|
|
+ public void CreateOmsAndHis() {
|
|
|
List<Long> omsList = fsStoreOrderMapper.selectFsStoreOrderNoCreateOms();
|
|
|
- logger.info("推送订单id====>{}",omsList);
|
|
|
+ logger.info("推送订单id====>{}", omsList);
|
|
|
for (Long l : omsList) {
|
|
|
try {
|
|
|
fsStoreOrderService.createOmsOrder(l);
|
|
|
} catch (Exception e) {
|
|
|
- logger.error("推送订单异常:",e);
|
|
|
+ logger.error("推送订单异常:", e);
|
|
|
}
|
|
|
}
|
|
|
// List<Long> tuiOrderList = fsStoreOrderMapper.selectFsStoreOrderNoTuiOrder();
|
|
@@ -641,31 +641,30 @@ public class Task {
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
- public void createFollow()
|
|
|
- {
|
|
|
+ public void createFollow() {
|
|
|
List<FsStoreOrder> orders = fsStoreOrderMapper.selectStoreOrderIdByFollow();
|
|
|
for (FsStoreOrder order : orders) {
|
|
|
try {
|
|
|
|
|
|
fsStoreOrderService.addFsFollowByStoreOrder(order);
|
|
|
- }catch (Exception e){
|
|
|
- logger.info("创建随访错误:"+order);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.info("创建随访错误:" + order);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
IFsStoreSubOrderService fsStoreSubOrderService;
|
|
|
|
|
|
|
|
|
- public void puSubStoreOrder()
|
|
|
- {
|
|
|
+ public void puSubStoreOrder() {
|
|
|
List<Long> longs = fsStoreSubOrderService.selectFsStoreSubOrderByNoPush();
|
|
|
- int i=0;
|
|
|
+ int i = 0;
|
|
|
for (Long aLong : longs) {
|
|
|
FsSubOrderResultVO fsSubOrderResultVO = fsStoreSubOrderService.TuiFsStoreSubOrderByStoreOrder(aLong);
|
|
|
- if (fsSubOrderResultVO!=null&&fsSubOrderResultVO.getCode()!=null&&fsSubOrderResultVO.getCode()==1){
|
|
|
+ if (fsSubOrderResultVO != null && fsSubOrderResultVO.getCode() != null && fsSubOrderResultVO.getCode() == 1) {
|
|
|
i++;
|
|
|
- if (i>65){
|
|
|
+ if (i > 65) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -673,14 +672,13 @@ public class Task {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void refundOp()
|
|
|
- {
|
|
|
- List<FsStoreAfterSales> list=fsStoreAfterSalesService.selectFsStoreAfterSalesByDoAudit();
|
|
|
- if(list!=null){
|
|
|
- for(FsStoreAfterSales afterSales:list){
|
|
|
+ public void refundOp() {
|
|
|
+ List<FsStoreAfterSales> list = fsStoreAfterSalesService.selectFsStoreAfterSalesByDoAudit();
|
|
|
+ if (list != null) {
|
|
|
+ for (FsStoreAfterSales afterSales : list) {
|
|
|
try {
|
|
|
fsStoreAfterSalesService.auditing(afterSales);
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
|
}
|
|
|
|
|
@@ -688,16 +686,17 @@ public class Task {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
public void isAfterSales() {
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
|
|
|
String configValue = sysConfig.getConfigValue();
|
|
|
Map<String, Object> config = (Map<String, Object>) JSON.parse(configValue);
|
|
|
- Integer storeAfterSalesDay = (Integer)config.get("storeAfterSalesDay");
|
|
|
+ Integer storeAfterSalesDay = (Integer) config.get("storeAfterSalesDay");
|
|
|
List<FsStoreOrder> fsStoreOrders = fsStoreOrderMapper.selectFsStoreOrderNoIsAfterSales(storeAfterSalesDay);
|
|
|
for (FsStoreOrder fsStoreOrder : fsStoreOrders) {
|
|
|
try {
|
|
|
fsStoreOrderService.addIntegralAndShareByStoreOrder(fsStoreOrder);
|
|
|
- }catch (Exception e) {
|
|
|
+ } catch (Exception e) {
|
|
|
logger.info("分账错误: " + fsStoreOrder.getOrderCode());
|
|
|
}
|
|
|
}
|
|
@@ -705,42 +704,41 @@ public class Task {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void integralOrderStatus(){
|
|
|
+ public void integralOrderStatus() {
|
|
|
integralOrderMapper.updatePackageOrderStatusByDeliveryTime();
|
|
|
}
|
|
|
|
|
|
- public void packageStatus()
|
|
|
- {
|
|
|
+ public void packageStatus() {
|
|
|
fsPackageOrderMapper.updatePackageOrderStatusByFinishTime();
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
|
|
|
String configValue = sysConfig.getConfigValue();
|
|
|
Map<String, Object> config = (Map<String, Object>) JSON.parse(configValue);
|
|
|
- Integer unPayTime = (Integer)config.get("unPayTime");
|
|
|
+ Integer unPayTime = (Integer) config.get("unPayTime");
|
|
|
fsPackageOrderMapper.updatePackageOrderStatusByStatus(unPayTime);
|
|
|
}
|
|
|
|
|
|
- public void endFollow(){
|
|
|
+ public void endFollow() {
|
|
|
fsStoreOrderService.endFollow();
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void erDelivery(){
|
|
|
+ public void erDelivery() {
|
|
|
fsStoreOrderService.endDeliveryOrder();
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
private ICompanyService companyService;
|
|
|
- public void addCompanyMoney(){
|
|
|
+
|
|
|
+ public void addCompanyMoney() {
|
|
|
List<FsStoreOrder> orders = fsStoreOrderMapper.selectOrderIds();
|
|
|
- for (FsStoreOrder order : orders){
|
|
|
+ for (FsStoreOrder order : orders) {
|
|
|
CompanyMoneyLogs moneyLog1 = moneyLogsMapper.selectCompanyMoneyLogsByOrderId(order.getOrderId(), 5);
|
|
|
- CompanyMoneyLogs moneyLog2 = moneyLogsMapper.selectCompanyMoneyLogsByOrderId(order.getOrderId(),3);
|
|
|
- if (moneyLog1==null){
|
|
|
+ CompanyMoneyLogs moneyLog2 = moneyLogsMapper.selectCompanyMoneyLogsByOrderId(order.getOrderId(), 3);
|
|
|
+ if (moneyLog1 == null) {
|
|
|
companyService.subtractCompanyMoney(order);
|
|
|
}
|
|
|
- if (moneyLog2==null){
|
|
|
+ if (moneyLog2 == null) {
|
|
|
companyService.addCompanyMoney(order);
|
|
|
FsStoreOrder orderMap = new FsStoreOrder();
|
|
|
orderMap.setOrderId(order.getOrderId());
|
|
@@ -751,28 +749,26 @@ public class Task {
|
|
|
}
|
|
|
|
|
|
//每天执行一次
|
|
|
- public void syncExpress()
|
|
|
- {
|
|
|
- List<Long> ids =fsStoreOrderMapper.selectSyncExpressIds();
|
|
|
+ public void syncExpress() {
|
|
|
+ List<Long> ids = fsStoreOrderMapper.selectSyncExpressIds();
|
|
|
for (Long id : ids) {
|
|
|
fsStoreOrderService.syncExpress(id);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void refundCompanyMoney(){
|
|
|
+ public void refundCompanyMoney() {
|
|
|
List<FsStoreOrder> list = fsStoreOrderMapper.selectOrders();
|
|
|
- for (FsStoreOrder order : list ){
|
|
|
+ for (FsStoreOrder order : list) {
|
|
|
companyService.refundCompanyMoney(order);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void subIntegral()
|
|
|
- {
|
|
|
+ public void subIntegral() {
|
|
|
fsUserIntegralLogsService.subFsUserIntegralLogsByOrder5();
|
|
|
}
|
|
|
|
|
|
- public void finishInquiry(){
|
|
|
+ public void finishInquiry() {
|
|
|
List<FsInquiryOrder> orders = inquiryOrderMapper.selectFsInquiryOrderByFinish();
|
|
|
for (FsInquiryOrder order : orders) {
|
|
|
// 订单已超过48小时,执行关闭操作
|
|
@@ -781,20 +777,20 @@ public class Task {
|
|
|
param.setDoctorId(order.getDoctorId());
|
|
|
try {
|
|
|
iFsInquiryOrderService.autoFinishOrder(param);
|
|
|
- }catch (Exception e){
|
|
|
- logger.info("订单已超过48小时关闭异常"+param);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.info("订单已超过48小时关闭异常" + param);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void finishStoreOrderByXN(){
|
|
|
+ public void finishStoreOrderByXN() {
|
|
|
List<FsStoreOrder> orders = fsStoreOrderMapper.selectFinishStoreOrderByXN();
|
|
|
- if (orders!=null&&orders.size()>0){
|
|
|
+ if (orders != null && orders.size() > 0) {
|
|
|
for (FsStoreOrder o : orders) {
|
|
|
FsStoreOrder order = fsStoreOrderMapper.selectFsStoreOrderByOrderId(o.getOrderId());
|
|
|
- if (order.getStatus()!= 2) {
|
|
|
+ if (order.getStatus() != 2) {
|
|
|
continue;
|
|
|
}
|
|
|
FsStoreOrder o1 = new FsStoreOrder();
|
|
@@ -805,20 +801,20 @@ public class Task {
|
|
|
int i = fsStoreOrderMapper.updateFsStoreOrder(o1);
|
|
|
fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.FINISH_ORDER.getValue(),
|
|
|
FsStoreOrderLogEnum.FINISH_ORDER.getDesc());
|
|
|
- if (order.getCompanyId()!=null&&order.getTuiMoneyStatus()==0&&order.getPayType()==1){
|
|
|
+ if (order.getCompanyId() != null && order.getTuiMoneyStatus() == 0 && order.getPayType() == 1) {
|
|
|
companyService.addCompanyMoney(order);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void inquirySendSms(){
|
|
|
+ public void inquirySendSms() {
|
|
|
List<FsInquiryOrder> orders = inquiryOrderMapper.selectFsInquiryOrderBySendSms();
|
|
|
- for (FsInquiryOrder order : orders){
|
|
|
- FsInquiryOrderPatientDTO patientDTO = JSON.parseObject(order.getPatientJson(),FsInquiryOrderPatientDTO.class);
|
|
|
- if (patientDTO!=null&&patientDTO.getPatientName()!=null){
|
|
|
+ for (FsInquiryOrder order : orders) {
|
|
|
+ FsInquiryOrderPatientDTO patientDTO = JSON.parseObject(order.getPatientJson(), FsInquiryOrderPatientDTO.class);
|
|
|
+ if (patientDTO != null && patientDTO.getPatientName() != null) {
|
|
|
FsUser fsUser = fsUserMapper.selectFsUserByUserId(order.getUserId());
|
|
|
- if (fsUser!=null&&fsUser.getPhone()!=null){
|
|
|
+ if (fsUser != null && fsUser.getPhone() != null) {
|
|
|
smsService.sendUserSms(fsUser.getPhone(), patientDTO.getPatientName(), "2");
|
|
|
order.setIsSendSms(1);
|
|
|
inquiryOrderMapper.updateFsInquiryOrder(order);
|
|
@@ -829,9 +825,9 @@ public class Task {
|
|
|
}
|
|
|
|
|
|
//处理30天问题件
|
|
|
- public void clearProblemOrder(){
|
|
|
+ public void clearProblemOrder() {
|
|
|
List<FsStoreOrder> orders = fsStoreOrderMapper.selectFsStoreOrderByProblemOrder();
|
|
|
- for (FsStoreOrder order : orders){
|
|
|
+ for (FsStoreOrder order : orders) {
|
|
|
FsStoreOrder map = new FsStoreOrder();
|
|
|
map.setStatus(4);
|
|
|
map.setOrderId(order.getOrderId());
|
|
@@ -842,14 +838,14 @@ public class Task {
|
|
|
|
|
|
|
|
|
//30天无通话记录回收坐席
|
|
|
- public void recoverCompanyCaller(){
|
|
|
+ public void recoverCompanyCaller() {
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
|
|
|
StoreConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), StoreConfig.class);
|
|
|
Integer days = fsPayConfig.getStoreCall();
|
|
|
List<CompanyVoiceCaller> list = companyVoiceCallerMapper.selectCompanyVoiceCallerByRecover(days);
|
|
|
- for (CompanyVoiceCaller caller : list){
|
|
|
- Long count = companyVoiceLogsMapper.selectCompanyVoiceLogsCountByCallerNo(caller.getCallerNo(),caller.getBindTime());
|
|
|
- if (count==0){
|
|
|
+ for (CompanyVoiceCaller caller : list) {
|
|
|
+ Long count = companyVoiceLogsMapper.selectCompanyVoiceLogsCountByCallerNo(caller.getCallerNo(), caller.getBindTime());
|
|
|
+ if (count == 0) {
|
|
|
caller.setCompanyId(0l);
|
|
|
caller.setCompanyUserId(0l);
|
|
|
caller.setMobile("");
|
|
@@ -862,32 +858,27 @@ public class Task {
|
|
|
|
|
|
|
|
|
public void tb() {
|
|
|
- packageOrderService.payConfirm("", "1780763211956486144", "1075999515888117190", "14", 1,null,null);
|
|
|
+ packageOrderService.payConfirm("", "1780763211956486144", "1075999515888117190", "14", 1, null, null);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public void addSend(){
|
|
|
- String userId="4048905872";
|
|
|
- String doctorId="147";
|
|
|
- String storeOrderId="470920";
|
|
|
- String followId="1062986";
|
|
|
+ public void addSend() {
|
|
|
+ String userId = "4048905872";
|
|
|
+ String doctorId = "147";
|
|
|
+ String storeOrderId = "470920";
|
|
|
+ String followId = "1062986";
|
|
|
//发送给用户
|
|
|
- MsgDTO msgDTO=new MsgDTO();
|
|
|
- MsgCustomDTO customDTO=new MsgCustomDTO();
|
|
|
+ MsgDTO msgDTO = new MsgDTO();
|
|
|
+ MsgCustomDTO customDTO = new MsgCustomDTO();
|
|
|
customDTO.setType("startDrugReport");
|
|
|
customDTO.setImType(2);
|
|
|
customDTO.setOrderId(storeOrderId);
|
|
|
customDTO.setFollowId(followId);
|
|
|
msgDTO.setCloudCustomData(JSONUtil.toJsonStr(customDTO));
|
|
|
- msgDTO.setFrom_Account("U-"+userId);
|
|
|
- msgDTO.setTo_Account("D-"+doctorId);
|
|
|
- List<MsgDataDTO> msgs=new ArrayList<>();
|
|
|
- MsgDataDTO msg=new MsgDataDTO();
|
|
|
+ msgDTO.setFrom_Account("U-" + userId);
|
|
|
+ msgDTO.setTo_Account("D-" + doctorId);
|
|
|
+ List<MsgDataDTO> msgs = new ArrayList<>();
|
|
|
+ MsgDataDTO msg = new MsgDataDTO();
|
|
|
msg.setMsgType("TIMTextElem");
|
|
|
msg.setMsgContent(new MsgDataFormatDTO("您好"));
|
|
|
msgs.add(msg);
|
|
@@ -1166,7 +1157,7 @@ public class Task {
|
|
|
// iFsPackageOrderService.updateFsPackageOrder(order);
|
|
|
// num++;
|
|
|
// }
|
|
|
-////
|
|
|
+ /// /
|
|
|
// }
|
|
|
//
|
|
|
// logger.info("所有订单同步完成:"+num);
|
|
@@ -1242,7 +1233,7 @@ public class Task {
|
|
|
//}
|
|
|
|
|
|
|
|
|
- //同步流水
|
|
|
+ //同步流水
|
|
|
// public void task(){
|
|
|
// CompanyMoneyLogs item = moneyLogsMapper.selectCompanyMoneyLogsById(248884L);
|
|
|
// String logsId=item.getLogsId().toString();
|
|
@@ -1345,27 +1336,27 @@ public class Task {
|
|
|
private IErpOrderService getErpService() {
|
|
|
FsSysConfig sysConfig = configUtil.getSysConfig();
|
|
|
Integer erpOpen = sysConfig.getErpOpen();
|
|
|
- if (erpOpen != null && erpOpen == 1){
|
|
|
+ if (erpOpen != null && erpOpen == 1) {
|
|
|
//判断erp类型
|
|
|
Integer erpType = sysConfig.getErpType();
|
|
|
- if (erpType != null){
|
|
|
+ if (erpType != null) {
|
|
|
IErpOrderService erpOrderService = null;
|
|
|
- if (erpType == 1){
|
|
|
+ if (erpType == 1) {
|
|
|
//管易
|
|
|
- erpOrderService = gyOrderService;
|
|
|
- } else if (erpType == 2){
|
|
|
+ erpOrderService = gyOrderService;
|
|
|
+ } else if (erpType == 2) {
|
|
|
//旺店通
|
|
|
- erpOrderService = wdtOrderService;
|
|
|
- } else if (erpType == 3){
|
|
|
+ erpOrderService = wdtOrderService;
|
|
|
+ } else if (erpType == 3) {
|
|
|
//
|
|
|
- erpOrderService = hzOMSErpOrderService;
|
|
|
- } else if (erpType == 4){
|
|
|
+ erpOrderService = hzOMSErpOrderService;
|
|
|
+ } else if (erpType == 4) {
|
|
|
//代服
|
|
|
- erpOrderService = dfOrderService;
|
|
|
- }else if(erpType == 5){
|
|
|
- erpOrderService=jSTOrderService;
|
|
|
- }else if(erpType == 6){
|
|
|
- erpOrderService=k9OrderService;
|
|
|
+ erpOrderService = dfOrderService;
|
|
|
+ } else if (erpType == 5) {
|
|
|
+ erpOrderService = jSTOrderService;
|
|
|
+ } else if (erpType == 6) {
|
|
|
+ erpOrderService = k9OrderService;
|
|
|
}
|
|
|
return erpOrderService;
|
|
|
|