| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.OffsetTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethod; |
| | | import com.ltkj.web.controller.his.HisMzJysqController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.DigestUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ltkj.common.annotation.Log; |
| | |
| | | private TjvLtkjvtjpatService tjvLtkjvtjpatService; |
| | | @Autowired |
| | | private ThreadPoolConfig threadPoolConfig; |
| | | |
| | | @Autowired |
| | | private HisApiMethod hisApiMethod; |
| | | |
| | | @Autowired |
| | | private HisMzJysqController hisMzJysqController; |
| | | @Autowired |
| | | private HisApiGetMethodService hisApiGetMethodService; |
| | | |
| | | |
| | | /** |
| | |
| | | wq1.eq(TjReservation::getIsExpire, 2); |
| | | TjReservation tjReservation = tjReservationService.getOne(wq1); |
| | | MallOrder mallOrder = null; |
| | | if (tjReservation != null) { |
| | | order.setReservationId(tjReservation.getId()); |
| | | if (null != tjReservation) { |
| | | tjOrder.setReservationId(tjReservation.getId()); |
| | | mallOrder = mallOrderService.getOne(new LambdaQueryWrapper<MallOrder>().eq(MallOrder::getReservationId, tjReservation.getId())); |
| | | if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) { |
| | | return AjaxResult.error("未到预约时间"); |
| | |
| | | tjOrder.setStatus(TjConstants.TJ_BEGIN); |
| | | tjOrder.setCardId(tjCustomer.getCardId()); |
| | | if (tjOrderService.save(tjOrder)) { |
| | | |
| | | //保存收货地址 |
| | | if ("2".equals(tjOrder.getGetType())) { |
| | | final TjReportGetAddress address = tjOrder.getAddAddress(); |
| | |
| | | // |
| | | // } |
| | | // } |
| | | |
| | | |
| | | /*调用his接口*/ |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if(null !=config && config.equals("Y")){ |
| | | hisApiMethod.HisApiMethods(tjCustomer,tjOrder.getOrderId()); |
| | | } |
| | | tjCustomer.setCardId("0"); |
| | | tjCustomerService.updateById(tjCustomer); |
| | | |
| | | return AjaxResult.success(tjNumber); |
| | | } |
| | | return AjaxResult.error(); |
| | |
| | | if (null != ppList && ppList.size() > 0) { |
| | | //异步保存数据库 |
| | | // asyncService.addRedisTransitionPac(cusId, pacId, ppList); |
| | | asyncService.saveRedisTransitionByPacId(cusId, pacId, null); |
| | | asyncService.saveRedisTransitionByPacId(cusId,cardId, pacId, null); |
| | | for (TjPackageProject tjPackageProject : ppList) { |
| | | TjProject project = projectService.getTjProjectById(String.valueOf(tjPackageProject.getProId())); |
| | | if (null != project) { |
| | |
| | | //单项 |
| | | if (null != proIds && proIds.size() > 0) { |
| | | //异步保存数据库表 |
| | | asyncService.saveRedisTransitionByPacId(cusId, null, proIds); |
| | | asyncService.saveRedisTransitionByPacId(cusId,cardId,null, proIds); |
| | | for (Long proId : proIds) { |
| | | List<TbTransition> transitions = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)); |
| | | if (null != transitions && transitions.size() > 0) { |
| | |
| | | tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId())); |
| | | transitionService.deletedTbTransitionByTjNum(tjNum); |
| | | transitionService.updateTbTransitionByTjNum(tjNum); |
| | | String configByKey = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (configByKey.equals("Y")){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("cardtype","4"); |
| | | map.put("input",order.getCardId()); |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDateTime startOfDay = currentDate.atStartOfDay(); |
| | | LocalDateTime nineteenOClock = currentDate.atTime(LocalTime.of(19, 0)); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String ksrq = startOfDay.format(formatter); |
| | | String jsrq = nineteenOClock.format(formatter); |
| | | map.put("ksrq",ksrq); |
| | | map.put("jsrq",jsrq); |
| | | AjaxResult result = hisApiGetMethodService.getHISDataNew("Getoutpatientcostinfo", map); |
| | | if (Integer.parseInt(String.valueOf(result.get("code"))) == 200){ |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("撤销失败,门诊患者费用清单信息不为空"); |
| | | }else { |
| | | boolean zfHisApiMethods = hisApiMethod.ZfHisApiMethods(null, order); |
| | | if (zfHisApiMethods) { |
| | | return AjaxResult.success("撤销成功", map); |
| | | }else { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("撤销失败,调用作废出现失败"); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success("撤销成功!!!"); |
| | | } |
| | | return AjaxResult.success("签到记录不存在!"); |